From d62b7f1f8a3c27c3cd51d4eb41d51e8aba545217 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Sun, 19 Dec 2010 15:40:03 +0000 Subject: cjk/utils 4.8.2 plus changes from Akira git-svn-id: svn://tug.org/texlive/trunk@20806 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/README | 4 +- Build/source/texk/cjkutils/ChangeLog | 7 + Build/source/texk/cjkutils/Makefile.am | 168 +- Build/source/texk/cjkutils/Makefile.in | 777 ++++-- Build/source/texk/cjkutils/aclocal.m4 | 1 + Build/source/texk/cjkutils/bat/bg5latex.bat | 3 - Build/source/texk/cjkutils/bat/bg5pltx.bat | 3 - Build/source/texk/cjkutils/bat/cef5ltx.bat | 3 - Build/source/texk/cjkutils/bat/ceflatex.bat | 3 - Build/source/texk/cjkutils/bat/cefsltx.bat | 3 - Build/source/texk/cjkutils/bat/cjklatex.c | 290 -- Build/source/texk/cjkutils/bat/f_name.bat | 205 -- Build/source/texk/cjkutils/bat/gbklatex.bat | 3 - Build/source/texk/cjkutils/bat/sjisltx.bat | 3 - Build/source/texk/cjkutils/bg5conv.c | 33 + Build/source/texk/cjkutils/c-auto.in | 186 ++ Build/source/texk/cjkutils/cef5conv.c | 135 + Build/source/texk/cjkutils/cefconv.c | 127 + Build/source/texk/cjkutils/cefsconv.c | 135 + .../texk/cjkutils/cjkutils-4.8.2-PATCHES/ChangeLog | 15 + .../cjkutils/cjkutils-4.8.2-PATCHES/TL-Changes | 21 + .../cjkutils-4.8.2-PATCHES/patch-01-ANSI-C | 758 +++++ .../cjkutils/cjkutils-4.8.2-PATCHES/patch-02-const | 148 + .../cjkutils-4.8.2-PATCHES/patch-03-kpathsea | 105 + .../cjkutils-4.8.2-PATCHES/patch-04-cjklatex | 108 + .../cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex | 95 + .../texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.1 | 110 + .../texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.c | 36 + .../texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.w | 121 + .../texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex | 43 + .../cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.bat | 3 + .../cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.cmd | 44 + .../cjkutils/cjkutils-4.8.2/Bg5conv/bg5pdflatex | 43 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.1 | 127 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.c | 138 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.w | 237 ++ .../texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5latex | 43 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.bat | 3 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.cmd | 46 + .../cjkutils/cjkutils-4.8.2/CEFconv/cef5pdflatex | 43 + .../texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.1 | 117 + .../texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.c | 130 + .../texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.w | 221 ++ .../texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex | 43 + .../cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.bat | 3 + .../cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.cmd | 46 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefpdflatex | 43 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.1 | 127 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.c | 138 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.w | 237 ++ .../texk/cjkutils/cjkutils-4.8.2/CEFconv/cefslatex | 43 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.bat | 3 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.cmd | 46 + .../cjkutils/cjkutils-4.8.2/CEFconv/cefspdflatex | 43 + .../source/texk/cjkutils/cjkutils-4.8.2/ChangeLog | 2164 +++++++++++++++ Build/source/texk/cjkutils/cjkutils-4.8.2/README | 35 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.1 | 110 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.c | 36 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.w | 120 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjislatex | 43 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.bat | 3 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.cmd | 44 + .../cjkutils/cjkutils-4.8.2/SJISconv/sjispdflatex | 43 + .../cjkutils/cjkutils-4.8.2/cjklatex/cjklatex.c | 297 ++ .../texk/cjkutils/cjkutils-4.8.2/extconv/bg5+latex | 43 + .../cjkutils/cjkutils-4.8.2/extconv/bg5+pdflatex | 43 + .../cjkutils/cjkutils-4.8.2/extconv/bg5pltx.bat | 3 + .../cjkutils/cjkutils-4.8.2/extconv/bg5pltx.cmd | 44 + .../texk/cjkutils/cjkutils-4.8.2/extconv/extconv.1 | 111 + .../texk/cjkutils/cjkutils-4.8.2/extconv/extconv.c | 37 + .../texk/cjkutils/cjkutils-4.8.2/extconv/extconv.w | 122 + .../texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex | 43 + .../cjkutils/cjkutils-4.8.2/extconv/gbklatex.bat | 3 + .../cjkutils/cjkutils-4.8.2/extconv/gbklatex.cmd | 44 + .../cjkutils/cjkutils-4.8.2/extconv/gbkpdflatex | 43 + .../cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.gnu | 127 + .../cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.in | 127 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/README | 2 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/README | 10 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5ka12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5kr12.cfg | 30 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5so12.cfg | 31 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c1so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c2so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c3so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c4so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c5so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c6so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c7so12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/csso12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/gsfs14.cfg | 27 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/j2so12.cfg | 30 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/jsso12.cfg | 28 + .../cjkutils/cjkutils-4.8.2/hbf2gf/cfg/ksso17.cfg | 27 + .../cjkutils/cjkutils-4.8.2/hbf2gf/configure.ac | 131 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/dvidrv.btm | 352 +++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.c | 109 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.h | 25 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.c | 405 +++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.h | 57 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.c | 1496 ++++++++++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.h | 215 ++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.1 | 754 +++++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.c | 2302 +++++++++++++++ .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.def | 3 + .../texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.w | 2808 +++++++++++++++++++ Build/source/texk/cjkutils/configure | 113 +- Build/source/texk/cjkutils/configure.ac | 20 +- Build/source/texk/cjkutils/conv/Makefile.am | 9 - Build/source/texk/cjkutils/conv/Makefile.in | 561 ---- Build/source/texk/cjkutils/conv/bg5conv.c | 34 - Build/source/texk/cjkutils/conv/cef5conv.c | 136 - Build/source/texk/cjkutils/conv/cefconv.c | 128 - Build/source/texk/cjkutils/conv/cefsconv.c | 136 - Build/source/texk/cjkutils/conv/extconv.c | 35 - Build/source/texk/cjkutils/conv/sjisconv.c | 34 - Build/source/texk/cjkutils/extconv.c | 34 + Build/source/texk/cjkutils/hbf2gf.c | 2242 +++++++++++++++ Build/source/texk/cjkutils/hbf2gf.dvi | Bin 0 -> 183712 bytes Build/source/texk/cjkutils/hbf2gf.idx | 326 +++ Build/source/texk/cjkutils/hbf2gf.scn | 56 + Build/source/texk/cjkutils/hbf2gf.tex | 2928 ++++++++++++++++++++ Build/source/texk/cjkutils/hbf2gf/Makefile.am | 63 - Build/source/texk/cjkutils/hbf2gf/Makefile.in | 655 ----- Build/source/texk/cjkutils/hbf2gf/c-auto.in | 192 -- Build/source/texk/cjkutils/hbf2gf/cfg/README | 10 - Build/source/texk/cjkutils/hbf2gf/cfg/b5ka12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/b5kr12.cfg | 30 - Build/source/texk/cjkutils/hbf2gf/cfg/b5so12.cfg | 31 - Build/source/texk/cjkutils/hbf2gf/cfg/c1so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c2so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c3so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c4so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c5so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c6so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/c7so12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/csso12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/gsfs14.cfg | 27 - Build/source/texk/cjkutils/hbf2gf/cfg/j2so12.cfg | 30 - Build/source/texk/cjkutils/hbf2gf/cfg/jsso12.cfg | 28 - Build/source/texk/cjkutils/hbf2gf/cfg/ksso17.cfg | 27 - Build/source/texk/cjkutils/hbf2gf/emdir.c | 109 - Build/source/texk/cjkutils/hbf2gf/emdir.h | 25 - Build/source/texk/cjkutils/hbf2gf/emtexdir.c | 405 --- Build/source/texk/cjkutils/hbf2gf/emtexdir.h | 57 - Build/source/texk/cjkutils/hbf2gf/hbf.c | 1496 ---------- Build/source/texk/cjkutils/hbf2gf/hbf.h | 215 -- Build/source/texk/cjkutils/hbf2gf/hbf2gf.1 | 754 ----- Build/source/texk/cjkutils/hbf2gf/hbf2gf.c | 2242 --------------- Build/source/texk/cjkutils/hbf2gf/hbf2gf.def | 3 - Build/source/texk/cjkutils/hbf2gf/hbf2gf.dvi | Bin 182440 -> 0 bytes Build/source/texk/cjkutils/hbf2gf/hbf2gf.idx | 326 --- Build/source/texk/cjkutils/hbf2gf/hbf2gf.scn | 56 - Build/source/texk/cjkutils/hbf2gf/hbf2gf.tex | 2928 -------------------- Build/source/texk/cjkutils/hbf2gf/hbf2gf.w | 2808 ------------------- Build/source/texk/cjkutils/scripts/Makefile.am | 30 - Build/source/texk/cjkutils/scripts/Makefile.in | 460 --- Build/source/texk/cjkutils/scripts/bg5latex | 43 - Build/source/texk/cjkutils/scripts/bg5pdflatex | 43 - Build/source/texk/cjkutils/scripts/cef5latex | 43 - Build/source/texk/cjkutils/scripts/cef5pdflatex | 43 - Build/source/texk/cjkutils/scripts/ceflatex | 43 - Build/source/texk/cjkutils/scripts/cefpdflatex | 43 - Build/source/texk/cjkutils/scripts/cefslatex | 43 - Build/source/texk/cjkutils/scripts/cefspdflatex | 43 - Build/source/texk/cjkutils/scripts/gbklatex | 43 - Build/source/texk/cjkutils/scripts/gbkpdflatex | 43 - Build/source/texk/cjkutils/scripts/sjislatex | 43 - Build/source/texk/cjkutils/scripts/sjispdflatex | 43 - Build/source/texk/cjkutils/sjisconv.c | 33 + 170 files changed, 23381 insertions(+), 15614 deletions(-) delete mode 100644 Build/source/texk/cjkutils/bat/bg5latex.bat delete mode 100644 Build/source/texk/cjkutils/bat/bg5pltx.bat delete mode 100644 Build/source/texk/cjkutils/bat/cef5ltx.bat delete mode 100644 Build/source/texk/cjkutils/bat/ceflatex.bat delete mode 100644 Build/source/texk/cjkutils/bat/cefsltx.bat delete mode 100644 Build/source/texk/cjkutils/bat/cjklatex.c delete mode 100644 Build/source/texk/cjkutils/bat/f_name.bat delete mode 100644 Build/source/texk/cjkutils/bat/gbklatex.bat delete mode 100644 Build/source/texk/cjkutils/bat/sjisltx.bat create mode 100644 Build/source/texk/cjkutils/bg5conv.c create mode 100644 Build/source/texk/cjkutils/c-auto.in create mode 100644 Build/source/texk/cjkutils/cef5conv.c create mode 100644 Build/source/texk/cjkutils/cefconv.c create mode 100644 Build/source/texk/cjkutils/cefsconv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/ChangeLog create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/TL-Changes create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-01-ANSI-C create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-02-const create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-03-kpathsea create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-04-cjklatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5pdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5latex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5pdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefpdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefslatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefspdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/ChangeLog create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/README create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjislatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjispdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/cjklatex/cjklatex.c create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+latex create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+pdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.cmd create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.w create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.bat create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.cmd create mode 100755 Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbkpdflatex create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.gnu create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.in create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/README create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/README create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5ka12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5kr12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c1so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c2so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c3so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c4so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c5so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c6so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c7so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/csso12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/gsfs14.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/j2so12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/jsso12.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/ksso17.cfg create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/configure.ac create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/dvidrv.btm create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.h create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.h create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.h create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.1 create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.c create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.def create mode 100644 Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.w delete mode 100644 Build/source/texk/cjkutils/conv/Makefile.am delete mode 100644 Build/source/texk/cjkutils/conv/Makefile.in delete mode 100644 Build/source/texk/cjkutils/conv/bg5conv.c delete mode 100644 Build/source/texk/cjkutils/conv/cef5conv.c delete mode 100644 Build/source/texk/cjkutils/conv/cefconv.c delete mode 100644 Build/source/texk/cjkutils/conv/cefsconv.c delete mode 100644 Build/source/texk/cjkutils/conv/extconv.c delete mode 100644 Build/source/texk/cjkutils/conv/sjisconv.c create mode 100644 Build/source/texk/cjkutils/extconv.c create mode 100644 Build/source/texk/cjkutils/hbf2gf.c create mode 100644 Build/source/texk/cjkutils/hbf2gf.dvi create mode 100644 Build/source/texk/cjkutils/hbf2gf.idx create mode 100644 Build/source/texk/cjkutils/hbf2gf.scn create mode 100644 Build/source/texk/cjkutils/hbf2gf.tex delete mode 100644 Build/source/texk/cjkutils/hbf2gf/Makefile.am delete mode 100644 Build/source/texk/cjkutils/hbf2gf/Makefile.in delete mode 100644 Build/source/texk/cjkutils/hbf2gf/c-auto.in delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/README delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/b5ka12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/b5kr12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/b5so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c1so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c2so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c3so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c4so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c5so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c6so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/c7so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/csso12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/gsfs14.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/j2so12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/jsso12.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/cfg/ksso17.cfg delete mode 100644 Build/source/texk/cjkutils/hbf2gf/emdir.c delete mode 100644 Build/source/texk/cjkutils/hbf2gf/emdir.h delete mode 100644 Build/source/texk/cjkutils/hbf2gf/emtexdir.c delete mode 100644 Build/source/texk/cjkutils/hbf2gf/emtexdir.h delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf.c delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf.h delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.1 delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.c delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.def delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.dvi delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.idx delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.scn delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.tex delete mode 100644 Build/source/texk/cjkutils/hbf2gf/hbf2gf.w delete mode 100644 Build/source/texk/cjkutils/scripts/Makefile.am delete mode 100644 Build/source/texk/cjkutils/scripts/Makefile.in delete mode 100755 Build/source/texk/cjkutils/scripts/bg5latex delete mode 100755 Build/source/texk/cjkutils/scripts/bg5pdflatex delete mode 100755 Build/source/texk/cjkutils/scripts/cef5latex delete mode 100755 Build/source/texk/cjkutils/scripts/cef5pdflatex delete mode 100755 Build/source/texk/cjkutils/scripts/ceflatex delete mode 100755 Build/source/texk/cjkutils/scripts/cefpdflatex delete mode 100755 Build/source/texk/cjkutils/scripts/cefslatex delete mode 100755 Build/source/texk/cjkutils/scripts/cefspdflatex delete mode 100755 Build/source/texk/cjkutils/scripts/gbklatex delete mode 100755 Build/source/texk/cjkutils/scripts/gbkpdflatex delete mode 100755 Build/source/texk/cjkutils/scripts/sjislatex delete mode 100755 Build/source/texk/cjkutils/scripts/sjispdflatex create mode 100644 Build/source/texk/cjkutils/sjisconv.c (limited to 'Build') diff --git a/Build/source/texk/README b/Build/source/texk/README index a05d4491424..5b335a8db72 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -27,8 +27,8 @@ bibtex8 - ? bibtexu - ? http://omega.enstb.org/yannis/bibtexu/ -cjkutils - Werner Lemberg - ctan +cjkutils 4.8.2 - checked 18dec10 + http://cjk.ffii.org/cjk-4.8.2.tar.gz detex 2.8 - checked 21may10 http://www.cs.purdue.edu/homes/trinkle/detex/ diff --git a/Build/source/texk/cjkutils/ChangeLog b/Build/source/texk/cjkutils/ChangeLog index 12e25e247f8..20d7cb5723e 100644 --- a/Build/source/texk/cjkutils/ChangeLog +++ b/Build/source/texk/cjkutils/ChangeLog @@ -1,3 +1,10 @@ +2010-12-18 Peter Breitenlohner + + * Import cjk-4.8.2/utils as cjkutils-4.8.2, + patches in cjkutils-4.8.2-PATCHES. + * Makefile.am, configure.ac: Adapted to modified layout. + [WIN32]: compile gbk{,pdf}latex.exe from Fabrice's cjklatex.c. + 2009-11-07 Peter Breitenlohner * configure.ac, hbf2gf/hbf2gf.w: Require recent kpathsea version. diff --git a/Build/source/texk/cjkutils/Makefile.am b/Build/source/texk/cjkutils/Makefile.am index 0f00c645ebe..03b7b89052a 100644 --- a/Build/source/texk/cjkutils/Makefile.am +++ b/Build/source/texk/cjkutils/Makefile.am @@ -1,17 +1,24 @@ ## Makefile.am for the TeX Live subdirectory texk/cjkutils/ ## -## Copyright (C) 2009 Peter Breitenlohner +## Copyright (C) 2009, 2010 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## ACLOCAL_AMFLAGS = -I ../../m4 +## We want to re-distribute the whole original cjk/utils source tree. +EXTRA_DIST = $(CJKUTILS_TREE) +## Patches applied to the original source tree +EXTRA_DIST += $(CJKUTILS_TREE)-PATCHES + # in case of an SVN repository dist-hook: rm -rf `find $(distdir) -name .svn` -SUBDIRS = . conv hbf2gf scripts - +if do_cweb +all-local: config.force hbf2gf.dvi +else !do_cweb all-local: config.force +endif !do_cweb config.force: $(KPATHSEA_DEPEND) echo timestamp >config.force @@ -19,7 +26,158 @@ config.force: $(KPATHSEA_DEPEND) DISTCLEANFILES = config.force -## Not used +INCLUDES = $(KPATHSEA_INCLUDES) +AM_CPPFLAGS = $(XX_CPPFLAGS) +AM_CFLAGS = $(XX_CFLAGS) + +bin_PROGRAMS = \ + bg5conv \ + cefconv \ + cef5conv \ + cefsconv \ + extconv \ + sjisconv \ + hbf2gf + +hbf2gf_SOURCES = \ + $(CJKUTILS_TREE)/hbf2gf/hbf.c \ + $(CJKUTILS_TREE)/hbf2gf/hbf.h \ + hbf2gf.c +hbf2gf_CPPFLAGS = -I$(srcdir)/$(CJKUTILS_TREE)/hbf2gf -Dunix -DHAVE_LIBKPATHSEA $(AM_CPPFLAGS) +hbf2gf_DEPENDENCIES = $(KPATHSEA_DEPEND) +hbf2gf_LDADD = $(KPATHSEA_LIBS) + +if WIN32 +bin_PROGRAMS += \ + gbklatex \ + gbkpdflatex +endif WIN32 + +## For WIN32 we compile gbk{,pdf}latex.exe from Fabrice's cjklatex.c +## and copy them to{bg5,cef5,cef,cefs,sjis}{,pdf}latex.exe. ## -EXTRA_DIST = bat +## For Unix systems we install the {bg5,cef5,cef,cefs,gbk,sjis}{,pdf}latex +## shell scripts and create symlinks gbk{,pdf}latex -> bg5{,pdf}latex. +## +if WIN32 +HOOK_DST = bg5 cef5 cef cefs sjis +HOOK_CMD = cp +else !WIN32 +HOOK_DST = bg5+ +HOOK_CMD = $(LN_S) +endif !WIN32 + +gbklatex_SOURCES = \ + $(CJKUTILS_TREE)/cjklatex/cjklatex.c +gbklatex_DEPENDENCIES = $(KPATHSEA_DEPEND) +gbklatex_LDADD = $(KPATHSEA_LIBS) + +gbkpdflatex_SOURCES = $(gbklatex_SOURCES) +gbkpdflatex_CPPFLAGS = -DLATEX=\"pdflatex\" $(AM_CPPFLAGS) +gbkpdflatex_DEPENDENCIES = $(gbklatex_DEPENDENCIES) +gbkpdflatex_LDADD = $(gbklatex_LDADD) + +## Rebuild libkpathsea +@KPATHSEA_RULE@ + +if WIN32 +bin_SCRIPTS = +else !WIN32 +bin_SCRIPTS = \ + $(CJKUTILS_TREE)/Bg5conv/bg5latex \ + $(CJKUTILS_TREE)/Bg5conv/bg5pdflatex \ + $(CJKUTILS_TREE)/CEFconv/cef5latex \ + $(CJKUTILS_TREE)/CEFconv/cef5pdflatex \ + $(CJKUTILS_TREE)/CEFconv/ceflatex \ + $(CJKUTILS_TREE)/CEFconv/cefpdflatex \ + $(CJKUTILS_TREE)/CEFconv/cefslatex \ + $(CJKUTILS_TREE)/CEFconv/cefspdflatex \ + $(CJKUTILS_TREE)/SJISconv/sjislatex \ + $(CJKUTILS_TREE)/SJISconv/sjispdflatex \ + $(CJKUTILS_TREE)/extconv/gbklatex \ + $(CJKUTILS_TREE)/extconv/gbkpdflatex +endif !WIN32 + +install-exec-hook: + @cd $(DESTDIR)$(bindir) && \ + for p in latex pdflatex; do \ + for c in $(HOOK_DST); do \ + echo "$(HOOK_CMD) gbk$$p$(EXEEXT) $$c$$p$(EXEEXT)"; \ + rm -f $$c$$p$(EXEEXT); $(HOOK_CMD) gbk$$p$(EXEEXT) $$c$$p$(EXEEXT); \ + done; \ + done + +uninstall-hook: + @for p in latex pdflatex; do \ + for c in $(HOOK_DST); do \ + echo "rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT)"; \ + rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT); \ + done; \ + done + +man1_MANS = \ + $(CJKUTILS_TREE)/Bg5conv/bg5conv.1 \ + $(CJKUTILS_TREE)/CEFconv/cef5conv.1 \ + $(CJKUTILS_TREE)/CEFconv/cefconv.1 \ + $(CJKUTILS_TREE)/CEFconv/cefsconv.1 \ + $(CJKUTILS_TREE)/SJISconv/sjisconv.1 \ + $(CJKUTILS_TREE)/extconv/extconv.1 \ + $(CJKUTILS_TREE)/hbf2gf/hbf2gf.1 + +hbf2gf_cfgdir = ${prefix}/texmf/hbf2gf +CFG = $(CJKUTILS_TREE)/hbf2gf/cfg +hbf2gf_cfg_DATA = \ + $(CFG)/b5ka12.cfg \ + $(CFG)/b5kr12.cfg \ + $(CFG)/b5so12.cfg \ + $(CFG)/c1so12.cfg \ + $(CFG)/c2so12.cfg \ + $(CFG)/c3so12.cfg \ + $(CFG)/c4so12.cfg \ + $(CFG)/c5so12.cfg \ + $(CFG)/c6so12.cfg \ + $(CFG)/c7so12.cfg \ + $(CFG)/csso12.cfg \ + $(CFG)/gsfs14.cfg \ + $(CFG)/j2so12.cfg \ + $(CFG)/jsso12.cfg \ + $(CFG)/ksso17.cfg + +CWEB_SRC = $(CJKUTILS_TREE)/hbf2gf/hbf2gf.w +CWEB_TEX = hbf2gf.tex hbf2gf.idx hbf2gf.scn +CWEB_DVI = hbf2gf.dvi + +EXTRA_DIST += $(CWEB_TEX) $(CWEB_DVI) + +CLEANFILES = hbf2gf.log hbf2gf.toc + +hbf2gf.dvi: $(CWEB_TEX) + TEXINPUTS=.:$(srcdir):$$TEXINPUTS $(TEX) hbf2gf.tex + +# Running cweave in order to create hbf2gf.tex generates in addition +# hbf2gf.idx and hbf2gf.scn; we must rerun cweave when they are not +# up to date (even if hbf2gf.tex is up to date). Thus the sub-make. +# +hbf2gf.tex hbf2gf.idx hbf2gf.scn: $(CWEB_SRC) + $(MAKE) $(AM_MAKEFLAGS) do-cweave +do-cweave: $(CWEB_SRC) .FORCE + $(CWEAVE) +ai $< +.PHONY: do-cweave .FORCE + +if do_cweb +bg5conv.c: $(CJKUTILS_TREE)/Bg5conv/bg5conv.w + $(CTANGLE) $< +cef5conv.c: $(CJKUTILS_TREE)/CEFconv/cef5conv.w + $(CTANGLE) $< +cefconv.c: $(CJKUTILS_TREE)/CEFconv/cefconv.w + $(CTANGLE) $< +cefsconv.c: $(CJKUTILS_TREE)/CEFconv/cefsconv.w + $(CTANGLE) $< +sjisconv.c: $(CJKUTILS_TREE)/SJISconv/sjisconv.w + $(CTANGLE) $< +extconv.c: $(CJKUTILS_TREE)/extconv/extconv.w + $(CTANGLE) $< +hbf2gf.c: $(CWEB_SRC) + $(CTANGLE) $< +endif do_cweb diff --git a/Build/source/texk/cjkutils/Makefile.in b/Build/source/texk/cjkutils/Makefile.in index 16d941218d9..5b69f5b17a9 100644 --- a/Build/source/texk/cjkutils/Makefile.in +++ b/Build/source/texk/cjkutils/Makefile.in @@ -14,6 +14,9 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + + + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -33,22 +36,32 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +bin_PROGRAMS = bg5conv$(EXEEXT) cefconv$(EXEEXT) cef5conv$(EXEEXT) \ + cefsconv$(EXEEXT) extconv$(EXEEXT) sjisconv$(EXEEXT) \ + hbf2gf$(EXEEXT) $(am__EXEEXT_1) +@WIN32_TRUE@am__append_1 = \ +@WIN32_TRUE@ gbklatex \ +@WIN32_TRUE@ gbkpdflatex + subdir = . DIST_COMMON = $(am__configure_deps) \ $(srcdir)/../../build-aux/config.guess \ $(srcdir)/../../build-aux/config.sub \ + $(srcdir)/../../build-aux/depcomp \ $(srcdir)/../../build-aux/install-sh \ $(srcdir)/../../build-aux/ltmain.sh \ $(srcdir)/../../build-aux/missing $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure \ - ../../build-aux/config.guess ../../build-aux/config.sub \ - ../../build-aux/depcomp ../../build-aux/install-sh \ - ../../build-aux/ltmain.sh ../../build-aux/missing \ - ../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog + $(srcdir)/Makefile.in $(srcdir)/c-auto.in \ + $(top_srcdir)/configure ../../build-aux/config.guess \ + ../../build-aux/config.sub ../../build-aux/depcomp \ + ../../build-aux/install-sh ../../build-aux/ltmain.sh \ + ../../build-aux/missing ../../build-aux/texinfo.tex \ + ../../build-aux/ylwrap ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 \ $(top_srcdir)/../../m4/libtool.m4 \ $(top_srcdir)/../../m4/ltoptions.m4 \ $(top_srcdir)/../../m4/ltsugar.m4 \ @@ -60,26 +73,87 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/hbf2gf/c-auto.h +CONFIG_HEADER = c-auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +@WIN32_TRUE@am__EXEEXT_1 = gbklatex$(EXEEXT) gbkpdflatex$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(hbf2gf_cfgdir)" +PROGRAMS = $(bin_PROGRAMS) +bg5conv_SOURCES = bg5conv.c +bg5conv_OBJECTS = bg5conv.$(OBJEXT) +bg5conv_LDADD = $(LDADD) +cef5conv_SOURCES = cef5conv.c +cef5conv_OBJECTS = cef5conv.$(OBJEXT) +cef5conv_LDADD = $(LDADD) +cefconv_SOURCES = cefconv.c +cefconv_OBJECTS = cefconv.$(OBJEXT) +cefconv_LDADD = $(LDADD) +cefsconv_SOURCES = cefsconv.c +cefsconv_OBJECTS = cefsconv.$(OBJEXT) +cefsconv_LDADD = $(LDADD) +extconv_SOURCES = extconv.c +extconv_OBJECTS = extconv.$(OBJEXT) +extconv_LDADD = $(LDADD) +am_gbklatex_OBJECTS = cjklatex.$(OBJEXT) +gbklatex_OBJECTS = $(am_gbklatex_OBJECTS) +am__DEPENDENCIES_1 = +am__objects_1 = gbkpdflatex-cjklatex.$(OBJEXT) +am_gbkpdflatex_OBJECTS = $(am__objects_1) +gbkpdflatex_OBJECTS = $(am_gbkpdflatex_OBJECTS) +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +am_hbf2gf_OBJECTS = hbf2gf-hbf.$(OBJEXT) hbf2gf-hbf2gf.$(OBJEXT) +hbf2gf_OBJECTS = $(am_hbf2gf_OBJECTS) +sjisconv_SOURCES = sjisconv.c +sjisconv_OBJECTS = sjisconv.$(OBJEXT) +sjisconv_LDADD = $(LDADD) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +SCRIPTS = $(bin_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = bg5conv.c cef5conv.c cefconv.c cefsconv.c extconv.c \ + $(gbklatex_SOURCES) $(gbkpdflatex_SOURCES) $(hbf2gf_SOURCES) \ + sjisconv.c +DIST_SOURCES = bg5conv.c cef5conv.c cefconv.c cefsconv.c extconv.c \ + $(gbklatex_SOURCES) $(gbkpdflatex_SOURCES) $(hbf2gf_SOURCES) \ + sjisconv.c +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man1_MANS) +DATA = $(hbf2gf_cfg_DATA) ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -87,31 +161,6 @@ am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print @@ -127,6 +176,7 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CJKUTILS_TREE = @CJKUTILS_TREE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CTANGLE = @CTANGLE@ @@ -241,12 +291,85 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../../m4 -SUBDIRS = . conv hbf2gf scripts +EXTRA_DIST = $(CJKUTILS_TREE) $(CJKUTILS_TREE)-PATCHES $(CWEB_TEX) \ + $(CWEB_DVI) DISTCLEANFILES = config.force -EXTRA_DIST = bat -all: all-recursive +INCLUDES = $(KPATHSEA_INCLUDES) +AM_CPPFLAGS = $(XX_CPPFLAGS) +AM_CFLAGS = $(XX_CFLAGS) +hbf2gf_SOURCES = \ + $(CJKUTILS_TREE)/hbf2gf/hbf.c \ + $(CJKUTILS_TREE)/hbf2gf/hbf.h \ + hbf2gf.c + +hbf2gf_CPPFLAGS = -I$(srcdir)/$(CJKUTILS_TREE)/hbf2gf -Dunix -DHAVE_LIBKPATHSEA $(AM_CPPFLAGS) +hbf2gf_DEPENDENCIES = $(KPATHSEA_DEPEND) +hbf2gf_LDADD = $(KPATHSEA_LIBS) +@WIN32_FALSE@HOOK_DST = bg5+ +@WIN32_TRUE@HOOK_DST = bg5 cef5 cef cefs sjis +@WIN32_FALSE@HOOK_CMD = $(LN_S) +@WIN32_TRUE@HOOK_CMD = cp +gbklatex_SOURCES = \ + $(CJKUTILS_TREE)/cjklatex/cjklatex.c + +gbklatex_DEPENDENCIES = $(KPATHSEA_DEPEND) +gbklatex_LDADD = $(KPATHSEA_LIBS) +gbkpdflatex_SOURCES = $(gbklatex_SOURCES) +gbkpdflatex_CPPFLAGS = -DLATEX=\"pdflatex\" $(AM_CPPFLAGS) +gbkpdflatex_DEPENDENCIES = $(gbklatex_DEPENDENCIES) +gbkpdflatex_LDADD = $(gbklatex_LDADD) +@WIN32_FALSE@bin_SCRIPTS = \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/Bg5conv/bg5latex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/Bg5conv/bg5pdflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/cef5latex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/cef5pdflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/ceflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/cefpdflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/cefslatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/CEFconv/cefspdflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/SJISconv/sjislatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/SJISconv/sjispdflatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/extconv/gbklatex \ +@WIN32_FALSE@ $(CJKUTILS_TREE)/extconv/gbkpdflatex + +@WIN32_TRUE@bin_SCRIPTS = +man1_MANS = \ + $(CJKUTILS_TREE)/Bg5conv/bg5conv.1 \ + $(CJKUTILS_TREE)/CEFconv/cef5conv.1 \ + $(CJKUTILS_TREE)/CEFconv/cefconv.1 \ + $(CJKUTILS_TREE)/CEFconv/cefsconv.1 \ + $(CJKUTILS_TREE)/SJISconv/sjisconv.1 \ + $(CJKUTILS_TREE)/extconv/extconv.1 \ + $(CJKUTILS_TREE)/hbf2gf/hbf2gf.1 + +hbf2gf_cfgdir = ${prefix}/texmf/hbf2gf +CFG = $(CJKUTILS_TREE)/hbf2gf/cfg +hbf2gf_cfg_DATA = \ + $(CFG)/b5ka12.cfg \ + $(CFG)/b5kr12.cfg \ + $(CFG)/b5so12.cfg \ + $(CFG)/c1so12.cfg \ + $(CFG)/c2so12.cfg \ + $(CFG)/c3so12.cfg \ + $(CFG)/c4so12.cfg \ + $(CFG)/c5so12.cfg \ + $(CFG)/c6so12.cfg \ + $(CFG)/c7so12.cfg \ + $(CFG)/csso12.cfg \ + $(CFG)/gsfs14.cfg \ + $(CFG)/j2so12.cfg \ + $(CFG)/jsso12.cfg \ + $(CFG)/ksso17.cfg + +CWEB_SRC = $(CJKUTILS_TREE)/hbf2gf/hbf2gf.w +CWEB_TEX = hbf2gf.tex hbf2gf.idx hbf2gf.scn +CWEB_DVI = hbf2gf.dvi +CLEANFILES = hbf2gf.log hbf2gf.toc +all: c-auto.h + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: +.SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -282,6 +405,221 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): +c-auto.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status c-auto.h +$(srcdir)/c-auto.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f c-auto.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +bg5conv$(EXEEXT): $(bg5conv_OBJECTS) $(bg5conv_DEPENDENCIES) + @rm -f bg5conv$(EXEEXT) + $(LINK) $(bg5conv_OBJECTS) $(bg5conv_LDADD) $(LIBS) +cef5conv$(EXEEXT): $(cef5conv_OBJECTS) $(cef5conv_DEPENDENCIES) + @rm -f cef5conv$(EXEEXT) + $(LINK) $(cef5conv_OBJECTS) $(cef5conv_LDADD) $(LIBS) +cefconv$(EXEEXT): $(cefconv_OBJECTS) $(cefconv_DEPENDENCIES) + @rm -f cefconv$(EXEEXT) + $(LINK) $(cefconv_OBJECTS) $(cefconv_LDADD) $(LIBS) +cefsconv$(EXEEXT): $(cefsconv_OBJECTS) $(cefsconv_DEPENDENCIES) + @rm -f cefsconv$(EXEEXT) + $(LINK) $(cefsconv_OBJECTS) $(cefsconv_LDADD) $(LIBS) +extconv$(EXEEXT): $(extconv_OBJECTS) $(extconv_DEPENDENCIES) + @rm -f extconv$(EXEEXT) + $(LINK) $(extconv_OBJECTS) $(extconv_LDADD) $(LIBS) +gbklatex$(EXEEXT): $(gbklatex_OBJECTS) $(gbklatex_DEPENDENCIES) + @rm -f gbklatex$(EXEEXT) + $(LINK) $(gbklatex_OBJECTS) $(gbklatex_LDADD) $(LIBS) +gbkpdflatex$(EXEEXT): $(gbkpdflatex_OBJECTS) $(gbkpdflatex_DEPENDENCIES) + @rm -f gbkpdflatex$(EXEEXT) + $(LINK) $(gbkpdflatex_OBJECTS) $(gbkpdflatex_LDADD) $(LIBS) +hbf2gf$(EXEEXT): $(hbf2gf_OBJECTS) $(hbf2gf_DEPENDENCIES) + @rm -f hbf2gf$(EXEEXT) + $(LINK) $(hbf2gf_OBJECTS) $(hbf2gf_LDADD) $(LIBS) +sjisconv$(EXEEXT): $(sjisconv_OBJECTS) $(sjisconv_DEPENDENCIES) + @rm -f sjisconv$(EXEEXT) + $(LINK) $(sjisconv_OBJECTS) $(sjisconv_LDADD) $(LIBS) +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg5conv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cef5conv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cefconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cefsconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjklatex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbkpdflatex-cjklatex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hbf2gf-hbf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hbf2gf-hbf2gf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sjisconv.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +cjklatex.o: $(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cjklatex.o -MD -MP -MF $(DEPDIR)/cjklatex.Tpo -c -o cjklatex.o `test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cjklatex.Tpo $(DEPDIR)/cjklatex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/cjklatex/cjklatex.c' object='cjklatex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cjklatex.o `test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/cjklatex/cjklatex.c + +cjklatex.obj: $(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cjklatex.obj -MD -MP -MF $(DEPDIR)/cjklatex.Tpo -c -o cjklatex.obj `if test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cjklatex.Tpo $(DEPDIR)/cjklatex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/cjklatex/cjklatex.c' object='cjklatex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cjklatex.obj `if test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; fi` + +gbkpdflatex-cjklatex.o: $(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gbkpdflatex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gbkpdflatex-cjklatex.o -MD -MP -MF $(DEPDIR)/gbkpdflatex-cjklatex.Tpo -c -o gbkpdflatex-cjklatex.o `test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gbkpdflatex-cjklatex.Tpo $(DEPDIR)/gbkpdflatex-cjklatex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/cjklatex/cjklatex.c' object='gbkpdflatex-cjklatex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gbkpdflatex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gbkpdflatex-cjklatex.o `test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/cjklatex/cjklatex.c + +gbkpdflatex-cjklatex.obj: $(CJKUTILS_TREE)/cjklatex/cjklatex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gbkpdflatex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gbkpdflatex-cjklatex.obj -MD -MP -MF $(DEPDIR)/gbkpdflatex-cjklatex.Tpo -c -o gbkpdflatex-cjklatex.obj `if test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gbkpdflatex-cjklatex.Tpo $(DEPDIR)/gbkpdflatex-cjklatex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/cjklatex/cjklatex.c' object='gbkpdflatex-cjklatex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gbkpdflatex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gbkpdflatex-cjklatex.obj `if test -f '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/cjklatex/cjklatex.c'; fi` + +hbf2gf-hbf.o: $(CJKUTILS_TREE)/hbf2gf/hbf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hbf2gf-hbf.o -MD -MP -MF $(DEPDIR)/hbf2gf-hbf.Tpo -c -o hbf2gf-hbf.o `test -f '$(CJKUTILS_TREE)/hbf2gf/hbf.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/hbf2gf/hbf.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hbf2gf-hbf.Tpo $(DEPDIR)/hbf2gf-hbf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/hbf2gf/hbf.c' object='hbf2gf-hbf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hbf2gf-hbf.o `test -f '$(CJKUTILS_TREE)/hbf2gf/hbf.c' || echo '$(srcdir)/'`$(CJKUTILS_TREE)/hbf2gf/hbf.c + +hbf2gf-hbf.obj: $(CJKUTILS_TREE)/hbf2gf/hbf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hbf2gf-hbf.obj -MD -MP -MF $(DEPDIR)/hbf2gf-hbf.Tpo -c -o hbf2gf-hbf.obj `if test -f '$(CJKUTILS_TREE)/hbf2gf/hbf.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/hbf2gf/hbf.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/hbf2gf/hbf.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hbf2gf-hbf.Tpo $(DEPDIR)/hbf2gf-hbf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(CJKUTILS_TREE)/hbf2gf/hbf.c' object='hbf2gf-hbf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hbf2gf-hbf.obj `if test -f '$(CJKUTILS_TREE)/hbf2gf/hbf.c'; then $(CYGPATH_W) '$(CJKUTILS_TREE)/hbf2gf/hbf.c'; else $(CYGPATH_W) '$(srcdir)/$(CJKUTILS_TREE)/hbf2gf/hbf.c'; fi` + +hbf2gf-hbf2gf.o: hbf2gf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hbf2gf-hbf2gf.o -MD -MP -MF $(DEPDIR)/hbf2gf-hbf2gf.Tpo -c -o hbf2gf-hbf2gf.o `test -f 'hbf2gf.c' || echo '$(srcdir)/'`hbf2gf.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hbf2gf-hbf2gf.Tpo $(DEPDIR)/hbf2gf-hbf2gf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hbf2gf.c' object='hbf2gf-hbf2gf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hbf2gf-hbf2gf.o `test -f 'hbf2gf.c' || echo '$(srcdir)/'`hbf2gf.c + +hbf2gf-hbf2gf.obj: hbf2gf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hbf2gf-hbf2gf.obj -MD -MP -MF $(DEPDIR)/hbf2gf-hbf2gf.Tpo -c -o hbf2gf-hbf2gf.obj `if test -f 'hbf2gf.c'; then $(CYGPATH_W) 'hbf2gf.c'; else $(CYGPATH_W) '$(srcdir)/hbf2gf.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hbf2gf-hbf2gf.Tpo $(DEPDIR)/hbf2gf-hbf2gf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hbf2gf.c' object='hbf2gf-hbf2gf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hbf2gf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hbf2gf-hbf2gf.obj `if test -f 'hbf2gf.c'; then $(CYGPATH_W) 'hbf2gf.c'; else $(CYGPATH_W) '$(srcdir)/hbf2gf.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -290,77 +628,61 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ +install-man1: $(man1_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } +install-hbf2gf_cfgDATA: $(hbf2gf_cfg_DATA) + @$(NORMAL_INSTALL) + test -z "$(hbf2gf_cfgdir)" || $(MKDIR_P) "$(DESTDIR)$(hbf2gf_cfgdir)" + @list='$(hbf2gf_cfg_DATA)'; test -n "$(hbf2gf_cfgdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(hbf2gf_cfgdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(hbf2gf_cfgdir)" || exit $$?; \ done +uninstall-hbf2gf_cfgDATA: + @$(NORMAL_UNINSTALL) + @list='$(hbf2gf_cfg_DATA)'; test -n "$(hbf2gf_cfgdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(hbf2gf_cfgdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(hbf2gf_cfgdir)" && rm -f $$files + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -371,24 +693,11 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) c-auto.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) c-auto.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ @@ -406,9 +715,9 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) c-auto.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + list='$(SOURCES) $(HEADERS) c-auto.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ @@ -427,6 +736,19 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -458,34 +780,6 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @@ -605,19 +899,22 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive -all-am: Makefile all-local -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +check: check-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) c-auto.h \ + all-local +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(hbf2gf_cfgdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -626,6 +923,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -635,107 +933,166 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive +clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: +install-data-am: install-hbf2gf_cfgDATA install-man -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: -install-exec-am: - -install-html: install-html-recursive +install-exec-am: install-binPROGRAMS install-binSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: -install-man: +install-man: install-man1 -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-hbf2gf_cfgDATA uninstall-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man1 -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: all install-am install-exec-am install-strip uninstall-am -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am all-local am--refresh check check-am clean \ - clean-generic clean-libtool ctags ctags-recursive dist \ +.PHONY: CTAGS GTAGS all all-am all-local am--refresh check check-am \ + clean clean-binPROGRAMS clean-generic clean-libtool ctags dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-generic distclean-libtool distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-binSCRIPTS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook \ + install-hbf2gf_cfgDATA install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-hbf2gf_cfgDATA uninstall-hook uninstall-man \ + uninstall-man1 # in case of an SVN repository dist-hook: rm -rf `find $(distdir) -name .svn` -all-local: config.force +@do_cweb_TRUE@all-local: config.force hbf2gf.dvi +@do_cweb_FALSE@all-local: config.force config.force: $(KPATHSEA_DEPEND) echo timestamp >config.force $(SHELL) ./config.status --recheck +@KPATHSEA_RULE@ + +install-exec-hook: + @cd $(DESTDIR)$(bindir) && \ + for p in latex pdflatex; do \ + for c in $(HOOK_DST); do \ + echo "$(HOOK_CMD) gbk$$p$(EXEEXT) $$c$$p$(EXEEXT)"; \ + rm -f $$c$$p$(EXEEXT); $(HOOK_CMD) gbk$$p$(EXEEXT) $$c$$p$(EXEEXT); \ + done; \ + done + +uninstall-hook: + @for p in latex pdflatex; do \ + for c in $(HOOK_DST); do \ + echo "rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT)"; \ + rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT); \ + done; \ + done + +hbf2gf.dvi: $(CWEB_TEX) + TEXINPUTS=.:$(srcdir):$$TEXINPUTS $(TEX) hbf2gf.tex + +# Running cweave in order to create hbf2gf.tex generates in addition +# hbf2gf.idx and hbf2gf.scn; we must rerun cweave when they are not +# up to date (even if hbf2gf.tex is up to date). Thus the sub-make. +# +hbf2gf.tex hbf2gf.idx hbf2gf.scn: $(CWEB_SRC) + $(MAKE) $(AM_MAKEFLAGS) do-cweave +do-cweave: $(CWEB_SRC) .FORCE + $(CWEAVE) +ai $< +.PHONY: do-cweave .FORCE + +@do_cweb_TRUE@bg5conv.c: $(CJKUTILS_TREE)/Bg5conv/bg5conv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@cef5conv.c: $(CJKUTILS_TREE)/CEFconv/cef5conv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@cefconv.c: $(CJKUTILS_TREE)/CEFconv/cefconv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@cefsconv.c: $(CJKUTILS_TREE)/CEFconv/cefsconv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@sjisconv.c: $(CJKUTILS_TREE)/SJISconv/sjisconv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@extconv.c: $(CJKUTILS_TREE)/extconv/extconv.w +@do_cweb_TRUE@ $(CTANGLE) $< +@do_cweb_TRUE@hbf2gf.c: $(CWEB_SRC) +@do_cweb_TRUE@ $(CTANGLE) $< + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/Build/source/texk/cjkutils/aclocal.m4 b/Build/source/texk/cjkutils/aclocal.m4 index d77f3a9c0b1..2e8f28004fa 100644 --- a/Build/source/texk/cjkutils/aclocal.m4 +++ b/Build/source/texk/cjkutils/aclocal.m4 @@ -992,6 +992,7 @@ AC_SUBST([am__untar]) m4_include([../../m4/kpse-common.m4]) m4_include([../../m4/kpse-kpathsea-flags.m4]) m4_include([../../m4/kpse-warnings.m4]) +m4_include([../../m4/kpse-win32.m4]) m4_include([../../m4/libtool.m4]) m4_include([../../m4/ltoptions.m4]) m4_include([../../m4/ltsugar.m4]) diff --git a/Build/source/texk/cjkutils/bat/bg5latex.bat b/Build/source/texk/cjkutils/bat/bg5latex.bat deleted file mode 100644 index 91e7dfd8575..00000000000 --- a/Build/source/texk/cjkutils/bat/bg5latex.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -bg5conv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/bg5pltx.bat b/Build/source/texk/cjkutils/bat/bg5pltx.bat deleted file mode 100644 index ccc6c76acd5..00000000000 --- a/Build/source/texk/cjkutils/bat/bg5pltx.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -extconv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/cef5ltx.bat b/Build/source/texk/cjkutils/bat/cef5ltx.bat deleted file mode 100644 index 187485301f9..00000000000 --- a/Build/source/texk/cjkutils/bat/cef5ltx.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -cef5conv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/ceflatex.bat b/Build/source/texk/cjkutils/bat/ceflatex.bat deleted file mode 100644 index ba5925a6df3..00000000000 --- a/Build/source/texk/cjkutils/bat/ceflatex.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -cefconv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/cefsltx.bat b/Build/source/texk/cjkutils/bat/cefsltx.bat deleted file mode 100644 index 662ef9e3af4..00000000000 --- a/Build/source/texk/cjkutils/bat/cefsltx.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -cefsconv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/cjklatex.c b/Build/source/texk/cjkutils/bat/cjklatex.c deleted file mode 100644 index c1749ab6a25..00000000000 --- a/Build/source/texk/cjkutils/bat/cjklatex.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - Purpose: call latex after preprocessing of the .tex file by - the cjk conversion tool. The old f_name.bat script - is not working anymore. - Author : F. Popineau - Date : <29/06/2001> -*/ - -/* - Copyright (C) 2001-2006 F. Popineau - - 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 in doc/COPYING; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA -*/ - -#include -#include -#include - -#include -#include -#include - -static char *cjklatex_version_string = "1.0"; - -static const char *usage_str[] = { - "Usage: %s OPTIONS FILE\n", - "Calls `latex' on FILE after conversion by the filter\n", - "specified by OPTIONS.\n", - "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n", - "--conv=bg5p\tfor Chinese, encoding Big 5+,\n", - "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n", - "--conv=cef5\tidem CEF, also converts Big5 characters,\n", - "--conv=cefs\tidem CEF, also converts SJIS characters,\n", - "--conv=sjis\tfor Japanese, SJIS encoding,\n", - "--conv=gbk\tfor Chinese, encoding GBK.", - "\nAlternatively, for compatibility with the previous DOS batch files,\n", - "you can also copy this program to any of the following names:\n", - "bg5latex.exe,bg5pltx.exe,cef5ltx.exe,ceflatex.exe,cefsltx.exe,\n", - "gbklatex.exe and sjisltx.exe .\n", - "Then running one of these programs will be identical to specify\n", - "the corresponding option.\n", - "\nAdditional options:\n", - "--verbose\tbe a bit more verbose about what is happening,\n", - "--nocleanup\tdo not remove intermediate files,\n", - "--latex=engine\tuse `engine' instead of `latex' to process the file.\n", - NULL -}; - -static char *progname = NULL; - -static struct _conv_table { - char *progname; - char *processor; -} CJKtable[] = { - { "cjklatex", "" }, - { "bg5latex", "bg5conv" }, - { "bg5pltx", "extconv" }, - { "cef5ltx", "cef5conv" }, - { "ceflatex", "cefconv" }, - { "cefsltx", "cefsconv" }, - { "gbklatex", "extconv" }, - { "sjisltx", "sjisconv" } -}; - -#define PROGRAM_IS(p) FILESTRCASEEQ (p, progname) -#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a) - -static int program_number = -1; -static int opt_verbose = 0; -static int opt_nocleanup = 0; -static char *texname, *cjkname, *texengine; - -static struct option long_options [] = { - { "debug", 1, 0, 0}, - { "help", 0, 0, 0}, - { "version", 0, 0, 0}, - { "verbose", 0, 0, 0}, - { "nocleanup", 0, 0, 0}, - { "latex", 1, 0, 0}, - { "conv", 1, 0, 0}, - {0, 0, 0, 0} -}; - -BOOL sigint_handler(DWORD dwCtrlType) -{ - /* Fix me : there is a problem if a system() command is running. - We should wait for the son process to be interrupted. - Only way I can think of to do that : rewrite system() based on - spawn() with parsing of the command line and set a global pid - Next cwait(pid) in the HandlerRoutine. - */ - - /* This is not that good, but else we would need to wait for - the child processes to finish ! */ - Sleep(250); - - fprintf(stderr, "Sending Ctrl+Break!\n"); - GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0); - - if (! opt_nocleanup) - unlink(cjkname); - - exit(1); - - return FALSE; /* return value obligatory */ -} - -void usage() -{ - int i; - fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string); - fprintf(stderr,usage_str[0], progname ); - fputs("\n", stderr); - for(i = 1; usage_str[i]; ++i) - fputs(usage_str[i], stderr); -} - -int do_process(char *processor, char *filename) -{ - char *ext, *p; - char cmd[_MAX_PATH*3]; - DWORD dwFA; - int ret; - - if (strlen(filename) > 4 && _strnicmp(filename + strlen(filename) - 4, ".tex", 4) == 0) { - texname = xstrdup(filename); - } - else { - texname = concat(filename, ".tex"); - } - for (p = texname; p && *p; p++) - *p = (*p == '\\' ? '/' : *p); - - dwFA = GetFileAttributes(texname); - if (dwFA == 0xFFFFFFFF || (dwFA & FILE_ATTRIBUTE_DIRECTORY)) { - fprintf(stderr, "%s: %s is an invalid input file.\n", - progname, texname); - ret = 1; - } - else { - cjkname = xstrdup(texname); - ext = strrchr(cjkname, '.'); - assert(ext != NULL); - strcpy(cjkname + (ext - cjkname), ".cjk"); - - sprintf(cmd, "%s < %s > %s", processor, texname, cjkname); - if (opt_verbose) - fprintf(stderr, "%s: running command `%s'.\n", progname, cmd); - ret = system(cmd); - if (ret == 0) { - sprintf(cmd, "%s %s", texengine, cjkname); - if (opt_verbose) - fprintf(stderr, "%s: running command `%s'.\n", progname, cmd); - ret = system(cmd); - if (! opt_nocleanup) - unlink(cjkname); - } - } - - free(texname); - free(cjkname); - - return ret; -} - -void main(int argc, char *argv[]) -{ - int g; /* getopt return code */ - int i; - int option_index; - char *filename; - - if (!progname) - progname = argv[0]; - - kpse_set_program_name (progname, NULL); - progname = kpse_program_name; - - for (i = 0; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number < 0; i++) { - if (STREQ(progname, CJKtable[i].progname) -#if 0 - || (STREQ(progname, CJKtable[i].progname) - && STREQ(progname+strlen(CJKtable[i].progname), ".exe")) -#endif - ) { - program_number = i; - } - } - - if (program_number == -1) { - fprintf(stderr, "%s: this program has been incorrecty copied to the name %s.\n", progname, progname); - usage(); - exit(1); - } - - for(;;) { - g = getopt_long_only (argc, argv, "", long_options, &option_index); - - if (g == EOF) - break; - - if (g == '?') { - usage(); /* Unknown option. */ - exit(1); - } - - /* assert (g == 0); */ /* We have no short option names. */ - /* - FIXME : try 'mktexpk --mfmode --bdpi 600 ...' - */ - if (ARGUMENT_IS ("debug")) { - kpathsea_debug |= atoi (optarg); - } - else if (ARGUMENT_IS ("help")) { - usage(); - exit(0); - } - else if (ARGUMENT_IS ("verbose")) { - opt_verbose = 1; - } - else if (ARGUMENT_IS ("nocleanup")) { - opt_nocleanup = 1; - } - else if (ARGUMENT_IS ("latex")) { - texengine = xstrdup(optarg); - } - else if (ARGUMENT_IS ("version")) { - fprintf(stderr, "%s of %s.\n", progname, cjklatex_version_string); - exit(0); - } - else if (PROGRAM_IS("cjklatex")) { - if (ARGUMENT_IS("conv")) { - for (i = 1; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number <= 0; i++) { - if (STRNEQ(optarg, CJKtable[i].progname, strlen(optarg))) { - program_number = i; - } - } - } - } - } - - /* shifting options from argv[] list */ - for (i = 1; optind < argc; i++, optind++) - argv[i] = argv[optind]; - argv[i] = NULL; - - argc = i; - - if (argc < 2) { - fprintf (stderr, "%s: Missing argument(s).\nTry `%s --help' for more information.\n", progname, kpse_program_name); - exit(1); - } - - if (argc > 2) { - fprintf(stderr, "%s: Extra arguments", progname); - for (i = 2; i < argc; i++) - fprintf (stderr, " \"%s\"", argv[i]); - fprintf (stderr, "\nTry `%s --help' for more information.\n", - kpse_program_name); - exit(1); - } - - SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE); - - filename = xstrdup(argv[1]); - - assert(program_number > 0); - - if (! texengine) { - texengine = xstrdup("latex"); - } - - do_process(CJKtable[program_number].processor, filename); - - free(filename); - free(texengine); -} diff --git a/Build/source/texk/cjkutils/bat/f_name.bat b/Build/source/texk/cjkutils/bat/f_name.bat deleted file mode 100644 index 70e6e69ce9a..00000000000 --- a/Build/source/texk/cjkutils/bat/f_name.bat +++ /dev/null @@ -1,205 +0,0 @@ -@echo off -:4dosCheck - if "%@eval[2+2]"=="4" loadbtm on -:Start - if [%1]==[] goto Usage - if [%1]==[/?] goto Help - if [%2]==[] goto InputCheck -REM -REM This file is called F_NAME.BAT per default. Call it whatever you like. -REM -REM You need enough free environment space for this batch file. -REM If there's not enough free space, f_name.bat will give you a warning. -REM -REM While f_name.bat tries to test your free environment space, you'll -REM probably need to check your config.sys for the following line: -REM -REM SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:1024 /p -REM -REM The '/E:1024' sets your environment space - it will probably need to -REM be 1024 or higher (unless you're really economical with env-space). -REM -REM If you are not sure about free space, set fp and fn with long dummy -REM strings in autoexec.bat to get enough free space, eg.: -REM -REM set fp=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -REM set fu=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -REM set fn=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -REM set fd=xx -REM set fe=xxxx -REM -REM Using dummy strings is necessary if you're going to execute -REM f_name.bat from a second command shell, eg. from Norton Commander. -REM In this case the total length reserved for f_name.bat should be up -REM to 192 bytes. My suggestion is, let the strings for fp, fu, and fn count -REM up to 186 bytes (eg. 62 each). -REM -REM Some releases of DOS (eg. some beta-releases/pre-releases of DOS 6.0 -REM and some older DOS releases) does not support the batchcommand 'NOT'. -REM If you're still using such a release you cannot use this batchfile -REM since it uses this batchcommand. -REM -REM Please also note that f_name.bat cannot work properly if filespec is -REM longer than around 38 (? I don't know the exact length) characters. If -REM filespec is long, f_name.bat will fail at 'for %%x in ... do if ...' -REM lines. The result of error is fairly unpredictable as DOS will try to -REM execute with a truncated batch command line. So, please use the -REM batch file for short filespecs (< 38??). (On my DOS 6.22 using -REM strings above 38 chars gives me an endless loop, Claus Futtrup). -REM -REM For large batchfiles it is usually an advantage to use a -REM 'batch-compiler', which will convert the .bat file into a .com or -REM .exe file. With f_name.bat this could probably speed it up many -REM times, but it has not been possible to find a batch-compiler, which -REM will compile this batchfile. The compilers PWR14G.ZIP and -REM BAT2EX15.ZIP have been tested without success. -REM -REM This modified release is more solid when it comes to garbage input, it -REM is provided with help option, additional documentation and additional -REM checking for sufficient environment space and now remove the temporary -REM environment settings (P, Q, R, S, T) at the bottom of the batchfile. The -REM structure is changed a bit, but the basic still is made by Wonkoo Kim. -REM -REM Please do not distribute this file without the above documentation -REM included in the batch-file. If you change the file please add your -REM name as a "modifier" as done below + document your changes. We do -REM not intend to hold a copyright, though. You may use, misuse or abuse -REM this batchfile as you see fit. -REM -REM This file is provided to you on a free basis. The author/modifiers -REM do not want to be hold responsible to whatever this batchfile is -REM doing. Use of this batchfile is entirely at your own risk. -REM -REM Wonkoo Kim (wkim+@pitt.edu), August 11, 1995 -REM Modified by Claus Futtrup (odie@csek.iprod.auc.dk), August 23. 1995 -REM Modified by Werner Lemberg (wl@gnu.org), Jan. 10. 1996 -REM to run this batch file under 4DOS too (replacing all %%f with %%x -REM and doubling the speed with the LOADBTM ON command) -REM Modified by Werner Lemberg (wl@gnu.org), Aug. 31. 1996 -REM to return unix-like paths additionally in the variable %fu%; -REM the batch file will now parse e.g. \a.b\ correctly as a directory. -REM -:Usage - echo. - echo Usage: %0 filespec - echo. - echo Returns: fd (drive), fp (path), fu (unix path), fn (name), fe (extension) - echo. - echo Type %0 /? for additional help - echo %0 is made by Wonkoo Kim, modified by C. Futtrup and W. Lemberg. - echo. - goto END -:Help - cls - echo %0 -- extracts the drive, path, name, and ext from file-path-name. - echo. - echo Return envs: FD (drive), FP (path), FU (unix path), FN (name), FE (ext) - echo Temp envs: P, Q, R, S, T - echo. - echo INPUT FILE fd fp fn fe - echo ------------------ --------- --------- --------- --------- - echo abc abc - echo abc.tex abc .tex - echo c:\abc.tex c: \ abc .tex - echo c:tmp\abc.tex c: tmp\ abc .tex - echo c:\tmp\abc.tex c: \tmp\ abc .tex - echo c:tmp\tex\abc.tex c: tmp\tex\ abc .tex - echo c:\tmp\tex\abc.tex c: \tmp\tex\ abc .tex - echo. - echo Please note this file isn't blazing fast + it needs a lot - echo of environment space. See comments in %0 for more info. - echo. - echo Wonkoo Kim (wkim+@pitt.edu), August 11, 1995 - echo Modified by Claus Futtrup (odie@csek.iprod.auc.dk), August 23. 1995 - echo Modified by Werner Lemberg (wl@gnu.org), Aug 31. 1996 - goto END -:InputCheck - for %%x in (%1) do if "%%x"=="%1" goto Okay - echo *** ERROR: Please do not use wildcards in input file name. - goto END -:Okay - set p= - set r= - set fp= - set fu= - set fe= - set fn=%1 - set s=XXXXXXXX%fn% - set t=%fn% - set s= - if [%t%]==[%1] goto GetDrive -:EnvErr - echo *** ERROR: Not enough environment space! - echo *** See documentation at top of file '%0' - goto END -:GetDrive - for %%x in (/%t%) do set fn=%%x - for %%x in (/%t%) do if not [%%x]==[%fn%] set fd=%%x - if [%fn%]==[:] goto DriveOnly - set t=%fn% - for %%x in (/%t%) do set fn=%%x - if [:%fn%]==[%t%] goto DriveFound - set fd= - set fn=%1 - goto GetPath -:DriveOnly - set fn= -:DriveFound - set fd=%fd%: -:GetPath - set s=%fn% -:PathLoop - set t=%s% - for %%x in (/%t%) do set s=%%x - set q= - for %%x in (/%t%) do if not [%%x]==[%s%] set q=%%x - if "\%s%"=="%t%" goto Separator - set p=%p%%q% - set r=%r%%q% - if [%s%]==[%t%] goto PathCheck - goto PathLoop -:Separator - set fn=%s% - set p=%p%\ - set r=%r%/ - set fp=%p% - set fu=%r% - goto PathLoop -:PathCheck - if [%s%]==[\] goto NoFilename - if not [%fn%]==[\] goto GetExt - set fp=\ - set fu=/ - set fn= - goto Done -:NoFilename - set fp=%p%\ - set fu=%r%/ - set fn= - goto Done -:GetExt - set s=%fn% - set fe=%fn% - set fn= -:ExtLoop - set t=%fe% - for %%x in (/%t%) do set fe=%%x - if ".%fe%"=="%t%" goto ExtFound - if [%fe%]==[%t%] goto NoExt - for %%x in (/%t%) do if not [%%x]==[%fe%] set fn=%fn%%%x - goto ExtLoop -:ExtFound - set fe=.%fe% - goto Done -:NoExt - if not [%fe%]==[.] set fn=%s% - set fe= -:Done - echo DRIVE=%fd% PATH=%fp% UNIX_PATH=%fu% NAME=%fn% EXT=%fe% -:END - set p= - set q= - set r= - set s= - set t= - diff --git a/Build/source/texk/cjkutils/bat/gbklatex.bat b/Build/source/texk/cjkutils/bat/gbklatex.bat deleted file mode 100644 index ccc6c76acd5..00000000000 --- a/Build/source/texk/cjkutils/bat/gbklatex.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -extconv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bat/sjisltx.bat b/Build/source/texk/cjkutils/bat/sjisltx.bat deleted file mode 100644 index 5702c113bdf..00000000000 --- a/Build/source/texk/cjkutils/bat/sjisltx.bat +++ /dev/null @@ -1,3 +0,0 @@ -call f_name %1 -sjisconv < %1 > %fd%%fp%%fn%.cjk -latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/bg5conv.c b/Build/source/texk/cjkutils/bg5conv.c new file mode 100644 index 00000000000..14837a1c843 --- /dev/null +++ b/Build/source/texk/cjkutils/bg5conv.c @@ -0,0 +1,33 @@ +#define banner \ +"bg5conv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 94 "./cjkutils-4.8.2/Bg5conv/bg5conv.w" + +#include +#include + + +int main(int argc,char*argv[]) +{int ch; + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0xA1&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/c-auto.in b/Build/source/texk/cjkutils/c-auto.in new file mode 100644 index 00000000000..546f1edcbb3 --- /dev/null +++ b/Build/source/texk/cjkutils/c-auto.in @@ -0,0 +1,186 @@ +/* c-auto.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the `bcmp' function. */ +#undef HAVE_BCMP + +/* Define to 1 if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define to 1 if you have the `bzero' function. */ +#undef HAVE_BZERO + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getwd' function. */ +#undef HAVE_GETWD + +/* Define to 1 if you have the `index' function. */ +#undef HAVE_INDEX + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `memcmp' function. */ +#undef HAVE_MEMCMP + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the `mktemp' function. */ +#undef HAVE_MKTEMP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you are using GNU libc or otherwise have global variables + `program_invocation_name' and `program_invocation_short_name'. */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the `rindex' function. */ +#undef HAVE_RINDEX + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if `st_mtim' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_MTIM + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +#undef _LARGEFILE_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/Build/source/texk/cjkutils/cef5conv.c b/Build/source/texk/cjkutils/cef5conv.c new file mode 100644 index 00000000000..1d648ef49a1 --- /dev/null +++ b/Build/source/texk/cjkutils/cef5conv.c @@ -0,0 +1,135 @@ +#define banner \ +"cef5conv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 108 "./cjkutils-4.8.2/CEFconv/cef5conv.w" + +#include +#include +#include + + +int main(int argc,char*argv[]) +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0xA1&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else if(ch=='&') + +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cefconv.c b/Build/source/texk/cjkutils/cefconv.c new file mode 100644 index 00000000000..f5932bbf7a4 --- /dev/null +++ b/Build/source/texk/cjkutils/cefconv.c @@ -0,0 +1,127 @@ +#define banner \ +"cefconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 100 "./cjkutils-4.8.2/CEFconv/cefconv.w" + +#include +#include +#include + + +int main(int argc,char*argv[]) +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch=='&') +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cefsconv.c b/Build/source/texk/cjkutils/cefsconv.c new file mode 100644 index 00000000000..b359e12533e --- /dev/null +++ b/Build/source/texk/cjkutils/cefsconv.c @@ -0,0 +1,135 @@ +#define banner \ +"cefsconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 108 "./cjkutils-4.8.2/CEFconv/cefsconv.w" + +#include +#include +#include + + +int main(int argc,char*argv[]) +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else if(ch=='&') + +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/ChangeLog b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/ChangeLog new file mode 100644 index 00000000000..257f4f6c06f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/ChangeLog @@ -0,0 +1,15 @@ +2010-12-19 Peter Breitenlohner + + Adapt to cjk-4.8.2/utils. + * patch-01-ANSI-C (new): ANSI C function declarations. + * patch-02-const (new): Declare numerous strings as const. + * patch-03-kpathsea (new): Require recent kpathsea version. + + * patch-04-cjklatexn (new): Merge upstream versions with changes + from Akira (mail 18 Dec 2010 09:12:01). + Return type of main is int. ANSI C function declarations. + Declare functions as static. Declare various strings as const. + + * patch-05-cjkpdflatex (new) [LATEX]: Allow to build both + gbklatex.exe and gbkpdflatex.exe from cjklatex.c. + diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/TL-Changes b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/TL-Changes new file mode 100644 index 00000000000..f28033b841b --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/TL-Changes @@ -0,0 +1,21 @@ +Changes applied to the cjk-4.8.2/utils tree as obtained from: + http://cjk.ffii.org/cjk-4.8.2.tar.gz + +Moved from top level to here: + ChangeLog + README + +Removed: + f_name.bat + hbf2gf/c-auto.h + hbf2gf/config.guess + hbf2gf/config.sub + hbf2gf/configure + hbf2gf/install-sh + hbf2gf/mkinstalldirs + hbf2gf/scripts/ + lisp/ + pyhyphen/ + subfonts/ + thaifont/ + diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-01-ANSI-C b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-01-ANSI-C new file mode 100644 index 00000000000..2227fd3fef9 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-01-ANSI-C @@ -0,0 +1,758 @@ +diff -ur cjkutils-4.8.2.orig/Bg5conv/bg5conv.w cjkutils-4.8.2/Bg5conv/bg5conv.w +--- cjkutils-4.8.2.orig/Bg5conv/bg5conv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/Bg5conv/bg5conv.w 2010-12-17 20:41:32.000000000 +0100 +@@ -96,10 +96,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch; + + fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@# +diff -ur cjkutils-4.8.2.orig/CEFconv/cef5conv.w cjkutils-4.8.2/CEFconv/cef5conv.w +--- cjkutils-4.8.2.orig/CEFconv/cef5conv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/CEFconv/cef5conv.w 2010-12-17 20:41:33.000000000 +0100 +@@ -111,10 +111,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; +diff -ur cjkutils-4.8.2.orig/CEFconv/cefconv.w cjkutils-4.8.2/CEFconv/cefconv.w +--- cjkutils-4.8.2.orig/CEFconv/cefconv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/CEFconv/cefconv.w 2010-12-17 20:41:34.000000000 +0100 +@@ -103,10 +103,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; +diff -ur cjkutils-4.8.2.orig/CEFconv/cefsconv.w cjkutils-4.8.2/CEFconv/cefsconv.w +--- cjkutils-4.8.2.orig/CEFconv/cefsconv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/CEFconv/cefsconv.w 2010-12-17 20:41:35.000000000 +0100 +@@ -111,10 +111,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; +diff -ur cjkutils-4.8.2.orig/SJISconv/sjisconv.w cjkutils-4.8.2/SJISconv/sjisconv.w +--- cjkutils-4.8.2.orig/SJISconv/sjisconv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/SJISconv/sjisconv.w 2010-12-17 20:41:37.000000000 +0100 +@@ -95,10 +95,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch; + + fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@# +diff -ur cjkutils-4.8.2.orig/extconv/extconv.w cjkutils-4.8.2/extconv/extconv.w +--- cjkutils-4.8.2.orig/extconv/extconv.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/extconv/extconv.w 2010-12-17 20:41:39.000000000 +0100 +@@ -96,10 +96,7 @@ + #include @# + + +-int main(argc, argv) +- int argc; +- char *argv[]; +- ++int main(int argc, char *argv[]) + {int ch; + + +diff -ur cjkutils-4.8.2.orig/hbf2gf/hbf.c cjkutils-4.8.2/hbf2gf/hbf.c +--- cjkutils-4.8.2.orig/hbf2gf/hbf.c 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/hbf2gf/hbf.c 2009-10-01 00:00:00.000000000 +0200 +@@ -283,16 +283,14 @@ + #endif /* __STDC__ */ + + static void +-clear_bbox(bbox) +- HBF_BBOX *bbox; ++clear_bbox(HBF_BBOX *bbox) + { + bbox->hbf_width = bbox->hbf_height = 0; + bbox->hbf_xDisplacement = bbox->hbf_yDisplacement = 0; + } + + static void +-clear_record(hbf) +- HBF_STRUCT *hbf; ++clear_record(HBF_STRUCT *hbf) + { + clear_bbox(&(hbf->public.hbf_bitmap_bbox)); + clear_bbox(&(hbf->public.hbf_font_bbox)); +@@ -309,10 +307,7 @@ + */ + + static void +-add_b2r(last_b2r, start, finish) +-reg B2_RANGE **last_b2r; +- int start; +- int finish; ++add_b2r(reg B2_RANGE **last_b2r, int start, int finish) + { + reg B2_RANGE *b2r; + +@@ -326,9 +321,7 @@ + } + + static CHAR_INDEX +-b2_pos(hbf, code) +- HBF_STRUCT *hbf; +- HBF_CHAR code; ++b2_pos(HBF_STRUCT *hbf, HBF_CHAR code) + { + reg B2_RANGE *b2r; + reg unsigned c; +@@ -345,8 +338,7 @@ + } + + static int +-b2_size(b2r) +-reg B2_RANGE *b2r; ++b2_size(reg B2_RANGE *b2r) + { + reg int size; + +@@ -358,9 +350,7 @@ + + /* map a position to a character code */ + static long +-code_of(hbf, pos) +- HBF_STRUCT *hbf; +- long pos; ++code_of(HBF_STRUCT *hbf, long pos) + { + long code; + int residue; +@@ -382,9 +372,7 @@ + */ + + static bool +-match(lp, sp) +-reg const char *lp; +-reg const char *sp; ++match(reg const char *lp, reg const char *sp) + { + while (*lp == *sp && *sp != '\0') { + lp++; +@@ -395,8 +383,7 @@ + + #ifdef NO_STRDUP + char * +-strdup(s) +- const char *s; ++strdup(const char *s) + { + char *new_s; + +@@ -411,9 +398,7 @@ + */ + + static void +-add_property(hbf, lp) +-reg HBF_STRUCT *hbf; +-reg const char *lp; ++add_property(reg HBF_STRUCT *hbf, const char *lp) + { + reg PROPERTY *prop; + char tmp[MAXLINE]; +@@ -454,9 +439,7 @@ + } + + const char * +-hbfProperty(hbfFile, propName) +- HBF *hbfFile; +- const char *propName; ++hbfProperty(HBF *hbfFile, const char *propName) + { + reg HBF_STRUCT *hbf; + reg PROPERTY *prop; +@@ -473,20 +456,15 @@ + */ + + const char * +-HBF_GetProperty(handle, propertyName) +- HBF *handle; +- const char *propertyName; ++HBF_GetProperty(HBF *handle, const char *propertyName) + { + return hbfProperty(handle, propertyName); + } + + int +-HBF_GetFontBoundingBox(handle, width, height, xDisplacement, yDisplacement) +- HBF_Handle handle; +- unsigned int *width; +- unsigned int *height; +- int *xDisplacement; +- int *yDisplacement; ++HBF_GetFontBoundingBox(HBF_Handle handle, ++ unsigned int *width, unsigned int *height, ++ int *xDisplacement, int *yDisplacement) + { + if (width != NULL) + *width = hbfFontBBox(handle)->hbf_width; +@@ -500,12 +478,9 @@ + } + + int +-HBF_GetBitmapBoundingBox(handle, width, height, xDisplacement, yDisplacement) +- HBF_Handle handle; +- unsigned int *width; +- unsigned int *height; +- int *xDisplacement; +- int *yDisplacement; ++HBF_GetBitmapBoundingBox(HBF_Handle handle, ++ unsigned int *width, unsigned int *height, ++ int *xDisplacement, int *yDisplacement) + { + if (width != NULL) + *width = hbfBitmapBBox(handle)->hbf_width; +@@ -522,10 +497,9 @@ + * Prepend a directory to a relative filename. + */ + static char * +-concat(dir, dirlen, stem) +- const char *dir; /* not necessarily null-terminated */ +- int dirlen; /* number of significant chars in dir */ +- const char *stem; /* relative filename */ ++concat(const char *dir, /* not necessarily null-terminated */ ++ int dirlen, /* number of significant chars in dir */ ++ const char *stem) /* relative filename */ + { + char *fullname; + +@@ -570,9 +544,7 @@ + * containing the HBF file. + */ + static char * +-expand_filename(name, hbf_name) +- const char *name; +- const char *hbf_name; ++expand_filename(const char *name, const char *hbf_name) + { + #ifdef unix + reg char *s; +@@ -639,9 +611,7 @@ + } + + static BM_FILE * +-find_file(hbf, filename) +- HBF_STRUCT *hbf; +- const char *filename; ++find_file(HBF_STRUCT *hbf, const char *filename) + { + BM_FILE **fp; + reg BM_FILE *file; +@@ -721,9 +691,7 @@ + #define GRAIN_SIZE 512 + + static bool +-read_bitmap_file(bmf, f) +- BM_FILE *bmf; +- FILE *f; ++read_bitmap_file(BM_FILE *bmf, FILE *f) + { + byte *contents, *cp; + long size; +@@ -760,9 +728,7 @@ + + /* check that a code range fits within its bitmap file */ + static bool +-too_short(hbf, cp) +- HBF_STRUCT *hbf; +- CODE_RANGE *cp; ++too_short(HBF_STRUCT *hbf, CODE_RANGE *cp) + { + int bm_size; + long offset, end_offset; +@@ -796,9 +762,7 @@ + } + + static const char * +-skip_word(n, s) +- int n; +- const char *s; ++skip_word(int n, const char *s) + { + for ( ; n > 0; n--) { + while (*s != '\0' && ! isspace(*s)) +@@ -811,9 +775,7 @@ + + /* optional keywords at the end of a CODE_RANGE line */ + static void +-parse_keywords(cp, s) +- CODE_RANGE *cp; +- const char *s; ++parse_keywords(CODE_RANGE *cp, const char *s) + { + for (s = skip_word(4, s) ; *s != '\0'; s = skip_word(1, s)) { + switch (*s) { +@@ -829,9 +791,7 @@ + } + + static bool +-add_code_range(hbf, line) +- HBF_STRUCT *hbf; +- const char *line; ++add_code_range(HBF_STRUCT *hbf, const char *line) + { + CODE_RANGE *cp; + CODE_RANGE **cpp; +@@ -896,10 +856,7 @@ + + /* get line, truncating to len, and trimming trailing spaces */ + static bool +-get_line(buf, len, f) +- char *buf; +- int len; +- FILE *f; ++get_line(char *buf, int len, FILE *f) + { + int c; + char *bp; +@@ -926,10 +883,7 @@ + + /* get next non-COMMENT line */ + static bool +-get_text_line(buf, len, f) +- char *buf; +- int len; +- FILE *f; ++get_text_line(char *buf, int len, FILE *f) + { + while (get_line(buf, len, f)) + if (*buf != '\0' && ! match(buf, "COMMENT")) +@@ -938,10 +892,7 @@ + } + + static bool +-get_property(line, keyword, hbf) +- const char *line; +- const char *keyword; +- HBF_STRUCT *hbf; ++get_property(const char *line, const char *keyword, HBF_STRUCT *hbf) + { + if (! match(line, keyword)) { + eprintf("%s expected", keyword); +@@ -952,10 +903,7 @@ + } + + static bool +-get_bbox(line, keyword, bbox) +- const char *line; +- const char *keyword; +- HBF_BBOX *bbox; ++get_bbox(const char *line, const char *keyword, HBF_BBOX *bbox) + { + int w, h, xd, yd; + +@@ -995,9 +943,7 @@ + */ + + static bool +-parse_file(f, hbf) +- FILE *f; +-reg HBF_STRUCT *hbf; ++parse_file(FILE *f, reg HBF_STRUCT *hbf) + { + char line[MAXLINE]; + int start, finish; +@@ -1091,10 +1037,7 @@ + } + + static FILE * +-path_open(path, filename, fullp) +- const char *path; +- const char *filename; +- char **fullp; ++path_open(const char *path, const char *filename, char **fullp) + { + if (LocalFileName(filename) && path != NULL) { + #ifdef PATH_DELIMITER +@@ -1128,9 +1071,7 @@ + } + + static bool +-real_open(filename, hbf) +- const char *filename; +-reg HBF_STRUCT *hbf; ++real_open(const char *filename, reg HBF_STRUCT *hbf) + { + FILE *f; + +@@ -1148,8 +1089,7 @@ + } + + HBF * +-hbfOpen(filename) +- const char *filename; ++hbfOpen(const char *filename) + { + reg HBF_STRUCT *hbf; + +@@ -1165,9 +1105,7 @@ + } + + int +-HBF_OpenFont(filename, ptrHandleStorage) +- const char *filename; +- HBF **ptrHandleStorage; ++HBF_OpenFont(const char *filename, HBF **ptrHandleStorage) + { + return (*ptrHandleStorage = hbfOpen(filename)) == NULL ? -1 : 0; + } +@@ -1177,8 +1115,7 @@ + */ + + int +-HBF_CloseFont(hbfFile) +- HBF *hbfFile; ++HBF_CloseFont(HBF *hbfFile) + { + reg HBF_STRUCT *hbf; + PROPERTY *prop_ptr, *prop_next; +@@ -1239,8 +1176,7 @@ + } + + void +-hbfClose(hbfFile) +- HBF *hbfFile; ++hbfClose(HBF *hbfFile) + { + (void)HBF_CloseFont(hbfFile); + } +@@ -1250,18 +1186,13 @@ + */ + + const byte * +-hbfGetBitmap(hbf, code) +- HBF *hbf; +- HBF_CHAR code; ++hbfGetBitmap(HBF *hbf, HBF_CHAR code) + { + return get_bitmap((HBF_STRUCT *)hbf, code, (byte *)NULL); + } + + int +-HBF_GetBitmap(hbf, code, buffer) +- HBF *hbf; +- HBF_CHAR code; +- byte *buffer; ++HBF_GetBitmap(HBF *hbf, HBF_CHAR code, byte *buffer) + { + return get_bitmap((HBF_STRUCT *)hbf, code, buffer) == NULL ? -1 : 0; + } +@@ -1271,10 +1202,7 @@ + * If buffer is non-null, it must be used. + */ + static const byte * +-get_bitmap(hbf, code, buffer) +-reg HBF_STRUCT *hbf; +- HBF_CHAR code; +- byte *buffer; ++get_bitmap(reg HBF_STRUCT *hbf, HBF_CHAR code, byte *buffer) + { + CHAR_INDEX pos, b2pos; + reg CODE_RANGE *cp; +@@ -1331,8 +1259,7 @@ + } + + static byte * +-local_buffer(hbf) +- HBF_STRUCT *hbf; ++local_buffer(HBF_STRUCT *hbf) + { + if (hbf->bitmap_buffer == NULL && + (hbf->bitmap_buffer = (byte *)malloc(HBF_BitmapSize(&(hbf->public)))) == NULL) { +@@ -1343,9 +1270,7 @@ + } + + static void +-invert(buffer, length) +- byte *buffer; +- unsigned int length; ++invert(byte *buffer, unsigned int length) + { + for ( ; length > 0; length--) + *buffer++ ^= 0xff; +@@ -1353,10 +1278,7 @@ + + #ifdef IN_MEMORY + static bool +-copy_transposed(hbf, bitmap, source) +- HBF *hbf; +-reg byte *bitmap; +-reg const byte *source; ++copy_transposed(HBF *hbf, reg byte *bitmap, reg const byte *source) + { + reg byte *pos; + reg byte *bm_end; +@@ -1402,10 +1324,7 @@ + } + #else /* ! IN_MEMORY */ + static bool +-get_transposed(hbf, f, bitmap) +- HBF *hbf; +- FILE *f; +-reg byte *bitmap; ++get_transposed(HBF *hbf, FILE *f, reg byte *bitmap) + { + reg byte *pos; + reg byte *bm_end; +@@ -1456,9 +1375,7 @@ + * Call function on each valid code in ascending order. + */ + void +-hbfForEach(hbfFile, func) +-reg HBF *hbfFile; +-reg void (*func)_((HBF *sameHbfFile, HBF_CHAR code)); ++hbfForEach(reg HBF *hbfFile, void (*func)(HBF *, HBF_CHAR)) + { + HBF_STRUCT *hbf; + CODE_RANGE *cp; +@@ -1493,15 +1410,13 @@ + } + + const char * +-hbfFileName(hbf) +- HBF *hbf; ++hbfFileName(HBF *hbf) + { + return ((HBF_STRUCT *)hbf)->filename; + } + + long +-hbfChars(hbfFile) +- HBF *hbfFile; ++hbfChars(HBF *hbfFile) + { + HBF_STRUCT *hbf; + CODE_RANGE *cp; +@@ -1527,8 +1442,7 @@ + #endif + + HBF_BBOX * +-hbfBitmapBBox(hbf) +- HBF *hbf; ++hbfBitmapBBox(HBF *hbf) + { + return &(hbf->hbf_bitmap_bbox); + } +@@ -1538,18 +1452,14 @@ + #endif + + HBF_BBOX * +-hbfFontBBox(hbf) +- HBF *hbf; ++hbfFontBBox(HBF *hbf) + { + return &(hbf->hbf_font_bbox); + } + + const void * +-hbfGetByte2Range(hbfFile, b2r_pointer, startp, finishp) +- HBF *hbfFile; +- const void *b2r_pointer; +- byte *startp; +- byte *finishp; ++hbfGetByte2Range(HBF *hbfFile, const void *b2r_pointer, ++ byte *startp, byte *finishp) + { + HBF_STRUCT *hbf; + B2_RANGE *b2r; +@@ -1567,11 +1477,8 @@ + } + + const void * +-hbfGetCodeRange(hbfFile, code_pointer, startp, finishp) +- HBF *hbfFile; +- const void *code_pointer; +- HBF_CHAR *startp; +- HBF_CHAR *finishp; ++hbfGetCodeRange(HBF *hbfFile, const void *code_pointer, ++ HBF_CHAR *startp, HBF_CHAR *finishp) + { + HBF_STRUCT *hbf; + CODE_RANGE *cp; +diff -ur cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w cjkutils-4.8.2/hbf2gf/hbf2gf.w +--- cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/hbf2gf/hbf2gf.w 2009-10-01 00:00:00.000000000 +0200 +@@ -196,10 +196,7 @@ + @@;@# + + +-int main(argc, argv) +- int argc; /* argument count */ +- char *argv[]; /* argument values */ +- ++int main(int argc, char *argv[]) + {char *p; + + @@;@# +@@ -839,10 +836,7 @@ + + @ + @c +-void fputl(num, f) +- long num; +- FILE *f; +- ++void fputl(long num, FILE *f) + {fputc(num >> 24, f); + fputc(num >> 16, f); + fputc(num >> 8, f); +@@ -1236,9 +1230,7 @@ + #ifdef __GNUC__ + __inline__ + #endif +-void read_row(pixelrow) +- unsigned char *pixelrow; +- ++void read_row(unsigned char *pixelrow) + {register int col, bitshift, offset; + register unsigned char *xP; + register unsigned char item = 0; +@@ -1288,9 +1280,7 @@ + #ifdef __GNUC__ + __inline__ + #endif +-void write_row(pixelrow) +- unsigned char *pixelrow; +- ++void write_row(unsigned char *pixelrow) + {register int col; + register unsigned char *xP; + +@@ -2320,9 +2310,7 @@ + + @ + @c +-int fsearch(search_string) +- char *search_string; +- ++int fsearch(char *search_string) + {char *P, p; + char temp_buffer[STRING_LENGTH + 1]; + char env_name[STRING_LENGTH + 1]; +@@ -2460,9 +2448,7 @@ + + @ + @c +-void config_error(message) +- char *message; +- ++void config_error(char *message) + {fprintf(stderr, "Couldn't find `%s' entry in configuration file\n", + message); + exit(1); +@@ -2654,9 +2640,7 @@ + @ + @c + #if defined(HAVE_LIBKPATHSEA) +-char *TeX_search_cfg_file(name) +- char *name; +- ++char *TeX_search_cfg_file(char *name) + { + #ifdef OLD_KPATHSEA + return kpse_find_file(name, kpse_dvips_config_format, TRUE); +@@ -2666,9 +2650,7 @@ + }@# + + +-char *TeX_search_hbf_file(name) +- char *name; +- ++char *TeX_search_hbf_file(char *name) + { + #ifdef VERY_OLD_KPATHSEA + return kpse_find_file(name, kpse_dvips_header_format, TRUE); +@@ -2683,24 +2665,18 @@ + + + #elif defined(HAVE_EMTEXDIR) +-char *TeX_search_cfg_file(name) +- char *name; +- ++char *TeX_search_cfg_file(char *name) + {return file_find(name, &cfg_path); + }@# + + +-char *TeX_search_hbf_file(name) +- char *name; +- ++char *TeX_search_hbf_file(char *name) + {return file_find(name, &hbf_path); + }@# + + + #elif defined(HAVE_MIKTEX) +-char *TeX_search_cfg_file(name) +- char *name; +- ++char *TeX_search_cfg_file(char *name) + {char result[_MAX_PATH]; + + if (!miktex_find_input_file("hbf2gf", *name, result)) +@@ -2709,9 +2685,7 @@ + }@# + + +-char *TeX_search_hbf_file(name) +- char *name; +- ++char *TeX_search_hbf_file(char *name) + {char result[_MAX_PATH]; + + +@@ -2722,16 +2696,12 @@ + + + #else +-char *TeX_search_cfg_file(name) +- char *name; +- ++char *TeX_search_cfg_file(char *name) + {return name; + }@# + + +-char *TeX_search_hbf_file(name) +- char *name; +- ++char *TeX_search_hbf_file(char *name) + {return name; + } + #endif diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-02-const b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-02-const new file mode 100644 index 00000000000..33649837b8c --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-02-const @@ -0,0 +1,148 @@ +diff -ur cjkutils-4.8.2.orig/hbf2gf/hbf.c cjkutils-4.8.2/hbf2gf/hbf.c +--- cjkutils-4.8.2.orig/hbf2gf/hbf.c 2009-10-01 00:00:00.000000000 +0200 ++++ cjkutils-4.8.2/hbf2gf/hbf.c 2009-10-01 00:04:37.000000000 +0200 +@@ -1462,18 +1462,18 @@ + byte *startp, byte *finishp) + { + HBF_STRUCT *hbf; +- B2_RANGE *b2r; ++ const B2_RANGE *b2r; + + hbf = (HBF_STRUCT *)hbfFile; + if (b2r_pointer == NULL) + b2r = hbf->byte_2_range; + else +- b2r = ((B2_RANGE *)b2r_pointer)->b2r_next; ++ b2r = ((const B2_RANGE *)b2r_pointer)->b2r_next; + if(b2r == NULL) + return NULL; + *startp = b2r->b2r_start; + *finishp = b2r->b2r_finish; +- return (void *)b2r; ++ return (const void *)b2r; + } + + const void * +@@ -1481,16 +1481,16 @@ + HBF_CHAR *startp, HBF_CHAR *finishp) + { + HBF_STRUCT *hbf; +- CODE_RANGE *cp; ++ const CODE_RANGE *cp; + + hbf = (HBF_STRUCT *)hbfFile; + if (code_pointer == NULL) + cp = hbf->code_range; + else +- cp = ((CODE_RANGE *)code_pointer)->code_next; ++ cp = ((const CODE_RANGE *)code_pointer)->code_next; + if(cp == NULL) + return NULL; + *startp = cp->code_start; + *finishp = cp->code_finish; +- return (void *)cp; ++ return (const void *)cp; + } +diff -ur cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w cjkutils-4.8.2/hbf2gf/hbf2gf.w +--- cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w 2009-10-01 00:00:00.000000000 +0200 ++++ cjkutils-4.8.2/hbf2gf/hbf2gf.w 2009-10-01 00:04:37.000000000 +0200 +@@ -871,7 +871,7 @@ + HBF_CHAR code; + const unsigned char *bitmap; + /* a proper input bitmap array will be allocated by the HBF API */ +-unsigned char *bP;@# ++const unsigned char *bP;@# + + unsigned char out_char[MAX_CHAR_SIZE * MAX_CHAR_SIZE + 1]; + /* the output bitmap array */ +@@ -1025,7 +1025,7 @@ + if(b2_codes[code & 0xFF]) /* a valid second byte? */ + {if(pk_files) + {bitmap = hbfGetBitmap(hbf, code); +- bP = (unsigned char *)bitmap; ++ bP = bitmap; + /* will be increased by |read_row()| */@# + + if(!bitmap) +@@ -1238,7 +1238,7 @@ + if(rotation) + {bitshift = 7 - (curr_row % 8); + offset = (input_size_y + 7) / 8; +- bP = (unsigned char *)bitmap + curr_row / 8; ++ bP = bitmap + curr_row / 8; + for(col = 0, xP = pixelrow; col < input_size_x; ++col, ++xP) + {*xP = ((*bP >> bitshift) & 1) == 1 ? PIXEL_MAXVAL : 0; + bP += offset; +@@ -2305,13 +2305,14 @@ + |Buffer| if existent. |fsearch()| returns~1 on success. + + @= +-int fsearch(char *); ++int fsearch(const char *); + + + @ + @c +-int fsearch(char *search_string) ++int fsearch(const char *search_string) + {char *P, p; ++ const char *Q; + char temp_buffer[STRING_LENGTH + 1]; + char env_name[STRING_LENGTH + 1]; + char *env_p; +@@ -2323,8 +2324,8 @@ + rewind(config); /* we start at offset~0 */@# + + do +- {P = search_string; +- p = tolower(*P); ++ {Q = search_string; ++ p = tolower(*Q); + Ch = fgetc(config); + ch = tolower(Ch); + while(!(ch == p && old_ch == '\n') && Ch != EOF) +@@ -2336,12 +2337,12 @@ + }@# + + for(;;) +- {if(*(++P) == '\0') ++ {if(*(++Q) == '\0') + if((Ch = fgetc(config)) == ' ' || Ch == '\t') + /* there must be a space or a tab stop after the keyword */ + goto success; + Ch = fgetc(config); +- if(tolower(Ch) != tolower(*P)) ++ if(tolower(Ch) != tolower(*Q)) + break; + } + } +@@ -2443,12 +2444,12 @@ + message. + + @= +-void config_error(char *); ++void config_error(const char *); + + + @ + @c +-void config_error(char *message) ++void config_error(const char *message) + {fprintf(stderr, "Couldn't find `%s' entry in configuration file\n", + message); + exit(1); +@@ -2501,12 +2502,12 @@ + + @ + @= +-char *TeX_search_version(void); ++const char *TeX_search_version(void); + + + @ + @c +-char *TeX_search_version(void) ++const char *TeX_search_version(void) + { + #if defined(HAVE_LIBKPATHSEA) + return kpathsea_version_string; diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-03-kpathsea b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-03-kpathsea new file mode 100644 index 00000000000..23a25bd8696 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-03-kpathsea @@ -0,0 +1,105 @@ +diff -ur cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w cjkutils-4.8.2/hbf2gf/hbf2gf.w +--- cjkutils-4.8.2.orig/hbf2gf/hbf2gf.w 2009-10-01 00:04:37.000000000 +0200 ++++ cjkutils-4.8.2/hbf2gf/hbf2gf.w 2010-12-17 21:38:32.783541781 +0100 +@@ -71,8 +71,6 @@ + @s HBF_BBOX int + + @s __inline__ int +-@s DllImport int +-@s KPSEDLL int + + + @* Introduction. +@@ -408,6 +406,9 @@ + + @ + @= ++#ifdef HAVE_CONFIG_H ++#include ++#endif + #include + #include + #include +@@ -2461,21 +2462,13 @@ + + We support three searching engines: emtexdir, kpathsea, and MiKTeX (which is + a Win32 port of kpathsea). For emtexdir, define |HAVE_EMTEXDIR| while +-compiling. For kpathsea, define |HAVE_LIBKPATHSEA|. If you have a version of +-kpathsea older than~3.2, define |OLD_KPATHSEA| additionally. For kpathsea +-older than~3.0, |VERY_OLD_KPATHSEA| must be also set. For MikTeX, define ++compiling. For kpathsea, define |HAVE_LIBKPATHSEA|. For MikTeX, define + |HAVE_MIKTEX|. If none of these macros is defined, a simple |fopen()| will + be used instead. + + @= + #if defined(HAVE_LIBKPATHSEA) +-#ifdef VERY_OLD_KPATHSEA +-#include "kpathsea/proginit.h" +-#include "kpathsea/progname.h" +-#include "kpathsea/tex-glyph.h" +-#else + #include "kpathsea/kpathsea.h" +-#endif@# + + #elif defined(HAVE_EMTEXDIR) + #include "emtexdir.h" +@@ -2486,14 +2479,7 @@ + + @ + @= +-#if defined(HAVE_LIBKPATHSEA) +-#ifdef KPSEDLL +-/* this is kpathsea 3.3 and newer */ +-extern KPSEDLL char *kpathsea_version_string; +-#else +-extern DllImport char *kpathsea_version_string; +-#endif +-#elif defined(HAVE_EMTEXDIR) ++#if defined(HAVE_EMTEXDIR) + char emtex_version_string[] = "emTeXdir"; + #elif !defined(HAVE_MIKTEX) + char no_version_string[] = "no search library"; +@@ -2599,17 +2585,8 @@ + + @= + #if defined(HAVE_LIBKPATHSEA) +-#ifdef OLD_KPATHSEA +- kpse_set_progname(argv[0]); +-#else + kpse_set_program_name(argv[0], "hbf2gf"); +-#endif@# +- +-#ifdef VERY_OLD_KPATHSEA +- kpse_init_prog("HBF2GF", 300, "cx", true, "cmr10"); +-#else + kpse_init_prog("HBF2GF", 300, "cx", "cmr10");@# +-#endif@# + + #elif defined(HAVE_EMTEXDIR) + if(!dir_setup(&cfg_path, "HBFCFG", NULL, EDS_BANG)) +@@ -2643,25 +2620,13 @@ + #if defined(HAVE_LIBKPATHSEA) + char *TeX_search_cfg_file(char *name) + { +-#ifdef OLD_KPATHSEA +- return kpse_find_file(name, kpse_dvips_config_format, TRUE); +-#else + return kpse_find_file(name, kpse_program_text_format, TRUE); +-#endif + }@# + + + char *TeX_search_hbf_file(char *name) + { +-#ifdef VERY_OLD_KPATHSEA +- return kpse_find_file(name, kpse_dvips_header_format, TRUE); +-#else +-#ifndef KPSEDLL +- return kpse_find_file(name, kpse_type1_format, TRUE); +-#else + return kpse_find_file(name, kpse_miscfonts_format, TRUE); +-#endif +-#endif + }@# + + diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-04-cjklatex b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-04-cjklatex new file mode 100644 index 00000000000..7f527c9e281 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-04-cjklatex @@ -0,0 +1,108 @@ +diff -ur cjkutils-4.8.2.orig/cjklatex/cjklatex.c cjkutils-4.8.2/cjklatex/cjklatex.c +--- cjkutils-4.8.2.orig/cjklatex/cjklatex.c 2008-12-29 00:00:00.000000000 +0100 ++++ cjkutils-4.8.2/cjklatex/cjklatex.c 2010-12-19 16:17:26.000000000 +0100 +@@ -27,29 +27,31 @@ + + #include + #include +-#include + + #include + #include + #include + +-static char *cjklatex_version_string = "1.0"; ++#if defined(WIN32) && !defined(__MINGW32__) ++#include ++#endif ++ ++static const char *cjklatex_version_string = "1.0"; + + static const char *usage_str[] = { + "Usage: %s OPTIONS FILE\n", + "Calls `latex' on FILE after conversion by the filter\n", + "specified by OPTIONS.\n", + "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n", +- "--conv=bg5p\tfor Chinese, encoding Big 5+,\n", + "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n", + "--conv=cef5\tidem CEF, also converts Big5 characters,\n", + "--conv=cefs\tidem CEF, also converts SJIS characters,\n", +- "--conv=sjis\tfor Japanese, SJIS encoding,\n", +- "--conv=gbk\tfor Chinese, encoding GBK.", ++ "--conv=gbk\tfor Chinese, encoding GBK,\n", ++ "--conv=sjis\tfor Japanese, SJIS encoding.", + "\nAlternatively, for compatibility with the previous DOS batch files,\n", + "you can also copy this program to any of the following names:\n", +- "bg5latex.exe,bg5pltx.exe,cef5ltx.exe,ceflatex.exe,cefsltx.exe,\n", +- "gbklatex.exe and sjisltx.exe .\n", ++ "bg5latex.exe, cef5latex.exe, ceflatex.exe, cefslatex.exe,\n", ++ "gbklatex.exe and sjislatex.exe .\n", + "Then running one of these programs will be identical to specify\n", + "the corresponding option.\n", + "\nAdditional options:\n", +@@ -62,17 +64,16 @@ + static char *progname = NULL; + + static struct _conv_table { +- char *progname; +- char *processor; ++ const char *progname; ++ const char *processor; + } CJKtable[] = { + { "cjklatex", "" }, + { "bg5latex", "bg5conv" }, +- { "bg5pltx", "extconv" }, +- { "cef5ltx", "cef5conv" }, + { "ceflatex", "cefconv" }, +- { "cefsltx", "cefsconv" }, ++ { "cef5latex", "cef5conv" }, ++ { "cefslatex", "cefsconv" }, + { "gbklatex", "extconv" }, +- { "sjisltx", "sjisconv" } ++ { "sjislatex", "sjisconv" } + }; + + #define PROGRAM_IS(p) FILESTRCASEEQ (p, progname) +@@ -94,7 +95,7 @@ + {0, 0, 0, 0} + }; + +-BOOL sigint_handler(DWORD dwCtrlType) ++static BOOL sigint_handler(DWORD dwCtrlType) + { + /* Fix me : there is a problem if a system() command is running. + We should wait for the son process to be interrupted. +@@ -118,7 +119,7 @@ + return FALSE; /* return value obligatory */ + } + +-void usage() ++static void usage(void) + { + int i; + fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string); +@@ -128,7 +129,7 @@ + fputs(usage_str[i], stderr); + } + +-int do_process(char *processor, char *filename) ++static int do_process(const char *processor, const char *filename) + { + char *ext, *p; + char cmd[_MAX_PATH*3]; +@@ -176,7 +177,7 @@ + return ret; + } + +-void main(int argc, char *argv[]) ++int main(int argc, char *argv[]) + { + int g; /* getopt return code */ + int i; +@@ -287,4 +288,6 @@ + + free(filename); + free(texengine); ++ ++ return 0; + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex new file mode 100644 index 00000000000..ccfa7871d8f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2-PATCHES/patch-05-cjkpdflatex @@ -0,0 +1,95 @@ +diff -ur cjkutils-4.8.2.orig/cjklatex/cjklatex.c cjkutils-4.8.2/cjklatex/cjklatex.c +--- cjkutils-4.8.2.orig/cjklatex/cjklatex.c 2010-12-19 16:17:26.000000000 +0100 ++++ cjkutils-4.8.2/cjklatex/cjklatex.c 2010-12-19 16:25:43.000000000 +0100 +@@ -1,11 +1,15 @@ + /* +- Purpose: call latex after preprocessing of the .tex file by ++ Purpose: call LATEX after preprocessing of the .tex file by + the cjk conversion tool. The old f_name.bat script + is not working anymore. + Author : F. Popineau + Date : <29/06/2001> + */ + ++#ifndef LATEX ++#define LATEX "latex" ++#endif ++ + /* + Copyright (C) 2001-2008 F. Popineau + +@@ -40,7 +44,7 @@ + + static const char *usage_str[] = { + "Usage: %s OPTIONS FILE\n", +- "Calls `latex' on FILE after conversion by the filter\n", ++ "Calls `" LATEX "' on FILE after conversion by the filter\n", + "specified by OPTIONS.\n", + "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n", + "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n", +@@ -50,14 +54,14 @@ + "--conv=sjis\tfor Japanese, SJIS encoding.", + "\nAlternatively, for compatibility with the previous DOS batch files,\n", + "you can also copy this program to any of the following names:\n", +- "bg5latex.exe, cef5latex.exe, ceflatex.exe, cefslatex.exe,\n", +- "gbklatex.exe and sjislatex.exe .\n", ++ "bg5" LATEX ".exe, cef5" LATEX ".exe, cef" LATEX ".exe, cefs" LATEX ".exe,\n", ++ "gbk" LATEX ".exe and sjis" LATEX ".exe .\n", + "Then running one of these programs will be identical to specify\n", + "the corresponding option.\n", + "\nAdditional options:\n", + "--verbose\tbe a bit more verbose about what is happening,\n", + "--nocleanup\tdo not remove intermediate files,\n", +- "--latex=engine\tuse `engine' instead of `latex' to process the file.\n", ++ "--latex=engine\tuse `engine' instead of `" LATEX "' to process the file.\n", + NULL + }; + +@@ -67,13 +71,13 @@ + const char *progname; + const char *processor; + } CJKtable[] = { +- { "cjklatex", "" }, +- { "bg5latex", "bg5conv" }, +- { "ceflatex", "cefconv" }, +- { "cef5latex", "cef5conv" }, +- { "cefslatex", "cefsconv" }, +- { "gbklatex", "extconv" }, +- { "sjislatex", "sjisconv" } ++ { "cjk" LATEX, "" }, ++ { "bg5" LATEX, "bg5conv" }, ++ { "cef" LATEX, "cefconv" }, ++ { "cef5" LATEX, "cef5conv" }, ++ { "cefs" LATEX, "cefsconv" }, ++ { "gbk" LATEX, "extconv" }, ++ { "sjis" LATEX, "sjisconv" } + }; + + #define PROGRAM_IS(p) FILESTRCASEEQ (p, progname) +@@ -122,7 +126,7 @@ + static void usage(void) + { + int i; +- fprintf(stderr, "CJKlatex version %s\n", cjklatex_version_string); ++ fprintf(stderr, "CJK" LATEX " version %s\n", cjklatex_version_string); + fprintf(stderr,usage_str[0], progname ); + fputs("\n", stderr); + for(i = 1; usage_str[i]; ++i) +@@ -242,7 +246,7 @@ + fprintf(stderr, "%s of %s.\n", progname, cjklatex_version_string); + exit(0); + } +- else if (PROGRAM_IS("cjklatex")) { ++ else if (PROGRAM_IS("cjk" LATEX)) { + if (ARGUMENT_IS("conv")) { + for (i = 1; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number <= 0; i++) { + if (STRNEQ(optarg, CJKtable[i].progname, strlen(optarg))) { +@@ -281,7 +285,7 @@ + assert(program_number > 0); + + if (! texengine) { +- texengine = xstrdup("latex"); ++ texengine = xstrdup(LATEX); + } + + do_process(CJKtable[program_number].processor, filename); diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.1 new file mode 100644 index 00000000000..6ec9aeaa9b6 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.1 @@ -0,0 +1,110 @@ +.\" man page for bg5conv +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH BG5CONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP\\$2 +.. +.\} +.if n \{\ +.de C +\\$1\\$2 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +bg5conv \- convert a TeX document in Big\ 5 encoding into `preprocessed' +form. +. +. +.SH SYNOPSIS +.B bg5conv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +Big\ 5 encoding for traditional Chinese uses the characters +.C { , +.C } , +and +.C \e +which have special meanings in \*(TX +documents. +.PP +After processing a \*(LE +document which contains Big\ 5 characters with +.B bg5conv +you need not care about these special characters. +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR \%sjisconv (1), +.BR \%cefconv (1), +.BR cef5conv (1), +.BR \%cefsconv (1), +.BR \%extconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.c new file mode 100644 index 00000000000..435492827e3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.c @@ -0,0 +1,36 @@ +#define banner \ +"bg5conv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 94 "/home/wl/git/cjk/cjk-4.8.2/utils/Bg5conv/bg5conv.w" + +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch; + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0xA1&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.w new file mode 100644 index 00000000000..2a25f5b91bf --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5conv.w @@ -0,0 +1,121 @@ +% This is the cweb file bg5conv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a bg5conv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{bg5conv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont bg5conv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert Big~5 encoded Chinese characters into a +`preprocessed' form. The need of this program arises from the fact that this +encoding uses the characters `\.{\\}', `\.{\{}', and `\.{\}}' which have +special meanings in \TeX. + +Use this program as a filter: + +\hskip 2em \.{bg5conv < input\_file > output\_file} + + +@* The program. +The only function of this program is to replace all occurrences of Big 5 +encoded characters \.{XY} (\.{X} and \.{Y} are the first and the second byte +of the character) with +\.{\char94 \char94 7fX\char94 \char94 7fZZZ\char94 \char94 7f}, where +\.{ZZZ} represents the second byte as a decimal number. \.{0x7F} is used as +an active character and delimiter. + +Additionally we define a \TeX\ macro at the very beginning to signal a +preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{bg5conv} complains loudly if something is +wrong. + +@d banner +"bg5conv (CJK ver. 4.8.2)" + +@c +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch; + + fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if(ch >= 0xA1 && ch <= 0xFE) + {fprintf(stdout, "\177%c\177", ch);@# + + ch = fgetc(stdin); + if(!feof(stdin)) + fprintf(stdout, "%d\177", ch); + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex new file mode 100755 index 00000000000..30195776a87 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +bg5conv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.bat new file mode 100644 index 00000000000..91e7dfd8575 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.bat @@ -0,0 +1,3 @@ +call f_name %1 +bg5conv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.cmd new file mode 100644 index 00000000000..a4800ee4821 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5latex.cmd @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------*\ + bg5latex.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'bg5conv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of bg5latex.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5pdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5pdflatex new file mode 100755 index 00000000000..ae165527569 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/Bg5conv/bg5pdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] pdflatex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +bg5conv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.1 new file mode 100644 index 00000000000..aa56b138c6d --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.1 @@ -0,0 +1,127 @@ +.\" man page for cef5conv +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH CEF5CONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP +.. +.\} +.if n \{\ +.de C +\\$1 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +cef5conv \- convert a TeX document in Big\ 5 encoding containing CEF macros +into `preprocessed' form. +. +. +.SH SYNOPSIS +.B cef5conv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +The +.B Chinese Encoding Framework +.RB ( CEF ) +developed by Christian Wittern +.C +makes it possible to include CJK characters in various encodings using the +SGML macros +.B &CX-aabb; +for Big\ 5 and CNS encoding and +.B &U-aabb; +for Unicode +.RB ( X +denotes a number between 0 and 7; 0 represents Big\ 5 encoding, 1-7 CNS +encoding planes 1-7. +.B aabb +is either a decimal or hexadecimal number). +.PP +.B cef5conv +converts the CEF macros of a Big\ 5 encoded document together with the Big\ +5 encoding itself into a form which can directly processed with \*(LE. +It is identical to +.IP +.B bg5conv +< +.I infile +| +.B cefconv +> +.I outfile +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR \%sjisconv (1), +.BR bg5conv (1), +.BR \%cefconv (1), +.BR \%cefsconv (1), +.BR \%extconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.c new file mode 100644 index 00000000000..e2d00c7de22 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.c @@ -0,0 +1,138 @@ +#define banner \ +"cef5conv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 108 "/home/wl/git/cjk/cjk-4.8.2/utils/CEFconv/cef5conv.w" + +#include +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0xA1&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else if(ch=='&') + +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.w new file mode 100644 index 00000000000..6c7618eeb74 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5conv.w @@ -0,0 +1,237 @@ +% This is the cweb file cef5conv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a cef5conv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{cef5conv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont cef5conv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998, 2002 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert Big~5 encoding with CNS encoded Chinese +characters using the {\it Chinese Encoding Framework (CEF)} into a +`preprocessed' form. The need of this program arises from the fact that +Big~5 encoding uses the characters `\.{\\}', `\.{\{}', and `\.{\}}' which +have special meanings in \TeX. + +Use this program as a filter: + +\hskip 2em \.{cef5conv < input\_file > output\_file} + + +@* The program. +In contrast to \.{cefconv} two tasks will be executed: + +Replacing all occurrences of Big~5 encoded characters \.{XY} (\.{X} and +\.{Y} are the first and the second byte of the character) with +\.{\char94 \char94 7fX\char94 \char94 7fZZZ\char94 \char94 7f}, where +\.{ZZZ} represents the second byte as a decimal number. \.{0x7F} is used as +a control character and a delimiter. + +Replacing CEF macros of the form \.{\&xx-yyzz;} (\.{xx} can be C1--C7 for +the CNS planes 1--7, C0 for Big~5 encoding, an encoding CX reserved for +IRIZ, a private encoding CY, and U for Unicode encoding; \.{yyzz} is a +hexadecimal representation of the code point in this plane) with +\medskip +\quad\.{\char94 \char94 7f72\char94 \char94 7fXX\char94 \char94 7f% +\char94 \char94 7f"0yy\char94 \char94 7f"0zz\char94 \char94 7f}\quad. +\medskip +\.{XX} is the corresponding CJK encoding of \.{xx}; the number `72' +specifies a macro in the file \.{MULEenc.sty} which further processes this +representation -- it is automatically loaded by the \.{CJK} package. + +Additionally we define a \TeX\ macro at the very beginning to signal a +preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{cef5conv} complains loudly if something is +wrong. + +@d banner +"cef5conv (CJK ver. 4.8.2)" + +@c +#include +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; + unsigned char *inp, *outp; + + fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if(ch >= 0xA1 && ch <= 0xFE) + {fprintf(stdout, "\177%c\177", ch);@# + + ch = fgetc(stdin); + if(!feof(stdin)) + fprintf(stdout, "%d\177", ch); + } + else if(ch == '&') + /* the macro test is hardcoded to make things simple */ + {inp = in; + outp = out; + *inp = ch; + *(++inp) = fgetc(stdin);@# + + if(*inp == 'C' && !feof(stdin)) + {*(++inp) = fgetc(stdin); + if(*inp == '0' && !feof(stdin)) + {*(outp++) = 'B'; + *(outp++) = 'g'; + *(outp++) = '5'; + } + else if(*inp >= '1' && *inp <= '7' && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'N'; + *(outp++) = 'S'; + *(outp++) = *inp; + } + else if((*inp == 'X' || *inp == 'Y') && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'E'; + *(outp++) = 'F'; + *(outp++) = *inp; + } + else + goto no_macro; + } + else if(*inp == 'U' && !feof(stdin)) + {*(outp++) = 'U'; + *(outp++) = 'T'; + *(outp++) = 'F'; + *(outp++) = '8'; + } + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(*inp != '-' || feof(stdin)) + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *outp = '\0';@# + + *(++inp) = fgetc(stdin); + if(*inp != ';' || feof(stdin)) + goto no_macro;@# + + outp = out; + fprintf(stdout, "\17772\177"); + while(*outp) + fputc(*(outp++), stdout);@# + + ch = fgetc(stdin); + continue;@# + +no_macro: + ch = *inp; + i = inp - in; + inp = in; + while(i--) + fputc(*(inp++), stdout); + continue; + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5latex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5latex new file mode 100755 index 00000000000..5e609181030 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5latex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cef5conv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.bat new file mode 100644 index 00000000000..187485301f9 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.bat @@ -0,0 +1,3 @@ +call f_name %1 +cef5conv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.cmd new file mode 100644 index 00000000000..6edd12690ed --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5ltx.cmd @@ -0,0 +1,46 @@ +/*----------------------------------------------------------------------*\ + cef5ltx.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'cef5conv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of cef5ltx.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5pdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5pdflatex new file mode 100755 index 00000000000..cd1118cd7c3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cef5pdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] pdflatex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cef5conv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.1 new file mode 100644 index 00000000000..f2bdca8bf2a --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.1 @@ -0,0 +1,117 @@ +.\" man page for cefconv +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH CEFCONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP +.. +.\} +.if n \{\ +.de C +\\$1 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +cefconv \- convert a TeX document containing CEF macros into `preprocessed' +form. +. +. +.SH SYNOPSIS +.B cefconv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +The +.B Chinese Encoding Framework +.RB ( CEF ) +developed by Christian Wittern +.C +makes it possible to include CJK characters in various encodings using the +SGML macros +.B &CX-aabb; +for Big\ 5 and CNS encoding and +.B &U-aabb; +for Unicode +.RB ( X +denotes a number between 0 and 7; 0 represents Big\ 5 encoding, 1-7 CNS +encoding planes 1-7. +.B aabb +is either a decimal or hexadecimal number) +.PP +.B \%cefconv +converts the CEF macros into a form which can directly processed with \*(LE. +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR \%sjisconv (1), +.BR bg5conv (1), +.BR cef5conv (1), +.BR \%cefsconv (1), +.BR \%extconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.c new file mode 100644 index 00000000000..8c3e624108e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.c @@ -0,0 +1,130 @@ +#define banner \ +"cefconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 100 "/home/wl/git/cjk/cjk-4.8.2/utils/CEFconv/cefconv.w" + +#include +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch=='&') +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.w new file mode 100644 index 00000000000..00f6a2b5917 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefconv.w @@ -0,0 +1,221 @@ +% This is the cweb file cefconv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a cefconv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{cefconv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont cefconv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998, 2002 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert EUC encoding with CNS encoded Chinese +characters using the {\it Chinese Encoding Framework (CEF)} into a +`preprocessed' form, expanding the CEF macros. + +Use this program as a filter: + +\hskip 2em \.{cefconv < input\_file > output\_file} + + +@* The program. +In contrast to \.{cef5conv} or \.{cefsconv}, only one task will be executed: + +Replacing CEF macros of the form \.{\&xx-yyzz;} (\.{xx} can be C1--C7 for +the CNS planes 1--7, C0 for Big~5 encoding, an encoding CX reserved for +IRIZ, a private encoding CY, and U for Unicode encoding; \.{yyzz} is a +hexadecimal representation of the code point in this plane) with +\medskip +\quad\.{\char94 \char94 7f72\char94 \char94 ffXX\char94 \char94 7f% +\char94 \char94 7f"0yy\char94 \char94 7f"0zz\char94 \char94 7f}\quad. +\medskip +\.{XX} is the corresponding CJK encoding of \.{xx}; the number `72' +specifies a macro in the file \.{MULEenc.sty} which further processes this +representation -- it is automatically loaded by the \.{CJK} package. + +Additionally we define an empty \TeX\ macro at the very beginning to signal +a preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{cefconv} complains loudly if something is +wrong. + +@d banner +"cefconv (CJK ver. 4.8.2)" + +@c +#include +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; + unsigned char *inp, *outp; + + fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if(ch == '&') /* the macro test is hardcoded to make things simple */ + {inp = in; + outp = out; + *inp = ch; + *(++inp) = fgetc(stdin);@# + + if(*inp == 'C' && !feof(stdin)) + {*(++inp) = fgetc(stdin); + if(*inp == '0' && !feof(stdin)) + {*(outp++) = 'B'; + *(outp++) = 'g'; + *(outp++) = '5'; + } + else if(*inp >= '1' && *inp <= '7' && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'N'; + *(outp++) = 'S'; + *(outp++) = *inp; + } + else if((*inp == 'X' || *inp == 'Y') && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'E'; + *(outp++) = 'F'; + *(outp++) = *inp; + } + else + goto no_macro; + } + else if(*inp == 'U' && !feof(stdin)) + {*(outp++) = 'U'; + *(outp++) = 'T'; + *(outp++) = 'F'; + *(outp++) = '8'; + } + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(*inp != '-' || feof(stdin)) + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *outp = '\0';@# + + *(++inp) = fgetc(stdin); + if(*inp != ';' || feof(stdin)) + goto no_macro;@# + + outp = out; + fprintf(stdout, "\17772\177"); + while(*outp) + fputc(*(outp++), stdout);@# + + ch = fgetc(stdin); + continue;@# + +no_macro: + ch = *inp; + i = inp - in; + inp = in; + while(i--) + fputc(*(inp++), stdout); + continue; + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex new file mode 100755 index 00000000000..1b110c613c6 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cefconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.bat new file mode 100644 index 00000000000..ba5925a6df3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.bat @@ -0,0 +1,3 @@ +call f_name %1 +cefconv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.cmd new file mode 100644 index 00000000000..d1f6eed43fc --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/ceflatex.cmd @@ -0,0 +1,46 @@ +/*----------------------------------------------------------------------*\ + ceflatex.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'cefconv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of ceflatex.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefpdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefpdflatex new file mode 100755 index 00000000000..706114a8c77 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefpdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] pdflatex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cefconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.1 new file mode 100644 index 00000000000..4cd962d3d2f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.1 @@ -0,0 +1,127 @@ +.\" man page for cefsconv +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH CEFSCONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP +.. +.\} +.if n \{\ +.de C +\\$1 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +cefsconv \- convert a TeX document in SJIS encoding containing CEF macros +into `preprocessed' form. +. +. +.SH SYNOPSIS +.B cefsconv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +The +.B Chinese Encoding Framework +.RB ( CEF ) +developed by Christian Wittern +.C +makes it possible to include CJK characters in various encodings using the +SGML macros +.B &CX-aabb; +for Big\ 5 and CNS encoding and +.B &U-aabb; +for Unicode +.RB ( X +denotes a number between 0 and 7; 0 represents Big\ 5 encoding, 1-7 CNS +encoding planes 1-7. +.B aabb +is either a decimal or hexadecimal number). +.PP +.B \%cefsconv +converts the CEF macros of a SJIS encoded document together with the SJIS +encoding itself into a form which can directly processed with \*(LE. +It is identical to +.IP +.B sjisconv +< +.I infile +| +.B cefconv +> +.I outfile +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR \%sjisconv (1), +.BR bg5conv (1), +.BR \%cefconv (1), +.BR cef5conv (1), +.BR \%extconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.c new file mode 100644 index 00000000000..cfb9a77b11b --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.c @@ -0,0 +1,138 @@ +#define banner \ +"cefsconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 108 "/home/wl/git/cjk/cjk-4.8.2/utils/CEFconv/cefsconv.w" + +#include +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch,i; +unsigned char in[16]; +unsigned char out[32]; +unsigned char*inp,*outp; + +fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else if(ch=='&') + +{inp= in; +outp= out; +*inp= ch; +*(++inp)= fgetc(stdin); + +if(*inp=='C'&&!feof(stdin)) +{*(++inp)= fgetc(stdin); +if(*inp=='0'&&!feof(stdin)) +{*(outp++)= 'B'; +*(outp++)= 'g'; +*(outp++)= '5'; +} +else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'N'; +*(outp++)= 'S'; +*(outp++)= *inp; +} +else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) +{*(outp++)= 'C'; +*(outp++)= 'E'; +*(outp++)= 'F'; +*(outp++)= *inp; +} +else +goto no_macro; +} +else if(*inp=='U'&&!feof(stdin)) +{*(outp++)= 'U'; +*(outp++)= 'T'; +*(outp++)= 'F'; +*(outp++)= '8'; +} +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(*inp!='-'||feof(stdin)) +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*(outp++)= '\177'; +*(outp++)= '\"'; +*(outp++)= '0'; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(++inp)= fgetc(stdin); +if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) +*(outp++)= toupper(*inp); +else +goto no_macro; + +*(outp++)= '\177'; +*outp= '\0'; + +*(++inp)= fgetc(stdin); +if(*inp!=';'||feof(stdin)) +goto no_macro; + +outp= out; +fprintf(stdout,"\17772\177"); +while(*outp) +fputc(*(outp++),stdout); + +ch= fgetc(stdin); +continue; + +no_macro: +ch= *inp; +i= inp-in; +inp= in; +while(i--) +fputc(*(inp++),stdout); +continue; +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.w new file mode 100644 index 00000000000..06cd823f2de --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsconv.w @@ -0,0 +1,237 @@ +% This is the cweb file cefsconv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a cefsconv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{cefsconv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont cefsconv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert SJIS encoding with CNS encoded Chinese +characters using the {\it Chinese Encoding Framework (CEF)} into a +`preprocessed' form. The need of this program arises from the fact that +SJIS encoding uses the characters `\.{\\}', `\.{\{}', and `\.{\}}' which +have special meanings in \TeX. + +Use this program as a filter: + +\hskip 2em \.{cefsconv < input\_file > output\_file} + + +@* The program. +In contrast to \.{cefconv} two tasks will be executed: + +Replacing all occurrences of two byte SJIS encoded characters \.{XY} with +\.{\char94 \char94 7fX\char94 \char94 7fZZZ\char94 \char94 7f} (\.{X} and +\.{Y} are the first and the second byte of the character; \.{ZZZ} represents +the second byte as a decimal number). + +Replacing CEF macros of the form \.{\&xx-yyzz;} (\.{xx} can be C1--C7 for +the CNS planes 1--7, C0 for Big~5 encoding, an encoding CX reserved for +IRIZ, a private encoding CY, and U for Unicode encoding; \.{yyzz} is a +hexadecimal representation of the code point in this plane) with +\medskip +\quad\.{\char94 \char94 7f72\char94 \char94 7fXX\char94 \char94 7f% +\char94 \char94 7f"0yy\char94 \char94 7f"0zz\char94 \char94 7f}\quad. +\medskip +\.{XX} is the corresponding CJK encoding of \.{xx}; the number `72' +specifies a macro in the file \.{MULEenc.sty} which further processes this +representation -- it is necessary to explicitly load this file with +\.{\\usepackage}. + +Additionally we define a \TeX\ macro at the very beginning to signal a +preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{cefsconv} complains loudly if something is +wrong. + +@d banner +"cefsconv (CJK ver. 4.8.2)" + +@c +#include +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch, i; + unsigned char in[16]; + unsigned char out[32]; + unsigned char *inp, *outp; + + fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if((ch >= 0x81 && ch <= 0x9F) || (ch >= 0xE0 && ch <= 0xEF)) + {fprintf(stdout, "\177%c\177", ch);@# + + ch = fgetc(stdin); + if(!feof(stdin)) + fprintf(stdout, "%d\177", ch); + } + else if(ch == '&') + /* the macro test is hardcoded to make things simple */ + {inp = in; + outp = out; + *inp = ch; + *(++inp) = fgetc(stdin);@# + + if(*inp == 'C' && !feof(stdin)) + {*(++inp) = fgetc(stdin); + if(*inp == '0' && !feof(stdin)) + {*(outp++) = 'B'; + *(outp++) = 'g'; + *(outp++) = '5'; + } + else if(*inp >= '1' && *inp <= '7' && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'N'; + *(outp++) = 'S'; + *(outp++) = *inp; + } + else if((*inp == 'X' || *inp == 'Y') && !feof(stdin)) + {*(outp++) = 'C'; + *(outp++) = 'E'; + *(outp++) = 'F'; + *(outp++) = *inp; + } + else + goto no_macro; + } + else if(*inp == 'U' && !feof(stdin)) + {*(outp++) = 'U'; + *(outp++) = 'T'; + *(outp++) = 'F'; + *(outp++) = '8'; + } + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(*inp != '-' || feof(stdin)) + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *(outp++) = '\177'; + *(outp++) = '\"'; + *(outp++) = '0';@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(++inp) = fgetc(stdin); + if(isxdigit(*inp) && *inp < 0x80 && !feof(stdin)) + *(outp++) = toupper(*inp); + else + goto no_macro;@# + + *(outp++) = '\177'; + *outp = '\0';@# + + *(++inp) = fgetc(stdin); + if(*inp != ';' || feof(stdin)) + goto no_macro;@# + + outp = out; + fprintf(stdout, "\17772\177"); + while(*outp) + fputc(*(outp++), stdout);@# + + ch = fgetc(stdin); + continue;@# + +no_macro: + ch = *inp; + i = inp - in; + inp = in; + while(i--) + fputc(*(inp++), stdout); + continue; + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefslatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefslatex new file mode 100755 index 00000000000..db2232d98c6 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefslatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cefsconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.bat new file mode 100644 index 00000000000..662ef9e3af4 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.bat @@ -0,0 +1,3 @@ +call f_name %1 +cefsconv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.cmd new file mode 100644 index 00000000000..011732c6ee4 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefsltx.cmd @@ -0,0 +1,46 @@ +/*----------------------------------------------------------------------*\ + cefsltx.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'cefsconv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of cefsltx.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefspdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefspdflatex new file mode 100755 index 00000000000..bc99498f4af --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/CEFconv/cefspdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +cefsconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/ChangeLog b/Build/source/texk/cjkutils/cjkutils-4.8.2/ChangeLog new file mode 100644 index 00000000000..51d9185d21f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/ChangeLog @@ -0,0 +1,2164 @@ +2008-12-29 Werner LEMBERG + + Version 4.8.2 released + ====================== + + Set version to 4.8.2. + + * doc/history.txt: Updated. + + Update headers in all text files. + +2008-12-29 Werner LEMBERG + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub, + utils/hbf2gf/install-sh, utils/hbf2gf/mkinstalldirs: Updated to + current versions. + + * utils/hbf2gf/configure: Regenerated with autoconf 2.63. + +2008-12-29 Werner LEMBERG + + * doc/TeXLive.txt: Replaced with... + * texlive/*.pl: These new files which define the various TeXLive + packages derived from the CJK bundle. + + * MANIFEST: Updated. + +2008-12-28 Werner LEMBERG + + * doc/history.txt: Updated. + + * doc/CJKnumb.txt: New file. + + * MANIFEST: Updated. + +2008-12-28 Werner LEMBERG + + Rename garuda & norasi stuff to garuda-c90 & norasi-c90. + + * MANIFEST, doc/thaifont.txt, utils/thaifont/tools/INSTALL: Updated. + + * utils/thaifont/texmf/dvips/garuda/config.garuda: Moved to... + * utils/thaifont/texmf/dvips/garuda-c90/config.garuda-c90: This + file. Updated. + * utils/thaifont/texmf/dvips/norasi/config.norasi: Moved to... + * utils/thaifont/texmf/dvips/norasi-c90/config.norasi-c90: This + file. Updated. + * utils/thaifont/texmf/fonts/map/dvips/garuda/garuda.map: Moved + to... + * utils/thaifont/texmf/fonts/map/dvips/garuda-c90/garuda-c90.map: + This file. + * utils/thaifont/texmf/fonts/map/dvips/norasi/norasi.map: Moved + to... + * utils/thaifont/texmf/fonts/map/dvips/norasi-c90/norasi-c90.map: + This file. + * utils/thaifont/texmf/fonts/tfm/public/garuda/*: Moved to... + * utils/thaifont/texmf/fonts/tfm/public/garuda-c90/*: This + directory. + * utils/thaifont/texmf/fonts/tfm/public/norasi/*: Moved to... + * utils/thaifont/texmf/fonts/tfm/public/norasi-c90/*: This + directory. + * utils/thaifont/tools/garuda.fontinst: Moved to... + * utils/thaifont/tools/garuda-c90.fontinst: This file. + * utils/thaifont/tools/norasi.fontinst: Moved to... + * utils/thaifont/tools/norasi-c90.fontinst: This file. + +2008-12-28 Werner LEMBERG + + * contrib/wadalab/DNP.txt: Renamed to... + * contrib/wadalab/wadalab.txt: This. + * MANIFEST: Updated. + +2008-12-28 Werner LEMBERG + + Use same font names as in thailatex. + + * doc/thaifont.txt, + utils/thaifont/texmf/fonts/map/dvips/garuda/garuda.map, + utils/thaifont/texmf/fonts/map/dvips/norasi/norasi.map: Updated. + + + Update to thailatex 0.4.2. + + * doc/thaifont.txt, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnr8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnb8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnbo8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftno8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdr8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdb8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdbo8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdo8z.tfm: Regenerated + with fontinst. + +2008-11-25 Werner LEMBERG + + * texinput/CJKnumb.sty: Use U+3007 (IDEOGRAPHIC NUMBER ZERO), + not U+25CB (WHITE CIRCLE). + + * texinput/UTF8/c70bkai.fdx, texinput/UTF8/c70bsmi.fdx: Map U+25CB + to U+3007. + * texinput/UTF8/c70gbsn.fdx, texinput/UTF8/c70gkai.fdx, + texinput/UTF8/c70mj.fdx: New files which do the same. + + * MANIFEST: Updated. + +2008-11-25 Werner LEMBERG + + * texinput/CJK.sty (\Unicode): Use vertical glyph representation + forms. + +2008-11-25 Werner LEMBERG + + * texinput/CJKnumb.sty (\CJKdigits*): New command to use traditional + form of glyph zero. + + * doc/history.txt: Updated. + +2008-10-01 Werner LEMBERG + + * *.fd: Add \CJKnormal to all font families which use \CJKbold. This + is necessary because NFSS doesn't call \selectfont if a font gets + substituted by another one (and \selectfont resets the \CJK@bold@ + flag). Here an example (where `gbsn' uses \CJKbold for boldface + emulation): + + \begin{CJK*}{GB}{gbsn} + {\bf\CJKchar{"D6}{"D0}} + {\em\CJKchar{"D6}{"D0}} + \end{CJK*} + +2008-09-23 Werner LEMBERG + + * utils/subfonts/subfonts.pe: Fix error message for too-old + FontForge versions. + +2008-08-21 Werner LEMBERG + + * utils/subfonts/subfonts.pe: Handle CID-keyed fonts. + +2008-08-10 Werner LEMBERG + + Version 4.8.1 released + ====================== + + Set version to 4.8.1. + + * doc/history.txt, README: Updated. + + * doc/TeXLive.txt: Updated. + PDF man pages are now autogenerated in TeXLive. + + Update headers in all text files. + + * utils/hbf2gf/config.sub: Updated to current version. + +2008-08-03 Werner LEMBERG + + Add some missing files. Found by Daniel Flipo. + + * texinput/Bg5/c00bkai.fd, texinput/GB/c10gkai.fd, + texinput/GB/c10gkai.fdx: New files. + + * MANIFEST: Updated. + +2008-07-11 Werner LEMBERG + + Make macros in pinyin.sty robust. + + Problem reported by Denis Roegel . + + * texinput/pinyin.sty (\py@macron): Make it work again with Plain + TeX. + (\py@@@): No longer needed. + (\py@): Do what \py@@@ did formerly. + (py@DRC): New macro to make the pinyin syllables robust. + Update all pinyin syllable macro definitions to use it. + + * doc/history.txt: Updated. + +2008-07-11 Werner LEMBERG + + Incorporate Wen-Chang's CJKspace package. + + * texinput/CJKspace.sty, examples/CJKspace.tex, doc/CJKspace.txt: + New files. + * texinput/CJK.sty (\CJK@@@): New signature macro for CJKspace.sty. + (\CJK@namedef, \CJK@namepdef, \CJK@nameppdef, \CJK@namepppdef, + \CJK@nameppppdef): Use it. + + * Makefile, doc/history.txt, MANIFEST: Updated. + +2008-05-22 Werner LEMBERG + + Version 4.8.0 released + ====================== + + Set version to 4.8.0. + + * doc/history.txt, doc/INSTALL, doc/TeXLive.txt, README: Updated. + + Update headers in all text files. + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + current versions. + + * utils/hbf2gf/configure: Regenerated with autoconf 2.62. + +2008-05-18 Werner LEMBERG + + * Makefile (DISTDIRS): We are now using git, not CVS. + +2008-05-18 Werner LEMBERG + + * doc/history.txt: Mention xCJK.sty. + +2008-05-17 Werner LEMBERG + + * texinput/CJK.sty (\CJK@UnicodeEnc): New macro (so that xCJK.sty + can overwrite it). + * texinput/CJKnumb.sty: Use it. + + * texinput/xCJK.sty: Simplify -- unicode mappings to other encodings + are no longer supported (since it hasn't worked for Big5 or GBK + anyway). + + (\xCJK@xUTF): Removed. + (\CJKsymbol): Simplified. + (\toutf@XXX): Removed. + (\xCJK@CJKenc, \CJKenc): Removed. + (\CJK@envStart): Produce error if encoding is not `UTF8'. + Simplified. + (\xCJK@setenc, \CJK@xpmC, \xCJK@enc@UTF8, \xCJK@xUTF8@hook): + Removed. + (\CJK@xUTF8@hook, \CJK@UnicodeEnc): New macros. + (\xCJK@@char): Removed. + (\CJK@XXpdf): Simplified. + (\CJK@@XXpdf): Removed. + + Add support for non-BMP Unicode. + + (\CJK@nameppppdef): New macro. + (\xCJK@char): Redefined. + (\xCJK@@char, \xCJK@@@char): New macros. + (\CJK@XXp, \CJK@XXXp): Redefined. + (\CJK@XXXXp): New macro. + + xdvipdfmx automatically handles UTF-8 encoded bookmarks. + + (\xCJK@four, \xCJK@@@char, <\if@filesw>): Removed. + + (\special): Use \utfout. + +2008-05-12 Danai SAE-HAN + + * utils/hbf2gf/hbf2gf.1: Replace some `-' with `\-'. + +2008-03-10 Werner LEMBERG + + * utils/hbf2gf/hbf2gf.1: s|-|\-| where appropriate. + +2008-03-09 Werner LEMBERG + + * Makefile (XELATEX): Call xelatex twice. + (manpages): Increase font size to 11pt for DVI and PDF output. + +2008-03-09 Werner LEMBERG + + Add support for EUC-JP with DNP font encoding. + + * texinput/CJK.enc (\CJK@@@EUC-JPdnp@hook, \CJK@EUC-JPdnp@enc): New + macros. + + * texinput/JIS/EUC-JPdnp.enc: New file. + + * texinput/JIS/EUC-JP.chr (\CJK@shiftchar): Define \CJK@plane as + empty. + + * doc/history.txt, MANIFEST: Updated. + +2008-03-09 Werner LEMBERG + + Make \CJK@bold work with C49 encoding too. The idea is to handle + the font as a CJK font but with \CJK@plane set to empty. + + * texinput/SJIS/SJIS.chr, texinput/SJIS/SJIdnp.chr (\CJK@sjischar): + Define \CJK@plane as empty. + + * texinput/SJIS/c49song.fd: Use `CJK' size function. + + * doc/history.txt: Updated. + +2008-03-03 Werner LEMBERG + + * texinput/CJKutf8.sty, texinput/xCJK.sty, + texinput/mule/MULEenc.sty: Use \ProvidesPackage, not \ProvidesFile. + +2008-03-03 Werner LEMBERG + + Better control for \baselinestretch with CJKvert.sty. + + * texinput/CJKvert.sty (usebaselinestretch): New option. + (\CJKbaselinestretch): New macro. + + * doc/history.txt, doc/vertical.txt: Document it. + +2008-02-11 Werner LEMBERG + + * doc/xCJK.txt: New file. + * MANIFEST: Updated. + +2008-02-11 Werner LEMBERG + + * doc/fonts.txt: Document installation of cyberbit.ttf. + +2008-02-05 Werner LEMBERG + + Add SUN Wen-Chang's xCJK bundle. + + * examples/xCJK.tex, texinput/UTF8/xUTF8.chr, + texinput/UTF8/xUTF8.enc, texinput/xCJK.sty, texinput/xpmC.chr, + texinput/xpmC.enc: New files. + + * MANIFEST: Updated. + + * Makefile (XELATEX): New macro. + (xCJK): New target. + (CJK2DVI, LATE2DVI): Simplify. + +2008-01-15 Gernot Hassenpflug + + * contrib/wadalab/c70goth.fdx, contrib/wadalab/c70min.fdx, + contrib/wadalab/c70maru.fdx: Rotate more glyphs for vertical + typesetting. + Shift small kana for vertical typesetting. + Other minor improvements. + +2007-12-27 Werner LEMBERG + + * utils/subfonts/vertical.pe, utils/subfonts/vertref.pe: Abort if no + vertical glyph representation forms are available. + +2006-12-05 Werner LEMBERG + + Make pinyin syllables work with \MakeUppercase and \MakeLowercase. + + * pinyin.sty: Almost completely rewrite macro logic to replace e.g. + `\py@@@a' with `\py@ a' so that the argument gets handled by + \MakeUppercase. + +2006-12-04 Werner LEMBERG + + Make pinyin syllables work with hyperref bookmarks. + + * pinyin.sty: Use \AtBeginDocument hook to add missing characters to + PU encoding needed for pinyin syllables. + Use \AtBeginDocument hook to set up some replacement macros for + bookmarks. + (\py@hr@macron, \py@hr@v): New replacement macros for + bookmarks. + +2007-11-23 Werner LEMBERG + + * texinput/CJK.enc: Add punctuation tables for GBK encoding. + +2007-11-06 Werner LEMBERG + + * utils/subfonts/subfonts.pe, utils/subfonts/vertical.pe, + utils/subfonts/vertref.pe: Put current time stamp into copyright + string. + Need FontForge 20071105 or newer. + +2007-11-02 SUN Wenchang + + * texinput/CJKfntef.sty (\CJK@preUnderdot): Use \cdot (in math mode). + (\CJKxout): Use `/' in math mode. + (\CJKunderdotbasesep, \CJKunderdotsep): Adjusted. + +2007-10-26 Werner LEMBERG + + * utils/subfonts/vertical.pe: Use glyph names of the horizontal + representation glyphs with an appended `.vert'. This makes dvipdfmx + automatically create a correct /ToUnicode CMap. + +2007-10-25 Werner LEMBERG + + Provide final fix for patch 2007-10-04. + + * utils/subfonts/makefdx.pl: Provide flag `-u' to produce a CMap + macro in the FDX file. + Don't specify FDX file directly on the command line but give family + name and encoding separately which are then concatenated to give the + FDX name (we need the family name separately). + Add code to produce a macro which provides a /ToUnicode CMap entry + as needed by pdfTeX. + Fix loop to not omit last glyph. + + * texinput/UTF8/c70bsmi.fdx, texinput/UTF8/c70bkai.fdx: Regenerated. + These now provide the macros \CJK@cmap@bsmiv and \CJK@cmap@bkaiv, + respectively. + + * texinput/CJKutf8.sty (\pickup@font): Call `\CJK@cmap@...' if it + exists. + +2007-10-04 Werner LEMBERG + + * texinput/CJKutf8.sty (\pickup@font): Disable generation of + ToUnicode cmap for `v' subfont (which holds vertical representation + glyphs). This is a temporary hack; the right solution is to modify + makefdx.pl so that it creates a ToUnicode macro for the specific + font; \CJK@addcmap should be then modified to use this macro instead + of autogenerating a cmap. + + Problem reported by Edward G.J. Lee. + +2007-09-10 Werner LEMBERG + + * utils/subfonts/vertical.pe, utils.subfonts/vertref.pe: Adapt to + FontForge version 2007-Sep-10 and newer. + +2007-07-26 Gernot Hassenpflug + + * contrib/wadalab/c70goth.fdx, contrib/wadalab/c70min.fdx, + contrib/wadalab/c70maru.fdx: New files to support vertical writing + with Unicode encoded Wadalab fonts. + +2007-07-07 Werner LEMBERG + + * texinput/pinyin.sty (\ding): Rename to... + (\py@ding): This to make \ding work actually. + +2007-05-04 Werner LEMBERG + + * texinput/CJKvert.sty (\CJKsymbol): Honour \CJKhdef{offset}{...}. + * doc/fdxfiles.txt, doc/history.txt: Document it. + +2007-04-08 Werner LEMBERG + + * utils/pyhyphen/pyhyph.tex: Replace latin-1 characters with + ^^xx sequences. Suggested by David Kastrup. + + * doc/cjk-enc.txt: Document special space handling for Emacs quail + input methods. + +2006-11-06 Werner LEMBERG + + * texinput/pinyin.sty (\py@macron, \py@@@v): Support T5 encoding. + * doc/history.txt: Document it. + +2006-10-31 Werner LEMBERG + + * doc/CJK.txt, doc/CJKutf8.txt: Mention Byte Order Mark in UTF-8. + +2006-10-19 Werner LEMBERG + + * doc/TeXLive.txt, MANIFEST: Minor fixes. + + * Makefile (DVI2PDF): Add argument for paper format. + (CONVERT, MULE, LATEX): Add optional argument for paper format; + default to `letter'. + (manpages, cweb): Use letter paper format. + (READMEb5): Use A4 paper. + + * examples/README: Minor fix. + +2006-10-17 Werner LEMBERG + + Version 4.7.0 released + ====================== + + Set version to 4.7.0. + + * doc/history.txt, doc/INSTALL, doc/TeXLive.txt, README: Updated. + + Update headers in all text files. + +2006-10-09 Werner LEMBERG + + * Makefile (abs-distdir): Fix assignment. + (distdoc): Remove generated C files. + + * utils/hbf2gf/hbf2gf.1: s/`/\(oq/ and s/'/\(cq/ where appropriate. + +2006-10-06 Werner LEMBERG + + * doc/CJKutf8.txt, doc/history.txt: Minor additions. + * MANIFEST: Sorted and updated. + +2006-10-05 Werner LEMBERG + + * texinput/CJKutf8.sty (\CJK@surr): Use \expandafter to make + \uppercase work actually. + + * texinput/CJK.sty (\CJK@makeActive, \CJK@makeInactive): Handle 0x80 + also (which is needed for UTF8). + +2006-10-05 Werner LEMBERG + + * texinput/CJKutf8.sty (\CJK@surr): New function. + (\CJK@addcmap): Use \CJK@surr so that values > U+FFFF are correctly + represented as surrogates. + +2006-09-30 Werner LEMBERG + + In CJKutf8.sty, add ToUnicode cmaps for pdfTeX. Note, however, that + it currently fails with virtual fonts: pdftex 3.141592-1.30.4-2.2 + can't resolve them to the used base fonts. + + * texinput/CJKutf8.sty: Require ifpdf package. + (\pickup@font) [\ifpdf]: Redefine, adding a call to CJK@addcmap. + (\CJK@addcmap) [\ifpdf]: New function. + + * doc/history.txt: Updated. + +2006-09-16 Werner LEMBERG + + * texinput/CJK.sty (\CJK@ifundefined): New macro. + Update all affected files where possible to use it instead of + \@ifundefined. This fixes a bug reported by Danai which made + \chapter work in the `scrartcl' article class (instead of + reporting an error) after using a CJK caption file. + + * *.cap, *.cpx: Don't redefine \thepart but use its previous + definition for \partformat. This fixes a bug reported by Danai + which produced bad TOC entries. + + * doc/history.txt: Updated. + +2006-09-12 Werner LEMBERG + + * texinput/UTF8/ko-Hanj.cpx: Renamed to... + * texinput/UTF8/ko-Hani.cpx: This to use the correct ISO 15924 + script tag. + + * doc/history.txt, doc/CJK.txt: Updated. + +2006-09-08 Werner LEMBERG + + Add caption files for UTF8 encoding. + + * texinput/UTF8/{ja,ko-Hang,ko-Hang2,ko-Hanj,zh-Hans,zh-Hant}.cap: + New files. + + * doc/history.txt, doc/CJK.txt: Mention them. + +2006-08-31 Werner LEMBERG + + Reimplement the \CJKbold mechanism to call the last argument of + \DeclareFontShape each time the font is selected only if a CJK size + function has been used. This fixes shape declarations like the ones + in the fourier package which rely on being called only once. + + * texinput/CJK.sty (\CJK@curr@fontshape): New macro. + (\CJK@empty, \CJK@fixed, \CJK@sub, \CJK@DNPgen, \CJK@DNP): Define a + macro where the name is the argument of \CJK@curr@fontshape. + (\selectfont): Execute macro where the name is the argument of + \CJK@curr@fontshape only if it exists. + + * doc/history.txt, doc/CJK.txt: Mention it. + +2006-08-29 Danai SAE-HAN + + * utils/subfonts/hlatex2agl.pl: Make it accept a third parameter + which specifies the used SFD file. + (process_afmfile, process_pfbfile): Add minor tweaks to handle fonts + generated with other tools than FontForge. + +2006-08-29 Werner LEMBERG + + * utils/Bg5conv/bg5conv.w, utils/extconv/extconv.w, + utils/hbf2gf/hbf2gf.w, utils/CEFconv/cefconv.w, + utils/CEFconv/cef5conv.w, utils/CEFconv/cefsconv.w, + utils/SJISconv/sjisconv.w: s/@/@@/ in email address. + + * utils/Bg5conv/bg5conv.c, utils/extconv/extconv.c, + utils/hbf2gf/hbf2gf.c, utils/CEFconv/cefconv.c, + utils/CEFconv/cef5conv.c, utils/CEFconv/cefsconv.c, + utils/SJISconv/sjisconv.c: Removed. These files are now generated + by the Makefile. + + * Makefile (version): Set to 4.7.0. + (CJK2DVI, LATEX2DVI): Add `texlive' subdirectory + (distsrc): Build .c from .w files. + +2006-08-28 Werner LEMBERG + + * texinput/*: Add various replacement files for TeXLive. + +2006-08-17 Werner LEMBERG + + * doc/CJK.txt: Mention problem with fourier.sty. + +2006-08-01 Werner LEMBERG + + * doc/cjk-enc.txt: Mention problems with UTF-8. + +2006-07-30 Werner LEMBERG + + * contrib/wadalab/DNP.txt: Fix patch for wftodm.c. + +2006-04-25 Danai SAE-HAN + + * : Add GPL. + * MANIFEST: New file. + +2006-03-25 Werner LEMBERG + + * texinput/CJKutf8.sty (\pdfstringdefPreHook): Don't overwrite but + prepend to this macro. + +2006-03-23 Werner LEMBERG + + * utils/subfonts/hlatex2agl.pl: New script (which has been used + to create the Korean fonts in TeXLive 2005). + + + * texinput/CJKutf8.sty: Add support for Unicode bookmarks. + (\CJK@UnicodeFourBytesFirst, \CJK@UnicodeFourBytesSecond, + \CJK@UnicodeFourBytesThird, \CJK@UnicodeThreeBytesFirst, + \CJK@UnicodeThreeBytesSecond, \CJK@UnicodeTwoBytesFirst, + \CJK@UnicodeLast): New macros to convert UTF-8 into UTF-16BE. + (\CJK@XXpdf, \CJK@XXXpdf, \CJK@XXXXpdf): Replacements for the + \CJK@XX, \CJK@XXX, and \CJK@XXXX macros, respectively. + (\pdfstringdefPreHook): Activate them. + +2006-03-22 Werner LEMBERG + + * texinput/KS/HLaTeX/c63sh.fd, texinput/KS/HLaTeX/c64sh.fd, + texinput/KS/HLaTeX/c65sh.fd: Fix font declaration. Bug reported by + Danai SAE-HAN . + +2006-02-20 Werner LEMBERG + + * texinput/UTF8/UTF8.bdg: Bugfix: Handle 0x80 also. + + * doc/history.txt: Mention it. + +2006-02-09 Werner LEMBERG + + Support complete Unicode range (up to U+10FFFF). + + * texinput/UTF8/UTF8.bdg: Handle leading characters 0xF0-0xF4. + + * texinput/UTF8/UTF8.enc: Ditto. + + * texinput/UTF8/UTF8.chr (\CJK@altxchar): New macro for four-byte + Unicode values. + + * texinput/CJK.enc (\CJK@unicodexError): New error macro. + + * texinput/CJK.sty (\CJK@numbxToHex): New auxiliary macro to convert + a number to a four-digit hex number string. + (\Unicode): Accept values greater than U+FFFF. + + * doc/command.txt, doc/CJK.txt: Document extended \Unicode (and + \CJKchar) command. + * doc/history.txt: Updated. + +2006-01-23 Werner LEMBERG + + * texinput/CJK.enc (\CJK@HK@enc): Load `HK' encoding, not `Bg5'. + Use \def, not \@namedef. + + * doc/CJK.txt: Mention `HKtext' environment. + +2006-01-22 Werner LEMBERG + + Add new encoding `HK' (C05) for Hong Kong's HKSCS-2004. + + * texinput/Bg5/HK.enc, texinput/Bg5/c05song.fd: New files. + * texinput/CJK.enc: Add support for `HK' (C05). + * texinput/CJKnumb.sty: Handle `HK'. + + * doc/CJK.txt: Bg5+ *cannot* be used for HKSCS. Fix this. + * doc/history.txt: Document `HK' encoding. + +2006-01-19 Werner LEMBERG + + * doc/CJK.txt: Mention usage of Bg5+ for HKSCS-2001/HKSCS-2004. + +2006-01-04 Werner LEMBERG + + * texinput/pinyin.sty (\PYding): New \let. + (\PYactivate, \PYdeacticate): Handle \ding (from pifont.sty). + + * doc/pinyin.tex: Document possible problems with pifont.sty. + + * doc/history.txt: Updated. + +2005-12-27 Werner LEMBERG + + * utils/hbf2gf/cfg/csso12.cfg: Fix typo. + +2005-10-31 Danai SAE-HAN + + * utils/subfonts/makefdx.pl: Provide header for output. + Add \CJKvlet lines. + +2005-08-19 Werner LEMBERG + + * doc/TeXLive.txt: New file, describing the relationship between + CJK files and TeXLive packages. + +2005-08-18 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Define \CJK@verbatim correctly if not + already defined. Reported by Andre Dierker. + + * doc/pdf/*: Move to... + * doc/pdfhowto/*: This. + +2005-08-11 Werner LEMBERG + + Version 4.6.0 released + ====================== + + Set version to 4.6.0. + + * doc/history.txt, doc/INSTALL, Makefile (version): Updated. + + Update headers in all text files. + +2005-08-10 Werner LEMBERG + + * doc/CEF.txt, doc/CJK.txt, doc/CJKutf8.txt, doc/INSTALL, + doc/TDS.txt, doc/cjk-enc.txt, doc/commands.txt, doc/dvidrv.txt, + doc/fonts.txt, doc/hbf2gf.txt, doc/history.2_5, doc/history.txt, + doc/pinyin.txt, doc/pyhyphen.txt, doc/ruby.txt, doc/thaifont.txt, + doc/vertical.txt: Updated and revised. + +2005-08-05 Werner LEMBERG + + * COPYING: Updated to new FSF address. + +2005-08-05 Werner LEMBERG + + After email exchange with Ross Paterson, the old (too restrictive) + license of the hbf module has been changed to the three-clause BSD + license -- Ross no longer maintains and distributes this code. + + * utils/hbf2gf/hbf.c: Change license to BSD. + (strdup) [WIN32]: Define. Change taken from teTeX distribution. + + * utils/hbf2gf/hbf.h: Change license to BSD. + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + current versions. + + * utils/hbf2gf/configure: Regenerated with autoconf 2.59b. + +2005-08-04 Werner LEMBERG + + Update files to compile with the forthcoming TeXLive 2005. + + * doc/README: Updated, extended. + + * examples/muletest.tex: Updated to new VnTeX (for Vietnamese). + Use type1ec.sty. + Suppress hyphenation. + + * examples/CJKbabel.tex: Don't use t5.sty but `vietnam' option of + babel. + Use type1ec.sty. + + * examples/CJKmixed.tex: Define and use `TChinese' environment. + Call \CJKhorz at the beginning of document. + + * examples/CJKutf8.tex: Don't use cyberbit but the new Unicode + (virtual) fonts of gbsn, bsmi, and mj. + + * texinput/Bg5/c00bsmi.fdx: Updated to new bsmi vertical glyph font. + + * texinput/Bg5/c00bkai.fdx: New file. + + * texinput/UTF8/c70bkai.fd, texinput/UTF8/c70bkai.fdx, + texinput/UTF8/c70bsmi.fd, texinput/UTF8/c70bsmi.fdx, + texinput/UTF8/c60gbsn.fd, texinput/UTF8/c70gkai.fd, + texinput/UTF8/c70mj.fd: New files. + + * utils/pyhyphen/pytest.tex: Usae type1ec.sty. + + * Makefile: Add rules for new example and documentation files. + (version): Set top 4.5.3. + (CJK2DVI, LATEX2DVI): Add `utils/pyhyphen' to TEXINPUTS variable. + (DVI2PS): Replace it with... + (DVI2PDF): New variable. + Update all callers. + (MULE): Add path to `cjk-enc.el' while calling emacs. + (DISTTARGETS): Add new example and documentation files. + (predistdoc): Don't create `ps' but `pdf' subdirectories. + (manpages): Add `-ww' option to groff. + Don't create `ps' but `pdf' files. + (cweb): Don't create `ps' but `pdf' file. + +2005-08-04 Werner LEMBERG + + * doc/*.doc, doc/japanese/*.doc, doc/chinese/*.doc, + contrib/wadalab/DNP.doc: Renamed to ... + * doc/*.txt, doc/japanese/*.txt, doc/chinese/*.txt, + contrib/wadalab/DNP.txt: This. + + Update all references. + +2005-08-03 Werner LEMBERG + + * texinput/CJKvert.sty (\CJKvert, \CJKhorz): Make commands act + completely local. + * doc/history.txt: Mention it. + + * doc/pdf/HOWTO.txt: Mention new $SFDFONTS variable from TDS 1.1. + +2005-08-02 Werner LEMBERG + + Update of HLaTeX support to version 1.0.1. + + * texinput/KS/HLaTeX/c63mg.fd, texinput/KS/HLaTeX/c63mgt.fd, + texinput/KS/HLaTeX/c63mmj.fd, texinput/KS/HLaTeX/c63mnv.fd, + texinput/KS/HLaTeX/c63msr.fd, texinput/KS/HLaTeX/c63ol.fd, + texinput/KS/HLaTeX/c63pbm.fd, texinput/KS/HLaTeX/c63pgr.fd, + texinput/KS/HLaTeX/c63pgs.fd, texinput/KS/HLaTeX/c63pgt.fd, + texinput/KS/HLaTeX/c63pmg.fd, texinput/KS/HLaTeX/c63pmgt.fd, + texinput/KS/HLaTeX/c63pmj.fd, texinput/KS/HLaTeX/c63pmmj.fd, + texinput/KS/HLaTeX/c63pmnv.fd, texinput/KS/HLaTeX/c63pmsr.fd, + texinput/KS/HLaTeX/c63pol.fd, texinput/KS/HLaTeX/c63ppg.fd, + texinput/KS/HLaTeX/c63ppn.fd, texinput/KS/HLaTeX/c63psm.fd, + texinput/KS/HLaTeX/c63ptt.fd, texinput/KS/HLaTeX/c63pyt.fd, + texinput/KS/HLaTeX/c63sm.fd, texinput/KS/HLaTeX/c63tt.fd, + texinput/KS/HLaTeX/c64mg.fd, texinput/KS/HLaTeX/c64mgt.fd, + texinput/KS/HLaTeX/c64mmj.fd, texinput/KS/HLaTeX/c64mnv.fd, + texinput/KS/HLaTeX/c64msr.fd, texinput/KS/HLaTeX/c64ol.fd, + texinput/KS/HLaTeX/c64pbm.fd, texinput/KS/HLaTeX/c64pgr.fd, + texinput/KS/HLaTeX/c64pgs.fd, texinput/KS/HLaTeX/c64pgt.fd, + texinput/KS/HLaTeX/c64pmg.fd, texinput/KS/HLaTeX/c64pmgt.fd, + texinput/KS/HLaTeX/c64pmj.fd, texinput/KS/HLaTeX/c64pmmj.fd, + texinput/KS/HLaTeX/c64pmnv.fd, texinput/KS/HLaTeX/c64pmsr.fd, + texinput/KS/HLaTeX/c64pol.fd, texinput/KS/HLaTeX/c64ppg.fd, + texinput/KS/HLaTeX/c64ppn.fd, texinput/KS/HLaTeX/c64psm.fd, + texinput/KS/HLaTeX/c64ptt.fd, texinput/KS/HLaTeX/c64pyt.fd, + texinput/KS/HLaTeX/c64sm.fd, texinput/KS/HLaTeX/c64tt.fd, + texinput/KS/HLaTeX/c65mg.fd, texinput/KS/HLaTeX/c65mgt.fd, + texinput/KS/HLaTeX/c65mmj.fd, texinput/KS/HLaTeX/c65mnv.fd, + texinput/KS/HLaTeX/c65msr.fd, texinput/KS/HLaTeX/c65ol.fd, + texinput/KS/HLaTeX/c65pbm.fd, texinput/KS/HLaTeX/c65pgr.fd, + texinput/KS/HLaTeX/c65pgs.fd, texinput/KS/HLaTeX/c65pgt.fd, + texinput/KS/HLaTeX/c65pmg.fd, texinput/KS/HLaTeX/c65pmgt.fd, + texinput/KS/HLaTeX/c65pmj.fd, texinput/KS/HLaTeX/c65pmmj.fd, + texinput/KS/HLaTeX/c65pmnv.fd, texinput/KS/HLaTeX/c65pmsr.fd, + texinput/KS/HLaTeX/c65pol.fd, texinput/KS/HLaTeX/c65ppg.fd, + texinput/KS/HLaTeX/c65ppn.fd, texinput/KS/HLaTeX/c65psm.fd, + texinput/KS/HLaTeX/c65ptt.fd, texinput/KS/HLaTeX/c65pyt.fd, + texinput/KS/HLaTeX/c65sm.fd, texinput/KS/HLaTeX/c65tt.fd: Removed. + + * texinput/KS/HLaTeX/c63dn.fd, texinput/KS/HLaTeX/c63jgt.fd, + texinput/KS/HLaTeX/c63jmj.fd, texinput/KS/HLaTeX/c63jnv.fd, + texinput/KS/HLaTeX/c63jsr.fd, texinput/KS/HLaTeX/c63pga.fd, + texinput/KS/HLaTeX/c63ph.fd, texinput/KS/HLaTeX/c63sh.fd, + texinput/KS/HLaTeX/c63tz.fd, texinput/KS/HLaTeX/c63vd.fd, + texinput/KS/HLaTeX/c64dn.fd, texinput/KS/HLaTeX/c64jgt.fd, + texinput/KS/HLaTeX/c64jmj.fd, texinput/KS/HLaTeX/c64jnv.fd, + texinput/KS/HLaTeX/c64jsr.fd, texinput/KS/HLaTeX/c64pga.fd, + texinput/KS/HLaTeX/c64ph.fd, texinput/KS/HLaTeX/c64sh.fd, + texinput/KS/HLaTeX/c64tz.fd, texinput/KS/HLaTeX/c64vd.fd, + texinput/KS/HLaTeX/c65dn.fd, texinput/KS/HLaTeX/c65jgt.fd, + texinput/KS/HLaTeX/c65jmj.fd, texinput/KS/HLaTeX/c65jnv.fd, + texinput/KS/HLaTeX/c65jsr.fd, texinput/KS/HLaTeX/c65pga.fd, + texinput/KS/HLaTeX/c65ph.fd, texinput/KS/HLaTeX/c65sh.fd, + texinput/KS/HLaTeX/c65tz.fd, texinput/KS/HLaTeX/c65vd.fd: New files. + + * texinput/KS/HLaTeX/c63bm.fd, texinput/KS/HLaTeX/c63gr.fd, + texinput/KS/HLaTeX/c63gs.fd, texinput/KS/HLaTeX/c63gt.fd, + texinput/KS/HLaTeX/c63mj.fd, texinput/KS/HLaTeX/c63pg.fd, + texinput/KS/HLaTeX/c63pn.fd, texinput/KS/HLaTeX/c63yt.fd, + texinput/KS/HLaTeX/c64bm.fd, texinput/KS/HLaTeX/c64gr.fd, + texinput/KS/HLaTeX/c64gs.fd, texinput/KS/HLaTeX/c64gt.fd, + texinput/KS/HLaTeX/c64mj.fd, texinput/KS/HLaTeX/c64pg.fd, + texinput/KS/HLaTeX/c64pn.fd, texinput/KS/HLaTeX/c64yt.fd, + texinput/KS/HLaTeX/c65bm.fd, texinput/KS/HLaTeX/c65gr.fd, + texinput/KS/HLaTeX/c65gs.fd, texinput/KS/HLaTeX/c65gt.fd, + texinput/KS/HLaTeX/c65mj.fd, texinput/KS/HLaTeX/c65pg.fd, + texinput/KS/HLaTeX/c65pn.fd, texinput/KS/HLaTeX/c65yt.fd: Updated. + + * texinput/KS/HLaTeX/pshan.sty: No longer needed. Make it empty for + backwards compatibility. + + * texinput/CJK.enc (\CJK@KSHL@enc): Updated. + + * doc/history.txt, doc/CJK.doc: Updated. + +2005-08-01 Werner LEMBERG + + * utils/subfont/uni2sfd.pl (read_tfmfile): Fix reading CHARWD, + CHARHT, and CHARDP. + +2005-07-31 Werner LEMBERG + + * utils/subfont/sfd2uni.pl: New script to produce Unicode virtual + subfonts from encoding specific subfonts. + +2005-07-29 Werner LEMBERG + + * contrib/wadalab/DNP.sfd: Fix typo. Found by Shunsaku Hirata. + * contrib/wadalab/fixwada2.pl: Since Wadalab fonts have already + been uploaded to CTAN, and the bug in DNP.sfd makes it necessary to + regenerate the fonts, and to update the version number and creation + date. + +2005-07-18 Werner LEMBERG + + * utils/subfonts/makefdx.pl, utils/subfonts/uni2sfd.pl: Fix typos. + + * utils/subfonts/clonevf.pl: New script to produce a VF clone of + a TFM file. + +2005-07-18 Werner LEMBERG + + * utils/subfonts/makefdx.pl: New script to create FDX entries. + +2005-07-17 Werner LEMBERG + + * utils/subfonts/subfonts.pe, utils/subfonts/uni2sfd.pl, + utils/subfonts/vertical.pe, utils/vertref.pe: New perl and FontForge + scripts for creating and handling subfonts. + +2005-07-12 Werner LEMBERG + + * contrib/wadalab/fixwada2.pl, contrib/wadalab/makeuniwada.pl: New + scripts which fix glyph names and create virtual Unicode fonts for + the Wadalab font families. + + * contrib/wadalab/DNP.sfd: A subfont definition file used by + `fixwada2.pl' and `makeuniwada.pl'. + + * contrib/wadalab/c70goth.fd, contrib/wadalab/c70maru.fd, + contrib/wadalab/c70min.fd: New font definition files for Wadalab + fonts in Unicode encoding. + + * contrib/wadalab/DNP.doc: Completely revised and updated. + +2005-07-07 Werner LEMBERG + + * doc/history.txt: Updated. + +2005-07-05 Werner LEMBERG + + * utils/thaifont/tools/c90.etx: Fix some typos. + +2005-07-04 Werner LEMBERG + + Update Thai support: + + . Use fontinst. We no longer need virtual fonts. + . Replace support for dbtt (which has an uncertain license) with + garuda. + . Update to TDS 1.1. + + * utils/thaifont/texmf/dvips/base/dbtt.enc: Removed. + * utils/thaifont/texmf/dvips/config/config.dbtt: Removed. + * utils/thaifont/texmf/dvips/config/dbtt.map: Removed. + * utils/thaifont/texmf/fonts/tfm/public/dbtt/*: Removed. + * utils/thaifont/texmf/fonts/vf/public/dbtt/*: Removed. + + * utils/thaifont/texmf/dvips/base/norasi.enc: Removed. + * utils/thaifont/texmf/dvips/config/config.norasi: Move to... + * utils/thaifont/texmf/dvips/norasi/config.norasi: Here. + * utils/thaifont/texmf/dvips/config/norasi.map: Moved to... + * utils/thai/font/texmf/fonts/map/dvips/norasi/norasi.map: Here. + Updated. + * utils/thaifont/texmf/fonts/tfm/public/norasi/ftnr9z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnb9z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnbo9z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftno9z.tfm: Removed. + * utils/thaifont/texmf/fonts/tfm/public/norasi/ftnr8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnb8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftnbo8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/norasi/ftno8z.tfm: Updated. + * utils/thaifont/texmf/fonts/vf/public/norasi/*: Removed. + + * utils/thaifont/texmf/dvips/garuda/config.garuda: New file. + * utils/thaifont/texmf/fonts/map/dvips/garuda/garuda.map: New file. + * utils/thaifont/texmf/fonts/tfm/public/garuda/fgdr8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdb8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdbo8z.tfm, + utils/thaifont/texmf/fonts/tfm/public/garuda/fgdo8z.tfm: New files. + + * utils/thaifont/texmf/fonts/enc/dvips/thai/c90.enc: New file, + generated by fontinst. + + * utils/thaifont/tools/c90.etx: New file. + * utils/thaifont/tools/c90.mtx: New file. + * utils/thaifont/tools/garuda.fontinst: New file. + * utils/thaifont/tools/norasi.fontinst: New file. + * utils/thaifont/tools/INSTALL: New file. + * utils/thaifont/tools/dbtt-old/*: New files. + * utils/thaifont/tools/README: Removed. + * utils/thaifont/tools/thai-dummy.afm: Removed. + * utils/thaifont/tools/thai.enc: Removed. + * utils/thaifont/tools/thailigs.vpl: Removed. + + * texinput/thai/c90cmss.fd, texinput/thai/c90cmtt.fd, + texinput/thai/c90nrsr.fd: Updated. + * texinput/thai/c90dbss.fd: Removed. + * texinput/thai/c90gar.fd: New file. + +2005-06-27 Werner LEMBERG + + Remove the `rotate' keyword for vertical typesetting and introduce + the opposite, `norotate'. + + * texinput/Bg5/c00bsmir.fdx, texinput/Bg5/c00kair.fdx: New files. + + * doc/fdxfiles.doc, doc/vertical.doc, texinput/Bg5/c00bsmi.fdx, + texinput/GB/c10gbsn.fdx, texinput/CJKvert.sty: Updated. + +2005-06-25 Werner LEMBERG + + * examples/CJKmixed.tex: New example file to demonstrate how to + use CJK scripts vertically and horizontally at the same time. + +2005-06-24 Werner LEMBERG + + * doc/vertical.doc: Mention that you need an `.fdx' file if you + want to use rotated glyphs for vertical typesetting. + +2005-05-23 Werner LEMBERG + + * doc/CJK.doc: Improve documentation of `encapsulated' option. + Suggested by Brian Murphy. + +2005-04-26 Werner LEMBERG + + * texinput/UTF8/UTF8.chr (\CJK@punctchar): Wrap code after \usefont + into three groups to make it work with CJKulem.sty. + + * texinput/CJKutf8.sty, examples/CJKutf8.tex, doc/CJKutf8.doc: New + files. + + * doc/history.txt: Updated. + +2005-04-22 Werner LEMBERG + + * utils/lisp/emacs/cjk-enc.el (cjk-viscii-lower, cjk-viscii-upper), + utils/lisp/mule-2.3/cjk-enc.el (cjk-viscii-lower, cjk-viscii-upper): + Update to next vntex version which no longer uses dblaccnt.sty. + +2005-03-27 Werner LEMBERG + + * texinput/CJK.sty (\CJKspace): Don't use \relax but \@empty. + +2005-03-02 Werner LEMBERG + + * doc/CJK.doc: Mention `CJKbookmarks' option of hyperref package. + +2005-02-23 Werner LEMBERG + + * README: Updated. No public CVS access possible currently. + +2004-07-26 Werner LEMBERG + + * utils/lisp/emacs/thai-word.el (thai-word-table): Use Thai word + list from IBM's ICU4J project; it is slightly larger and uses an + X license. + +2004-07-25 Werner LEMBERG + + * utils/lisp/emacs-20.3/*: Moved to... + * utils/lisp/emacs/*: This. + + * utils/thaifont/tools/thai.enc: Minor updates. Will be replaced + with a fontinst solution soon. + +2004-06-08 Werner LEMBERG + + * doc/reftex.doc: New file. + * doc/history.txt: Updated. + +2004-06-07 Werner LEMBERG + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-write-all-files): Handle + case where files are in other directories. Bug reported by Hartwig + Crailsheim. + + * doc/cjk-enc.doc, doc/history.txt: Updated. + +2004-06-04 Werner LEMBERG + + * contrib/wadalab/c42goth.fdx, contrib/wadalab/c42maru.fdx, + contrib/wadalab/c42min.fdx: Don't rotate the Hiragana-Katagana + prolongation mark. + + * doc/vertical.doc: Updated. + Move text describing .fdx files to... + * doc/fdxfiles.doc: New file. + + * texinput/CJK.sty: Minor spelling improvements. + +2004-06-03 Werner LEMBERG + + * contrib/wadalab/DNP.doc: Improve patch for wftodm.c. + +2004-04-29 Werner LEMBERG + + Add a style file for various CJK font effects. + + * texinput/CJKfntef.sty, examples/CJKfntef.tex: New files. + * doc/CJK.doc, doc/history.txt: Document it. + +2004-03-13 Werner LEMBERG + + * texinput/*.enc: Replace \relax with \@empty in the \CJK@namegdef + assignments to assure that we only have expansion at this macro + level. + + * doc/history.txt: Updated. + +2004-02-08 Werner LEMBERG + + Bug fix: Umlaut u with diacritic appears bold. + + * texinput/pinyin.sty (\py@@@v): Apply kerning at correct place. + +2004-02-07 Werner LEMBERG + + Bug fix: Umlaut u with macron above was broken. + + * texinput/pinyin.sty (\py@macron): Add second argument to + initialize \dimen@. Update all callers. + +2004-02-06 Werner LEMBERG + + Bug fix: Use user-defined \CJKglue value. + + * texinput/CJKulem.sty (\CJK@skip): New skip register. + (\UL@CJKglue): Use it. + (\UL@hook): Initialize \CJK@skip. + Move assignments of \LA@CJKglue, \LA@Thaiglue, and \LA@Thaibreak + to here. + +2004-02-05 Wenchang Sun + + Bug fix: Disable line breaks before a post-punctuation CJK glyph + when \uline, \uwave, etc., are used. + + * texinput/CJK.sty (\CJKnobreakglue): New macro. + (\Unicode): Use it. + + * texinput/CJKulem.sty (\UL@CJKnobreakglue): New macro. + + * texinput/standard.chr, texinput/extended.chr, texinput/pmC.chr, + texinput/Bg5/bg5.chr, texinput/JIS/EUC-JP.chr, + texinput/SJIS/SJIS.chr, texinput/SJIS/SJISdnp.chr, + texinput/UTF8/UTF8.chr, texinput/CNS/EUC-TW.chr (\CJK@char, + \CJK@charx, \CJK@punctchar, \CJK@punctcharx): Use \CJKnobreakglue. + +2004-02-02 Hin-Tak Leung + + * doc/pdf/*: New directory tree documenting usage of CJK for + improved PDF output. + * doc/history.txt: Document it. + +2004-01-29 Wenchang Sun + + * texinput/CJK.sty (\CJKpunctsymbol): New \let to \CJKsymbol. + + * texinput/standard.chr, texinput/extended.chr, texinput/pmC.chr, + texinput/Bg5/bg5.chr, texinput/JIS/EUC-JP.chr, texinput/KS/KS.chr, + texinput/SJIS/SJIS.chr, texinput/SJIS/SJISdnp.chr, + texinput/UTF8/UTF8.chr, texinput/CNS/EUC-TW.chr (\CJK@punctchar, + \CJK@punctcharx): Replace \CJKsymbol with \CJKpunctsymbol. + +2003-10-12 Werner LEMBERG + + A first step to allow modification of horizontal character widths + which is needed for CJK fonts which don't have punctuation glyphs + centered within the CJK square. The same mechanism will work with + vertical glyphs also; since a common interface will differ from the + current implementation, *.fdv files are renamed to *.fdx. Note that + special character width handling of punctuation characters is still + missing. + + * texinput/CJK.sty (\CJK@load@fdx): New function, used as a hook + for \try@load@fontshape. It defines the macros \CJKhdef, \CJKhlet, + \CJKvdef, and \CJKvlet. The writing direction is appended to the + character macros -- this also fixes a bug for vertical writing + support with Big5 encoding (some characters disappeared in the + output without any warning due to character macro name clashes with + the subfont macro names). + (\CJK@direction): New macro to select the writing direction. + (\ifCJK@vertical@): Moved to CJKvert.sty. + + * texinput/CJKvert.sty (\ifCJK@vertical@): Moved from CJK.sty. + (\CJKvert, \CJKhorz): Set \CJK@direction. + (\CJKsymbol): Updated to use writing direction. + (\CJK@load@fdv): Removed. + + * texinput/*.chr: Simplified since \ifCJK@vertical@ is no longer + needed. + + * texinput/*.fdv, contrib/wadalab/*.fdv: Renamed to... + * texinput/*.fdx, contrib/wadalab/*.fdx: This. + +2003-10-25 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Fix positions of \texordfeminine and + \textordmasculine. + +2003-09-20 Werner LEMBERG + + With the help of Paul Eggert and Edward G.J. + Lee , the conversion scripts now accept + parameters. + + * utils/Bg5conv/bg5{pdf,}latex, + utils/CEFconv/{cef5{pdf,}latex,cef{pdf,}latex,cefs{pdf,}latex}, + utils/SJISconv/sjis{pdf,}latex, + utils/extconv/{bg5+{pdf,}latex,gbk{pdf,}latex}: Rewritten to accept + arguments. + * doc/history.txt: Updated. + +2003-09-16 Werner LEMBERG + + * utils/Bg5conv/bg5pdflatex, + utils/CEFconv/{cef5pdflatex,cefpdflatex,cefspdflatex}, + utils/SJISconv/sjispdflatex, + utils/extconv/{bg5+pdflatex,gbkpdflatex}: New scripts to call + pdflatex. + * doc/history.txt: Updated. + +2003-07-06 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Add some \@gobble macros in commands + defined with \mule@def. + Change definition of Thai EOL macro to make it really work. + (\mule@ignorespaces, \Thaispace, \Thainospace): New macros. + + * doc/cjk-enc.doc, doc/history.txt: Document \Thaispace and + \Thainospace. + +2003-03-30 Werner LEMBERG + + * doc/CJK.doc: Add item how to handle \bibliography which has + author names containing CJK characters. + + * utils/hbf2gf/hbf2gf.1: Minor workarounds for current grohtml bugs. + +2003-03-28 Werner LEMBERG + + Version 4.5.2 released + ====================== + + Update version numbers and time stamps in all non-binary files. + +2003-03-19 Werner LEMBERG + + Add improved support for pseudo-vertical typesetting. Based on + ideas by Robert Fendt . + + * texinput/CJK.sty (\ifCJK@vertical@): New if. + + * texinput/CJKvert.sty: Require `graphicx' package. + (\CJKvert, \CJKhorz, \CJKvdef, \CJKvlet, \CJKsymbolsimple): New + commands. + (\CJKsymbol): Add support for vertical parameters (`rotate', + `offset', `fullheight, `height') in the new *.fdv files. + (\CJK@load@fdv): New command to be appended to LaTeX's + \try@load@fontshape. + + * texinput/*/*.chr: Replace calls to \CJKsymbol with an extended + version which, if \CJKvert is active, checks the existence of a + macro + + \///// + + This macro is then called if it exists, instead of calling + \CJKsymbol. For halfwidth katakana, the macro is called + + \//// + + For HLaTeX, the macro is called + + \///// + + For UTF8, only characters in the range 0x800-0xFFFF get the new + code. + + , , and are decimal numbers. + + * contrib/wadalab/c42{goth,maru,min}.fdv, + contrib/wadalab/c52{maru,min}.fdv, texinput/Bg5/c00bsmi.fdv, + texinput/GB/c10gbsn.fdv: New files containing information for + vertical typesetting. + + * examples/Big5vert.tex: Use font shape `bsmi'. + + * doc/history.txt, doc/chinese/README, contrib/wadalab/DNP.doc, + doc/vertical.doc, examples/README, README: Updated. + + * Makefile (DVI2PS): Load bsmilp.map and gbsnlp.map. + (cweb): Fix typo (cms->cmz). + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + current versions. + + * utils/extconv/extconv.w: Remove duplicated lines. + Fix incorrect use of \@. + * utils/extconv/extconv.c: Regenerated. + +2003-03-18 Werner LEMBERG + + * texinput/pinyin.sty (\rua): New syllable. While only dialect, it + actually is used... + +2003-03-12 Werner LEMBERG + + * texinput/pinyin.sty (\den, \chua): Add missing syllables (found by + Jean-Luc Koning ). + +2003-03-07 Werner LEMBERG + + * texinput/pinyin.sty (\py@hy): Assure horizontal mode. + +2003-02-10 Werner LEMBERG + + * texinput/CJK.sty (\CJKchar): Make \CJKchar accept 7bit input for + character definitions other than standard.chr. + * doc/history.txt: Updated. + +2003-02-06 Werner LEMBERG + + Horizontal hints in Wadalab fonts weren't shifted vertically, + causing inferior results at small sizes. + + * contrib/wadalab/makefont: Rewritten using awk. + * contrib/wadalab/fixwada: New. + * contrib/wadalab/DNP.doc, doc/history.txt: Updated. + * doc/INSTALL: Minor fixes. Mention wadalab.doc and pfaedit. + +2003-01-31 Werner LEMBERG + + Add two commands \CJKhwkatakana and \CJKnohwkatakana to control + whether C49 encoding is used or whether SJIS half-width katakana are + mapped to full-width glyphs instead. + + * texinput/CJK.sty (\CJKhwkatakana, \CJK@nohwkatakana): New commands. + (\ifCJK@hwkatakana@): New if-macro. + + * texinput/SJIS/SJIS.chr, texinput/SJIS/SJISdnp.chr (\CJK@sjischar): + Add second and third parameter to call \CJK@XXX conditionally. + * texinput/SJIS/SJIS.enc (\CJK@SJISEncoding): Fill second and + third parameters for half-width katakana. + * texinput/SJIS/SJISdnp.enc (\CJK@SJISdnpEncoding): Ditto. + * doc/commands.doc, doc/CJK.doc, doc/history.txt: Updated. + + * examples/README: New file. + +2002-07-29 Werner LEMBERG + + * texinput/CNS/EUC-TW.chr (\CJK@shiftchar): Pass correct parameters + to \CJKchar. + +2002-06-19 Werner LEMBERG + + Version 4.5.1 released + ====================== + + Update version numbers and time stamps in all non-binary files. + +2002-06-17 Werner LEMBERG + + Preparation of release 4.5.1. + + * README: Updated. + * texinput/CJK.sty, doc/CJK.doc: Require LaTeX 2001/06/01 to have + support for \textkra, \texttstroke, and \textTstroke. + Other minor documentation updates. + * doc/*: Updated. + +2002-06-16 Werner LEMBERG + + * doc/chinese/READMEgb.tex: Use `gbsn' font. + * Makefile (CJK2DVI): Remove *.toc also. + (LATEX2DVI): Take two arguments. + (LATEX): Ditto. + (DISTTARGETS): Add READMEb5 and pytest. + (READMEgb, pytest): New rules + (GB...): Updated. + (predistdoc): Create README file. + (distdoc): Depend also on `cweb'. + (cweb): New target. + +2002-06-14 Edward Lee + + * texinput/Bg5/c00bsmi.fd, texinput/Bg5/c00bsmir.fd: Fix typo. + +2002-06-13 Werner LEMBERG + + * Makefile: New file, used for creating the tarballs. + * README: Updated. + * texinput/GB/c10gbsn.fd, texinput/Bg5/c00bsmi.fd, + texinput/Bg5/c00bsmir.fd: New files for fonts from the TeXLive CD. + * doc/chinese/READMEb5.tex, examples/*: Changed to use the fonts + provided by the TeXLive CD. + +2002-06-12 Werner LEMBERG + + * texinput/JISdnp.enc (\CJK@JISdnpEncoding): Fix position of closing + brace. + +2002-06-07 Werner LEMBERG + + * texinput/thai/c90enc.def: New file, contributed by Dominique + Unruh . + * texinput/thai/thaicjk.ldf: Use it. + * doc/history.txt: Updated. + +2002-05-16 Werner LEMBERG + + * doc/cjk-enc.doc: Document behaviour for master files without CJK + characters. + * doc/CJK.doc: Explain usage of `~' for BibTeX. + +2002-05-10 Werner LEMBERG + + * texinput/CJKnumb.sty (\CJKnullspace): New macro to control the + additional space inserted before and after a circle used as a + CJK zero digit. + * doc/history.txt: Updated. + +2002-05-09 Werner LEMBERG + + * texinput/CJKnumb.sty (\CJK@traditionalNumbers, + \CJK@simplifiedNumbers): New macros. + Use them for GB, GBK, Bg5, Bg5+ hooks. + +2002-05-01 Werner LEMBERG + + * doc/commands.doc: Minor fix. + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + current versions. + * utils/hbf2gf/configure.in: Renamed to... + * utils/hbf2gf/configure.ac: This. + Updated to autoconf 2.53. + * utils/hbf2gf/configure: Regenerated with autoconf 2.53. + * utils/hbf2gf/README: Text improved. + * utils/hbf2gf/hbf2gf.1: Minor typographical fixes. + +2002-04-30 Werner LEMBERG + + * texinput/CJK.sty (\CJK@errxx, \CJKindent): New macros. + * texinput/CJK.enc (\CJK@spaceChar): Define it for all encodings. + It is used by \CJKindent. + (\CJK@KSHL@enc): Add \CJK@min and \CJK@max. + * texinput/SJIS/SJISdnp.enc (\CJK@SJISdnpEncoding), + texinput/JIS/JISdnp.enc (\CJK@JISdnpEncoding), + texinput/KS/HLaTeX/KSHL.enc (\CJK@KSHLEncoding): Use \CJK@errxx + for unused slots. + + * doc/history.txt, doc/commands.doc: Document \CJKindent. + + * utils/CEFconv/cef5conv.w, utils/CEFconv/cefconv.w: Fix + documentation errors. + * utils/CEFconv/cef5conv.c, utils/CEFconv/cefconv.c: Regenerated. + +2002-04-29 Werner LEMBERG + + * texinput/CJK.sty (\pickup@font): Add comment character. + +2002-04-28 Werner LEMBERG + + Preparation of release 4.5.0. + + * README: Updated. + +2002-04-27 Werner LEMBERG + + * texinput/CJK.sty (\CJKsymbol, \CJKsymbols): Simplified. + (\Unicode, \CJKenc): Fix error text. + +2001-10-08 Mike Fabian + + * contrib/wadalab/c42goth.fd: Use `dgj' for normal series and add + `\CJKbold' for bold series. + +2001-07-31 Werner LEMBERG + + * doc/CJK.doc: Note use of \cleardoublepage if problems occur with + two-column printing. + +2001-07-27 Fabrice Popineau + + * utils/cjklatex/cjklatex.c: New file. + +2001-06-27 Werner LEMBERG + + * doc/CJK.doc: Add info how to use a CJK environment in the + preamble. + * doc/cjk-enc.doc: Simplify usage of AUC TeX. + Modify definition of `TeX-run-CJK-LaTeX' to handle directories + properly. + +2001-06-15 Werner LEMBERG + + * texinput/CJK.enc (\CJK@disableMakeUppercase): Define it as \relax + if in preprocessed mode. + +2001-06-14 HANDA Ken'ichi + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-set-buffer-multibyte): + Use backquote operator to make cjk-enc.elc work correctly. + +2001-06-08 Werner LEMBERG + + The next LaTeX release will use \textkra, \texttstroke, and + \textTstroke for the missing latin-4 characters. + + * texinput/mule/MULEenc.sty: Use \textkra. Add \TEXTTSTROKE. + * utils/lisp/emacs-20.3/cjk-enc.el, utils/lisp/mule-2.3/cjk-enc.el: + Use \texttstroke and \TEXTTSTROKE. + +2001-05-26 Werner LEMBERG + + * texinputs/CJK.sty: Restore EOL character before loading `CJK.cfg'. + +2001-05-18 Werner LEMBERG + + * contrib/wadalab/DNP.doc: Document installation for pdfTeX. + * contrib/wadalab/makefont: Updated to normalize font matrix of + PS fonts. + +2001-04-24 Werner LEMBERG + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + latest version from gnu.org. + +2001-04-21 Werner LEMBERG + + * examples/muletest.tex: Remove Thai support so that this file can + really be run with Mule 2.3. + Update comment. + * example/CJKbabel.tex, example/rubytest.tex: Update comment. + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-format-spec-table): Fix + Thai. + * texinput/mule/MULEenc.sty (\mule@char): Don't use delimiter. + * texinput/SJIS/sjisdnp.enc: Update this file also to the changes + introduced 2001-03-15. + +2001-04-17 Werner LEMBERG + + * examples/*.tex: Added local variables for Emacs to specify + encoding. + * doc/history.txt: Emphasize the need of local variables for the + encoding if `cjk-enc.el' is used. + +2001-04-02 Werner LEMBERG + + * utils/lisp/emacs-20.3/cjk-enc.el: Fix documentation to follow + Elisp documentation conventions. + +2001-04-01 Werner LEMBERG + + Make UTF8 encoding work in TOC. + + * texinput/CJK.sty (\CJK@namedef): New macro. + * texinput/UTF8/UTF8.bdg: Use it. + +2001-03-28 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Use \textnumero instead of \CYRNo + (found by Vladimir Volovich). + +2001-03-18 Werner LEMBERG + + * utils/lisp/cjkspace.el, INSTALL: Fix documentation. + +2001-03-15 Werner LEMBERG + + A major change: Preprocessed and non-preprocessed mode can be used + simultaneously! For example, you can now use include a file encoded + in UTF-8 in another file encoded in Big5. + + To achieve this, ^^7f will always start a command in preprocessed + mode, even for CJK macros. + + * texinput/CJK.sty: Require MULEenc.sty. + Remove ^^7f handling. + Remove preprocessed versions of \CJK@XX, \CJK@XXX, and \CJK@XXXX. + (\CJKcaption): Always include .cpx files. + + * texinput/CJK.enc (\CJK@disableMakeUppercase): New macro. + (\CJK@shiftError): New macro. + (\CJK@unicodeError): New macro. + (\CJK@makeEnvironment): Don't handle \MakeUppercase. + (\CJK@*@enc): Always use `true' branch in \CJKpreproc conditionals. + + * texinput/mule/MULEenc.sty (\mule@@@arg, \mule@def): Use \string. + (\mule@@def): New function to set up macros for leading bytes in the + range ^^81-^^fe. + * texinput/extended.enc (\CJK@extendedEncoding), + texinput/Bg5/Bg5.enc (\CJK@Bg5Encoding), texinput/SJIS/SJIS.enc + (\CJK@SJISEncoding): Use \CJK@disableMakeUppercase. + * texinput/pmCbig.enc (\CJK@pmCbigEncoding), texinput/pmCsmall.enc + (\CJK@pmCsmallEncoding), texinput/standard.enc + (\CJK@standardEncoding): Add \relax. + * texinput/CNS/EUC-TW.enc (\CJK@EUC-TWEncoding), + texinput/JIS/EUC-JP.enc (\CJK@EUC-JPEncoding): Use \CJK@shiftError + for single shifts. Add \relax for all other macros. + * texinput/UTF8/UTF8.enc (\CJK@UTF8Encoding): Use \CJK@unicodeError + for three-byte sequences. Add \relax for all other macros. + + * texinput/*/*.cpx: Updated to new preprocessing scheme. + + * utils/*conv/*conv.w: Updated to new preprocessing scheme. + * utils/*conv/*conv.c: Regenerated. + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-format-spec-table): Updated + to new preprocessing scheme. + (cjk-encode): Fix file header insertion strings. + * utils/lisp/mule-2.3/cjk-enc.el (cjk-enc-table): Updated to new + preprocessing scheme. + (cjk-encode): Fix file header insertion strings. + + * doc/*: Updated and revised. + +2001-03-13 Werner LEMBERG + + Implement \CJKinput. + + * mule/MULEenc.sty (\CJKinput): New macro. + (\CJKinclude): Fix error message. + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-write-all-files): Update + docstring. + (tex-input-regexp): New test for \CJKinput. + (do-batch-cjk-write-file): Fix typo. + + * texinput/thai/thaicjk.ldf: Fix typo. + +2001-02-21 Werner LEMBERG + + * doc/INSTALL: Minor improvements. + +2001-02-13 Werner LEMBERG + + * utils/hbf2gf/config.{guess,sub}: Updated (from ftp.gnu.org). + +2000-12-17 Werner LEMBERG + + * utils/SJISconv/sjisconv.w: Fix typo ff -> 7f. + * utils/CEFconv/cef5conv.w, utils/CEFconv/cefconv.w: Ditto. + + * utils/*conv/*conv.w: \XXXpreproc will now contain the version of + the conversion program. + * utils/*conv/*conv.c: Updated. + + * doc/history.txt: Updated. + + * all files: Version number changed to 4.4.0. + +2000-12-03 Werner LEMBERG + + * utils/hbf2gf/configure.in: Fix kpathsea checking message. + * utils/hbf2gf/configure: Updated. + +2000-12-02 Werner LEMBERG + + * doc/cjk-enc.doc: Clarify usage of cjk-coding. + * doc/INSTALL: Add hints how to use kpsewhich to check + configuration. + +2000-12-01 Werner LEMBERG + + * doc/INSTALL: Fix documentation of --with-kpathsea-include. + * doc/cjk-enc.doc: Fix typo. + +2000-09-21 Werner LEMBERG + + * texinput/{CJK.sty, CJKulem.sty, pinyin.sty, ruby.sty}: Replacing + some \ifdim with \ifnum. + +2000-09-20 Werner LEMBERG + + * texinput/CJKulem.sty: Fixed two nasty bugs (spotted by Sim Ing + ): No underlining for \CJKglue and no \CJKglue + before and after \uline. + +2000-08-28 Werner LEMBERG + + * utils/thaifont/texmf/dvips/config/config.{norasi,dbtt}: New files. + * doc/thaifont.doc: Added info about PS font configuration. + +2000-08-24 Werner LEMBERG + + * utils/lisp/emacs-20.3/thai-word.el (thai-update-word-table): Add + documentation string. + +2000-08-24 HANDA Ken'ichi + + * utils/lisp/emacs-20.3/thai-word.el (thai-update-word-table): New + function. + (thai-find-word-ends): Fix loop. + +2000-08-23 Werner LEMBERG + + * texinput/thai/thaicjk.ldf: Remove warning about nonexistent + hyphenation patterns. + +2000-08-20 Werner LEMBERG + + Another big sigh. Wrong glyph names for Norasi's Thai digits. + Additionally, all ligature rules no longer use `>' to make kerning + possible. + + * utils/thaifont/texmf/dvips/base/norasi.enc: Fixed. + * utils/thaifont/tools/{thai.enc,thailigs.vpl}: Updated. + * utils/thaifont/texmf/fonts/{tfm,vf}/public/{dbtt,norasi}/*: + Regenerated. + +2000-08-19 Werner LEMBERG + + * examples/thai.tex: New file. + * doc/history.txt: Updated. + + * examples/CJKbabel.tex: Doc fixes. + +2000-08-17 Werner LEMBERG + + * doc/cjk-enc.el, doc/thaifont.doc: Give better URL for thailatex + package. + +2000-08-15 Werner LEMBERG + + Sigh, another forgotten Thai ligature rule. + + * utils/thaifont/tools/{thai.enc,thailigs.vpl}: Updated. + * utils/thaifont/texmf/fonts/{tfm,vf}/public/{dbtt,norasi}/*: + Regenerated. + +2000-08-15 Werner LEMBERG + + * texinput/thai/c90{cmr,cmss.cmtt}.fd: Make font substitution + silent. + + * utils/thaifont/texmf/dvips/base/norasi.enc: Fixing typo. + * utils/thaifont/texmf/fonts/{tfm,vf}/public/norasi/*: Updated. + +2000-08-13 Werner LEMBERG + + Improved support for Thai. + + * doc/thaifont.doc: New file. + + * utils/thaifont/*: Metrics and support files for Thai fonts. + + * texinput/thai/c90{nrsr,dbss}.fd: New font definition files for + dbtt and norasi font families. + * texinput/thai/c90{cmr,cmss,cmtt}.fd: Font alias files. + * texinput/thai/thaicjk.ldf: New file for thai support in Babel. + * texinput/thai/thai.sty: Removed. + + * utils/lisp/emacs20.3/cjk-enc.el: Redesigned Thai support by + HANDA Ken'ichi . + Will now run under XEmacs also (with help of Martin Buchholz + ). No Thai support yet due to limitations in + current XEmacs version (21.2). + (cjk-write-all-files): New optional argument to force the processing + of all files. + (do-batch-cjk-write-file): New function. + (batch-cjk-write-file): Use do-batch-cjk-write-file. + (batch-force-cjk-write-file): New function. Uses + do-batch-cjk-write-file also. + * utils/lisp/mule-2.3/cjk-enc.el: Rename write-cjk-file to + cjk-write-file for consistency. + * utils/lisp/emacs20.3/thai-word.el: New file written by HANDA + Ken'ichi for Thai word breaking support. Replaces thaiconv. + * utils/thaiconv: Removed. + + * utils/lisp/emacs20/cjk-enc.el: Removed. No longer supported. + + * texinput/mule/MULEenc.sty: Adapted to new cjk-enc.el version. + Make it robust for CJKulem.sty. + + * examples/CJKbabel.tex: Use CJKulem.sty and thaicjk module for + Babel. + * examples/muletest.tex: Remove \if... \fi clause for Thai. + + * doc/history.txt, doc/INSTALL: Updated. + +2000-08-12 Werner LEMBERG + + * texinput/CJKulem.sty: New file which provides CJK support for + ulem.sty. + * doc/history.txt, doc/CJK.doc: Updated. + +2000-08-09 Werner LEMBERG + + * utils/hbf2gf/configure.in: Replaced --with-kpathsea-dir with + --with-kpathsea-lib and --with-kpathsea-include. + * utils/hbf2gf/configure, doc/history.txt, doc/INSTALL, + doc/hbf2gf.doc: Updated. + + * texinput/CJK.sty, texinput/mule/MULEenc.sty: New command + \CJKverbatim which disables \Thaiglue and \CJKglue in verbatim + environments if the `verbatim' package is loaded. + * doc/history.txt, doc/CJK.doc, doc/commands.doc: Updated. + +2000-07-30 Werner LEMBERG + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + latest version from ftp.gnu.org. + +2000-07-27 Werner LEMBERG + + * utils/thaiconv/thaiconv.c: Improve comment. + + * *.fd: Set \hyphenchar to -1 for all CJK fonts. + +2000-06-23 Werner LEMBERG + + * utils/hbf2gf/config.guess, utils/hbf2gf/config.sub: Updated to + latest version from ftp.gnu.org. + + * texinput/CJK.enc: Removed redefinition of C42 and C49. + +2000-05-03 Werner LEMBERG + + * texinput/CJK.sty: Specifying an optional argument to the `CJK' + size function will no longer produce a warning message for each + subfont. + + * contrib/wadalab/*.fd, doc/CJK.doc, doc/fonts.doc: Wadalab PS fonts + now use `CJK' size functions instead of `DNP' ones. + + * doc/history.txt: Updated. + +2000-05-02 Werner LEMBERG + + * texinput/*/*.cpx: Replace incorrect 0xFF with 0x7F. + +2000-04-18 Werner LEMBERG + + * texinput/CJK.sty, texinput/pinyin.sty, texinput/ruby.sty: + Balancing the small kern control values, e.g. using + `\kern -1sp\kern 1sp' instead of `\kern 1sp' only. + + Replacing kern value of 3sp with 5sp to avoid clash with ulem.sty. + +2000-04-01 Werner LEMBERG + + Version 4.3.0 released + ====================== + + This version exists on the Tex Live CD 5 only; a lot of files have + been adapted to the special needs of the CD's texmf tree -- these + changes are not in the CVS tree. + +2000-03-15 Werner LEMBERG + + * contrib/wadalab/wadalab.map: Renamed from Wadalab.map + * contrib/wadalab/DNP.doc: Updated accordingly. + + * utils/hbf2gf/cfg/*: Updated -- if possible, the foundry is used + as the target directory instead of the encoding, e.g. + `tfm/ntu/b5ka12'. + +2000-03-14 Werner LEMBERG + + * texinput/SJIS/SJISdnp.{chr,enc}: New files to support SJIS + encoding with DNP fontencoding. + * texinput/CJK.enc: Add SJISdnp. + Add forgotten punctuation pattern macro to KSHL encoding. + * doc/history.txt, doc/CJK.doc, doc/command.doc: Update. + +2000-03-13 Werner LEMBERG + + * texinput/CJK.sty: Fixing definition of ^^7f to do nothing if + written to the TOC file. + +2000-03-12 Werner LEMBERG + + * texinput/KS/HLaTeX/pshan.sty: Fix typo. + + Call \mj to activate default family correctly. + + * contrib/wadalab/makefont: Add echo commands. + * contrib/wadalab/DNP.doc: Updated. Add info about gsftopk. + +2000-03-03 Werner LEMBERG + + * utils/hbf2gf/README: New file. + * utils/hbf2gf/hbf2gf.1, doc/hbf2gf.doc: Small improvements. + + * README: Removed `romaji environment' from TODO section. According + to HANDA Ken'ichi it is impossible to provide + hyphenation patterns for transcribed Japanese without semantic + analysis. + +2000-03-02 Werner LEMBERG + + * README, doc/INSTALL: Slight improvements. + + * utils/hbf2gf/Makefile.in, utils/hbf2gf/configure.in: Fix incorrect + test for NO_STRDUP. Thanks to . + +2000-02-06 Werner LEMBERG + + * texinput/CJK.sty, texinput/mule/MULEenc.sty, + utils/lisp/*/cjk-enc.el, utils/*conv/*conv.[cw], history.txt, + CJK.doc, cjk-enc.doc: Use 0x7F both as the multiplex character and + as a delimiter -- apparently no package uses this character... + This solves all problems with \uppercase and \lowercase. + + * utils/hbf2gf/cfg/j2so12.cfg: Added `min_char' parameter to get + correct offsets (thanks to Martin Minich + for finding this bug). + +2000-01-26 Werner LEMBERG + + * doc/cjk-enc.doc, doc/history.txt, examples/CJKbabel.tex, + examples/muletest.tex, texinput/mule/MULEenc.sty, + utils/lisp/*/cjk-enc.el: Change X5 to T5. + +2000-01-20 Werner LEMBERG + + * examples/muletest.tex: Greek added; updated to X5 encoding. + * examples/CJKbabel.tex: Greek added; updated to X5 encoding. + + * texinput/mule/MULEenc.sty: Use \AtBeginDocument for \mule@ + definitions. + +2000-01-14 Werner LEMBERG + + * doc/cjk-enc.doc: Added info about file variables to specify + document encoding. + +2000-01-03 Ching-Mo CHANG + + * utils/lisp/emacs-20.3/cjk-enc.el (cjk-write-all-files): Always + returned nul for include and bib file names due to incorrect + pattern matching. + +1999-12-18 Werner LEMBERG + + * utils/hbf2gf/configure.in: Removed `-pedantic' flag which causes + problems with newer gcc versions. + +1999-11-19 Werner LEMBERG + + * examples/muletest.tex, examples/CJKbabel.tex: Fixing a typo. + +1999-11-07 Werner LEMBERG + + * doc/CEF.doc: Minor fixes. + + * doc/CJK.doc: Updated; minor fixes. + +1999-11-06 Werner LEMBERG + + * doc/cjk-enc.doc, doc/commands.doc, doc/fonts.doc: Minor fixes. + + * doc/vertical.doc, doc/history.txt: Updated. + +1999-11-05 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Added \CJKinclude{} and + \CJKbibliography{}. These functions act identically to + \include resp. \bibliography but load .cjk + resp. -cjk.bib. + + * utils/lisp/emacs-20.3/cjk-enc.el: Using `cjk' throughout as the + prefix to variable and function names. This causes a renaming of + virtually all functions. Some other local variables were renamed + also for consistency. + + Changing ET5 to X5 encoding for Vietnamese. + + (decompose-char): Removed. Not needed at all. + + (cjk-tex-in-comment): New function. Similar to AUC TeX's + TeX-in-comment function; has been added to be independent from AUC + TeX. + + (cjk-write-all-files): New function. It checks for \CJKinclude + and \CJKbibliography commands in the master file and converts the + referenced files accordingly if necessary. Intended as a hook to + AUC TeX to make multiple files work as expected. + +1999-11-02 Werner LEMBERG + + * doc/cjk-enc.doc: Small improvement in explanation of usage with + AUC TeX. + +1999-10-24 Werner LEMBERG + + * utils/lisp/emacs-20.3/cjk-enc.el (get-cjk-name): New function. + + (file-write-cjk-file, batch-write-cjk-file): New functions which + do the same as write-cjk-file but operate on a given file (resp. a + suite of files and directories given on the command line). + + (write-cjk-file): Will now properly ask for a file name if the + current buffer is not visiting a file. + + * doc/cjk-enc.doc: Expanded TeX-translate-location-hook to cover + CJK BibTeX input files also. + + TeX-run-CJK-LaTeX now checks whether it must call write-cjk-file + at all (emacs > 20.3 only). + +1999-10-07 Werner LEMBERG + + * texinput/mule/MULEenc.sty: Removed \textendash wrapper macro. + + * utils/lisp/{emacs-20.3,emacs-20,mule-2.3}/cjk-enc.el: Added + iso-8859-9 (Greek) support (mapped to LGR encoding as used in the + Babel package). + + Fixed character `SOFT-HYPHEN' in iso-8859-x encodings (using `\-' + instead of \textendash). + + * README, doc/cjk-enc.doc, doc/history.txt: Updated. + + * doc/CJK.doc: Fixed a typo. + + * texinput/CJK.enc, texinput/CJK.sty, texinput/*/{*.cap,*.cpx}: + Replaced `\ifx\foo \undefined' with `\@ifundefined{}{}' to fix the + case that a not-defined macro has been tested with \@ifundefined + before. In this case, it is no longer undefined but identical to + \relax. + + * texinput/pmC.chr: Fixed punctuation macros for pmC. + +1999-10-02 Werner LEMBERG + + * texinput/pinyin.sty: The method with appending `\-' to all + syllables fails (stupid I am :-), so here a solution which really + works. It uses a small kern (4sp, similar to the ruby and CJK + packages) to tell the following pinyin syllable that a + discretionary has to be inserted. + +1999-10-01 Werner LEMBERG + + * texinput/mule/MULEenc.sty: \lccode and \uccode of ^^ff must not + be modified, otherwise hyphenation patterns containing \ss will + fail (which happens e.g. in German). + +1999-09-28 Werner LEMBERG + + * doc/history.txt: Updated. + + * utils/pyhyphen/pyhyph.tex, utils/pyhyphen/pytest.tex, + utils/pyhyphen/pinyin.ldf, doc/pyhpyhen.doc: Hyphenation patterns + for unaccented pinyin syllables to be used with the Babel package. + + * utils/pyhyphen/pinyin.c, utils/pyhpyhen/pinyin.tr: Utility files + for creating pinyin hyphenation patterns. + +1999-09-27 Werner LEMBERG + + * doc/history.txt: Updated. + +1999-09-21 Werner LEMBERG + + * texinput/pinyin.sty: Adding hyphenation points at the end of all + syllables. + +1999-09-18 Werner LEMBERG + + * texinput/pinyin.sty: Making accent commands like \py@a robust. + + Added option `useCMmacron' (for LaTeX only) to use a macron accent + from the CM fonts in case the used font doesn't have it + (e.g. some versions of virtual files for Palatino). + +1999-08-26 Werner LEMBERG + + * utils/hbf2gf/hbf2gf.1: Added some documentation how to find out + the expanded value of a kpathsea variable (like $MISCFONT). + +1999-08-07 Werner LEMBERG + + * utils/thaiconv/thaiconv.c (adj): Fixed invalid array index in + case of marks without base characters. + +1999-07-07 Werner LEMBERG + + * texinput/Bg5/Bg5.chr, + texinput/extended.chr: Fixed a typo \CJK@temp->\CJK@gtemp + +1999-06-30 Werner LEMBERG + + * utils/lisp/emacs-20/cjk-enc.el, + utils/lisp/emacs-20.3/cjk-enc.el, + utils/lisp/mule-2.3: Fixed code for 0x80 multiplex character. + +1999-06-22 Werner LEMBERG + + * doc/TDS.doc: Completely revised. + +1999-06-10 Werner LEMBERG + + * utils/hbf2gf/configure.in: Removed `-ansi' flag which can cause + problems with the kpathsea library (which is not compiled with + -ansi). + +1999-06-07 Werner LEMBERG + + * utils/hbf2gf/hbf2gf.1: Added documentation about MiKTeX. + + * utils/hbf2gf/hbf2gf.w: Added support for MiKTeX file search + library. + + * texinput/CEF/*.fd: Removed -- these files were erroneously + included into the CVS repository. + +1999-06-04 Werner LEMBERG + + * *.fd files: minor documentation addition regarding font + encoding. + + * all files: Changed date/version to 4.3.0. + +1999-06-02 Werner LEMBERG + + * README: Added info about http and ftp home sites and how to + access the CVS repository. + +1999-06-01 Werner LEMBERG + + * README: Added info about CVS mailing list. + +1999-05-29 Werner LEMBERG + + * README: Added mailing list. + + * doc/INSTALL: Small correction. + + * README: Small additions. + +;; Local Variables: +;; coding: utf-8 +;; End: + + Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Werner Lemberg + + This file is part of the CJK package for using Asian logographs + (Chinese/Japanese/Korean) with LaTeX2e. + + 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, 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 GNU Emacs; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/README b/Build/source/texk/cjkutils/cjkutils-4.8.2/README new file mode 100644 index 00000000000..f66b64c24ec --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/README @@ -0,0 +1,35 @@ +Welcome to CJK version 4.8.2 (29-Dec-2008), a LaTeX2e macro package which +enables the use of CJK scripts (Chinese/Japanese/Korean) in various +encodings, written by Werner Lemberg . + +A mailing list exists at cjk@ffii.org; bugs should be sent to +cjk-bug@ffii.org. To subscribe one of the lists, send a mail with the +subject `subscribe' (without the quotes) to -request@ffii.org, e.g., +cjk-request@ffii.org. + +If you are interested in the process of development you may observe + + http://git.savannah.gnu.org/gitweb/?p=cjk.git;a=summary + +to see the commitments to the git repository of the CJK package, and which +also provides snapshots. + +The home site of the CJK package is + + http://cjk.ffii.org + +Additionally, the latest non-development version can be found on all CTAN +hosts and its mirrors in the directory /language/chinese. + + +The package comes in two parts: + + cjk-4.8.2.tar.gz: The source files. Needed for all platforms. + cjk-4.8.2-doc.tar.gz: Preformatted documentation files: DVI, PS, + output from cjk-enc.el, etc. + +Note that on CTAN and its mirrors, the `src' archive is unpacked; you must +thus get all files and subdirectories from language/chinese/CJK/. + + +---End of README--- diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.1 new file mode 100644 index 00000000000..0ffd2460885 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.1 @@ -0,0 +1,110 @@ +.\" man page for sjisconv +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH SJISCONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP\\$2 +.. +.\} +.if n \{\ +.de C +\\$1\\$2 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +sjisconv \- convert a TeX document in SJIS encoding into `preprocessed' +form. +. +. +.SH SYNOPSIS +.B sjisconv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +SJIS encoding for Japanese uses the characters +.C { , +.C } , +and +.C \e +which have special meanings in \*(TX +documents. +.PP +After processing a \*(LE +document which contains SJIS characters with +.B \%sjisconv +you need not care about these special characters. +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR bg5conv (1), +.BR \%cefconv (1), +.BR cef5conv (1), +.BR \%cefsconv (1), +.BR \%extconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.c new file mode 100644 index 00000000000..6b1b5409bf3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.c @@ -0,0 +1,36 @@ +#define banner \ +"sjisconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 93 "/home/wl/git/cjk/cjk-4.8.2/utils/SJISconv/sjisconv.w" + +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch; + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.w new file mode 100644 index 00000000000..26469af5c57 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisconv.w @@ -0,0 +1,120 @@ +% This is the cweb file sjisconv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a sjisconv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{sjisconv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont sjisconv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert SJIS encoded Japanese characters into a +`preprocessed' form. The need of this program arises from the fact that this +encoding uses the characters `\.{\\}', `\.{\{}', and `\.{\}}' which have +special meanings in \TeX. + +Use this program as a filter: + +\hskip 2em \.{sjisconv < input\_file > output\_file} + + +@* The program. +The only function of this program is to replace all occurrences of SJIS +encoded two byte characters \.{XY} with +\.{\char94 \char94 7fX\char94 \char94 7fZZZ\char94 \char94 7f} (\.{X} +and \.{Y} are the first and the second byte of the character; \.{ZZZ} +represents the second byte as a decimal number). + +Additionally we define a \TeX\ macro at the very beginning to signal a +preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{sjisconv} complains loudly if something is +wrong. + +@d banner +"sjisconv (CJK ver. 4.8.2)" + +@c +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch; + + fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if((ch >= 0x81 && ch <= 0x9F) || (ch >= 0xE0 && ch <= 0xEF)) + {fprintf(stdout, "\177%c\177", ch);@# + + ch = fgetc(stdin); + if(!feof(stdin)) + fprintf(stdout, "%d\177", ch); + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjislatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjislatex new file mode 100755 index 00000000000..d794a7c7f5e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjislatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +sjisconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.bat new file mode 100644 index 00000000000..5702c113bdf --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.bat @@ -0,0 +1,3 @@ +call f_name %1 +sjisconv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.cmd new file mode 100644 index 00000000000..ff8955dfba2 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjisltx.cmd @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------*\ + sjisltx.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'sjisconv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of sjisltx.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjispdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjispdflatex new file mode 100755 index 00000000000..50daf343502 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/SJISconv/sjispdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +sjisconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/cjklatex/cjklatex.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/cjklatex/cjklatex.c new file mode 100644 index 00000000000..6518cc63491 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/cjklatex/cjklatex.c @@ -0,0 +1,297 @@ +/* + Purpose: call LATEX after preprocessing of the .tex file by + the cjk conversion tool. The old f_name.bat script + is not working anymore. + Author : F. Popineau + Date : <29/06/2001> +*/ + +#ifndef LATEX +#define LATEX "latex" +#endif + +/* + Copyright (C) 2001-2008 F. Popineau + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA +*/ + +#include +#include + +#include +#include +#include + +#if defined(WIN32) && !defined(__MINGW32__) +#include +#endif + +static const char *cjklatex_version_string = "1.0"; + +static const char *usage_str[] = { + "Usage: %s OPTIONS FILE\n", + "Calls `" LATEX "' on FILE after conversion by the filter\n", + "specified by OPTIONS.\n", + "--conv=bg5\tfor traditional Chinese, encoding Big 5,\n", + "--conv=cef\tfor Chinese Encoding Framework, encoding CEF,\n", + "--conv=cef5\tidem CEF, also converts Big5 characters,\n", + "--conv=cefs\tidem CEF, also converts SJIS characters,\n", + "--conv=gbk\tfor Chinese, encoding GBK,\n", + "--conv=sjis\tfor Japanese, SJIS encoding.", + "\nAlternatively, for compatibility with the previous DOS batch files,\n", + "you can also copy this program to any of the following names:\n", + "bg5" LATEX ".exe, cef5" LATEX ".exe, cef" LATEX ".exe, cefs" LATEX ".exe,\n", + "gbk" LATEX ".exe and sjis" LATEX ".exe .\n", + "Then running one of these programs will be identical to specify\n", + "the corresponding option.\n", + "\nAdditional options:\n", + "--verbose\tbe a bit more verbose about what is happening,\n", + "--nocleanup\tdo not remove intermediate files,\n", + "--latex=engine\tuse `engine' instead of `" LATEX "' to process the file.\n", + NULL +}; + +static char *progname = NULL; + +static struct _conv_table { + const char *progname; + const char *processor; +} CJKtable[] = { + { "cjk" LATEX, "" }, + { "bg5" LATEX, "bg5conv" }, + { "cef" LATEX, "cefconv" }, + { "cef5" LATEX, "cef5conv" }, + { "cefs" LATEX, "cefsconv" }, + { "gbk" LATEX, "extconv" }, + { "sjis" LATEX, "sjisconv" } +}; + +#define PROGRAM_IS(p) FILESTRCASEEQ (p, progname) +#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a) + +static int program_number = -1; +static int opt_verbose = 0; +static int opt_nocleanup = 0; +static char *texname, *cjkname, *texengine; + +static struct option long_options [] = { + { "debug", 1, 0, 0}, + { "help", 0, 0, 0}, + { "version", 0, 0, 0}, + { "verbose", 0, 0, 0}, + { "nocleanup", 0, 0, 0}, + { "latex", 1, 0, 0}, + { "conv", 1, 0, 0}, + {0, 0, 0, 0} +}; + +static BOOL sigint_handler(DWORD dwCtrlType) +{ + /* Fix me : there is a problem if a system() command is running. + We should wait for the son process to be interrupted. + Only way I can think of to do that : rewrite system() based on + spawn() with parsing of the command line and set a global pid + Next cwait(pid) in the HandlerRoutine. + */ + + /* This is not that good, but else we would need to wait for + the child processes to finish ! */ + Sleep(250); + + fprintf(stderr, "Sending Ctrl+Break!\n"); + GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0); + + if (! opt_nocleanup) + unlink(cjkname); + + exit(1); + + return FALSE; /* return value obligatory */ +} + +static void usage(void) +{ + int i; + fprintf(stderr, "CJK" LATEX " version %s\n", cjklatex_version_string); + fprintf(stderr,usage_str[0], progname ); + fputs("\n", stderr); + for(i = 1; usage_str[i]; ++i) + fputs(usage_str[i], stderr); +} + +static int do_process(const char *processor, const char *filename) +{ + char *ext, *p; + char cmd[_MAX_PATH*3]; + DWORD dwFA; + int ret; + + if (strlen(filename) > 4 && _strnicmp(filename + strlen(filename) - 4, ".tex", 4) == 0) { + texname = xstrdup(filename); + } + else { + texname = concat(filename, ".tex"); + } + for (p = texname; p && *p; p++) + *p = (*p == '\\' ? '/' : *p); + + dwFA = GetFileAttributes(texname); + if (dwFA == 0xFFFFFFFF || (dwFA & FILE_ATTRIBUTE_DIRECTORY)) { + fprintf(stderr, "%s: %s is an invalid input file.\n", + progname, texname); + ret = 1; + } + else { + cjkname = xstrdup(texname); + ext = strrchr(cjkname, '.'); + assert(ext != NULL); + strcpy(cjkname + (ext - cjkname), ".cjk"); + + sprintf(cmd, "%s < %s > %s", processor, texname, cjkname); + if (opt_verbose) + fprintf(stderr, "%s: running command `%s'.\n", progname, cmd); + ret = system(cmd); + if (ret == 0) { + sprintf(cmd, "%s %s", texengine, cjkname); + if (opt_verbose) + fprintf(stderr, "%s: running command `%s'.\n", progname, cmd); + ret = system(cmd); + if (! opt_nocleanup) + unlink(cjkname); + } + } + + free(texname); + free(cjkname); + + return ret; +} + +int main(int argc, char *argv[]) +{ + int g; /* getopt return code */ + int i; + int option_index; + char *filename; + + if (!progname) + progname = argv[0]; + + kpse_set_program_name (progname, NULL); + progname = kpse_program_name; + + for (i = 0; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number < 0; i++) { + if (STREQ(progname, CJKtable[i].progname) +#if 0 + || (STREQ(progname, CJKtable[i].progname) + && STREQ(progname+strlen(CJKtable[i].progname), ".exe")) +#endif + ) { + program_number = i; + } + } + + if (program_number == -1) { + fprintf(stderr, "%s: this program has been incorrecty copied to the name %s.\n", progname, progname); + usage(); + exit(1); + } + + for(;;) { + g = getopt_long_only (argc, argv, "", long_options, &option_index); + + if (g == EOF) + break; + + if (g == '?') { + usage(); /* Unknown option. */ + exit(1); + } + + /* assert (g == 0); */ /* We have no short option names. */ + /* + FIXME : try 'mktexpk --mfmode --bdpi 600 ...' + */ + if (ARGUMENT_IS ("debug")) { + kpathsea_debug |= atoi (optarg); + } + else if (ARGUMENT_IS ("help")) { + usage(); + exit(0); + } + else if (ARGUMENT_IS ("verbose")) { + opt_verbose = 1; + } + else if (ARGUMENT_IS ("nocleanup")) { + opt_nocleanup = 1; + } + else if (ARGUMENT_IS ("latex")) { + texengine = xstrdup(optarg); + } + else if (ARGUMENT_IS ("version")) { + fprintf(stderr, "%s of %s.\n", progname, cjklatex_version_string); + exit(0); + } + else if (PROGRAM_IS("cjk" LATEX)) { + if (ARGUMENT_IS("conv")) { + for (i = 1; i < sizeof(CJKtable)/sizeof(CJKtable[0]) && program_number <= 0; i++) { + if (STRNEQ(optarg, CJKtable[i].progname, strlen(optarg))) { + program_number = i; + } + } + } + } + } + + /* shifting options from argv[] list */ + for (i = 1; optind < argc; i++, optind++) + argv[i] = argv[optind]; + argv[i] = NULL; + + argc = i; + + if (argc < 2) { + fprintf (stderr, "%s: Missing argument(s).\nTry `%s --help' for more information.\n", progname, kpse_program_name); + exit(1); + } + + if (argc > 2) { + fprintf(stderr, "%s: Extra arguments", progname); + for (i = 2; i < argc; i++) + fprintf (stderr, " \"%s\"", argv[i]); + fprintf (stderr, "\nTry `%s --help' for more information.\n", + kpse_program_name); + exit(1); + } + + SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE); + + filename = xstrdup(argv[1]); + + assert(program_number > 0); + + if (! texengine) { + texengine = xstrdup(LATEX); + } + + do_process(CJKtable[program_number].processor, filename); + + free(filename); + free(texengine); + + return 0; +} diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+latex b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+latex new file mode 100755 index 00000000000..4136537872e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+latex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +extconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+pdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+pdflatex new file mode 100755 index 00000000000..e28761ef423 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5+pdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] pdflatex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +extconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.bat new file mode 100644 index 00000000000..ccc6c76acd5 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.bat @@ -0,0 +1,3 @@ +call f_name %1 +extconv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.cmd new file mode 100644 index 00000000000..64b768ee178 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/bg5pltx.cmd @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------*\ + bg5pltx.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'extconv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of bg5pltx.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.1 new file mode 100644 index 00000000000..d8494edc1e1 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.1 @@ -0,0 +1,111 @@ +.\" man page for bg5conv +.\" +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +. +.TH EXTCONV 1 29-Dec-2008 "CJK Version 4.8.2" +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP\\$2 +.. +.\} +.if n \{\ +.de C +\\$1\\$2 +.. +.\} +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH NAME +extconv \- convert a TeX document in either Big\ 5+ or GBK encoding into +`preprocessed' form. +. +. +.SH SYNOPSIS +.B extconv +< +.I infile +> +.I outfile +. +. +.SH DESCRIPTION +Big\ 5+ and GBK encodings use the characters +.C { , +.C } , +and +.C \e +which have special meanings in \*(TX +documents. +.PP +After processing a \*(LE +document which contains such characters with +.B \%extconv +you need not care about these special characters. +.PP +This filter is part of the +.B CJK +macro package for \*(LE. +. +. +.SH "SEE ALSO" +.BR bg5conv (1), +.BR \%sjisconv (1), +.BR \%cefconv (1), +.BR cef5conv (1), +.BR \%cefsconv (1), +.br +the +.B CJK +documentation files. +. +. +.SH AUTHOR +Werner Lemberg +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.c new file mode 100644 index 00000000000..1b1753fd08b --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.c @@ -0,0 +1,37 @@ +#define banner \ +"extconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 94 "/home/wl/git/cjk/cjk-4.8.2/utils/extconv/extconv.w" + +#include +#include + + +int main(argc,argv) +int argc; +char*argv[]; + +{int ch; + + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0x81&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.w new file mode 100644 index 00000000000..554106fe78e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/extconv.w @@ -0,0 +1,122 @@ +% This is the cweb file extconv.w of the CJK Package Ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +a extconv.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\def\title{extconv (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont extconv} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright\ 1996, 1998 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice + are preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + +\noinx +\nosecs +\nocon + +@* Function and Use. +This small program will convert Big~5+ or GBK encoded Chinese characters +into a `preprocessed' form. The need of this program arises from the fact +that these two encodings use the characters `\.{\\}', `\.{\{}', and `\.{\}}' +which have special meanings in \TeX. + +Use this program as a filter: + +\hskip 2em \.{extconv < input\_file > output\_file} + + +@* The program. +The only function of this program is to replace all occurrences of Big~5+ +and GBK encoded characters \.{XY} (\.{X} and \.{Y} are the first and the +second byte of the character) with +\.{\char94 \char94 7fX\char94 \char94 7fZZZ\char94 \char94 7f}, where \.{ZZZ} +represents the second byte as a decimal number. \.{0x7F} is used as an active +character and delimiter. + +Additionally we define a \TeX\ macro at the very beginning to signal a +preprocessed file. + +The following code is very simple. No error detection is done because \TeX\ +which will see the output of \.{extconv} complains loudly if something is +wrong. + +@d banner +"extconv (CJK ver. 4.8.2)" + +@c +#include +#include @# + + +int main(int argc, char *argv[]) + {int ch; + + + fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@# + + ch = fgetc(stdin);@# + + while(!feof(stdin)) + {if(ch >= 0x81 && ch <= 0xFE) + {fprintf(stdout, "\177%c\177", ch);@# + + ch = fgetc(stdin); + if(!feof(stdin)) + fprintf(stdout, "%d\177", ch); + } + else + fputc(ch, stdout);@# + + ch = fgetc(stdin); + } + exit(EXIT_SUCCESS); + return 0; /* never reached */ + } diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex new file mode 100755 index 00000000000..4136537872e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] latex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +extconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.bat b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.bat new file mode 100644 index 00000000000..ccc6c76acd5 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.bat @@ -0,0 +1,3 @@ +call f_name %1 +extconv < %1 > %fd%%fp%%fn%.cjk +latex %fd%%fu%%fn%.cjk diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.cmd b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.cmd new file mode 100644 index 00000000000..7f19637ade8 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbklatex.cmd @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------*\ + gbklatex.cmd + + This file is part of the CJK macro package for LaTeX2e ver. 4.8.2 + + Copyright (C) 1994-2008 Wonkoo Kim + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + Wonkoo Kim (wkim+@pitt.edu), September 2, 1996 +\*----------------------------------------------------------------------*/ + +Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' +Call SysLoadFuncs + +parse arg file + +drive = filespec('drive', file) +path = filespec('path', file) +fname = filespec('name', file) +m = lastpos('.', fname) +if (m = 0) then m = length(fname) + 1 +cjkfile = drive||path||delstr(fname, m)||'.cjk' + +'extconv <' file '>' cjkfile + +ucjkfile = translate(cjkfile,'/','\') +if stream(cjkfile, 'C', 'QUERY EXISTS') \= '' then + 'call latex.cmd' ucjkfile + +/* End of gbklatex.cmd */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbkpdflatex b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbkpdflatex new file mode 100755 index 00000000000..e28761ef423 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/extconv/gbkpdflatex @@ -0,0 +1,43 @@ +#! /bin/sh + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +n=1 +argv= + +# get last argument +while test 1 -lt $#; do + eval argv$n=\$1 + argv="$argv \"\$argv$n\"" + n=`expr $n + 1` + shift +done + +# replace extension with .cjk or append .cjk if there is no extension +tex=$1 +case $tex in +""|*.cjk) + echo >&2 "Usage: $0 [options] pdflatex-file" + exit 1;; +*) + aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; +esac + +extconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" + +# EOF diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.gnu b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.gnu new file mode 100644 index 00000000000..6ecf115b5dd --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.gnu @@ -0,0 +1,127 @@ +# This file is part of the CJK package Version 4.8.2 (29-Dec-2008) + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +# GNU Makefile for hbf2gf + +.PHONY: default all debug documentation clean \ + do_all + +.CAUTIOUS: hbf2gf.c + +default: + @echo " say " + @echo ". " + @echo " make TARGET OS=SYSTEM " + @echo ". " + @echo " SYSTEM can be one of the following: " + @echo ". " + @echo " os2 bound (emx) " + @echo " dos (djgpp) " + @echo ". " + @echo " TARGET can be one of the following: " + @echo ". " + @echo " all debug " + @echo " documentation (needs cweave package)" + @echo " clean " + +ifdef OS + + # default values (bound executables built with emx) + FS = msdos + CC = gcc -Wall -O -DHAVE_EMTEXDIR + LIB = + O = .o + EXE = .exe + RM = del + + ifeq ($(OS),os2) + FS = msdos + CC = gcc -Wall -Zomf -Zmtd -O -DHAVE_EMTEXDIR + LIB = hbf2gf.def + O = .obj + EXE = .exe + RM = del + endif + + ifeq ($(OS),dos) + FS = msdos + CC = gcc -Wall -O -DHAVE_EMTEXDIR + LIB = + O = .o + EXE = .exe + RM = del + endif + + + %$O: %.c + $(CC) $(CFLAGS) -c -D$(FS) -o $@ $< + + %.c: %.w %.ch + $(CTANGLE) $^ $@ + %.c: %.w + $(CTANGLE) $< + + %.tex: %.w %.ch + $(CWEAVE) +ai $^ $@ + %.tex: %.w + $(CWEAVE) +ai $< + + %.dvi: %.tex + $(TEX) $* + + + all: + $(MAKE) -f Makefile.gnu do_all CFLAGS=-s + + debug: + $(MAKE) -f Makefile.gnu do_all CFLAGS=-g + + # this builds the .dvi-file + documentation: hbf2gf.dvi + + # remove the unnecessary files; + clean: + -$(RM) *.scn + -$(RM) *.toc + -$(RM) *.idx + -$(RM) *.log + -$(RM) *.o + + + do_all: hbf2gf$(EXE) + + hbf2gf$(EXE): hbf2gf$O hbf$O emdir$O emtexdir$O + ifeq ($(OS),dos) + $(CC) $(CFLAGS) -o $(basename $@) $^ + strip $(basename $@) + coff2exe $(basename $@) + -del $(basename $@) + else + $(CC) $(CFLAGS) -o $@ $^ $(LIB) + endif + + hbf$O: hbf.c hbf.h + emdir$O: emdir.c emdir.h + emtexdir$O: emtexdir.c emtexdir.h emdir.h + +else # ifdef OS + + all debug documentation clean: default + +endif diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.in b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.in new file mode 100644 index 00000000000..ece2f79c89a --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/Makefile.in @@ -0,0 +1,127 @@ +# Makefile for hbf2gf -- wl@gnu.org + +# Copyright (C) 1994-2008 Werner Lemberg +# +# 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 in doc/COPYING; if not, write to the Free +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301 USA + +VPATH = @srcdir@ +srcdir = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +bindir = @bindir@ +mandir = @mandir@ + +RM = @RM@ +RMF = @RM@ -f + +TEX = tex +CTANGLE = ctangle +CWEAVE = cweave + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ + +CC = @CC@ +CPP = @CPP@ + +MKINSTALLDIRS = $(srcdir)/mkinstalldirs + +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ @no_strdup@ -Dunix +MY_CFLAGS = $(CFLAGS) $(CPPFLAGS) @XX_CFLAGS@ +LDFLAGS = @LDFLAGS@ @LIBS@ + +SRC = hbf2gf.c $(srcdir)/hbf.c +OBJ = hbf2gf.o hbf.o + + +.SUFFIXES: .dvi .tex .w + + +.w.c: + $(CTANGLE) $< +.c.o: + $(CC) -c $(MY_CFLAGS) $< + +.w.tex: + $(CWEAVE) +ai $< + +.tex.dvi: + $(TEX) $< + + + +PROGRAMS = hbf2gf + +default all: $(PROGRAMS) + +hbf2gf.c: $(srcdir)/hbf2gf.w + +hbf2gf: $(OBJ) + $(CC) $(MY_CFLAGS) -o hbf2gf $(OBJ) $(LDFLAGS) + +documentation: hbf2gf.dvi + +install: $(PROGRAMS) + $(MKINSTALLDIRS) $(bindir) $(mandir)/man1 + for P in $(PROGRAMS) ; do \ + $(INSTALL_PROGRAM) $$P $(bindir)/$$P ; \ + $(INSTALL_DATA) $(srcdir)/$$P.1 $(mandir)/man1 ; \ + done + +uninstall: + -for P in $(PROGRAMS) ; do \ + $(RMF) $(bindir)/$$P ; \ + $(RMF) $(mandir)/man1/$$P.1 ; \ + done + +clean: do_clean + +distclean: do_clean + -$(RMF) dep.end $(PROGRAMS) *.dvi + -$(RMF) *~ *.orig core *.core + -$(RMF) config.cache config.log config.status Makefile + +do_clean: + -$(RMF) *.o + -$(RMF) *.scn *.toc *.idx *.log + +maintainer-clean: distclean + -$(RMF) hbf2gf.c + +depend: $(SRC) + (echo '/^#.* PUT NO STUFF BELOW/,$$d'; echo w; echo q) | \ + ed - Makefile + echo '# Dependencies generated by make depend: PUT NO STUFF BELOW' \ + >> Makefile + for file in $(SRC) ; do \ + $(CPP) $(CPPFLAGS) $$file | \ + sed -n -e 's|^# [1-9][0-9]* "\([^/].*\.h\)".*|\1|p' \ + -e 's|^# [1-9][0-9]* "\($(srcdir)/.*\.h\)".*|\1|p' | \ + sed -e 's|/\./|.|g' -e "s/^/`basename $$file .c`.o: /" ; \ + done | \ + sort -u | \ + awk '{ if (LINE == 1) \ + { line = last = $$1 } \ + else if ($$1 != last) \ + { print line ; line = last = $$1 } \ + line = line " " $$2 } \ + END { print line }' >> Makefile + +# Dependencies generated by make depend: PUT NO STUFF BELOW diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/README b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/README new file mode 100644 index 00000000000..a7de0ec1402 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/README @@ -0,0 +1,2 @@ +Additional installation documentation can be found in the files `INSTALL' +(in the top directory) and `doc/hbf2gf.txt'. diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/README b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/README new file mode 100644 index 00000000000..689d59e7397 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/README @@ -0,0 +1,10 @@ +In this directory you find some hbf2gf configuration files for common CJK +bitmap fonts. + +No paths are specified for the HBF files -- under web2c you should add the +path for these fonts to the `MISCFONTS' variable in texmf.cnf; under emTeX +you should set the environment variable `HBFONTS'. + +The font paths used here in the config files of this directory are TDS +compliant; only the `HBF_TARGET' environment variable is used (an example +would be `set HBF_TARGET=/usr/local/TeX/texmf/fonts'). diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5ka12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5ka12.cfg new file mode 100644 index 00000000000..f5c142f0235 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5ka12.cfg @@ -0,0 +1,28 @@ + +hbf_header ntukai48.hbf +mag_x 1 +threshold 128 +comment Big 5 normal 48x48 pixel font scaled and adapted to 12pt + +design_size 12 + +x_offset 2 +y_offset -12 + +nmb_files -1 + +output_name b5ka12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme Big 5 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/ntu/b5ka12/ +tfm_directory $HBF_TARGET/tfm/ntu/b5ka12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5kr12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5kr12.cfg new file mode 100644 index 00000000000..9d9da2c1a2f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5kr12.cfg @@ -0,0 +1,30 @@ + +hbf_header ntukai48.hbf +mag_x 1 +threshold 128 +comment Big 5 normal 48x48 pixel font rotated, scaled and adapted to 12pt + +design_size 12 + +x_offset 2 +y_offset -10 + +rotation yes + +nmb_files -1 + +output_name b5kr12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme Big 5 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/ntu/b5kr12/ +tfm_directory $HBF_TARGET/tfm/ntu/b5kr12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5so12.cfg new file mode 100644 index 00000000000..dc0bcd9fbf0 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/b5so12.cfg @@ -0,0 +1,31 @@ + +hbf_header et24.hbf +mag_x 2.076 +threshold 128 +comment fanti songti 24x24 pixel font magnified and adapted for 12pt + +design_size 12.0 + +x_offset 3 +y_offset -8 + +nmb_files -1 + +output_name b5so12 + +checksum 123456789 + +dpi_x 300 + +tfm_files yes +pk_files no + +coding codingscheme Big 5 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/eten/b5so12/ +tfm_directory $HBF_TARGET/tfm/eten/b5so12/ + + rm_command del + cp_command copy + long_extension no + job_extension .cmd diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c1so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c1so12.cfg new file mode 100644 index 00000000000..de5b32b3efc --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c1so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-1.hbf +mag_x 1 +threshold 128 +comment CNS plane 1 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c1so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 1 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c1so12/ +tfm_directory $HBF_TARGET/tfm/cns/c1so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c2so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c2so12.cfg new file mode 100644 index 00000000000..969af8fae14 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c2so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-2.hbf +mag_x 1 +threshold 128 +comment CNS plane 2 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c2so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 2 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c2so12/ +tfm_directory $HBF_TARGET/tfm/cns/c2so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c3so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c3so12.cfg new file mode 100644 index 00000000000..0e65768ee5e --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c3so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-3.hbf +mag_x 1 +threshold 128 +comment CNS plane 3 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c3so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 3 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c3so12/ +tfm_directory $HBF_TARGET/tfm/cns/c3so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c4so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c4so12.cfg new file mode 100644 index 00000000000..8ea3a8b270c --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c4so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-4.hbf +mag_x 1 +threshold 128 +comment CNS plane 4 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c4so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 4 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c4so12/ +tfm_directory $HBF_TARGET/tfm/cns/c4so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c5so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c5so12.cfg new file mode 100644 index 00000000000..1b81c90a0d3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c5so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-5.hbf +mag_x 1 +threshold 128 +comment CNS plane 5 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c5so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 5 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c5so12/ +tfm_directory $HBF_TARGET/tfm/cns/c5so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c6so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c6so12.cfg new file mode 100644 index 00000000000..5b9c912ce53 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c6so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-6.hbf +mag_x 1 +threshold 128 +comment CNS plane 6 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c6so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 6 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c6so12/ +tfm_directory $HBF_TARGET/tfm/cns/c6so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c7so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c7so12.cfg new file mode 100644 index 00000000000..051b2601426 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/c7so12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-7.hbf +mag_x 1 +threshold 128 +comment CNS plane 7 song 40x40 pixel font scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name c7so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme CNS plane 7 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/c7so12/ +tfm_directory $HBF_TARGET/tfm/cns/c7so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/csso12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/csso12.cfg new file mode 100644 index 00000000000..9ad91b0c574 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/csso12.cfg @@ -0,0 +1,28 @@ + +hbf_header cns40-b5.hbf +mag_x 1 +threshold 128 +comment CNS song 40x40 pixel font (Bg5 encoded) scaled and adapted to 12pt + +design_size 12.0 + +x_offset 2 +y_offset -8 + +nmb_files -1 + +output_name csso12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme Big 5 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/cns/csso12/ +tfm_directory $HBF_TARGET/tfm/cns/csso12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/gsfs14.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/gsfs14.cfg new file mode 100644 index 00000000000..4b397aca464 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/gsfs14.cfg @@ -0,0 +1,27 @@ + +hbf_header jfs56.hbf +mag_x 1 +threshold 128 +comment jianti fansongti 56x56 pixel font scaled and adapted to 14.4pt + +design_size 14.4 + +y_offset -13 + +nmb_files -1 + +output_name gsfs14 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme GuoBiao encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/ccdos/gsfs14/ +tfm_directory $HBF_TARGET/tfm/ccdos/gsfs14/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/j2so12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/j2so12.cfg new file mode 100644 index 00000000000..7e0d70b5c0f --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/j2so12.cfg @@ -0,0 +1,30 @@ + +hbf_header jisksp40.hbf +mag_x 1.0 +threshold 128 +comment supplemental kanji normal 40x40 pixel font scaled and adapted to 12pt + +design_size 12 + +min_char 0x2121 + +x_offset 2 +y_offset -7 + +nmb_files -1 + +output_name j2so12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme JIS2 encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/jisx0212/j2so12/ +tfm_directory $HBF_TARGET/tfm/jisx0212/j2so12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/jsso12.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/jsso12.cfg new file mode 100644 index 00000000000..9bdfc7b1e8a --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/jsso12.cfg @@ -0,0 +1,28 @@ + +hbf_header kanji48.hbf +mag_x 0.83 +threshold 128 +comment kanji normal 48x48 pixel font scaled and adapted to 12pt + +design_size 12 + +x_offset 2 +y_offset -7 + +nmb_files -1 + +output_name jsso12 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme JIS encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/jisx0208/jsso12/ +tfm_directory $HBF_TARGET/tfm/jisx0208/jsso12/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/ksso17.cfg b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/ksso17.cfg new file mode 100644 index 00000000000..c82f7e7eee4 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/cfg/ksso17.cfg @@ -0,0 +1,27 @@ + +hbf_header hanja65.hbf +mag_x 1 +threshold 128 +comment hanja normal 65x65 pixel font scaled and adapted to 17.28pt + +design_size 17.28 + +y_offset -16 + +nmb_files -1 + +output_name ksso17 + +checksum 123456789 + +dpi_x 300 + +pk_files no +tfm_files yes + + long_extension no + +coding codingscheme KS encoded TeX text + +pk_directory $HBF_TARGET/pk/modeless/ksc5601/ksso17/ +tfm_directory $HBF_TARGET/tfm/ksc5601/ksso17/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/configure.ac b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/configure.ac new file mode 100644 index 00000000000..2cd5796a51a --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/configure.ac @@ -0,0 +1,131 @@ +dnl This file is part of the CJK package ver. 4.8.2 + +dnl Copyright (C) 1994-2008 Werner Lemberg + +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. + +dnl You should have received a copy of the GNU General Public License +dnl along with this program in doc/COPYING; if not, write to the Free +dnl Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +dnl MA 02110-1301 USA + +dnl Process this file with autoconf to produce a configure script. +AC_INIT +AC_CONFIG_SRCDIR([hbf.h]) + + +dnl check host +AC_CANONICAL_TARGET([]) + + +dnl Checks for programs. +AC_PROG_CC + + +dnl Checks for header files. +AC_HEADER_STDC + +AC_ARG_WITH(kpathsea-include, + [ --with-kpathsea-include=DIR + location of the kpathsea include dir],[ + if test x$withval = xyes; then + AC_MSG_WARN(Usage is: --with-kpathsea-include=includedir) + else + if test x$withval = xno; then + AC_MSG_WARN(Usage is: --with-kpathsea-include=includedir) + else + kpathsea_include=$withval + fi + fi +]) + + +dnl Checks for libraries. +AC_ARG_WITH(kpathsea-lib, + [ --with-kpathsea-lib=DIR + location of the kpathsea lib dir],[ + if test x$withval = xyes; then + AC_MSG_WARN(Usage is: --with-kpathsea-lib=libdir) + else + if test x$withval = xno; then + AC_MSG_WARN(Usage is: --with-kpathsea-lib=libdir) + else + kpathsea_lib=$withval + fi + fi +]) + + +if test -n "$kpathsea_include" -o -n "$kpathsea_lib"; then + LIBS="$LIBS -L$kpathsea_lib" + CPPFLAGS="$CPPFLAGS -I$kpathsea_include -I$srcdir" + + dnl the function kpse_set_program_name() is available since kpathsea 3.2 + AC_CHECK_LIB(kpathsea, kpse_set_program_name, , AC_DEFINE(OLD_KPATHSEA)) + + AC_CHECK_LIB(kpathsea, kpse_init_prog, ,[ + AC_MSG_ERROR([Can't find kpathsea library! Use --with-kpathsea-lib option.])]) + + dnl the header file kpathsea.h doesn't exist in kpathsea 2.6 and before + AC_CHECK_HEADER(kpathsea/kpathsea.h, , AC_DEFINE(VERY_OLD_KPATHSEA)) + + AC_CHECK_HEADER(kpathsea/c-auto.h, ,[ + AC_MSG_ERROR([Can't find kpathsea include files! Use --with-kpathsea-include option.])]) +else + CPPFLAGS="$CPPFLAGS -I$srcdir" +fi + + +dnl Get compiler flags right. +if test "x$CC" = xgcc; then + XX_CFLAGS="-Wall" +else + case "$host" in + alpha-dec-osf*) + XX_CFLAGS="-std1 -O2 -g3" + ;; + *) + XX_CFLAGS= + ;; + esac +fi +AC_SUBST(XX_CFLAGS) + + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_STRUCT_TM + + +dnl Checks for library functions. +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(strdup strstr strtol strtoul) + +dnl we need this for hbf.c +if test "x$ac_cv_func_strdup" = xno; then + no_strdup=-DNO_STRDUP +fi +AC_SUBST(no_strdup) + +AC_CHECK_PROG(RM, rm, rm) +AC_PROG_INSTALL + +if test -z "$kpathsea_include" -a -z "$kpathsea_lib"; then + AC_MSG_WARN([ + + hbf2gf will be compiled without file search library support! + For kpathsea support use the --with-kpathsea-lib and + --with-kpathsea-include options. + ]) +fi + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/dvidrv.btm b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/dvidrv.btm new file mode 100644 index 00000000000..daeba96f01c --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/dvidrv.btm @@ -0,0 +1,352 @@ +setdos /y1 +:: +:: Copyright (C) 1994-2008 Werner Lemberg +:: +:: 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 in doc/COPYING; if not, write to the Free +:: Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +:: MA 02110-1301 USA +:: +:: +:: This is dvidrv.btm, a batch file for 4DOS/4OS2 written by +:: Werner Lemberg partially based on the +:: dvidrv.btm file of the 4allTeX package written by Phons Bloemen. +:: +:: It is a replacement for dvidrv.exe of the emTeX package. +:: +:: Additional features: support of ps2pk +:: support of ttf2pk +:: support of hbf2gf for HBFs (Hanzi bitmap fonts) +:: +:: Only quadratic printer modes are supported for ttf2pk! +:: +:: All needed binaries will be searched in the path. + +iff %# lt 2 then + echo `` + echo Usage: %0 dvi-driver dvi-file [parameters] + quit +endiff + +setlocal + :: we set a default value only if the corresponding environment variable + :: is empty. The `=' must follow the variable name immediately. + alias set_def `iff "%[%@word["=",0,%1]]" eq "" then %+ set %& %+ endiff` + + :: ========================================= + :: ======== User defined variables. ======== + :: ========================================= + :: + :: Can be overridden in the environment (except %ps2pk, %ttf2pk, %hbf2gf, + :: %pre_dpi, and %post_dpi). + + :: Comment out the programs you don't want to use. + set ps2pk=yes + set ttf2pk=yes + set hbf2gf=yes + + :: where the PK files will be installed created by ps2pk, ttf2pk, and + :: hbf2gf. + :: dvidrv.btm adds `\modeless\XXXdpi' to this string (see below for the + :: exact string). + set_def pkdir=%emtexdir\pixel\tmp\pk + + :: where the TrueType fonts reside. + set_def ttfonts=%emtexdir\fonts\truetype + :: where auxiliary files of ttf2pk are located. + set_def ttfcfg=%emtexdir\ttf2pk + + :: where the HBF files reside. + set_def hbfonts=%emtexdir\fonts\hbf + :: where the hbf2gf config files are. + set_def hbfcfg=%emtexdir\hbf2gf + + :: the dpi-subdirectory has various forms; the most common are XXXdpi and + :: dpiXXX, e.g. 300dpi and dpi300. Here we define two variables which + :: control this behaviour. + :: [dpiXXX is used for TDS compatible TeX trees.] + set pre_dpi=dpi + set post_dpi= + + :: ================================================ + :: ======== End of user defined variables. ======== + :: ================================================ + + :: the base name for log files etc. + set basename=%@name[%1] + + :: do we run dvips? + iff "%basename" ne "dvips" then + goto nodvips1 + endiff + + :: we delete dvips.mfj if it exists. + del dvips.mfj >& nul + + :: now we run dvips with all supplied parameters. + %& + + :: do we have to generate fonts? + iff exist dvips.mfj then + goto generate_fonts + endiff + + :: else all is done. + goto end + + +:nodvips1 + :: here we call the dvi driver with all supplied parameters. + %& -pj:%basename.mfj + + :: do we have to generate fonts? + iff errorlevel 8 then + goto generate_fonts + endiff + + :: else all is done. + goto end + + +:generate_fonts + gosub call_mfjob + + :: do we run dvips? + iff "%basename" ne "dvips" then + goto nodvips2 + endiff + + :: we now call dvips a second time + %& + + :: since no fonts will be generated in the second run we remove dvips.mfj + del dvips.mfj >& nul + + goto end + + +:nodvips2 + :: we call the dvi driver a second time (without font generation). + %& -pj -fm + + del %basename.mfj >& nul + + goto end + + +:: this is the main subroutine which calls mfjob and then parses the mfjob +:: file for fonts which can be handled by ps2pk, ttf2pk, or hbf2gf. +:call_mfjob + :: this alias prints a message on the screen and writes it into the logfile. + alias echolog=`echo %& | tee /a %basename.mlg` + + echo ======== DVIDRV.BTM logfile ======== > %basename.mlg + echo Commandline: dvidrv.btm %& >> %basename.mlg + echo `` >> %basename.mlg + echo basename=%basename >> %basename.mlg + echo emtexdir=%emtexdir >> %basename.mlg + echo dvidrvfonts=%dvidrvfonts >> %basename.mlg + echo mfinput=%mfinput >> %basename.mlg + echo mfjobopt=%mfjobopt >> %basename.mlg + echo textfm=%textfm >> %basename.mlg + echo psfonts=%psfonts >> %basename.mlg + echo ttfonts=%ttfonts >> %basename.mlg + echo ttfcfg=%ttfcfg >> %basename.mlg + echo hbfonts=%hbfonts >> %basename.mlg + echo hbfcfg=%hbfcfg >> %basename.mlg + echo `` >> %basename.mlg + + iff "%@search[mfjob]" eq "" then + echolog MFJOB not found in the path. + echolog Can't generate PK fonts from METAFONT automatically. + echo `` + quit + endiff + + :: now we call mfjob. + echolog mfjob %mfjobopt -g%basename.mfl %basename.mfj + mfjob %mfjobopt -g%basename.mfl %basename.mfj + iff %? gt 0 then + echolog `` + echolog Something went wrong while running METAFONT. + echolog Look into the log files... + echolog `` + endiff + + :: after running mfjob we scan the mfjob input file for fonts which can + :: be handled by ps2pk, ttf2pk or hbf2gf. + set lnnr=0 + set totlines=%@lines[%basename.mfj] + + do while %lnnr le %totlines + :: input a line. + set scratch=%@line[%basename.mfj,%lnnr] + set lnnr=%@inc[%lnnr] + + :: get resolutions (METAFONT mode will be ignored). + :: example: + :: mode=lqlores[180 180]; + iff %@index[%scratch,mode] ge 0 then + set temp=%@word["[]",1,%scratch] + set xdpi=%@word[0,%temp] + set ydpi=%@word[1,%temp] + endiff + + :: get fontname and magnification; we then compute the font resolutions + :: (rounded to the nearest integer---there is no necessity to adjust + :: these values further because of possible rounding errors since both + :: emTeX's dvi drivers and dvips check neighbored values too). + :: example: + :: {font=cmr10; mag=0.5;} + iff %@index[%scratch,{font] ge 0 then + set testfont=%@word["=;",1,%scratch] + set temp=%@word["=;",3,%scratch] + :: we use highest arithmetic precision for these calculations. + :: Additionally we write 1/2 instead of 0.5 to avoid problems with + :: countries which use a comma instead of a colon as the decimal + :: separator. + set fontresx=%@int[%@eval[%xdpi*%temp+1/2=8]] + set fontresy=%@int[%@eval[%ydpi*%temp+1/2=8]] + set pksubdir=modeless\%[pre_dpi]%[fontresx]%post_dpi + + set success=0 + + :: check whether %testfont leads to a PS font (we call ps2pkmfj). + iff %success == 0 .and. "%ps2pk" ne "" then + gosub call_ps2pk + endiff + + :: check whether %testfont leads to a TrueType font. + iff %success == 0 .and. "%ttf2pk" ne "" then + gosub call_ttf2pk + endiff + + :: check whether %testfont leads to a HBF file. + iff %success == 0 .and. "%hbf2gf" ne "" then + gosub call_hbf2gf + endiff + endiff + enddo + + iff exist %basename.mfp then + echo `` >> %basename.mlg + echo `` >> %basename.mlg + echo ======== PS2PK logfile ======== >> %basename.mlg + echo `` >> %basename.mlg + type %basename.mfp >> %basename.mlg + echo `` >> %basename.mlg + del %basename.mfp >& nul + endiff + + iff exist %basename.mfl then + echo `` >> %basename.mlg + type %basename.mfl >> %basename.mlg + echo `` >> %basename.mlg + del %basename.mfl >& nul + endiff + + return + + +:call_ttf2pk + iff "%@search[ttf2pk]" eq "" then + echolog TTF2PK not found in the path. + echolog Can't generate PK fonts from TrueType fonts automatically. + echo `` + quit + endiff + + echolog ttf2pk -q -n %testfont %fontresx + ttf2pk -q -n %testfont %fontresx + + iff %? == 0 then + echolog Font %pkdir\%pksubdir\%testfont.pk generated. + mkdir /s %pkdir\%pksubdir >& nul + move %testfont.pk %pkdir\%pksubdir >& nul + set success=1 + elseiff %? == 2 then + echolog (%lnnr/%totlines): Font %testfont is no TrueType font. + set success=0 + else + echolog Error running TTF2PK for font %testfont! + endiff + + return + + +:call_hbf2gf + iff "%@search[hbf2gf]" eq "" then + echolog HBF2GF not found in the path. + echolog Can't generate PK fonts from HBF files automatically. + echo `` + quit + endiff + + echolog hbf2gf -q -p -n %testfont %fontresx %fontresy + hbf2gf -q -p -n %testfont %fontresx %fontresy + + iff %? == 0 then + echolog Font %pkdir\%pksubdir\%testfont.pk generated. + mkdir /s %pkdir\%pksubdir >& nul + gftopk %testfont.gf %testfont.pk + move %testfont.pk %pkdir\%pksubdir >& nul + del %testfont.gf >& nul + set success=1 + elseiff %? == 2 then + echolog (%lnnr/%totlines): Font %testfont is no HBF. + set success=0 + else + echolog Error running HBF2GF for font %testfont! + endiff + + return + + +:call_ps2pk + iff not exist %pkdir\%pksubdir\%testfont.pk then + iff "%@search[ps2pkmfj]" eq "" .or. "%@search[ps2pk]" eq "" then + echolog PS2PKMFJ and/or PS2PK not found in the path. + echolog Can't generate PK fonts from PostScript fonts automatically. + echo `` + quit + endiff + + echolog ps2pkmfj -X%fontresx -Y%fontresy %testfont %testfont.pk + ps2pkmfj -X%fontresx -Y%fontresy %testfont %testfont.pk | input %%pspkline + + iff errorlevel != 1 then + %pspkline >> %basename.mfp + iff %? == 0 then + echolog Font %pkdir\%pksubdir\%testfont.pk generated. + mkdir /s %pkdir\%pksubdir >& nul + move %testfont.pk %pkdir\%pksubdir >& nul + success=1 + else + echolog Error running PS2PK for font %testfont! + endiff + else + echolog (%lnnr/%totlines): Font %testfont is no PS font. + success=0 + endiff + else + echolog Font %pkdir\%pksubdir\%testfont.pk already exists. + endiff + + return + + +:end + +endlocal + +:: ==== end of dvidrv.btm ==== diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.c new file mode 100644 index 00000000000..4e759c83eb2 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.c @@ -0,0 +1,109 @@ +/* emdir.c -- Written by Eberhard Mattes, donated to the public domain */ + +#include "emdir.h" + +#ifdef OS2 + +#undef HPS +#define INCL_DOSFILEMGR +#include +#include + +#define FHDIR(b) (*(HDIR *)(b)->reserved) + +static void fconv (struct ll_findbuffer *dst, const FILEFINDBUF *src) +{ + dst->attr = src->attrFile; + dst->time = *(unsigned *)&src->ftimeLastWrite; + dst->date = *(unsigned *)&src->fdateLastWrite; + dst->size = src->cbFile; + strcpy (dst->name, src->achName); +} + + +int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) +{ + USHORT rc; + ULONG count; + HDIR hdir; + FILEFINDBUF ffbuf; + + hdir = HDIR_CREATE; + count = 1; + rc = DosFindFirst ((PSZ)path, &hdir, attr, &ffbuf, sizeof (ffbuf), + &count, 0L); + if (rc != 0 || count != 1) + return 0; + FHDIR (buffer) = hdir; + fconv (buffer, &ffbuf); + return 1; +} + + +int ll_findnext (struct ll_findbuffer *buffer) +{ + USHORT rc; + ULONG count; + HDIR hdir; + FILEFINDBUF ffbuf; + + hdir = FHDIR (buffer); + count = 1; + rc = DosFindNext (hdir, &ffbuf, sizeof (ffbuf), &count); + if (rc != 0 || count != 1) + { + DosFindClose (hdir); + return 0; + } + fconv (buffer, &ffbuf); + return 1; +} + + +#elif defined(DJGPP) + +/* djgpp support by Hartmut Schirmer (hsc@techfak.uni-kiel.de), May 30, 1997 */ + +#include +#include + +static int ll_attr = 0; +int ll_findnext (struct ll_findbuffer *buffer) +{ + int res; + do { + res = _dos_findnext ((struct find_t *)buffer); + if (res != 0) return 0; + } while ( (buffer->attrib&ll_attr) == 0); + return 1; +} + +int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) +{ + int res; + ll_attr = attr; + res = _dos_findfirst((char *)path, attr, (struct find_t *)buffer); + if (res != 0) return 0; + if ( (buffer->attrib&ll_attr) == 0) + return ll_findnext(buffer); + return 1; +} + +#elif !defined(__EMX__) /* if not OS2 nor DJGPP nor __EMX__ defined */ + +/* Not tested */ + +#include + +int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) +{ + return _dos_findfirst (path, attr, (struct find_t *)buffer) == 0; +} + + +int ll_findnext (struct ll_findbuffer *buffer) +{ + return _dos_findnext ((struct find_t *)buffer) == 0; +} + +#endif diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.h b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.h new file mode 100644 index 00000000000..0606d476ab1 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emdir.h @@ -0,0 +1,25 @@ +/* emdir.h -- Written by Eberhard Mattes, donated to the public domain */ + +#if defined(DJGPP) + +/* djgpp support by Hartmut Schirmer (hsc@techfak.uni-kiel.de), May 30, 1997 */ +#include +#define ll_findbuffer find_t +#define attr attrib + +#else + +struct ll_findbuffer +{ + char reserved[21]; + unsigned char attr; + unsigned time; + unsigned date; + long size; + char name[257]; +}; + +#endif + +int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer); +int ll_findnext (struct ll_findbuffer *buffer); diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.c new file mode 100644 index 00000000000..9a35570adb3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.c @@ -0,0 +1,405 @@ +/* emtexdir.c -- written by Eberhard Mattes, donated to the public domain */ + +#if defined (__EMX__) +#include +#else +#include "emdir.h" +#endif +#if defined(DJGPP) || defined(GO32) +#include +#endif +#include +#include +#include +#include +#include "emtexdir.h" + +#define FALSE 0 +#define TRUE 1 + +void (*emtex_dir_find_callback)(const char *name, int ok) = NULL; + +static int setup_add (struct emtex_dir *dst, const char *path) +{ + char *p; + + if (dst->used >= dst->alloc) + { + dst->alloc += 8; + dst->list = realloc (dst->list, dst->alloc * sizeof (*dst->list)); + if (dst->list == NULL) + return (FALSE); + } + p = strdup (path); + if (p == NULL) + return (FALSE); + dst->list[dst->used++] = p; + return (TRUE); +} + + +static int setup_subdir (struct emtex_dir *dst, char *path, size_t add, + unsigned flags, int recurse) +{ + int ok, i, end, len; +#if defined (__EMX__) + struct _find find; +#else + struct ll_findbuffer find; +#endif + + i = dst->used; + strcpy (path + add, "*.*"); +#if defined (__EMX__) + ok = __findfirst (path, 0x10, &find) == 0; +#else + ok = ll_findfirst (path, 0x10, &find); +#endif + while (ok) + { + if ((find.attr & 0x10) + && !(strcmp (find.name, ".") == 0 || strcmp (find.name, "..") == 0)) + { + len = strlen (find.name); + memcpy (path + add, find.name, len); + path[add+len] = '\\'; + path[add+len+1] = 0; + if (!setup_add (dst, path)) + return (FALSE); + } +#if defined (__EMX__) + ok = __findnext (&find) == 0; +#else + ok = ll_findnext (&find); +#endif + } + if (recurse) + { + end = dst->used; + while (i < end) + { + strcpy (path, dst->list[i]); + if (!setup_subdir (dst, path, strlen (path), flags, TRUE)) + return (FALSE); + ++i; + } + } + return (TRUE); +} + + +static int setup_dir (struct emtex_dir *dst, char *path, + const char *base_dir, size_t base_dir_len, + const char *sub_dir, + unsigned flags) +{ + size_t i, len; + + memcpy (path, base_dir, base_dir_len); + i = base_dir_len; + if ((flags & EDS_BANG) && sub_dir == NULL) + { + flags &= ~(EDS_ONESUBDIR|EDS_ALLSUBDIR); + if (i >= 2 && path[i-1] == '!' && path[i-2] == '!') + { + flags |= EDS_ALLSUBDIR; + i -= 2; + } + else if (i >= 1 && path[i-1] == '!') + { + flags |= EDS_ONESUBDIR; + --i; + } + } + if (sub_dir != NULL && *sub_dir != 0) + { + if (i != 0 && path[i-1] != ':' && path[i-1] != '/' && path[i-1] != '\\') + path[i++] = '\\'; + len = strlen (sub_dir); + memcpy (path+i, sub_dir, len); + i += len; + } + if (path[i-1] != ':' && path[i-1] != '/' && path[i-1] != '\\') + path[i++] = '\\'; + path[i] = 0; + if (!setup_add (dst, path)) + return (FALSE); + if (flags & EDS_ALLSUBDIR) + return (setup_subdir (dst, path, i, flags, TRUE)); + else if (flags & EDS_ONESUBDIR) + return (setup_subdir (dst, path, i, flags, FALSE)); + else + return (TRUE); +} + + +/*static */int setup_list (struct emtex_dir *dst, char *path, + const char *list, unsigned flags) +{ + const char *end; + size_t i; + + for (;;) + { + while (*list == ' ' || *list == '\t') + ++list; + if (*list == 0) + return (TRUE); + end = list; + while (*end != 0 && *end != ';') + ++end; + i = end - list; + while (i > 0 && (list[i-1] == ' ' || list[i-1] == '\t')) + --i; + if (i != 0 && !setup_dir (dst, path, list, i, NULL, flags)) + return (FALSE); + if (*end == 0) + return (TRUE); + list = end + 1; + } +} + + +int emtex_dir_setup (struct emtex_dir *ed, const char *env, const char *dir, + unsigned flags) +{ + const char *val; + char path[260]; + + ed->alloc = 0; + ed->used = 0; + ed->list = NULL; + if (env != NULL && (val = getenv (env)) != NULL) + return (setup_list (ed, path, val, flags)); + else if ((val = getenv ("EMTEXDIR")) != NULL) + return (setup_dir (ed, path, val, strlen (val), dir, flags)); + else + return (setup_dir (ed, path, "\\emtex", 6, dir, flags)); +} + + +static void pretty (char *path, unsigned flags) +{ + char *p; + + if (flags & EDF_FSLASH) + for (p = path; *p != 0; ++p) + if (*p == '\\') + *p = '/'; +} + + +#define ADDCHAR(C) \ + if (dst_size < 1) return (EDT_TOOLONG); \ + *dst++ = (C); --dst_size + +int emtex_dir_trunc (char *dst, size_t dst_size, const char *src, + unsigned flags, int method) +{ + int len, truncated, dot; + + if (src[0] != 0 && src[1] == ':') + { + ADDCHAR (src[0]); + ADDCHAR (src[1]); + src += 2; + } + + truncated = FALSE; dot = FALSE; len = 0; + for (;;) + { + switch (*src) + { + case 0: + ADDCHAR (0); + return (truncated ? EDT_CHANGED : EDT_UNCHANGED); + + case ':': + return (EDT_INVALID); + + case '/': + case '\\': + ADDCHAR (*src); + len = 0; dot = FALSE; + break; + + case '.': + if (dot) + return (EDT_INVALID); + ADDCHAR (*src); + + /* ".." is allowed -- don't return EDT_INVALID for the next + dot. */ + + if (!(len == 0 && src[1] == '.' + && (src[2] == 0 || src[2] == '/' || src[2] == '\\'))) + { + len = 0; dot = TRUE; + } + break; + + default: + if (dot && len == 3) + truncated = TRUE; + else if (!dot && len == 8) + { + truncated = TRUE; + if (method == 0) + { + dst[-3] = dst[-2]; + dst[-2] = dst[-1]; + dst[-1] = *src; + } + } + else + { + ADDCHAR (*src); + ++len; + } + break; + } + ++src; + } +} + + +static int find2 (const char *name, unsigned flags) +{ + int ok; + + ok = (access (name, 4) == 0); + if (flags & EDF_TRACE) + emtex_dir_find_callback (name, ok); + return (ok); +} + + +static int find1 (char *path, size_t path_size, const char *dir, + const char *fname, unsigned flags) +{ + char buf[260]; + int method, rc; + size_t len, tmp; + + len = 0; + if (dir != NULL) + { + tmp = strlen (dir); + if (tmp >= sizeof (buf)) + return (FALSE); + memcpy (buf, dir, tmp); + len = tmp; + } + tmp = strlen (fname); + if (len + tmp >= sizeof (buf)) + return (FALSE); + memcpy (buf + len, fname, tmp + 1); + len += tmp; +#if 0 /* wkim */ +/* disabled for Win95's long file name support */ +/* -- Wonkoo Kim (wkim+@pitt.edu), May 18, 1997 */ + if (_osmode == DOS_MODE) + { + rc = emtex_dir_trunc (path, path_size, buf, flags, EDT_5_PLUS_3); + if ((rc == EDT_UNCHANGED || rc == EDT_CHANGED) && find2 (path, flags)) + { + pretty (path, flags); + return (TRUE); + } + rc = emtex_dir_trunc (path, path_size, buf, flags, EDT_8); + if (rc == EDT_CHANGED && find2 (path, flags)) + { + pretty (path, flags); + return (TRUE); + } + return (FALSE); + } + else +#endif /* wkim */ + { + if (len < path_size && find2 (buf, flags)) + { + memcpy (path, buf, len + 1); + pretty (path, flags); + return (TRUE); + } + for (method = 0; method < 2; ++method) + { + rc = emtex_dir_trunc (path, path_size, buf, flags, method); + if (rc == EDT_CHANGED && find2 (path, flags)) + { + pretty (path, flags); + return (TRUE); + } + } + return (FALSE); + } +} + + +int emtex_dir_find (char *path, size_t path_size, + const struct emtex_dir *ed, + const char *fname, unsigned flags) +{ + int i, absp; + const char *p; + + absp = FALSE; + for (p = fname; *p != 0; ++p) + if (*p == ':' || *p == '/' || *p == '\\') + { + absp = TRUE; + break; + } + + if (absp) + return (find1 (path, path_size, NULL, fname, flags)); + + if ((flags & EDF_CWD) && find1 (path, path_size, NULL, fname, flags)) + return (TRUE); + + for (i = 0; i < ed->used; ++i) + if (find1 (path, path_size, ed->list[i], fname, flags)) + return (TRUE); + return (FALSE); +} + + +#if defined (TEST) + +#include + +int main (int argc, char *argv[]) +{ + struct emtex_dir ed; + int i; + unsigned flags1, flags2; + char path[260]; + + if (argc != 6) + { + puts ("Usage: emtexdir "); + return (1); + } + + flags1 = (unsigned)strtol (argv[1], NULL, 0); + flags2 = (unsigned)strtol (argv[2], NULL, 0); + + if (!emtex_dir_setup (&ed, argv[3], argv[4], flags1)) + { + fputs ("emtex_dir_setup failed\n", stderr); + return (2); + } + + printf ("Directories:\n"); + for (i = 0; i < ed.used; ++i) + printf (" %s\n", ed.list[i]); + + if (!emtex_dir_find (path, sizeof (path), &ed, argv[5], flags2)) + puts ("File not found"); + else + printf ("Path: %s\n", path); + return (0); +} + +#endif diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.h b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.h new file mode 100644 index 00000000000..a9a986db05b --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/emtexdir.h @@ -0,0 +1,57 @@ +/* emtexdir.h -- written by Eberhard Mattes, donated to the public domain */ + +#if !defined (_EMTEXDIR_H) +#define _EMTEXDIR_H + +#if defined (__cplusplus) +extern "C" { +#endif + + +/* Flags for emtex_dir_setup */ + +#define EDS_ONESUBDIR 0x0001 +#define EDS_ALLSUBDIR 0x0002 +#define EDS_BANG 0x0004 + +/* Flags for emtex_dir_find */ + +#define EDF_CWD 0x0001 +#define EDF_FSLASH 0x0002 +#define EDF_TRACE 0x8000 + +/* Methods for emtex_dir_trunc */ + +#define EDT_5_PLUS_3 0 /* 5+3.3 */ +#define EDT_8 1 /* 8.3 */ + +/* Return values for emtex_dir_trunc */ + +#define EDT_UNCHANGED 0 /* Path name not changed */ +#define EDT_CHANGED 1 /* Path name truncated */ +#define EDT_TOOLONG 2 /* Path name too long */ +#define EDT_INVALID 3 /* Path name invalid */ + +struct emtex_dir +{ + char **list; + int used; + int alloc; +}; + +extern void (*emtex_dir_find_callback)(const char *name, int ok); + +int emtex_dir_setup (struct emtex_dir *ed, const char *env, const char *dir, + unsigned flags); + +int emtex_dir_find (char *path, size_t path_size, const struct emtex_dir *ed, + const char *fname, unsigned flags); + +int emtex_dir_trunc (char *dst, size_t dst_size, const char *src, + unsigned flags, int method); + +#if defined (__cplusplus) +} +#endif + +#endif /* !defined (_EMTEXDIR_H) */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.c new file mode 100644 index 00000000000..6056555d704 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.c @@ -0,0 +1,1496 @@ +/* + * Copyright 1993,1994,1995,2005 by Ross Paterson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. 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. + * + * + * Ross Paterson + * 17 October 1995 + * + * The following people have supplied bug fixes: + * + * Simon Chow + * Fung Fung Lee + * Man-Chi Pong + * Steven Simpson + * Charles Wang + * Werner Lemberg + * + * Ross no longer maintains this code. Please send bug reports to + * Werner Lemberg . + * + */ + +/* + * Two C interfaces to HBF files. + * + * The multiple interfaces make this code rather messy; I intend + * to clean it up as experience is gained on what is really needed. + * + * There are also two modes of operation: + * - the default is to read each bitmap from its file as demanded + * - if IN_MEMORY is defined, the whole bitmap file is held in memory. + * In this case, if running under Unix, the bitmap files may be gzipped + * (but the filename used in the HBF file should be the name of the + * file before it was gzipped). + */ +#include +#include +#include +#include +#include +#include "hbf.h" + +#ifdef __MSDOS__ +#define msdos +#endif + +/* + * if the linker complains about an unresolved identifier '_strdup', + * uncomment the following definition. + */ +/* #define NO_STRDUP */ + +#ifdef __STDC__ +# define _(x) x +#else +# define _(x) () +#endif + +#define reg register + +typedef int bool; +#define TRUE 1 +#define FALSE 0 + +#define Bit(n) (1<<(7 - (n))) + +/* + * Messy file system issues + */ + +#ifdef unix +#define PATH_DELIMITER ':' +#define RelativeFileName(fn) ((fn)[0] != '/') +#define LocalFileName(fn) (strchr(fn, '/') == NULL) +#endif /* unix */ +#ifdef msdos +#define PATH_DELIMITER ';' +#define HasDrive(fn) (isalpha((fn)[0]) && (fn)[1] == ':') +#ifdef __EMX__ +#define RelativeFileName(fn) (! HasDrive(fn) && \ + !((fn)[0] == '\\' || (fn)[0] == '/')) +#define LocalFileName(fn) (! HasDrive(fn) && \ + strchr(fn, '\\') == NULL && \ + strchr(fn, '/') == NULL) +#else +#define RelativeFileName(fn) (! HasDrive(fn) && (fn)[0] != '\\') +#define LocalFileName(fn) (! HasDrive(fn) && strchr(fn, '\\') == NULL) +#endif /* __EMX__ */ +#define READ_BINARY "rb" +#endif /* msdos */ +#ifdef vms +#define PATH_DELIMITER ',' +#define RelativeFileName(fn) (strchr(fn, ':') == NULL && ((fn)[0] != '[' || (fn)[1] == '.' || (fn)[1] == '-')) +#define LocalFileName(fn) (strchr(fn, ':') == NULL && strchr(fn, ']') == NULL) +#endif + +#ifndef RelativeFileName +#define RelativeFileName(fn) FALSE +#endif + +#ifndef LocalFileName +#define LocalFileName(fn) FALSE +#endif + +#ifndef READ_BINARY +#define READ_BINARY "r" +#endif + +#define MAX_FILENAME 1024 + +/* + * Internal structures + */ + +typedef unsigned char byte; + +#define PROPERTY struct _PROPERTY +#define BM_FILE struct _BM_FILE +#define B2_RANGE struct _B2_RANGE +#define CODE_RANGE struct _CODE_RANGE + +PROPERTY { + char *prop_name; + char *prop_value; + PROPERTY *prop_next; +}; + +BM_FILE { + char *bmf_name; +#ifdef IN_MEMORY + byte *bmf_contents; +#else + FILE *bmf_file; +#endif + long bmf_size; + BM_FILE *bmf_next; +}; + +B2_RANGE { + byte b2r_start; + byte b2r_finish; + B2_RANGE *b2r_next; +}; + +typedef unsigned short CHAR; +typedef unsigned int CHAR_INDEX; /* character index in file */ +#define BAD_CHAR_INDEX 0xffff + +CODE_RANGE { + CHAR code_start; + CHAR code_finish; + BM_FILE *code_bm_file; + long code_offset; + CHAR_INDEX code_pos; + bool code_transposed; + bool code_inverted; + CODE_RANGE *code_next; +}; + +/* + * Extended internal version of HBF + */ + +typedef struct { + /* fields corresponding to the definition */ + HBF public; + /* plus internal stuff */ + char *filename; + byte *bitmap_buffer; + unsigned int b2_size; /* number of legal byte-2's */ + PROPERTY *property; + B2_RANGE *byte_2_range; + CODE_RANGE *code_range; + BM_FILE *bm_file; +} HBF_STRUCT; + +#define FirstByte(code) ((code)>>8) +#define SecondByte(code) ((code)&0xff) +#define MakeCode(byte1,byte2) (((byte1)<<8)|(byte2)) + +/* size of a bitmap in the file (may be affected by transposition) */ +#define FileBitmapSize(hbfFile,cp) \ + ((cp)->code_transposed ? \ + (hbfBitmapBBox(hbfFile)->hbf_height + 7)/8 * \ + hbfBitmapBBox(hbfFile)->hbf_width : \ + HBF_BitmapSize(hbfFile)) + +#define NEW(type) ((type *)malloc((unsigned)(sizeof(type)))) + +#define QUOTE '"' + +#define MAXLINE 1024 + +#ifdef WIN32 +#define strdup(x) _strdup(x) +#else + extern char *strdup _((const char *s)); +#endif + +static void add_b2r _((B2_RANGE **last_b2r, int start, int finish)); +static bool add_code_range _((HBF_STRUCT *hbf, const char *line)); +static void add_property _((HBF_STRUCT *hbf, const char *lp)); +static CHAR_INDEX b2_pos _((HBF_STRUCT *hbf, HBF_CHAR code)); +static int b2_size _((B2_RANGE *b2r)); +static void clear_bbox _((HBF_BBOX *bbox)); +static void clear_record _((HBF_STRUCT *hbf)); +static char *concat _((const char *dir, int dirlen, const char *stem)); +static char *expand_filename _((const char *name, const char *filename)); +static const byte *get_bitmap + _((HBF_STRUCT *hbf, HBF_CHAR code, byte *buffer)); +static byte *local_buffer _((HBF_STRUCT *hbf)); +static void invert _((byte *buffer, unsigned length)); +#ifdef IN_MEMORY +static bool read_bitmap_file _((BM_FILE *bmf, FILE *f)); +static bool copy_transposed + _((HBF *hbf, byte *bitmap, const byte *source)); +#else +static bool get_transposed _((HBF *hbf, FILE *f, byte *bitmap)); +#endif +static bool match _((const char *lp, const char *sp)); +static bool parse_file _((FILE *f, HBF_STRUCT *hbf)); +static FILE *path_open + _((const char *path, const char *filename, char **fullp)); +static bool real_open _((const char *filename, HBF_STRUCT *hbf)); + +/* Error reporting */ + +int hbfDebug; /* set this for error reporting */ + +#ifdef __STDC__ +#include + +static void +eprintf(const char *fmt, ...) +{ + if (hbfDebug) { + va_list args; + + (void)fprintf(stderr, "HBF: "); + va_start(args, fmt); + (void)vfprintf(stderr, fmt, args); + va_end(args); + (void)fprintf(stderr, "\n"); + } +} +#else /* ! __STDC__ */ +/* poor man's variable-length argument list */ +static void +eprintf(fmt, x1, x2, x3, x4, x5, x6, x7, x8, x9) + const char *fmt; + int x1, x2, x3, x4, x5, x6, x7, x8, x9; +{ + if (hbfDebug) { + (void)fprintf(stderr, "HBF: "); + (void)fprintf(stderr, fmt, x1, x2, x3, x4, x5, x6, x7, x8, x9); + (void)fprintf(stderr, "\n"); + } +} +#endif /* __STDC__ */ + +static void +clear_bbox(HBF_BBOX *bbox) +{ + bbox->hbf_width = bbox->hbf_height = 0; + bbox->hbf_xDisplacement = bbox->hbf_yDisplacement = 0; +} + +static void +clear_record(HBF_STRUCT *hbf) +{ + clear_bbox(&(hbf->public.hbf_bitmap_bbox)); + clear_bbox(&(hbf->public.hbf_font_bbox)); + hbf->property = NULL; + hbf->filename = NULL; + hbf->bitmap_buffer = NULL; + hbf->byte_2_range = NULL; + hbf->code_range = NULL; + hbf->bm_file = NULL; +} + +/* + * Byte-2 ranges + */ + +static void +add_b2r(reg B2_RANGE **last_b2r, int start, int finish) +{ +reg B2_RANGE *b2r; + + b2r = NEW(B2_RANGE); + while (*last_b2r != NULL && (*last_b2r)->b2r_start < start) + last_b2r = &((*last_b2r)->b2r_next); + b2r->b2r_next = *last_b2r; + b2r->b2r_start = start; + b2r->b2r_finish = finish; + *last_b2r = b2r; +} + +static CHAR_INDEX +b2_pos(HBF_STRUCT *hbf, HBF_CHAR code) +{ +reg B2_RANGE *b2r; +reg unsigned c; +reg CHAR_INDEX pos; + + c = SecondByte(code); + pos = 0; + for (b2r = hbf->byte_2_range; b2r != NULL; b2r = b2r->b2r_next) + if (b2r->b2r_start <= c && c <= b2r->b2r_finish) + return pos + c - b2r->b2r_start; + else + pos += b2r->b2r_finish - b2r->b2r_start + 1; + return BAD_CHAR_INDEX; +} + +static int +b2_size(reg B2_RANGE *b2r) +{ +reg int size; + + size = 0; + for ( ; b2r != NULL; b2r = b2r->b2r_next) + size += b2r->b2r_finish - b2r->b2r_start + 1; + return size; +} + +/* map a position to a character code */ +static long +code_of(HBF_STRUCT *hbf, long pos) +{ + long code; + int residue; +reg B2_RANGE *b2r; + + code = pos / hbf->b2_size * 256; + residue = pos % hbf->b2_size; + for (b2r = hbf->byte_2_range; b2r != NULL; b2r = b2r->b2r_next) + if (b2r->b2r_start + residue <= b2r->b2r_finish) + return code + b2r->b2r_start + residue; + else + residue -= b2r->b2r_finish - b2r->b2r_start + 1; + /* should never get here */ + return 0L; +} + +/* + * String stuff + */ + +static bool +match(reg const char *lp, reg const char *sp) +{ + while (*lp == *sp && *sp != '\0') { + lp++; + sp++; + } + return (*lp == '\0' || isspace(*lp)) && *sp == '\0'; +} + +#ifdef NO_STRDUP +char * +strdup(const char *s) +{ + char *new_s; + + new_s = malloc((unsigned)strlen(s) + 1); + strcpy(new_s, s); + return new_s; +} +#endif + +/* + * Properties + */ + +static void +add_property(reg HBF_STRUCT *hbf, const char *lp) +{ +reg PROPERTY *prop; + char tmp[MAXLINE]; +reg char *tp; + + prop = NEW(PROPERTY); + + tp = tmp; + while (*lp != '\0' && ! isspace(*lp)) + *tp++ = *lp++; + *tp = '\0'; + prop->prop_name = strdup(tmp); + + while (*lp != '\0' && isspace(*lp)) + lp++; + + tp = tmp; + if (*lp == QUOTE) { + lp++; + while (*lp != '\0' && ! (*lp == QUOTE && *++lp != QUOTE)) + *tp++ = *lp++; + } + else + for (;;) { + while (*lp != '\0' && ! isspace(*lp)) + *tp++ = *lp++; + while (*lp != '\0' && isspace(*lp)) + lp++; + if (*lp == '\0') + break; + *tp++ = ' '; + } + *tp = '\0'; + prop->prop_value = strdup(tmp); + + prop->prop_next = hbf->property; + hbf->property = prop; +} + +const char * +hbfProperty(HBF *hbfFile, const char *propName) +{ +reg HBF_STRUCT *hbf; +reg PROPERTY *prop; + + hbf = (HBF_STRUCT *)hbfFile; + for (prop = hbf->property; prop != NULL; prop = prop->prop_next) + if (strcmp(prop->prop_name, propName) == 0) + return prop->prop_value; + return NULL; +} + +/* + * Compatability routines + */ + +const char * +HBF_GetProperty(HBF *handle, const char *propertyName) +{ + return hbfProperty(handle, propertyName); +} + +int +HBF_GetFontBoundingBox(HBF_Handle handle, + unsigned int *width, unsigned int *height, + int *xDisplacement, int *yDisplacement) +{ + if (width != NULL) + *width = hbfFontBBox(handle)->hbf_width; + if (height != NULL) + *height = hbfFontBBox(handle)->hbf_height; + if (xDisplacement != NULL) + *xDisplacement = hbfFontBBox(handle)->hbf_xDisplacement; + if (yDisplacement != NULL) + *yDisplacement = hbfFontBBox(handle)->hbf_yDisplacement; + return 0; +} + +int +HBF_GetBitmapBoundingBox(HBF_Handle handle, + unsigned int *width, unsigned int *height, + int *xDisplacement, int *yDisplacement) +{ + if (width != NULL) + *width = hbfBitmapBBox(handle)->hbf_width; + if (height != NULL) + *height = hbfBitmapBBox(handle)->hbf_height; + if (xDisplacement != NULL) + *xDisplacement = hbfBitmapBBox(handle)->hbf_xDisplacement; + if (yDisplacement != NULL) + *yDisplacement = hbfBitmapBBox(handle)->hbf_yDisplacement; + return 0; +} + +/* + * Prepend a directory to a relative filename. + */ +static char * +concat(const char *dir, /* not necessarily null-terminated */ + int dirlen, /* number of significant chars in dir */ + const char *stem) /* relative filename */ +{ + char *fullname; + + if (dirlen == 0) /* null: current directory */ + return strdup(stem); +#ifdef unix + fullname = malloc(dirlen + strlen(stem) + 2); + (void)sprintf(fullname, "%.*s/%s", dirlen, dir, stem); +#else +#ifdef msdos + fullname = malloc(dirlen + strlen(stem) + 2); + (void)sprintf(fullname, "%.*s\\%s", dirlen, dir, stem); +#else +#ifdef vms + if (dir[dirlen-1] == ']' && stem[0] == '[' && stem[1] == '-') { + dirlen--; + stem++; + fullname = malloc(dirlen + strlen(stem) + 2); + (void)sprintf(fullname, "%.*s.%s", dirlen, dir, stem); + } + else { + if (dir[dirlen-1] == ']' && stem[0] == '[' && stem[1] == '.') { + dirlen--; + stem++; + } + fullname = malloc(dirlen + strlen(stem) + 1); + (void)sprintf(fullname, "%.*s%s", dirlen, dir, stem); + } +#else + fullname = strdup(stem); +#endif /* vms */ +#endif /* msdos */ +#endif /* unix */ + return fullname; +} + +/* + * Bitmap files + * + * If the host operating system has a heirarchical file system and + * the bitmap file name is relative, it is relative to the directory + * containing the HBF file. + */ +static char * +expand_filename(const char *name, const char *hbf_name) +{ +#ifdef unix +reg char *s; +reg int size; + + size = name[0] != '/' && (s = strrchr(hbf_name, '/')) != NULL ? + s - hbf_name + 1 : 0; + s = malloc((unsigned)size + strlen(name) + 1); + (void)sprintf(s, "%.*s%s", size, hbf_name, name); + return s; +#else +#ifdef msdos +reg char *s; +reg int size; + +#ifdef __EMX__ + s = (unsigned char *)hbf_name + strlen((unsigned char *)hbf_name) - 1; + for(;;) { + if (*s == '\\' || *s == '/') + break; + if (s == hbf_name) { + s = NULL; + break; + } + s--; + } + + size = HasDrive(name) ? 0 : + (name[0] == '\\' || name[0] == '/') ? + (HasDrive(hbf_name) ? 2 : 0) : + s != NULL ? s - hbf_name + 1 : 0; +#else + size = HasDrive(name) ? 0 : + name[0] == '\\' ? (HasDrive(hbf_name) ? 2 : 0) : + (s = strrchr(hbf_name, '\\')) != NULL ? + s - hbf_name + 1 : 0; +#endif /* __EMX__ */ + s = malloc((unsigned)size + strlen(name) + 1); + (void)sprintf(s, "%.*s%s", size, hbf_name, name); + return s; +#else +#ifdef vms +reg char *s; +reg const char *copyto; +reg int size; + + if ((s = strchr(hbf_name, ']')) != NULL && RelativeFileName(name)) + return concat(hbf_name, (s - hbf_name) + 1, name); + + copyto = hbf_name; + if ((s = strstr(copyto, "::")) != NULL && strstr(name, "::") == NULL) + copyto = s+2; + if ((s = strchr(copyto, ':')) != NULL && strchr(name, ':') == NULL) + copyto = s+1; + size = copyto - hbf_name; + s = malloc((unsigned)size + strlen(name) + 1); + (void)sprintf(s, "%.*s%s", size, hbf_name, name); + return s; +#else + return strdup(name); +#endif /* vms */ +#endif /* msdos */ +#endif /* unix */ +} + +static BM_FILE * +find_file(HBF_STRUCT *hbf, const char *filename) +{ + BM_FILE **fp; +reg BM_FILE *file; + FILE *f; + char *bmfname; +#ifdef IN_MEMORY +#ifdef unix + bool from_pipe; +#endif +#endif + + for (fp = &(hbf->bm_file); *fp != NULL; fp = &((*fp)->bmf_next)) { + bmfname = strrchr((*fp)->bmf_name, '/'); + bmfname = (bmfname) ? bmfname + 1 : (*fp)->bmf_name; + if (strcmp(bmfname, filename) == 0) + return *fp; + } + + file = NEW(BM_FILE); + if (file == NULL) { + eprintf("out of memory"); + return NULL; + } + file->bmf_name = expand_filename(filename, hbf->filename); + if (file->bmf_name == NULL) { + free((char *)file); + return NULL; + } + f = fopen(file->bmf_name, READ_BINARY); +#ifdef IN_MEMORY +#ifdef unix + from_pipe = FALSE; + if (f == NULL) { + char tmp[400]; + + sprintf(tmp, "%s.gz", file->bmf_name); + if ((f = fopen(tmp, "r")) != NULL) { + fclose(f); + sprintf(tmp, "gzcat %s.gz", file->bmf_name); + if ((f = popen(tmp, "r")) != NULL) + from_pipe = TRUE; + } + } +#endif /* unix */ +#endif /* IN_MEMORY */ + if (f == NULL) { + eprintf("can't open bitmap file '%s'", file->bmf_name); + free(file->bmf_name); + free((char *)file); + return NULL; + } +#ifdef IN_MEMORY + if (! read_bitmap_file(file, f)) { + free(file->bmf_name); + free((char *)file); + return NULL; + } +#ifdef unix + if (from_pipe) + pclose(f); + else + fclose(f); +#else /* ! unix */ + fclose(f); +#endif /* ! unix */ +#else /* ! IN_MEMORY */ + file->bmf_file = f; + fseek(f, 0L, 2); + file->bmf_size = ftell(f); +#endif /* ! IN_MEMORY */ + file->bmf_next = NULL; + *fp = file; + return file; +} + +#ifdef IN_MEMORY +#define GRAIN_SIZE 512 + +static bool +read_bitmap_file(BM_FILE *bmf, FILE *f) +{ + byte *contents, *cp; + long size; + int c; + + size = 0; + cp = contents = (byte *)malloc((unsigned)GRAIN_SIZE); + if (contents == NULL) { + eprintf("not enough space for bitmap file"); + return NULL; + } + while ((c = getc(f)) != EOF) { + if (size%GRAIN_SIZE == 0) { + contents = (byte *)realloc((char *)contents, + (unsigned)(size + GRAIN_SIZE)); + if (contents == NULL) { + eprintf("not enough space for bitmap file"); + return NULL; + } + cp = contents + size; + } + *cp++ = c; + size++; + } + bmf->bmf_size = size; + bmf->bmf_contents = (byte *)realloc((char *)contents, (unsigned)size); + return TRUE; +} +#endif /* IN_MEMORY */ + +/* + * Code ranges + */ + +/* check that a code range fits within its bitmap file */ +static bool +too_short(HBF_STRUCT *hbf, CODE_RANGE *cp) +{ + int bm_size; + long offset, end_offset; + BM_FILE *bmf; + long start, finish; + + bm_size = FileBitmapSize(&(hbf->public), cp); + offset = cp->code_offset; + start = cp->code_start; + finish = cp->code_finish; + end_offset = offset + bm_size * + (hbf->b2_size*(long)FirstByte(finish) + + b2_pos(hbf, finish) - cp->code_pos + 1); + bmf = cp->code_bm_file; + if (end_offset <= bmf->bmf_size) + return FALSE; + /* bitmap file is too short: produce a specific error message */ + if (offset > bmf->bmf_size) + eprintf("bitmap file '%s' is shorter than offset 0x%04lx", + bmf->bmf_name, offset); + else if (offset + bm_size > bmf->bmf_size) + eprintf("bitmap file '%s' too short: no room for any bitmaps at offset 0x%04lx", + bmf->bmf_name, offset); + else + eprintf("bitmap file '%s' is too short - code range appears to be 0x%04lx-0x%04lx", + bmf->bmf_name, + start, + code_of(hbf, cp->code_pos + + (bmf->bmf_size - offset)/bm_size) - 1); + return TRUE; +} + +static const char * +skip_word(int n, const char *s) +{ + for ( ; n > 0; n--) { + while (*s != '\0' && ! isspace(*s)) + s++; + while (*s != '\0' && isspace(*s)) + s++; + } + return s; +} + +/* optional keywords at the end of a CODE_RANGE line */ +static void +parse_keywords(CODE_RANGE *cp, const char *s) +{ + for (s = skip_word(4, s) ; *s != '\0'; s = skip_word(1, s)) { + switch (*s) { + case 's': case 'S': case 't': case 'T': + /* keyword "sideways" or "transposed" */ + cp->code_transposed = TRUE; + break; + case 'i': case 'I': + /* keyword "inverted" */ + cp->code_inverted = TRUE; + } + } +} + +static bool +add_code_range(HBF_STRUCT *hbf, const char *line) +{ + CODE_RANGE *cp; + CODE_RANGE **cpp; + long start, finish; + long offset; + char filename[MAXLINE]; + BM_FILE *bmf; + CHAR_INDEX b2pos; + + if (sscanf(line, "HBF_CODE_RANGE %li-%li %s %li", + &start, &finish, filename, &offset) != 4) { + eprintf("syntax error in HBF_CODE_RANGE"); + return FALSE; + } + /* code ranges are checked in real_open() */ + if ((bmf = find_file(hbf, filename)) == NULL) + return FALSE; + if ((cp = NEW(CODE_RANGE)) == NULL) { + eprintf("out of memory"); + return FALSE; + } + + cp->code_start = (CHAR)start; + cp->code_finish = (CHAR)finish; + cp->code_bm_file = bmf; + cp->code_offset = offset; + cp->code_transposed = cp->code_inverted = FALSE; + parse_keywords(cp, line); + /* insert it in order */ + for (cpp = &hbf->code_range; + *cpp != NULL && (*cpp)->code_finish < start; + cpp = &((*cpp)->code_next)) + ; + if (*cpp != NULL && (*cpp)->code_start <= finish) { + eprintf("code ranges overlap"); + return FALSE; + } + cp->code_next = *cpp; + *cpp = cp; + + /* set code_pos, and check range */ + if (start > finish) { + eprintf("illegal code range 0x%04lx-0x%04lx", start, finish); + return FALSE; + } + if ((b2pos = b2_pos(hbf, start)) == BAD_CHAR_INDEX) { + eprintf("illegal start code 0x%04lx", start); + return FALSE; + } + cp->code_pos = hbf->b2_size*(long)FirstByte(start) + b2pos; + if ((b2pos = b2_pos(hbf, finish)) == BAD_CHAR_INDEX) { + eprintf("illegal finish code 0x%04lx", finish); + return FALSE; + } + /* check that the bitmap file has enough bitmaps */ + return ! too_short(hbf, cp); +} + +/* + * Reading and parsing of an HBF file + */ + +/* get line, truncating to len, and trimming trailing spaces */ +static bool +get_line(char *buf, int len, FILE *f) +{ + int c; + char *bp; + + bp = buf; + for (;;) { + if ((c = getc(f)) == EOF) { + eprintf("unexpected end of file"); + return FALSE; + } + if (c == '\n' || c == '\r') { + /* trim trailing space */ + while (bp > buf && isspace(*(bp-1))) + bp--; + *bp = '\0'; + return TRUE; + } + if (len > 0) { + *bp++ = c; + len--; + } + } +} + +/* get next non-COMMENT line */ +static bool +get_text_line(char *buf, int len, FILE *f) +{ + while (get_line(buf, len, f)) + if (*buf != '\0' && ! match(buf, "COMMENT")) + return TRUE; + return FALSE; +} + +static bool +get_property(const char *line, const char *keyword, HBF_STRUCT *hbf) +{ + if (! match(line, keyword)) { + eprintf("%s expected", keyword); + return FALSE; + } + add_property(hbf, line); + return TRUE; +} + +static bool +get_bbox(const char *line, const char *keyword, HBF_BBOX *bbox) +{ + int w, h, xd, yd; + + if (! match(line, keyword) || + sscanf(line + strlen(keyword), "%i %i %i %i", + &w, &h, &xd, &yd) != 4) { + eprintf("%s expected", keyword); + return FALSE; + } + if (w <= 0 || h <= 0) { + eprintf("illegal %s dimensions %dx%d", keyword, w, h); + return FALSE; + } + bbox->hbf_width = w; + bbox->hbf_height = h; + bbox->hbf_xDisplacement = xd; + bbox->hbf_yDisplacement = yd; + return TRUE; +} + +/* + * HBFHeaderFile ::= + * 'HBF_START_FONT' version EOLN + * 'HBF_CODE_SCHEME' word ... EOLN + * 'FONT' fontName EOLN + * 'SIZE' ptsize xres yres EOLN + * 'HBF_BITMAP_BOUNDING_BOX' w h xd yd EOLN + * 'FONTBOUNDINGBOX' w h xd yd EOLN + * X11R5FontPropertySection + * 'CHARS' n EOLN + * HBFByte2RangeSection + * HBFCodeRangeSection + * 'HBF_END_FONT' EOLN . + * + * This implementation allows extra lines before HBF_END_FONT. + * Anything after HBF_END_FONT is ignored. + */ + +static bool +parse_file(FILE *f, reg HBF_STRUCT *hbf) +{ + char line[MAXLINE]; + int start, finish; + + if (! get_text_line(line, MAXLINE, f) || + ! get_property(line, "HBF_START_FONT", hbf)) + return FALSE; + + if (! get_text_line(line, MAXLINE, f) || + ! get_property(line, "HBF_CODE_SCHEME", hbf)) + return FALSE; + + if (! get_text_line(line, MAXLINE, f) || + ! get_property(line, "FONT", hbf)) + return FALSE; + + if (! get_text_line(line, MAXLINE, f) || + ! get_property(line, "SIZE", hbf)) + return FALSE; + + if (! get_text_line(line, MAXLINE, f) || + ! get_bbox(line, "HBF_BITMAP_BOUNDING_BOX", + &(hbf->public.hbf_bitmap_bbox))) + return FALSE; + + if (! get_text_line(line, MAXLINE, f) || + ! get_bbox(line, "FONTBOUNDINGBOX", &(hbf->public.hbf_font_bbox))) + return FALSE; + + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + if (match(line, "STARTPROPERTIES")) { + for (;;) { + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + if (match(line, "ENDPROPERTIES")) + break; + add_property(hbf, line); + } + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + } + + if (match(line, "CHARS")) + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + + if (match(line, "HBF_START_BYTE_2_RANGES")) { + for (;;) { + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + if (match(line, "HBF_END_BYTE_2_RANGES")) + break; + if (sscanf(line, "HBF_BYTE_2_RANGE %i-%i", + &start, &finish) != 2) { + eprintf("HBF_BYTE_2_RANGE expected"); + return FALSE; + } + add_b2r(&(hbf->byte_2_range), start, finish); + } + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + } + else + add_b2r(&(hbf->byte_2_range), 0, 0xff); + hbf->b2_size = b2_size(hbf->byte_2_range); + + if (! match(line, "HBF_START_CODE_RANGES")) { + eprintf("HBF_START_CODE_RANGES expected"); + return FALSE; + } + for (;;) { + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + if (match(line, "HBF_END_CODE_RANGES")) + break; + if (! add_code_range(hbf, line)) + return FALSE; + } + + for (;;) { + if (! get_text_line(line, MAXLINE, f)) + return FALSE; + if (match(line, "HBF_END_FONT")) + break; + /* treat extra lines as properties (for private extensions) */ + add_property(hbf, line); + } + + return TRUE; +} + +static FILE * +path_open(const char *path, const char *filename, char **fullp) +{ + if (LocalFileName(filename) && path != NULL) { +#ifdef PATH_DELIMITER + int len; + char *fullname; + FILE *f; + const char *p_next; + + len = strlen(filename); + for (;;) { + p_next = strchr(path, PATH_DELIMITER); + if (p_next == NULL) + p_next = path + strlen(path); + fullname = concat(path, p_next - path, filename); + if ((f = fopen(fullname, "r")) != NULL) { + *fullp = fullname; + return f; + } + free(fullname); + if (*p_next == '\0') + break; + path = p_next + 1; + } +#endif + return NULL; + } + else { + *fullp = strdup(filename); + return fopen(*fullp, "r"); + } +} + +static bool +real_open(const char *filename, reg HBF_STRUCT *hbf) +{ + FILE *f; + + f = path_open(getenv("HBFPATH"), filename, &(hbf->filename)); + if (f == NULL) { + eprintf("can't read file '%s'", filename); + return FALSE; + } + if (! parse_file(f, hbf)) { + fclose(f); + return FALSE; + } + fclose(f); + return TRUE; +} + +HBF * +hbfOpen(const char *filename) +{ +reg HBF_STRUCT *hbf; + + if ((hbf = NEW(HBF_STRUCT)) == NULL) { + eprintf("can't allocate HBF structure"); + return NULL; + } + clear_record(hbf); + if (real_open(filename, hbf)) + return &(hbf->public); + hbfClose(&(hbf->public)); + return NULL; +} + +int +HBF_OpenFont(const char *filename, HBF **ptrHandleStorage) +{ + return (*ptrHandleStorage = hbfOpen(filename)) == NULL ? -1 : 0; +} + +/* + * Close files, free everything associated with the HBF. + */ + +int +HBF_CloseFont(HBF *hbfFile) +{ +reg HBF_STRUCT *hbf; + PROPERTY *prop_ptr, *prop_next; + B2_RANGE *b2r_ptr, *b2r_next; + CODE_RANGE *code_ptr, *code_next; + BM_FILE *bmf_ptr, *bmf_next; + int status; + + status = 0; + hbf = (HBF_STRUCT *)hbfFile; + + if (hbf->filename != NULL) + free(hbf->filename); + if (hbf->bitmap_buffer != NULL) + free(hbf->bitmap_buffer); + + for (prop_ptr = hbf->property; + prop_ptr != NULL; + prop_ptr = prop_next) { + prop_next = prop_ptr->prop_next; + free(prop_ptr->prop_name); + free(prop_ptr->prop_value); + free((char *)prop_ptr); + } + + for (b2r_ptr = hbf->byte_2_range; + b2r_ptr != NULL; + b2r_ptr = b2r_next) { + b2r_next = b2r_ptr->b2r_next; + free((char *)b2r_ptr); + } + + for (code_ptr = hbf->code_range; + code_ptr != NULL; + code_ptr = code_next) { + code_next = code_ptr->code_next; + free((char *)code_ptr); + } + + for (bmf_ptr = hbf->bm_file; + bmf_ptr != NULL; + bmf_ptr = bmf_next) { + bmf_next = bmf_ptr->bmf_next; +#ifdef IN_MEMORY + free((char *)(bmf_ptr->bmf_contents)); +#else + if (bmf_ptr->bmf_file != NULL && + fclose(bmf_ptr->bmf_file) < 0) + status = -1; +#endif + free(bmf_ptr->bmf_name); + free((char *)bmf_ptr); + } + + free((char *)hbf); + + return status; +} + +void +hbfClose(HBF *hbfFile) +{ + (void)HBF_CloseFont(hbfFile); +} + +/* + * Fetch a bitmap + */ + +const byte * +hbfGetBitmap(HBF *hbf, HBF_CHAR code) +{ + return get_bitmap((HBF_STRUCT *)hbf, code, (byte *)NULL); +} + +int +HBF_GetBitmap(HBF *hbf, HBF_CHAR code, byte *buffer) +{ + return get_bitmap((HBF_STRUCT *)hbf, code, buffer) == NULL ? -1 : 0; +} + +/* + * Internal function to fetch a bitmap. + * If buffer is non-null, it must be used. + */ +static const byte * +get_bitmap(reg HBF_STRUCT *hbf, HBF_CHAR code, byte *buffer) +{ + CHAR_INDEX pos, b2pos; +reg CODE_RANGE *cp; + BM_FILE *bmf; + int bm_size; + long offset; + + if ((b2pos = b2_pos(hbf, code)) == BAD_CHAR_INDEX) + return NULL; + pos = hbf->b2_size*FirstByte(code) + b2pos; + for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) + if (cp->code_start <= code && code <= cp->code_finish) { + bmf = cp->code_bm_file; + bm_size = FileBitmapSize(&(hbf->public), cp); + offset = cp->code_offset + + (long)(pos - cp->code_pos) * bm_size; +#ifdef IN_MEMORY + if (buffer == NULL && + ! cp->code_transposed && ! cp->code_inverted) + return bmf->bmf_contents + offset; +#endif /* IN_MEMORY */ + if (buffer == NULL && + ((buffer = local_buffer(hbf)) == NULL)) + return NULL; +#ifdef IN_MEMORY + if (cp->code_transposed) + copy_transposed(&(hbf->public), + buffer, + bmf->bmf_contents + offset); + else + memcpy((char *)buffer, + (char *)(bmf->bmf_contents + offset), + bm_size); +#else /* ! IN_MEMORY */ + if (fseek(bmf->bmf_file, offset, 0) != 0) { + eprintf("seek error on code 0x%04x", code); + return NULL; + } + if (cp->code_transposed ? + ! get_transposed(&(hbf->public), bmf->bmf_file, + buffer) : + fread((char *)buffer, + bm_size, 1, bmf->bmf_file) != 1) { + eprintf("read error on code 0x%04x", code); + return NULL; + } +#endif /* IN_MEMORY */ + if (cp->code_inverted) + invert(buffer, HBF_BitmapSize(&(hbf->public))); + return buffer; + } + eprintf("code 0x%04x out of range", code); + return NULL; +} + +static byte * +local_buffer(HBF_STRUCT *hbf) +{ + if (hbf->bitmap_buffer == NULL && + (hbf->bitmap_buffer = (byte *)malloc(HBF_BitmapSize(&(hbf->public)))) == NULL) { + eprintf("out of memory"); + return NULL; + } + return hbf->bitmap_buffer; +} + +static void +invert(byte *buffer, unsigned int length) +{ + for ( ; length > 0; length--) + *buffer++ ^= 0xff; +} + +#ifdef IN_MEMORY +static bool +copy_transposed(HBF *hbf, reg byte *bitmap, reg const byte *source) +{ +reg byte *pos; +reg byte *bm_end; + int x; + int width; +reg int row_size; +reg int c; +reg int imask, omask; + + width = hbfBitmapBBox(hbf)->hbf_width; + row_size = HBF_RowSize(hbf); + bm_end = bitmap + HBF_BitmapSize(hbf); + (void)memset((char *)bitmap, '\0', HBF_BitmapSize(hbf)); + for (x = 0; x < width; x++) { + pos = bitmap + x/8; + omask = Bit(x%8); + /* y = 0 */ + for (;;) { + c = *source++; + for (imask = Bit(0); imask != 0; imask >>= 1) { + /* + * At this point, + * + * imask == Bit(y%8) + * pos == bitmap + y*row_size + x/8 + * + * We examine bit y of row x of the input, + * setting bit x of row y of the output if + * required, by applying omask to *pos. + */ + if ((c & imask) != 0) + *pos |= omask; + /* if (++y > height) goto end_column */ + pos += row_size; + if (pos >= bm_end) + goto end_column; + } + } +end_column: + ; + } + return TRUE; +} +#else /* ! IN_MEMORY */ +static bool +get_transposed(HBF *hbf, FILE *f, reg byte *bitmap) +{ +reg byte *pos; +reg byte *bm_end; + int x; + int width; +reg int row_size; +reg int c; +reg int imask, omask; + + width = hbfBitmapBBox(hbf)->hbf_width; + row_size = HBF_RowSize(hbf); + bm_end = bitmap + HBF_BitmapSize(hbf); + (void)memset((char *)bitmap, '\0', HBF_BitmapSize(hbf)); + for (x = 0; x < width; x++) { + pos = bitmap + x/8; + omask = Bit(x%8); + /* y = 0 */ + for (;;) { + if ((c = getc(f)) == EOF) + return FALSE; + for (imask = Bit(0); imask != 0; imask >>= 1) { + /* + * At this point, + * + * imask == Bit(y%8) + * pos == bitmap + y*row_size + x/8 + * + * We examine bit y of row x of the input, + * setting bit x of row y of the output if + * required, by applying omask to *pos. + */ + if ((c & imask) != 0) + *pos |= omask; + /* if (++y > height) goto end_column */ + pos += row_size; + if (pos >= bm_end) + goto end_column; + } + } +end_column: + ; + } + return TRUE; +} +#endif /* ! IN_MEMORY */ + +/* + * Call function on each valid code in ascending order. + */ +void +hbfForEach(reg HBF *hbfFile, void (*func)(HBF *, HBF_CHAR)) +{ + HBF_STRUCT *hbf; + CODE_RANGE *cp; +reg B2_RANGE *b2r; +reg unsigned byte1, byte2; +reg unsigned finish; + + hbf = (HBF_STRUCT *)hbfFile; + for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) { + byte1 = FirstByte(cp->code_start); + byte2 = SecondByte(cp->code_start); + while (MakeCode(byte1, byte2) <= cp->code_finish) { + for (b2r = hbf->byte_2_range; + b2r != NULL; + b2r = b2r->b2r_next) { + if (byte2 < b2r->b2r_start) + byte2 = b2r->b2r_start; + finish = b2r->b2r_finish; + if (byte1 == FirstByte(cp->code_finish) && + finish > SecondByte(cp->code_finish)) + finish = SecondByte(cp->code_finish); + while (byte2 <= finish) { + (*func)(hbfFile, + MakeCode(byte1, byte2)); + byte2++; + } + } + byte1++; + byte2 = 0; + } + } +} + +const char * +hbfFileName(HBF *hbf) +{ + return ((HBF_STRUCT *)hbf)->filename; +} + +long +hbfChars(HBF *hbfFile) +{ + HBF_STRUCT *hbf; + CODE_RANGE *cp; + long num_chars; + + hbf = (HBF_STRUCT *)hbfFile; + num_chars = 0; + for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) + num_chars += + hbf->b2_size*FirstByte(cp->code_finish) + + b2_pos(hbf, cp->code_finish) - + (hbf->b2_size*FirstByte(cp->code_start) + + b2_pos(hbf, cp->code_start)) + 1; + return num_chars; +} + +/* + * Functions also implemented as macros + */ + +#ifdef hbfBitmapBBox +#undef hbfBitmapBBox +#endif + +HBF_BBOX * +hbfBitmapBBox(HBF *hbf) +{ + return &(hbf->hbf_bitmap_bbox); +} + +#ifdef hbfFontBBox +#undef hbfFontBBox +#endif + +HBF_BBOX * +hbfFontBBox(HBF *hbf) +{ + return &(hbf->hbf_font_bbox); +} + +const void * +hbfGetByte2Range(HBF *hbfFile, const void *b2r_pointer, + byte *startp, byte *finishp) +{ + HBF_STRUCT *hbf; + const B2_RANGE *b2r; + + hbf = (HBF_STRUCT *)hbfFile; + if (b2r_pointer == NULL) + b2r = hbf->byte_2_range; + else + b2r = ((const B2_RANGE *)b2r_pointer)->b2r_next; + if(b2r == NULL) + return NULL; + *startp = b2r->b2r_start; + *finishp = b2r->b2r_finish; + return (const void *)b2r; +} + +const void * +hbfGetCodeRange(HBF *hbfFile, const void *code_pointer, + HBF_CHAR *startp, HBF_CHAR *finishp) +{ + HBF_STRUCT *hbf; + const CODE_RANGE *cp; + + hbf = (HBF_STRUCT *)hbfFile; + if (code_pointer == NULL) + cp = hbf->code_range; + else + cp = ((const CODE_RANGE *)code_pointer)->code_next; + if(cp == NULL) + return NULL; + *startp = cp->code_start; + *finishp = cp->code_finish; + return (const void *)cp; +} diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.h b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.h new file mode 100644 index 00000000000..34f5940a71b --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf.h @@ -0,0 +1,215 @@ +/* + * Copyright 1993,1994,1995,2005 by Ross Paterson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. 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. + * + * + * Two interfaces to HBF files -- take your pick. + * + * Ross Paterson + * + * Ross no longer maintains this code. Please send bug reports to + * Werner Lemberg . + * + */ +#ifndef _HBF_ +#define _HBF_ + +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif + +/* + * #1: a lightweight C interface. + */ + +typedef unsigned int HBF_CHAR; + +typedef struct { + unsigned short hbf_width; + unsigned short hbf_height; + short hbf_xDisplacement; + short hbf_yDisplacement; +} HBF_BBOX; + +typedef struct { + /* fields corresponding to the definition */ + HBF_BBOX hbf_bitmap_bbox; /* HBF_BITMAP_BOUNDING_BOX */ + HBF_BBOX hbf_font_bbox; /* FONTBOUNDINGBOX */ +} HBF; + +extern HBF *hbfOpen( +#ifdef __STDC__ + const char *filename +#endif + ); + +extern void hbfClose( +#ifdef __STDC__ + HBF *hbf +#endif + ); + +extern const char *hbfProperty( +#ifdef __STDC__ + HBF *hbf, + const char *propName +#endif + ); + +extern const unsigned char *hbfGetBitmap( +#ifdef __STDC__ + HBF *hbf, + HBF_CHAR code +#endif + ); + +extern void hbfForEach( +#ifdef __STDC__ + HBF *hbf, + void (*func)(HBF *sameHbf, HBF_CHAR code) +#endif + ); + +extern const char *hbfFileName( +#ifdef __STDC__ + HBF *hbf +#endif + ); + +extern long hbfChars( +#ifdef __STDC__ + HBF *hbf +#endif + ); + +extern HBF_BBOX *hbfBitmapBBox( +#ifdef __STDC__ + HBF *hbf +#endif + ); +/* but defined here as a macro */ +#define hbfBitmapBBox(hbf) (&((hbf)->hbf_bitmap_bbox)) + +extern HBF_BBOX *hbfFontBBox( +#ifdef __STDC__ + HBF *hbf +#endif + ); +/* but defined here as a macro */ +#define hbfFontBBox(hbf) (&((hbf)->hbf_font_bbox)) + +#define HBF_RowSize(hbf)\ + ((hbfBitmapBBox(hbf)->hbf_width + 7)/8) + +#define HBF_BitmapSize(hbf)\ + (HBF_RowSize(hbf) * hbfBitmapBBox(hbf)->hbf_height) + +#define HBF_GetBit(hbf,bitmap,x,y)\ + (((bitmap)[(y)*HBF_RowSize(hbf) + (x)/8]>>(7 - (x)%8))&01) + +extern int hbfDebug; /* set non-zero for error reporting */ + +extern const void *hbfGetCodeRange( +#ifdef __STDC__ + HBF *hbfFile, + const void *code_pointer, + HBF_CHAR *startp, + HBF_CHAR *finishp +#endif + ); + +extern const void *hbfGetByte2Range( +#ifdef __STDC__ + HBF *hbfFile, + const void *b2r_pointer, + unsigned char *startp, + unsigned char *finishp +#endif + ); + +/* + * #2: taken from Appendix 2 of the HBF draft. + */ + +typedef unsigned int HBF_HzCode; +typedef unsigned char HBF_Byte ; +typedef HBF_Byte * HBF_BytePtr ; +typedef HBF * HBF_Handle ; +typedef HBF_Handle * HBF_HandlePtr ; +typedef char * String ; + +extern int HBF_OpenFont( +#ifdef __STDC__ + const char * filename, + HBF_HandlePtr ptrHandleStorage +#endif +); + +extern int HBF_CloseFont( +#ifdef __STDC__ + HBF_Handle handle +#endif +); + +extern const char * HBF_GetProperty( +#ifdef __STDC__ + HBF_Handle handle, + const char * propertyName +#endif +); + +extern int HBF_GetFontBoundingBox( +#ifdef __STDC__ + HBF_Handle handle, + unsigned int *width, + unsigned int *height, + int *xDisplacement, + int *yDisplacement +#endif +); + +extern int HBF_GetBitmapBoundingBox( +#ifdef __STDC__ + HBF_Handle handle, + unsigned int *width, + unsigned int *height, + int *xDisplacement, + int *yDisplacement +#endif +); + +extern int HBF_GetBitmap( +#ifdef __STDC__ + HBF_Handle handle, + HBF_HzCode hanziCode, + HBF_BytePtr ptrBitmapBuffer +#endif +); + +#endif /* ! _HBF_ */ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.1 b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.1 new file mode 100644 index 00000000000..0ccb6648f56 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.1 @@ -0,0 +1,754 @@ +.\" man page for hbf2gf +.\" +.\" Copyright (C) 1994-2008 Werner Lemberg +.\" +.\" 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 in doc/COPYING; if not, write to the Free +.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +.\" MA 02110-1301 USA +.\" +. +.TH HBF2GF 1 29-Dec-2008 "CJK Version 4.8.2" +.SH NAME +hbf2gf \- convert a CJK bitmap font into subfonts usable by TeX and Omega. +. +. +.SH SYNOPSIS +.na +.nh +.B hbf2gf +.RB [ \-q ] +.IR \%configuration-file [ .cfg ] +.br +.B hbf2gf +'in +\n(.ku +.RB [ \-q ] +.RB [ \-p ] +.RB [ \-g ] +.RB [ \-n ] +.I \%subfont-name \%x-resolution +.RI [ \%y-scale \ | \ \%y-resolution ] +.br +.in +.B hbf2gf +.B \-t +.RB [ \-q ] +.I \%subfont-name +.br +.B "hbf2gf \-\-version" +| +.B \-\-help +.ad +.hy +. +. +. +.\" ==== +.\" ==== macro definitions +.\" ==== +. +.\" here we define \TeX for troff and nroff +.if t .ds TX \fRT\h'-0.1667m'\v'0.20v'E\v'-0.20v'\h'-0.125m'X\fP +.if n .ds TX TeX +. +.\" and here the same for \LaTeX +.if t \{\ +.ie '\*(.T'dvi' \ +.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX +.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX +.\} +.if n .ds LX LaTeX +. +.\" \LaTeXe +.\" note that we need \vareps for TeX instead of \eps which can only be +.\" accessed with the \N escape sequence (in the Math Italic font) +.if t \{\ +.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' +.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' +.\} +.if n .ds LE LaTeX\ 2e +. +.\" a definition for \Delta +.if t .ds DE \(*D +.if n .ds DE Delta_ +. +.\" a typewriter font +.if t \{\ +.de C +\fC\\$1\fP\\$2 +.. +.\} +.if n \{\ +.de C +\\$1\\$2 +.. +.\} +. +.\" an addition to .TP to allow two labels for the same item +.de TQ +.br +.ns +.TP +.. +. +.\" ==== +.\" ==== end of macro definitions +.\" ==== +. +. +. +.SH DESCRIPTION +CJK bitmap fonts can't be directly used with \*(TX +because the number of characters in such fonts exceeds\ 256, the limit of a +\*(TX +font. +Thus it is necessary to split these fonts into subfonts, and this is +exactly what +.B hbf2gf +does. +.PP +As the name says, +.B hbf2gf +uses CJK fonts in a certain format which is called +.B Hanzi Bitmap Font +.RB ( HBF ) +format. +It simply consists of the CJK bitmap file(s) and a text file in a format +very similar to the BDF format of the X\ Window System which describes the +bitmap font files: the encoding, the size, etc. +The produced +.C GF +files can then be converted with +.B gftopk +into standard +.C PK +files. +.PP +.B hbf2gf +can be called in three modes: +. +.PP +.in +2m +.B hbf2gf +.RB [ \-q ] +.IR configuration-file [ .cfg ] +.PP +.in +5m +This call normally creates a set of +.C GF +files, one +.C PL +file, and a batch file which must be executed after +.B hbf2gf +has finished. +This script will then call +.B gftopk +to convert all +.C GF +files into +.C PK +files, and it will call +.B pltotf +to convert the +.C PL +file into a +.C TFM +file. +Finally it will copy the +.C TFM +file so that each +.C PK +file has its +.C TFM +file (which are all identical). +.PP +.in +5m +If +.B ofm_file +is set to \(oqyes\(cq in the configuration file, +.C OFM +and +.C OVF +files will be created too. +. +.PP +.in +5m +.B \-q +makes +.B hbf2gf +quiet. +.PP +.in +2m +.na +.nh +.B hbf2gf +'in +\n(.ku +.RB [ \-q ] +.RB [ \-p ] +.RB [ \-g ] +.RB [ \-n ] +.I \%subfont-name \%x-resolution +.RI [ \%y-scale \ | \ \%y-resolution ] +.ad +.hy +.PP +.in +5m +This mode is intended for use with +.B \%mktexpk +and its derivates. +Only one +.C GF +file together with a +.C PL +file for the given subfont will be computed, taking the horizontal +resolution and a vertical scaling factor (if the value is smaller than\ 10) +resp. the vertical resolution (otherwise) from the command line, ignoring +the +.B nmb_fonts +parameter of the configuration file. +The last two characters (which are interpreted as the subfont number) are +stripped to get the name for the configuration file (which must end with +\(oq\c +.C \&.cfg \(cq). +No job file will be created. +If option +.B \-p +is set, no +.C PL +file is created. +If +.B \-g +is set, no +.C GF +file is created. +The extension can be controlled with +.BR \-n ; +if set, the extension is \(oq\c +.C \&.gf \(cq, +otherwise \(oq\c +.C \&. <\c +.IR resolution >\c +.C gf \(cq. +.B \-q +makes +.B hbf2gf +quiet. +. +.PP +.in +2m +.na +.nh +.B hbf2gf +'in +\n(.ku +.B \-t +.RB [ \-q ] +.I \%subfont-name +.ad +.hy +.PP +.in +5m +This mode is intended for use with scripts like +.BR \%mktexpk ; +it tests whether the specified subfont name leads to an +.B hbf2gf +configuration file. +It returns 0 on success and prints out the name of that configuration file +(provided the +.B \-q +switch isn't set). +This test isn't a thorough one; it only removes the last two characters +and checks whether a configuration file with that name exists. +.PP +See the next section for more details about configuration files. +.PP +Specifying the option +.B \-\-version +returns the current version of +.B hbf2gf +and the used file search library (e.g.\ \c +.BR kpathsea ). +Usage information is shown with the +.B \-\-help +parameter. +. +. +.SH "CONFIGURATION FILE" +Here a sample configuration file (\c +.C gsfs14.cfg ) +for a 56\(mu56 Chinese font in GB encoding; note that all information +about the font is in the +.C jfs56.hbf +file. +See the +.B "FILE SEARCHING" +section how HBF fonts and +.B hbf2gf +configuration files are found. +See the +.B AVAILABILITY +section where to get CJK fonts together with its +.C HBF +files: +.PP +.if t \fC +.nf + hbf_header jfs56.hbf + mag_x 1 + threshold 128 + comment jianti fansongti 56x56 pixel font + + design_size 14.4 + + y_offset \-13 + + nmb_files \-1 + + output_name gsfs14 + + checksum 123456789 + + dpi_x 300 + + pk_files no + tfm_files yes + + coding codingscheme GuoBiao encoded TeX text + + pk_directory $HBF_TARGET/pk/modeless/gb2312/gsfs14/ + tfm_directory $HBF_TARGET/tfm/gb2312/gsfs14/ +.fi +.if t \fP +.PP +A configuration file is a plain text file consisting of keywords and its +arguments. +A keyword must start a line, otherwise the whole line will be ignored. +If the word starting a line is not a keyword, the line will be ignored too. +Empty lines will also be skipped. +The search for keywords is case insensitive; in contrast, the arguments will +be taken exactly as given (except \(oqyes\(cq and \(oqno\(cq which can be written with +uppercase or lowercase letters). +Each keyword has one argument which must be separated by whitespace (blanks +or tabs) from the keyword and must be on the same line. +Each line must not be longer than 256 characters. +.PP +You can use environment variables in the configuration file. +The escape character starting an environment variable in the configuration +file is always \(oq\c +.C $ \(cq, +even for operating systems like DOS which has other conventions. +.B hbf2gf +recognizes only environment variable names which start with a letter or an +underscore, followed by alphanumeric characters or underscores. +You can surround the variable with braces to indicate where the variable +name ends, for example +.C ${FOO} . +To get a dollar sign you must write \(oq\c +.C $$ \(cq. +The expansion of environment variables in hbf2gf itself (without the help of +either kpathsea, emtexdir, or MiKTeX searching routines) is very limited; +this feature has been carried over from previous versions. +It can't expand variables set in texmf.cnf; it also can't handle more than +one directory as the variable's value. +.B Don't use it except for the \(oqpk_directory\(cq and \(oqtfm_directory\(cq +.B parameters! +.PP +This is the list of all necessary keywords: +.TP +.B hbf_header +The HBF header file name of the input font(s). +.B hbf2gf +uses the given searching mechanism (kpathsea, emtexdir, or MiKTeX) to locate +this file. +.TP +.B output_name +The name stem of the output files. +A running two digit decimal number starting with \(oq\c +.C 01 \(cq +will be appended. +For Unicode fonts see the keyword +.B unicode +below. +This value is in almost all cases identical to the name of the configuration +file. +.PP +And now all optional keywords: +.TP +.B x_offset +Increases the character width. +Will be applied on both sides; default for non-rotated glyphs is the value +given in the HBF header +.RB ( HBF_BITMAP_BOUNDING_BOX ) +scaled to +.B design_size +(in pixels). +.TP +.B y_offset +Shifts all characters up or down; default for non-rotated glyphs is the value +given in the HBF header +.RB ( HBF_BITMAP_BOUNDING_BOX ) +scaled to +.B design_size +(in pixels). +.TP +.B design_size +The design size (in points) of the font. +.B x_offset +and +.B y_offset +refer to this size. +Default is\ 10.0. +.TP +.B slant +The slant of the font (given as \*(DEx\ /\ \*(DEy). +Only values in the range 0\ \(<=\ \fBslant\fP\ \(<=\ 1 are allowed. +Default is\ 0.0. +.TP +.B rotation +If set to \(oqyes\(cq, all glyphs will be rotated 90\ degrees counter-clockwise. +The default offsets as given in the HBF header will be ignored (and set +to\ 0). +Default is \(oqno\(cq. +.TP +.B mag_x +.TQ +.B mag_y +Scaling values of the characters to reach design size. +If only one magnification is given, x and y values are assumed to be equal. +Default is \fBmag_x\fP\ =\ \fBmag_y\fP\ =\ 1.0. +.PP +.TP +.B threshold +A value between 1 and\ 254 defining a threshold for converting the internal +graymap into the output bitmap; lower values cut more pixels. +Default value is\ 128. +.PP +.TP +.B comment +A comment describing the font; default is none. +.PP +.TP +.B nmb_fonts +The number of subfonts to create. +Default value is \-1 for creating all fonts. +.TP +.B unicode +If \(oqyes\(cq, a two digit hexadecimal number will be used as a running number, +starting with the value of the first byte of the first code range. +Default is \(oqno\(cq. +.TP +.B min_char +The minimum value of the encoding. +You should set this value to get correct subfile offsets if it is not +identical to the lowest character code in the HBF file. +.PP +.TP +.B dpi_x +.TQ +.B dpi_y +The horizontal and vertical resolution (in dpi) of the printer. +If only one resolution is given, x and y values are assumed to be equal. +Default is\ 300. +.TP +.B checksum +A checksum to identify the +.C GF +files with the appropriate +.C TFM +files. +The default value of this unsigned 32bit integer is\ 0. +.TP +.B coding +A comment describing the coding scheme; default is none. +.PP +.TP +.B pk_directory +The destination directory of the +.C PK +files; default: none. +Attention! +The batch file will not check whether this directory exists. +.TP +.B tfm_directory +The destination directory of the +.C TFM +files; default: none. +Attention! +The batch file will not check whether this directory exists. +.TP +.B pk_files +Whether to create +.C PK +files or not; default is \(oqyes\(cq. +.TP +.B tfm_files +Whether to create +.C TFM +files or not; default is \(oqyes\(cq. +.TP +.B ofm_file +Whether to create an +.C OPL +file or not; default is \(oqno\(cq. +The batch file will then use +.B ovp2ovf +of the Omega distribution to convert it into an +.C OFM +and an +.C OVF +file. +The +.C OPL +file simply maps all subfonts back to a single Omega font. +.TP +.B long_extension +If \(oqyes\(cq, +.C PK +files will include the resolution in the extension (e.g. +.C gsso1201.300pk ). +This affects the batch file only (default is \(oqyes\(cq). +.TP +.B rm_command +The shell command to remove files; default: \(oqrm\(cq. +.TP +.B cp_command +The shell command to copy files; default: \(oqcp\(cq. +.TP +.B job_extension +The extension of the batch file which calls +.B gftopk +and +.B pltotf +to convert the +.C GF +and the +.C PL +files into +.C PK +and +.C TFM +files respectively; default is none. +. +. +.SH "FILE SEARCHING" +.B hbf2gf +uses either the +.BR kpathsea , +.BR emtexdir , +or +.B MiKTeX +library for searching files +.RB ( emtexdir +will work only on operating systems which have an MS-DOSish background, +i.e., MS-DOS, OS/2, Windows; +.B MiKTeX +is for Win32 systems). +. +.SS kpathsea +Please note that older versions of +.B kpathsea +(<3.2) have no special means to seach for program related files. +Additionally, versions older than 3.3 have no default path for miscellaneous +fonts, thus we use the paths for PostScript related stuff if necessary for +fonts resp. configuration files. +The actual version of kpathsea is displayed on screen if you call +.B hbf2gf +.BR \-\-version . +.PP +Here is a table of the file type and the corresponding +.B kpathsea +variables. +.PP +Version\ 3.3 and newer (this won't change again in the future!): +.PP +.in +4m +.ta 2i +.br +.C "\&.hbf MISCFONTS" +.br +.C "\&.cfg HBF2GFINPUTS" +.PP +Version\ 3.2: +.PP +.in +4m +.ta 2i +.br +.C "\&.hbf T1FONTS" +.br +.C "\&.cfg HBF2GFINPUTS" +.PP +And here the same for pre-3.2-versions of +.B kpathsea: +.PP +.in +4m +.ta 2i +.br +.C "\&.hbf T1FONTS" +.br +.C "\&.cfg TEXCONFIG" +.PP +Finally, the same for versions\ \(<=2.6: +.PP +.in +4m +.ta 2i +.br +.C "\&.hbf DVIPSHEADERS" +.br +.C "\&.cfg TEXCONFIG" +.PP +Please consult the info files of +.B kpathsea +for details on these variables. +The decision which naming scheme to use for variables will be done during +compilation. +.PP +You should set the +.C TEXMFCNF +variable to the directory where your +.C texmf.cnf +configuration file resides. +.PP +Here is the proper command to find out to which value a +.B kpathsea +variable is set (we use +.C MISCFONTS +as an example). +This is especially useful if a variable isn't set in +.C texmf.cnf +or in the environment, thus pointing to the default value which is +hard-coded into the +.B kpathsea +library. +.PP +.in +2m +.C "kpsewhich \-progname=hbf2gf \-expand\-var='$MISCFONTS'" +.PP +We select the program name also since it is possible to specify +variables which are searched only for a certain program \(en in our +example it would be +.C MISCFONTS.hbf2gf . +.PP +A similar but not identical method is to say +.PP +.in +2m +.C "kpsewhich \-progname=hbf2gf \-show\-path='misc fonts'" +.PP +[A full list of format types can be obtained by saying \(oq\c +.C "kpsewhich \-\-help" \(cq +on the command line prompt.] +This is exactly how +.B hbf2gf +searches for files; the disadvantage is that all variables are expanded +which can cause very long strings. +. +.SS emtexdir +.PP +Here the list of suffixes and its related environment variables to be set in +.C autoexec.bat +(resp. in +.C config.sys +for OS/2): +.PP +.in +4m +.ta 2i +.br +.C "\&.hbf HBFONTS" +.br +.C "\&.cfg HBFCFG" +.PP +If one of the variables isn't set, a warning message is emitted. +The current directory will always be searched. +As usual, one exclamation mark appended to a directory path causes +subdirectories one level deep to be searched, two exclamation marks causes +all subdirectories to be searched. +Example: +.PP +.in +2m +.C HBFONTS=c:\\\\fonts\\\\hbf!!;d:\\\\myfonts\\\\hbf! +.PP +Constructions like \(oq\c +.C c:\\\\fonts!!\\\\hbf \(cq +aren't possible. +. +.SS MikTeX +.PP +Please consult the documentation files of +.B MiKTeX +for more details. +. +. +.SH LIMITATIONS +The x and y output size must not exceed +.BR MAX_CHAR_SIZE , +which is defined at compile time; its default value is 1023\ (pixel). +. +. +.SH "SEE ALSO" +.BR ttf2pk (1) +.PP +.C hbf2gf.w : +'in +\n(.ku +this is the source code written in +.B CWEB +which can be converted into a pretty-printed \*(TX +document using +.BR cweave . +The CJK package also contains a preformatted +.C hbf2gf.pdf +file. +.PP +the +.B CJK +documentation files (\c +.C hbf2gf.txt ). +.PP +the +.B Hanzi Bitmap File +.RB ( HBF ) +standard version\ 1.3; available at +.C \%ftp.ifcss.org . +.PP +the Omega documentation available at +.C ftp.ens.fr +and the CTAN hosts and mirrors. +. +. +.SH FILES +.TP +.C *.cfg +The +.B hbf2gf +configuration scripts. +.TP +.C *.hbf +HBF header files which describe fixed-width bitmap fonts. +Note that the bitmap font name(s) themselves as specified in the header files +are irrelevant for +.BR hbf2gf . +. +. +.SH AVAILABILITY +.B hbf2gf +is part of the CJK macro package for \*(LE +available at the CTAN hosts and its mirrors. +.PP +CJK fonts together with HBF header files can be found at +.C ftp.ifcss.org +and its mirrors. +. +. +.SH AUTHORS +Werner Lemberg +.C +.br +Ross Paterson (the HBF API) +.C diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.c b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.c new file mode 100644 index 00000000000..061e4191221 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.c @@ -0,0 +1,2302 @@ +#define banner \ +"hbf2gf (CJK ver. 4.8.2)" \ + \ + +#define TRUE 1 +#define FALSE 0 \ + +#define STRING_LENGTH 255 \ + +#define FILE_NAME_LENGTH 1024 \ + \ + +#define VERSION \ +"\n" \ +"Copyright (C) 1996-1999 Werner Lemberg.\n" \ +"There is NO warranty. You may redistribute this software\n" \ +"under the terms of the GNU General Public License\n" \ +"and the HBF library copyright.\n" \ +"\n" \ +"For more information about these matters, see the files\n" \ +"named COPYING and hbf.c.\n" \ +"\n" \ + +#define USAGE \ +"\n" \ +"Usage: hbf2gf [-q] configuration_file[.cfg]\n" \ +" hbf2gf [options] font_name x_resolution [y_scale | y_resolution]\n" \ +" hbf2gf -t [-q] font_name\n" \ +"\n" \ +" Convert a font in HBF format to TeX's GF resp. PK format.\n" \ +"\n" \ +" -q be silent\n" \ +" -p don't produce a PL file\n" \ +" -g don't produce a GF file\n" \ +" -n use no resolution in extension (only `.gf')\n" \ +" -t test for font_name (returns 0 on success)\n" \ +" --help print this message and exit\n" \ +" --version print version number and exit\n" \ +"\n" \ + +#define GF_ID 131 +#define PRE 247 \ + +#define header " hbf2gf output " \ + +#define BOC 67 +#define BOC1 68 +#define EOC 69 \ + +#define _2_16 65536.0 +#define _2_20 1048576.0 \ + +#define XXX1 239 +#define XXX2 240 +#define XXX3 241 +#define XXX4 242 \ + +#define YYY 243 \ + +#define POST 248 \ + +#define CHAR_LOC 245 +#define CHAR_LOC0 246 \ + +#define POSTPOST 249 +#define POSTPOST_ID 223 \ + +#define BLACK 1 +#define WHITE 0 \ + +#define PIXEL_MAXVAL 255 +#define SCALE 4096 +#define HALFSCALE 2048 \ + +#define MAX_CHAR_SIZE 1023 \ + +#define PAINT_(x) (x) +#define PAINT1 64 +#define PAINT2 65 +#define PAINT3 66 \ + +#define SKIP0 70 +#define SKIP1 71 +#define SKIP2 72 +#define SKIP3 73 \ + +#define NEW_ROW_(x) ((x) +74) \ + +#define NOOP 244 \ + +#define EXTENSION_LENGTH 8 \ + +#define GFTOPK_NAME "gftopk" +#define PLTOTF_NAME "pltotf" +#define OVP2OVF_NAME "ovp2ovf" \ + +#define PRINTER_MIN_RES_X 50 +#define PRINTER_MIN_RES_Y 50 \ + +#define VALID_SUBCODE 1 \ + +/*4:*/ +#line 193 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*10:*/ +#line 413 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#include +#include +#include +#include +#include +#ifdef TM_IN_SYS_TIME +#include +#endif +#include "hbf.h" + + + +/*:10*//*69:*/ +#line 2483 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +#ifdef VERY_OLD_KPATHSEA +#include "kpathsea/proginit.h" +#include "kpathsea/progname.h" +#include "kpathsea/tex-glyph.h" +#else +#include "kpathsea/kpathsea.h" +#endif + +#elif defined(HAVE_EMTEXDIR) +#include "emtexdir.h" + +#elif defined(HAVE_MIKTEX) +#include "miktex.h" +#endif + +/*:69*/ +#line 194 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*11:*/ +#line 431 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_file(void); + + +/*:11*//*13:*/ +#line 493 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_pre(void); + + +/*:13*//*16:*/ +#line 581 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_data(void); + + +/*:16*//*20:*/ +#line 692 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_post(void); + + +/*:20*//*25:*/ +#line 836 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void fputl(long,FILE*); + + +/*:25*//*29:*/ +#line 999 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void make_pixel_array(void); + + +/*:29*//*36:*/ +#line 1227 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void read_row(unsigned char*); + + +/*:36*//*39:*/ +#line 1279 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void write_row(unsigned char*); + + +/*:39*//*41:*/ +#line 1334 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_coding(void); + + +/*:41*//*45:*/ +#line 1495 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_pl(void); + + +/*:45*//*47:*/ +#line 1592 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_ovp(void); + + +/*:47*//*50:*/ +#line 1737 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_job(void); + + +/*:50*//*54:*/ +#line 1986 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void read_config(void); + + +/*:54*//*64:*/ +#line 2317 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +int fsearch(char*); + + +/*:64*//*67:*/ +#line 2457 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void config_error(char*); + + +/*:67*//*71:*/ +#line 2517 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char*TeX_search_version(void); + + +/*:71*//*74:*/ +#line 2552 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +extern int setup_list(struct emtex_dir*,char*,const char*,unsigned); +int dir_setup(struct emtex_dir*,const char*,const char*,unsigned); +char*file_find(char*,struct emtex_dir*); +#endif + + +/*:74*//*79:*/ +#line 2649 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char*TeX_search_cfg_file(char*); +char*TeX_search_hbf_file(char*); + + +/*:79*/ +#line 195 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*2:*/ +#line 129 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +int nmb_files= -1; +int unicode= FALSE; + +int testing= FALSE; + +int mf_like= FALSE; +int file_number= 0; + +double x_resolution= 0.0; +double y_scale= 1.0; + +int pk_files= TRUE; +int tfm_files= TRUE; +int long_extension= TRUE; +int quiet= FALSE; + +char config_file[FILE_NAME_LENGTH+4+1]; + +char output_name[STRING_LENGTH+1]; + +FILE*config,*out; +HBF*hbf; + +#ifdef msdos +#define WRITE_BIN "wb" +#define WRITE_TXT "wt" +#define READ_BIN "rb" +#define READ_TXT "rt" +#else +#define WRITE_BIN "w" +#define WRITE_TXT "w" +#define READ_BIN "r" +#define READ_TXT "r" +#endif + +int end_of_file= FALSE; + + +/*:2*//*15:*/ +#line 540 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +long char_adr[256]; +long*char_adr_p; + +int pk_offset_x; + + +double tfm_offset_x; +int pk_offset_y; + +double tfm_offset_y; + +int input_size_x; +int input_size_y; +const char*font_encoding; +int pk_width; +int pk_output_size_x; + +double tfm_output_size_x; +int pk_output_size_y; +double tfm_output_size_y; + +double design_size= 10.0; +double target_size_x; +double target_size_y; +double magstep_x; +double magstep_y; +double slant; +int rotation; + +double mag_x; +double mag_y; + +int empty_char; +int last_char; + +int dot_count; + + + +/*:15*//*19:*/ +#line 669 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char coding[STRING_LENGTH+1]; +char comment[STRING_LENGTH+1]; + +unsigned long checksum; + +long pk_total_min_x; +long pk_total_max_x; +long pk_total_min_y; +long pk_total_max_y; + +int dpi_x; +int dpi_y; +double ppp_x; +double ppp_y; + + +/*:19*//*27:*/ +#line 876 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +HBF_CHAR code; +const unsigned char*bitmap; + +unsigned char*bP; + +unsigned char out_char[MAX_CHAR_SIZE*MAX_CHAR_SIZE+1]; + +unsigned char*out_char_p; + +unsigned char pixelrow[MAX_CHAR_SIZE]; +unsigned char temp_pixelrow[MAX_CHAR_SIZE]; +unsigned char new_pixelrow[MAX_CHAR_SIZE+1]; + +int curr_row; + +long grayrow[MAX_CHAR_SIZE]; + +long s_mag_x,s_mag_y,s_slant; + + +/*:27*//*38:*/ +#line 1274 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +int threshold= 128; + + +/*:38*//*49:*/ +#line 1726 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char job_extension[EXTENSION_LENGTH+1]; +char rm_command[STRING_LENGTH+1]; +char cp_command[STRING_LENGTH+1]; +char pk_directory[STRING_LENGTH+1]; +char tfm_directory[STRING_LENGTH+1]; + +int ofm_file= FALSE; + + +/*:49*//*53:*/ +#line 1981 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char Buffer[STRING_LENGTH+1]; + + +/*:53*//*58:*/ +#line 2099 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +int offset_x; +int offset_y; + +HBF_CHAR user_min_char; +int have_min_char= FALSE; + +/*:58*//*60:*/ +#line 2256 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +HBF_CHAR min_char,max_char; + + +/*:60*//*62:*/ +#line 2283 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char b2_codes[256]; +unsigned char min_2_byte,max_2_byte; +int nmb_2_bytes= 0; + + +/*:62*//*70:*/ +#line 2501 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +#ifdef KPSEDLL + +extern KPSEDLL char*kpathsea_version_string; +#else +extern DllImport char*kpathsea_version_string; +#endif +#elif defined(HAVE_EMTEXDIR) +char emtex_version_string[]= "emTeXdir"; +#elif !defined(HAVE_MIKTEX) +char no_version_string[]= "no search library"; +#endif + + +/*:70*//*73:*/ +#line 2545 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +struct emtex_dir cfg_path,hbf_path; +#endif + + +/*:73*//*76:*/ +#line 2591 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char name_buffer[FILE_NAME_LENGTH+1]; + + +/*:76*/ +#line 196 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + + +int main(argc,argv) +int argc; +char*argv[]; + +{char*p; + +/*78:*/ +#line 2613 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +#ifdef OLD_KPATHSEA +kpse_set_progname(argv[0]); +#else +kpse_set_program_name(argv[0],"hbf2gf"); +#endif + +#ifdef VERY_OLD_KPATHSEA +kpse_init_prog("HBF2GF",300,"cx",true,"cmr10"); +#else +kpse_init_prog("HBF2GF",300,"cx","cmr10"); +#endif + +#elif defined(HAVE_EMTEXDIR) +if(!dir_setup(&cfg_path,"HBFCFG",NULL,EDS_BANG)) +{fprintf(stderr, +"Couldn't setup search path for configuration files\n"); +exit(1); +} +if(!dir_setup(&hbf_path,"HBFONTS",NULL,EDS_BANG)) +{fprintf(stderr, +"Couldn't setup search path for HBF header files\n"); +exit(1); +} +#endif + + +/*:78*/ +#line 205 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +/*7:*/ +#line 312 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +if(argc==2) +{if(strcmp(argv[1],"--help")==0) +/*6:*/ +#line 293 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{printf(USAGE); +exit(0); +} + + +/*:6*/ +#line 315 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +else if(strcmp(argv[1],"--version")==0) +/*5:*/ +#line 266 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{printf("\n"); +printf(banner); +printf(" (%s)\n",TeX_search_version()); +printf(VERSION); +exit(0); +} + + +/*:5*/ +#line 317 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +} + +while(argc> 1) +{p= argv[1]; +if(p[0]!='-') +break; +if(p[1]=='p') +tfm_files= FALSE; +else if(p[1]=='g') +pk_files= FALSE; +else if(p[1]=='n') +long_extension= FALSE; +else if(p[1]=='q') +quiet= TRUE; +else if(p[1]=='t') +testing= TRUE; + +argv++; +argc--; +} + +if(testing) +{if(argc!=2) +{fprintf(stderr,"Need exactly one parameter for `-t' option.\n"); +fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); +exit(1); +} +} +else if(argc<2||argc> 4) +{fprintf(stderr,"Invalid number of parameters.\n"); +fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); +exit(1); +} + + +/*:7*/ +#line 207 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +if(!quiet) +printf("\n%s\n\n",banner); + +strncpy(config_file,argv[1],FILE_NAME_LENGTH); +config_file[FILE_NAME_LENGTH]= '\0'; + +if(argc> 2||testing) +{int l= strlen(config_file); + +if(l> 2) +config_file[l-2]= '\0'; + +else +{if(!quiet) +printf("`%s' can't be a subfont created by hbf2gf\n", +config_file); +exit(2); +} + +mf_like= TRUE; +} + +read_config(); + +if(mf_like) +/*8:*/ +#line 357 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{if(unicode) +file_number= (int)strtol(&argv[1][strlen(argv[1])-2], +(char**)NULL,16); +else +file_number= atoi(&argv[1][strlen(argv[1])-2]); + +x_resolution= atof(argv[2]); +if(x_resolution 3) +{y_scale= atof(argv[3]); +if(y_scale<0.01) +{fprintf(stderr, +"Invalid vertical scaling factor or resolution\n"); +exit(1); +} +if(y_scale> 10.0) +y_scale= (double)x_resolution/y_scale; +} +} + + +/*:8*/ +#line 234 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +/*28:*/ +#line 908 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{int col,offset; + +if(rotation) +{int tmp; + + +tmp= input_size_x; +input_size_x= input_size_y; +input_size_y= tmp; +} + +if(mf_like) +{target_size_x= design_size*(x_resolution/dpi_x); +target_size_y= design_size*(x_resolution*y_scale/dpi_y); +} +else +target_size_x= target_size_y= design_size; +magstep_x= target_size_x/design_size; +magstep_y= target_size_y/design_size; + +pk_offset_x= offset_x*magstep_x+0.5; +pk_offset_y= offset_y*magstep_y+0.5; +tfm_offset_x= offset_x/(dpi_x/72.27)/design_size; +tfm_offset_y= offset_y/(dpi_y/72.27)/design_size; + +pk_width= input_size_x*mag_x*magstep_x+0.5; +pk_output_size_x= input_size_x*mag_x*magstep_x+ +input_size_y*mag_y*magstep_y*slant+0.5; +pk_output_size_y= input_size_y*mag_y*magstep_y+0.5; +tfm_output_size_x= input_size_x*mag_x/ +(dpi_x/72.27)/design_size; +tfm_output_size_y= input_size_y*mag_y/ +(dpi_y/72.27)/design_size; +if(pk_output_size_x> MAX_CHAR_SIZE) +{fprintf(stderr,"Output character box width too big\n"); +exit(1); +} +if(pk_output_size_y> MAX_CHAR_SIZE) +{fprintf(stderr,"Output character box height too big\n"); +exit(1); +} + +for(col= 0;col=0x100)) +{fprintf(stderr,"Invalid subfile number\n"); +exit(1); +} + +if(unicode) +{offset= 0; +code= file_number*0x100; +} +else +{offset= (file_number-1)*256%nmb_2_bytes; +code= (min_char&0xFF00)+min_2_byte+ +(file_number-1)*256/nmb_2_bytes*0x100; +} + +while(offset--) +while(!b2_codes[code++&0xFF]) + +; + +if(code> max_char) +{fprintf(stderr,"Invalid subfile number\n"); +exit(1); +} +} + +s_mag_x= mag_x*magstep_x*SCALE; +s_mag_y= mag_y*magstep_y*SCALE; +s_slant= slant*SCALE; +} + + +/*:28*/ +#line 236 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +/*9:*/ +#line 392 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{int j,max_numb; + +if(!mf_like) +{file_number= (unicode==TRUE?(min_char>>8):1); +if(nmb_files==-1) +max_numb= (unicode==TRUE?0x100:100); +else +max_numb= nmb_files; +} +else +max_numb= 1; + +for(j= 0;(j>24,f); +fputc(num>>16,f); +fputc(num>>8,f); +fputc(num,f); +} + + +/*:26*//*30:*/ +#line 1004 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void make_pixel_array(void) +{unsigned char*prP; +unsigned char*temp_prP; +unsigned char*new_prP; +long*grP; + +register unsigned char*xP; +register unsigned char*nxP; + +register int row,col; +int rows_read= 0; +register int need_to_read_row= 1; + +long frac_row_to_fill= SCALE; +long frac_row_left= s_mag_y; + +int no_code= FALSE; + + +prP= pixelrow; +temp_prP= temp_pixelrow; +new_prP= new_pixelrow; +grP= grayrow; +out_char_p= out_char; + +again: +if(b2_codes[code&0xFF]) +{if(pk_files) +{bitmap= hbfGetBitmap(hbf,code); +bP= (unsigned char*)bitmap; + + +if(!bitmap) +empty_char= TRUE; +else +/*31:*/ +#line 1063 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{if(pk_output_size_y==input_size_y) +temp_prP= prP; + +curr_row= input_size_y-1; +for(row= 0;row PIXEL_MAXVAL) +g= PIXEL_MAXVAL; + +*nxP= g; +grP[col]= HALFSCALE; +} + +frac_row_left-= frac_row_to_fill; +if(frac_row_left==0) +{frac_row_left= s_mag_y; +need_to_read_row= 1; +} +frac_row_to_fill= SCALE; + + +/*:33*/ +#line 1097 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +} + + +/*:32*/ +#line 1069 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*34:*/ +#line 1145 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +if(pk_width==input_size_x&&s_slant==0) + +write_row(temp_prP); +else +{register long g= HALFSCALE; +register long frac_col_to_fill= SCALE; +register long frac_col_left; +register int need_col= 0; + + +nxP= new_prP; + +frac_col_left= (pk_output_size_y-row)*s_slant; +while(frac_col_left>=frac_col_to_fill) +{*(nxP++)= 0; +frac_col_left-= frac_col_to_fill; +} + +if(frac_col_left> 0) +frac_col_to_fill-= frac_col_left; + +for(col= 0,xP= temp_prP;col=frac_col_to_fill) +{if(need_col) +{++nxP; +g= HALFSCALE; +} + +g+= frac_col_to_fill*(*xP); +g/= SCALE; +if(g> PIXEL_MAXVAL) +g= PIXEL_MAXVAL; + +*nxP= g; +frac_col_left-= frac_col_to_fill; +frac_col_to_fill= SCALE; +need_col= 1; +} + +if(frac_col_left> 0) +{if(need_col) +{++nxP; +g= HALFSCALE; +need_col= 0; +} + +g+= frac_col_left*(*xP); +frac_col_to_fill-= frac_col_left; +} +} + +/*35:*/ +#line 1203 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +if(frac_col_to_fill> 0) +{--xP; +g+= frac_col_to_fill*(*xP); +} + +if(!need_col) +{g/= SCALE; +if(g> PIXEL_MAXVAL) +g= PIXEL_MAXVAL; +*nxP= g; +} + +*(++nxP)= 0; + +write_row(new_prP); + + +/*:35*/ +#line 1198 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +} + + +/*:34*/ +#line 1071 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +} +} + + +/*:31*/ +#line 1040 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +} +} +else +no_code= TRUE; + +if((code&0xFF)==max_2_byte) +code+= 0xFF-(max_2_byte-min_2_byte); +if(code>=max_char) +{end_of_file= TRUE; +return; +} + +code++; + +if(no_code) +{no_code= FALSE; +goto again; +} +} + + +/*:30*//*37:*/ +#line 1235 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void read_row(pixelrow) +unsigned char*pixelrow; + +{register int col,bitshift,offset; +register unsigned char*xP; +register unsigned char item= 0; + +if(rotation) +{bitshift= 7-(curr_row%8); +offset= (input_size_y+7)/8; +bP= (unsigned char*)bitmap+curr_row/8; +for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; +bP+= offset; +} +curr_row--; +} +else +{bitshift= -1; +for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; +--bitshift; +} +} +} + + +/*:37*//*40:*/ +#line 1287 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void write_row(pixelrow) +unsigned char*pixelrow; + +{register int col; +register unsigned char*xP; + +for(col= 0,xP= pixelrow;col=threshold)?1:0; + +} + + +/*:40*//*42:*/ +#line 1342 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_coding(void) +{register int count,skip; +register unsigned char paint; +register int x,y; +register unsigned char*cp; + +x= 0; +y= 0; +cp= out_char+y*pk_output_size_x+x; +count= skip= 0; +paint= WHITE; +goto start; + +while(y>8,out); +fputc(count&0xFF,out); +} +} +} +else +{if(skip==1) +fputc(SKIP0,out); +else +{if(skip<256) +{fputc(SKIP1,out); +fputc(skip,out); +} +else +{fputc(SKIP2,out); +fputc(skip>>8,out); +fputc(skip&0xFF,out); +} +} +skip= 0; +if(count<64) +fputc(PAINT_(count),out); +else if(count<256) +{fputc(PAINT1,out); +fputc(count,out); +} +else +{fputc(PAINT2,out); +fputc(count>>8,out); +fputc(count&0xFF,out); +} +} +count= 0; +paint= BLACK; +break; +} +x++; +cp++; +} +if(x>=pk_output_size_x) +{skip++; +y++; +continue; +} + + +/*:43*/ +#line 1357 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +start: +/*44:*/ +#line 1434 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +while(x>8,out); +fputc(count&0xFF,out); +} +count= 1; +paint= BLACK-paint; +} +x++; +cp++; +} +if(paint==BLACK) +{if(count<64) +fputc(PAINT_(count),out); +else if(count<256) +{fputc(PAINT1,out); +fputc(count,out); +} +else +{fputc(PAINT2,out); +fputc(count>>8,out); +fputc(count&0xFF,out); +} +paint= WHITE; +} + + + +/*:44*/ +#line 1359 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +y++; +} +} + + +/*:42*//*46:*/ +#line 1500 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void write_pl(void) +{int i,pos; +char output_file[FILE_NAME_LENGTH+1]; +long t,sc; +char*s; +char tfm_header[]= "Created by hbf2gf"; + +file_number--; + +if(mf_like) +{if(unicode) +sprintf(output_file,"%s%02x.pl",output_name,file_number); +else +sprintf(output_file,"%s%02i.pl",output_name,file_number); +} +else +sprintf(output_file,"%s.pl",output_name); + +if(!(out= fopen(output_file,WRITE_TXT))) +{fprintf(stderr,"Couldn't open `%s'\n",output_file); +exit(1); +} +if(!quiet) +printf("\nWriting `%s'\n",output_file); + +fprintf(out, +"\n(FAMILY %s%d)" +"\n(CODINGSCHEME CJK-%s)", +output_name,file_number,font_encoding); + +fprintf(out, +"\n(DESIGNSIZE R %.6f)" +"\n(COMMENT DESIGNSIZE IS IN POINTS)" +"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" +"\n(CHECKSUM O %lo)" +"\n(FONTDIMEN" +"\n (SLANT R %.6f)" +"\n (SPACE R 0.0)" +"\n (STRETCH R 0.0)" +"\n (SHRINK R 0.0)" +"\n (XHEIGHT R 1.0)" +"\n (QUAD R 1.0)" +"\n (EXTRASPACE R 0.0)" +"\n )",design_size,checksum,slant); + +s= tfm_header; +i= strlen(s); +t= ((long)i)<<24; +sc= 16; +pos= 18; + +fprintf(out,"\n"); +while(i> 0) +{t|= ((long)(*(unsigned char*)s++))<=256) +nmb_subfonts++; + +sprintf(output_file,"%s.ovp",output_name); + +if(!(out= fopen(output_file,WRITE_TXT))) +{fprintf(stderr,"Couldn't open `%s'\n",output_file); +exit(1); +} +if(!quiet) +printf("\nWriting `%s'\n",output_file); + +fprintf(out, +"\n(VTITLE Omega virtual font created by hbf2gf)" +"\n(DESIGNSIZE R %.6f)" +"\n(COMMENT DESIGNSIZE IS IN POINTS)" +"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" +"\n(CHECKSUM O %lo)" +"\n(FONTDIMEN" +"\n (SLANT R %.6f)" +"\n (SPACE R 0.0)" +"\n (STRETCH R 0.0)" +"\n (SHRINK R 0.0)" +"\n (XHEIGHT R 1.0)" +"\n (QUAD R 1.0)" +"\n (EXTRASPACE R 0.0)" +"\n )",design_size,checksum,slant); + +s= ofm_header; +i= strlen(s); +t= ((long)i)<<24; +sc= 16; +pos= 18; + +fprintf(out,"\n"); +while(i> 0) +{t|= ((long)(*(unsigned char*)s++))<>8),j= 0;j>8),j= 0;jhbf_height; +input_size_y= boxp->hbf_width; +font_encoding= hbfProperty(hbf,"HBF_CODE_SCHEME"); + +if(!fsearch("output_name")) +config_error("output_name"); +else +strcpy(output_name,Buffer); +} + + +/*:57*/ +#line 2033 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*59:*/ +#line 2107 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{if(fsearch("nmb_files")) +nmb_files= atoi(Buffer); +if(fsearch("unicode")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +unicode= TRUE; +if(fsearch("min_char")) +{user_min_char= strtoul(Buffer,(char**)NULL,0); +have_min_char= TRUE; +} + +if(!mf_like) +{if(fsearch("pk_files")) +if(Buffer[0]=='n'||Buffer[0]=='N') +pk_files= FALSE; +if(fsearch("tfm_files")) +if(Buffer[0]=='n'||Buffer[0]=='N') +tfm_files= FALSE; +if(fsearch("ofm_file")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +ofm_file= TRUE; +if(fsearch("long_extension")) +if(Buffer[0]=='n'||Buffer[0]=='N') +long_extension= FALSE; +} + +if(fsearch("slant")) +slant= atof(Buffer); +if(slant<0.0||slant> 1.0) +{fprintf(stderr,"Invalid slant\n"); +exit(1); +} +if(fsearch("rotation")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +rotation= TRUE; + +if(fsearch("mag_x")) +mag_x= atof(Buffer); +if(fsearch("mag_y")) +mag_y= atof(Buffer); +if(!mag_x&&!mag_y) +{mag_x= 1.0; +mag_y= 1.0; +} +if(mag_x&&!mag_y) +mag_y= mag_x; +if(mag_y&&!mag_x) +mag_x= mag_y; +if(mag_x<=0.0) +{fprintf(stderr,"Invalid horizontal magnification\n"); +exit(1); +} +if(mag_y<=0.0) +{fprintf(stderr,"Invalid vertical magnification\n"); +exit(1); +} + +if(fsearch("dpi_x")) +dpi_x= atoi(Buffer); +if(fsearch("dpi_y")) +dpi_y= atoi(Buffer); +if(!dpi_x&&!dpi_y) +{dpi_x= 300; +dpi_y= 300; +} +if(dpi_x&&!dpi_y) +dpi_y= dpi_x; +if(dpi_y&&!dpi_x) +dpi_x= dpi_y; +if(dpi_x<=PRINTER_MIN_RES_X) +{fprintf(stderr,"Invalid horizontal printer resolution\n"); +exit(1); +} +if(dpi_y<=PRINTER_MIN_RES_Y) +{fprintf(stderr,"Invalid vertical printer resolution\n"); +exit(1); +} + +if(fsearch("design_size")) +design_size= atof(Buffer); + +if(fsearch("x_offset")) +offset_x= atoi(Buffer); +else +offset_x= rotation?0:(boxp->hbf_xDisplacement*mag_x+0.5); +if(fsearch("y_offset")) +offset_y= atoi(Buffer); +else +offset_y= rotation?0:(boxp->hbf_yDisplacement*mag_y+0.5); +if(!fsearch("comment")) +comment[0]= '\0'; +else +strcpy(comment,Buffer); + +if(fsearch("threshold")) +threshold= atoi(Buffer); +if(threshold<=0||threshold>=255) +{fprintf(stderr,"Invalid threshold\n"); +exit(1); +} + +if(!fsearch("checksum")) +checksum= 0; +else +checksum= strtoul(Buffer,(char**)NULL,0); + +if(!fsearch("coding")) +coding[0]= '\0'; +else +strcpy(coding,Buffer); + +if(!fsearch("pk_directory")) +pk_directory[0]= '\0'; +else +strcpy(pk_directory,Buffer); + +if(!fsearch("tfm_directory")) +tfm_directory[0]= '\0'; +else +strcpy(tfm_directory,Buffer); + +if(fsearch("rm_command")) +strcpy(rm_command,Buffer); +else +strcpy(rm_command,"rm"); + +if(fsearch("cp_command")) +strcpy(cp_command,Buffer); +else +strcpy(cp_command,"cp"); + +if(!fsearch("job_extension")) +job_extension[0]= '\0'; +else +{strncpy(job_extension,Buffer,EXTENSION_LENGTH); +job_extension[EXTENSION_LENGTH]= '\0'; +} +} + + +/*:59*/ +#line 2034 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +/*61:*/ +#line 2261 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{const void*cp; +HBF_CHAR dummy; + +cp= hbfGetCodeRange(hbf,NULL,&min_char,&max_char); +for(;cp!=NULL;cp= hbfGetCodeRange(hbf,cp,&dummy,&max_char)) +; + +if(have_min_char) +min_char= user_min_char; +} + + +/*:61*/ +#line 2036 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +/*63:*/ +#line 2290 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{const void*b2r; +unsigned char dummy; +int i; + +for(i= 0;i<256;i++) +b2_codes[i]= 0; + +b2r= hbfGetByte2Range(hbf,NULL,&min_2_byte,&max_2_byte); +dummy= min_2_byte; +for(;b2r!=NULL;b2r= hbfGetByte2Range(hbf,b2r,&dummy,&max_2_byte)) +{for(i= dummy;i<=max_2_byte;i++) +b2_codes[i]= VALID_SUBCODE; +} + +for(i= 0;i<256;i++) +if(b2_codes[i]==VALID_SUBCODE) +nmb_2_bytes++; +} + + +/*:63*/ +#line 2037 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + + +fclose(config); +} + + +/*:55*//*65:*/ +#line 2322 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +int fsearch(search_string) +char*search_string; + +{char*P,p; +char temp_buffer[STRING_LENGTH+1]; +char env_name[STRING_LENGTH+1]; +char*env_p; +char*env_value; +char*Buf_p; +int Ch,ch,old_ch= '\n'; +int count= STRING_LENGTH; + +rewind(config); + +do +{P= search_string; +p= tolower(*P); +Ch= fgetc(config); +ch= tolower(Ch); +while(!(ch==p&&old_ch=='\n')&&Ch!=EOF) + + +{old_ch= ch; +Ch= fgetc(config); +ch= tolower(Ch); +} + +for(;;) +{if(*(++P)=='\0') +if((Ch= fgetc(config))==' '||Ch=='\t') + +goto success; +Ch= fgetc(config); +if(tolower(Ch)!=tolower(*P)) +break; +} +} +while(Ch!=EOF); + +return 0; + +success: +P= temp_buffer; + +while((Ch= fgetc(config))==' '||Ch=='\t') + +; +while(Ch!='\n'&&--count> 0&&Ch!=EOF) +{*P++= Ch; +Ch= fgetc(config); +} +*P= '\0'; + +if(*temp_buffer) +/*66:*/ +#line 2402 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +{P= temp_buffer; +Buf_p= Buffer; +count= STRING_LENGTH-1; + +while(*P&&count> 0) +{env_p= env_name; + +if(*P=='$') +{P++; +if(*P=='$') +{*(Buf_p++)= *(P++); +count--; +continue; +} +while(*P=='{') +P++; +if(!(isalpha(*P)||*P=='_')) +{fprintf(stderr, +"Invalid environment variable name in configuration file\n"); +exit(1); +} +*(env_p++)= *(P++); +while(*P) +{if(isalnum(*P)||*P=='_') +*(env_p++)= *(P++); +else +{while(*P=='}') +P++; +*env_p= '\0'; +break; +} +} + +env_value= getenv(env_name); +if(env_value) +{while(*env_value&&count> 0) +{*(Buf_p++)= *(env_value++); +count--; +} +} +} +else +{*(Buf_p++)= *(P++); +count--; +} +} +*Buf_p= '\0'; +} + + +/*:66*/ +#line 2377 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +else +*Buffer= '\0'; + +return(*Buffer)?1:0; +} + + +/*:65*//*68:*/ +#line 2462 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +void config_error(message) +char*message; + +{fprintf(stderr,"Couldn't find `%s' entry in configuration file\n", +message); +exit(1); +} + + + +/*:68*//*72:*/ +#line 2522 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char*TeX_search_version(void) +{ +#if defined(HAVE_LIBKPATHSEA) +return kpathsea_version_string; +#elif defined(HAVE_EMTEXDIR) +return emtex_version_string; +#elif defined(HAVE_MIKTEX) +char buf[200]; + +strcpy(buf,"MiKTeX "); +miktex_get_miktex_version_string_ex(buf+7,sizeof(buf)-7); + +return buf; +#else +return no_version_string; +#endif +} + + +/*:72*//*75:*/ +#line 2564 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +int dir_setup(ed,env,dir,flags) +struct emtex_dir*ed; +const char*env; +const char*dir; +unsigned flags; + +{const char*val; +char path[260]; + +ed->alloc= 0; +ed->used= 0; +ed->list= NULL; + +if(env!=NULL&&(val= getenv(env))!=NULL) +return setup_list(ed,path,val,flags); +else +fprintf(stderr, +"Environment variable `%s' not set; use current directory\n", +env); + +return TRUE; +} + + +/*:75*//*77:*/ +#line 2596 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +char*file_find(name,list) +char*name; +struct emtex_dir*list; + +{if(emtex_dir_find(name_buffer,sizeof(name_buffer),list,name,EDF_CWD)) +return name_buffer; + +return NULL; +} +#endif + + +/*:77*//*80:*/ +#line 2655 "/home/wl/git/cjk/cjk-4.8.2/utils/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +char*TeX_search_cfg_file(name) +char*name; + +{ +#ifdef OLD_KPATHSEA +return kpse_find_file(name,kpse_dvips_config_format,TRUE); +#else +return kpse_find_file(name,kpse_program_text_format,TRUE); +#endif +} + + +char*TeX_search_hbf_file(name) +char*name; + +{ +#ifdef VERY_OLD_KPATHSEA +return kpse_find_file(name,kpse_dvips_header_format,TRUE); +#else +#ifndef KPSEDLL +return kpse_find_file(name,kpse_type1_format,TRUE); +#else +return kpse_find_file(name,kpse_miscfonts_format,TRUE); +#endif +#endif +} + + +#elif defined(HAVE_EMTEXDIR) +char*TeX_search_cfg_file(name) +char*name; + +{return file_find(name,&cfg_path); +} + + +char*TeX_search_hbf_file(name) +char*name; + +{return file_find(name,&hbf_path); +} + + +#elif defined(HAVE_MIKTEX) +char*TeX_search_cfg_file(name) +char*name; + +{char result[_MAX_PATH]; + +if(!miktex_find_input_file("hbf2gf",*name,result)) +return 0; +return strdup(result); +} + + +char*TeX_search_hbf_file(name) +char*name; + +{char result[_MAX_PATH]; + + +if(!miktex_find_miscfont_file(*name,result)) +return 0; +return strdup(result); +} + + +#else +char*TeX_search_cfg_file(name) +char*name; + +{return name; +} + + +char*TeX_search_hbf_file(name) +char*name; + +{return name; +} +#endif + + + +/*:80*/ diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.def b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.def new file mode 100644 index 00000000000..0137e4ac9e3 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.def @@ -0,0 +1,3 @@ +NAME HBF2GF WINDOWCOMPAT +DESCRIPTION 'hbf2gf (CJK Ver. 4.8.2)' +STACKSIZE 0x80000 diff --git a/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.w b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.w new file mode 100644 index 00000000000..f96282776f1 --- /dev/null +++ b/Build/source/texk/cjkutils/cjkutils-4.8.2/hbf2gf/hbf2gf.w @@ -0,0 +1,2808 @@ +% This is the cweb file hbf2gf.w of the CJK package ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +ai hbf2gf.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\font\meta=logo10 +\def\mf{{\meta META}\-{\meta FONT}} +\def\Om{\char "0A} % Omega symbol + +\def\title{hbf2gf (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont hbf2gf} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright~1996-1999 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice are + preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + + +\def\msdos{\.{msdos}} +@s msdos TeX + +@s HBF int +@s HBF_CHAR int +@s HBF_BBOX int + +@s __inline__ int + + +@* Introduction. +This is the \.{hbf2gf} program by Werner Lemberg +(\.{wl@@gnu.org}). + +The ``banner line'' defined here should be changed whenever \.{hbf2gf} is +modified. + +@d banner +"hbf2gf (CJK ver. 4.8.2)" + + +@ +\.{hbf2gf} is intended to convert Hanzi Bitmap Fonts (HBF) into \TeX\ +generic font files (\.{GF} files) according to the \\{CJK} package, which +\.{hbf2gf} is part of. + +The outline of \.{hbf2gf} is simple: a CJK (Chinese/Japanese/Korean) bitmap +file will be scaled and written in at most |nmb_files| \.{GF} files, each +file containing |256|~characters (except the last and possibly the first +one). In the normal case it's not necessary to compute the right value of +|nmb_files| because \.{hbf2gf} will do this; you should use |-1| instead to +indicate this. See the last section for an example. + +Alternatively you can call \.{hbf2gf} similar to \mf, i.e., the program will +compute one font on demand. This mode will be used if two or three input +parameters instead of one are given: the font name, the horizontal +resolution, and optionally a vertical scaling factor or resolution to allow +modes for e.g.\ $300\times600\,\hbox{dpi}$ printers. \.{hbf2gf} will extract +the configuration file name from the font name; if this file isn't found, +the program exits with error code~|2| (this is useful for scripts like +\.{mktexpk}). If the configuration file is found but an error occurs while +computing the font, error code~|1| is returned. In case of success, the exit +code is zero. + +The characters in the input font files are completely described by the HBF +header file. This program uses the HBF API implementation of Ross Paterson +(\.{ross@@soi.city.ac.uk}; with small extensions). You will find a +description of the HBF standard at \.{ftp.ifcss.org}. + +A batch file created by \.{hbf2gf} too (if the program computes a whole set +of subfonts) will convert the \.{GF} files to \.{PK} files using +\.{GFtoPK}, a part of every \TeX\ package. + +@d TRUE 1 +@d FALSE 0@# + +@d STRING_LENGTH 255 + /* the maximal length of an input string in the configuration file */ +@d FILE_NAME_LENGTH 1024 + /* the maximal length (including the path) of a filename */@# + +@= +int nmb_files = -1; /* create all files by default */ +int unicode = FALSE; /* whether a Unicode font should be processed */@# + +int testing = FALSE; /* whether we test only the font name */@# + +int mf_like = FALSE; /* whether we are in the \mf-like mode */ +int file_number = 0; /* the subfont number */@# + +double x_resolution = 0.0; /* the second and third input parameter */ +double y_scale = 1.0;@# + +int pk_files = TRUE; /* command line options */ +int tfm_files = TRUE; +int long_extension = TRUE; +int quiet = FALSE;@# + +char config_file[FILE_NAME_LENGTH + 4 + 1]; + /* we probably must add `\.{.cfg}' */ +char output_name[STRING_LENGTH + 1];@# + +FILE *config, *out; +HBF *hbf;@# + +#ifdef msdos /* if we compile under DOS or OS/2 */ +#define WRITE_BIN "wb" +#define WRITE_TXT "wt" +#define READ_BIN "rb" +#define READ_TXT "rt" +#else +#define WRITE_BIN "w" +#define WRITE_TXT "w" +#define READ_BIN "r" +#define READ_TXT "r" +#endif@# + +int end_of_file = FALSE; + + +@ +One \.{PL} file will be created additionally, which describes the font +metrics in a readable way. Because all CJK characters have identical +bounding boxes, one metrics file is enough---the batch job created by +\.{hbf2gf} calls \.{PLtoTF} to produce this \.{TFM} file and then copies +it into |nmb_files| metrics files. There usually will be a discrepancy +between the number of characters in the last \.{GF} file and the +\.{TFM} file, but this does not harm. + +If you specify the \.{ofm\_file} option in the configuration file, an +extended virtual property file (such files have the extension \.{.ovp}) for +the \Om\ system is written; this will be then converted with +\.{ovp2ovf} into an \.{OFM} and an \.{OVF} file to map all the subfonts +into one large virtual font. + + + +@* The main routine. +The main routine takes |file_name|, |x_resolution|, and |y_scale| as command +line parameters if in \mf-like mode, otherwise |config_file| as the only +argument. |read_config()| scans the configuration file and fills the global +variables, |write_file()| writes the \.{GF} files, |write_pl()| and +|write_ovp()| write the \.{PL} and \.{OVP} files respectively, and +|write_job()| the batch file. + +@c +@@; +@@; +@@;@# + + +int main(int argc, char *argv[]) + {char *p; + + @@;@# + + @@;@# + + if(!quiet) + printf("\n%s\n\n", banner);@# + + strncpy(config_file, argv[1], FILE_NAME_LENGTH); + config_file[FILE_NAME_LENGTH] = '\0';@# + + if(argc > 2 || testing) + {int l = strlen(config_file); + + if(l > 2) + config_file[l - 2] = '\0'; + /* strip subfont number from file name */ + else + {if(!quiet) + printf("`%s' can't be a subfont created by hbf2gf\n", + config_file); + exit(2); + }@# + + mf_like = TRUE; + }@# + + read_config(); /* will call |exit(1)| on errors */@# + + if(mf_like) + @@;@# + + @@;@# + + @@;@# + + if(tfm_files) + write_pl(); + if(ofm_file) + write_ovp(); + if(!mf_like) + write_job();@# + + hbfClose(hbf);@# + + exit(0); + return 0; /* never reached */ + } + + +@ +@d VERSION @/ +"\n"@/ +"Copyright (C) 1996-1999 Werner Lemberg.\n"@/ +"There is NO warranty. You may redistribute this software\n"@/ +"under the terms of the GNU General Public License\n"@/ +"and the HBF library copyright.\n"@/ +"\n"@/ +"For more information about these matters, see the files\n"@/ +"named COPYING and hbf.c.\n"@/ +"\n" + +@= + {printf("\n"); + printf(banner); + printf(" (%s)\n", TeX_search_version()); + printf(VERSION); + exit(0); + } + + +@ +@d USAGE @/ +"\n"@/ +"Usage: hbf2gf [-q] configuration_file[.cfg]\n"@/ +" hbf2gf [options] font_name x_resolution [y_scale | y_resolution]\n"@/ +" hbf2gf -t [-q] font_name\n"@/ +"\n"@/ +" Convert a font in HBF format to TeX's GF resp. PK format.\n"@/ +"\n"@/ +" -q be silent\n"@/ +" -p don't produce a PL file\n"@/ +" -g don't produce a GF file\n"@/ +" -n use no resolution in extension (only `.gf')\n"@/ +" -t test for font_name (returns 0 on success)\n"@/ +" --help print this message and exit\n"@/ +" --version print version number and exit\n"@/ +"\n" + +@= + {printf(USAGE); + exit(0); + } + + +@ +Three options can be specified to the program (\.{-p}, \.{-g}, and \.{-n}) +if in \mf-like mode to suppress creation of a \.{PL} resp.\ a +\.{GF} file, and to force a `\.{.gf}' extension (instead of +e.g.\ `\.{.300gf}'). The corresponding setting of a particular switch in the +configuration file is ignored then. + +Additionally, the option \.{-t} tests whether the specified subfont name +leads to an \.{hbf2gf} configuration file. It returns 0 on success and prints +out the name of that configuration file (provided the \.{-q} switch isn't +set). This test isn't a thorough one; it only removes the last two characters +and checks whether a configuration file with that name exists. + +@= + if(argc == 2) + {if(strcmp(argv[1], "--help") == 0) + @@; + else if(strcmp(argv[1], "--version") == 0) + @@; + }@# + + while(argc > 1) + {p = argv[1]; + if(p[0] != '-') + break; + if(p[1] == 'p') + tfm_files = FALSE; + else if(p[1] == 'g') + pk_files = FALSE; + else if(p[1] == 'n') + long_extension = FALSE; + else if(p[1] == 'q') + quiet = TRUE; + else if(p[1] == 't') + testing = TRUE;@# + + argv++; + argc--; + }@# + + if(testing) + {if(argc != 2) + {fprintf(stderr, "Need exactly one parameter for `-t' option.\n"); + fprintf(stderr, "Try `hbf2gf --help' for more information.\n"); + exit(1); + } + } + else if(argc < 2 || argc > 4) + {fprintf(stderr, "Invalid number of parameters.\n"); + fprintf(stderr, "Try `hbf2gf --help' for more information.\n"); + exit(1); + }@# + + +@ +If the (optional) argument is larger than~|10|, we treat it as a value for +the vertical resolution (in dpi), otherwise as a vertical scaling factor. + +@= + {if(unicode) + file_number = (int)strtol(&argv[1][strlen(argv[1]) - 2], + (char **)NULL, 16); + else + file_number = atoi(&argv[1][strlen(argv[1]) - 2]);@# + + x_resolution = atof(argv[2]); + if(x_resolution < PRINTER_MIN_RES_X) + {fprintf(stderr, "Invalid horizontal resolution\n"); + exit(1); + }@# + + if(argc > 3) + {y_scale = atof(argv[3]); + if(y_scale < 0.01) + {fprintf(stderr, + "Invalid vertical scaling factor or resolution\n"); + exit(1); + } + if(y_scale > 10.0) + y_scale = (double)x_resolution / y_scale; + } + } + + +@ +If |unicode| is |TRUE|, the start value of the running number appended to +the base name of the output font files is taken from the HBF header file, +otherwise it starts with~`\.{01}'. |min_char| represents the lower bound of +the code range. + +If we are in \mf-like mode, |file_number| is taken from the command line, +and |max_numb| will be set to~|1|. + +@= + {int j, max_numb; + + if(!mf_like) + {file_number = (unicode == TRUE ? (min_char >> 8) : 1); + if(nmb_files == -1) + max_numb = (unicode == TRUE ? 0x100 : 100); + else + max_numb = nmb_files; + } + else + max_numb = 1;@# + + for(j = 0; (j < max_numb) && !end_of_file; file_number++, j++) + write_file();@# + + nmb_files = j; /* the real number of output font files */ + } + + +@ +@= +#ifdef HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef TM_IN_SYS_TIME +#include +#endif +#include "hbf.h" + + + +@* The functions. +The first function to be described is |write_file()|. Each \.{GF} file +consists of three sections: a preamble, a data section, and a postamble. The +functions |write_pre()|, |write_data()|, and |write_post()| handle this. + +@= +void write_file(void); + + +@ +In \mf-like mode we create font file name extensions similar to \mf\ if +the \.{-n} option isn't specified; otherwise only `\.{.gf}' will be appended. + +@c +void write_file(void) + {char output_file[FILE_NAME_LENGTH + 1]; + + + if(pk_files) + {if(mf_like) + {if(unicode) + sprintf(output_file, "%s%02x.%.0igf",@/ + output_name, file_number, + long_extension ? (int)(x_resolution + 0.5) : 0); + else + sprintf(output_file, "%s%02i.%.0igf",@/ + output_name, file_number, + long_extension ? (int)(x_resolution + 0.5) : 0); + } + else + {if(unicode) + sprintf(output_file, "%s%02x.gf", output_name, file_number); + else + sprintf(output_file, "%s%02i.gf", output_name, file_number); + } + if(!(out = fopen(output_file, WRITE_BIN))) + {fprintf(stderr, "Couldn't open `%s'\n", output_file); + exit(1); + } + if(!quiet) + printf("Writing `%s' ", output_file);@# + + write_pre(); + write_data(); + write_post(); + fclose(out);@# + + if(!quiet) + printf("\n"); + } + else + write_data(); + } + + +@ +The preamble has two bytes at the very beginning, |PRE| and |GF_ID|. |PRE| +starts the preamble, and |GF_ID| is the Generic Font Identity Byte. The next +bytes are a string in Pascal format containing a header, the date, and the +time. Strings in Pascal format start with the length of the string and have +no terminating NULL byte. + +@d GF_ID 131 +@d PRE 247@# + +@d header " hbf2gf output " + +@= +void write_pre(void); + + +@ +@s tm int + +@c +void write_pre(void) + {char out_s[40], s[20]; + time_t secs_now; + struct tm *time_now; + + + strcpy(out_s, header);@# + + secs_now = time(NULL); /* system date and time */ + time_now = localtime(&secs_now); + strftime(s, 20, "%Y.%m.%d:%H.%M", time_now); + strcat(out_s, s);@# + + fputc(PRE, out); + fputc(GF_ID, out); + fputc(strlen(out_s), out); + fputs(out_s, out); + } + + +@ +|write_data()| produces the middle part of the \.{GF} file. It first sets +|char_adr_p| equal to the address of |char_adr[]| which will contain file +offsets of the compressed characters. + +|input_size_x| and |input_size_y| reflect the original dimensions of the +bitmap font, |pk_output_size_x| and |pk_output_size_y| contain the width and +height of the output character box (in pixels), |pk_offset_x| and +|pk_offset_y| define the baseline of the font. The same names starting with +`\\{tfm\_}' instead of `\\{pk\_}' are used for \.{TFM} files (values are +multiples of design size). |mag_x| and |mag_y| hold the scaling factors +which are needed to reach |design_size|. |slant| defines the slant ($\Delta +x / \Delta y$), |target_size_x| and |target_size_y| will be the final +dimensions; |magstep_x = target_size_x / design_size| is \TeX's +\.{\\magstep}. + +The \CEE/ standard specifies that all global values will be automatically +set to~|0| if no initialization value is given. + +@= +long char_adr[256]; +long *char_adr_p;@# + +int pk_offset_x; + /* horizontal offset (increase character width a bit; will be applied on + both the left and the right side) */ +double tfm_offset_x; +int pk_offset_y; + /* vertical offset (must be configured to desired font size) */ +double tfm_offset_y;@# + +int input_size_x; +int input_size_y; +const char *font_encoding; /* taken from the HBF file */ +int pk_width; /* without slant */ +int pk_output_size_x; + /* the output character box dimensions without offsets */ +double tfm_output_size_x; +int pk_output_size_y; +double tfm_output_size_y;@# + +double design_size = 10.0; /* in points */ +double target_size_x; /* in points */ +double target_size_y; +double magstep_x; +double magstep_y; +double slant; +int rotation;@# + +double mag_x; /* horizontal and vertical magnification values */ +double mag_y;@# + +int empty_char; /* a flag whether the character does not exist or is empty */ +int last_char; /* the last valid character in a \.{GF} file */@# + +int dot_count; /* this counts the processed characters; + every ten characters a dot is output to the screen */ + + +@ +@= +void write_data(void); + + +@ +@c +void write_data(void) + {dot_count = 0; + char_adr_p = char_adr;@# + + for(last_char = 0; (last_char < 256) && !end_of_file; last_char++) + @@; + } + + +@ +The code in this section saves the current file position first and calls +|make_pixel_array()|, which expands and scales the character bitmap. + +|BOC| (and |BOC1|), the Begin Of Character command byte, must be followed by +the character code and the dimensions of the character as explained in +``\mf---the program'' (corrected by vertical and horizontal offsets). + +|write_coding()| compresses and outputs the bitmap; |EOC| (End Of Character) +finishes the current character. + +@d BOC 67 +@d BOC1 68 /* simplified version of |BOC| */ +@d EOC 69 + +@= + {if(dot_count++ % 10 == 0) /* a progress report for impatient users */ + if(pk_files && !quiet) + {printf("."); + fflush(stdout); + }@# + + empty_char = FALSE; + make_pixel_array(); + if(end_of_file) + return;@# + + if(pk_files) + {*char_adr_p = ftell(out); + char_adr_p++;@# + + if(empty_char) + {fputc(BOC1, out); + fputc((unsigned char)last_char, out); + fputc(0, out); + fputc(0, out); + fputc(0, out); + fputc(0, out); + fputc(EOC, out); + } + else + {fputc(BOC, out); + fputl(last_char, out); + fputl(-1L, out); + fputl(pk_offset_x, out); + fputl(pk_output_size_x + pk_offset_x, out); + fputl(pk_offset_y, out); + fputl(pk_output_size_y + pk_offset_y, out);@# + + write_coding();@# + + fputc(EOC, out); + } + } + } + + +@ +The current \.{GF} file will be completed with data written by +|write_post()|. The end consists of three sections: ``special'', ``post'', +and ``postpost''. The first contains material not used by \TeX\ itself but +which can be used by other programs like \.{GFtoDVI} or for documentary +purposes (|coding[]| and |comment[]|). The second describes the font as a +whole, and the last marks the end of the file. + +|pk_total_min_x| up to |pk_total_max_y| define the greatest bounding box of +this file (including offsets); the horizontal character escapement after +drawing the character is |pk_dx|. |tfm_width| is the width in multiples of +the design size ignoring the target size. + +@d _2_16 65536.0 /* $2^{16}$ */ +@d _2_20 1048576.0 /* $2^{20}$ */ + +@= +char coding[STRING_LENGTH + 1]; /* a comment describing the font encoding */ +char comment[STRING_LENGTH + 1]; /* a comment describing the font */@# + +unsigned long checksum;@# + +long pk_total_min_x; +long pk_total_max_x; +long pk_total_min_y; +long pk_total_max_y;@# + +int dpi_x; /* printer resolution */ +int dpi_y; +double ppp_x; /* pixels per point */ +double ppp_y; + + +@ +To clarify the meaning of these values see the sections about the metrics +and configuration file also. + +\TeX\ defines that 72.27~points are exactly 1~inch. + +@= +void write_post(void); + + +@ +@c +void write_post(void) + {long special_adr; + long post_adr;@# + + long designsize = design_size * _2_20; /* design size $* 2^{20}$ */@# + + int pk_dx; + long tfm_width;@# + + int i; + long temp; + + + ppp_x = dpi_x / 72.27 * magstep_x; + ppp_y = dpi_y / 72.27 * magstep_y;@# + + pk_total_min_x = pk_offset_x; + pk_total_max_x = pk_output_size_x + 2 * pk_offset_x; + pk_total_min_y = pk_offset_y; + pk_total_max_y = pk_output_size_y + pk_offset_y;@# + + pk_dx = pk_width + 2 * pk_offset_x; /* no slant */ + tfm_width = (tfm_output_size_x + 2 * tfm_offset_x) * _2_20; + /* width in multiples of design size $* 2^{20}$ */@# + + @@; + @@; + @@; + } + + +@ +\.{XXXn} will be followed by n~bytes representing the length of a string +which follows immediately. |YYY| is a 32~bit integer which is normally +connected with the preceding string (but not used here). |special_adr| +contains the address of the ``special section''. All items here are +optional. + +@d XXX1 239 /* these are all special command bytes */ +@d XXX2 240 /* not used */ +@d XXX3 241 /* not used */ +@d XXX4 242 /* not used */@# + +@d YYY 243 /* not used */ + +@= + special_adr = ftell(out);@# + + if(*coding) + {fputc(XXX1, out); /* |XXX1| implies a string length |< 256| */ + fputc(strlen(coding), out); + fputs(coding, out); + }@# + + if(*comment) + {fputc(XXX1, out); + fputc(strlen(comment), out); + fputs(comment, out); + } + + +@ +All character offsets collected in |char_adr| will be written to the output +file. |fputl()| writes a 32~bit integer into a file. + +|CHAR_LOC0| (and |CHAR_LOC|) is the first byte of a character locator +(i.e., offset, character code, and width information). |POST| starts the +postamble, and |post_adr| points to the beginning byte of the postamble. + +@d POST 248@# + +@d CHAR_LOC 245 +@d CHAR_LOC0 246 /* simplified version of |CHAR_LOC| */ + +@= + post_adr = ftell(out); + fputc(POST, out); + fputl(special_adr, out);@# + + fputl(designsize, out); + fputl(checksum, out); + fputl(ppp_x * _2_16, out); + fputl(ppp_y * _2_16, out); + fputl(pk_total_min_x, out); + fputl(pk_total_max_x, out); + fputl(pk_total_min_y, out); + fputl(pk_total_max_y, out);@# + + char_adr_p = char_adr;@# + + if(pk_dx < 256) + {for(i = 0; i < last_char; i++) /* the character locators */ + {fputc(CHAR_LOC0, out); + fputc(i, out); + fputc(pk_dx, out); + fputl(tfm_width, out); + fputl(*char_adr_p++, out); + } + } + else /* will only happen if |MAX_CHAR_SIZE >= 256| */ + {for(i = 0; i < last_char; i++) + {fputc(CHAR_LOC, out); + fputc(i, out); + fputl(pk_dx * _2_16, out); + fputl(0, out); + fputl(tfm_width, out); + fputl(*char_adr_p++, out); + } + } + + +@ +|POSTPOST| starts the section after the postamble. To get all information in +a \.{GF} file, you must start here. The very last bytes of the file have +the value |POSTPOST_ID| (the file is filled with at least 4 of these bytes +until a file length of a multiple of~4 is reached). Going backwards a +|GF_ID| will be next, then comes the address of the postamble section. + +Jumping to the postamble, a |POST| byte comes first, then the address of +the special section, and afterwards all character offsets. These offsets and +addresses describe the whole file. + +@d POSTPOST 249 +@d POSTPOST_ID 223 + +@= + fputc(POSTPOST, out); + fputl(post_adr, out); + fputc(GF_ID, out); + temp = ftell(out); + i = (int)(temp % 4) + 4; + while(i--) + fputc(POSTPOST_ID, out); + + +@ +\TeX\ wants the most significant byte first. + +@= +void fputl(long, FILE *); + + +@ +@c +void fputl(long num, FILE *f) + {fputc(num >> 24, f); + fputc(num >> 16, f); + fputc(num >> 8, f); + fputc(num, f); + } + + +@ +|make_pixel_array()| scales a character into the array |out_char[]| where +each \\{byte} represents one pixel, contrary to the input file where each +\\{bit} is used to store the character bitmap. |BLACK| indicates a black +pixel. + +The scaling routine was modeled after the program \.{pnmscale} of the +\.{pbmplus} package. \.{pbmplus} was designed to handle arbitrary pictures, +and bitmaps are only a special case of a graymap with values from~0 for +white up to |PIXEL_MAXVAL = 255| for black. + +If |EOF| is encountered, |end_of_file| is set and the function returns +immediately. + +@d BLACK 1 +@d WHITE 0@# + +@d PIXEL_MAXVAL 255 +@d SCALE 4096 +@d HALFSCALE 2048@# + +@d MAX_CHAR_SIZE 1023 + +@= +HBF_CHAR code; +const unsigned char *bitmap; + /* a proper input bitmap array will be allocated by the HBF API */ +const unsigned char *bP;@# + +unsigned char out_char[MAX_CHAR_SIZE * MAX_CHAR_SIZE + 1]; + /* the output bitmap array */ +unsigned char *out_char_p;@# + +unsigned char pixelrow[MAX_CHAR_SIZE]; +unsigned char temp_pixelrow[MAX_CHAR_SIZE]; +unsigned char new_pixelrow[MAX_CHAR_SIZE + 1]; + /* we need space to append a white pixel */@# +int curr_row; /* for |read_row()| if we access the glyph rotated */ + +long grayrow[MAX_CHAR_SIZE];@# + +long s_mag_x, s_mag_y, s_slant; + + +@ +We need to initialize the |grayrow[]| array together with some other +variables. + +Two steps are necessary to compute the |code| if we are in the \mf-like +mode. Assuming that we search the code \.{0xXXYY}, we first set |code| to +the value \.{0xXXAA}, where \.{0xAA} is equal to |min_2_byte| (getting +|offset| as the number of remaining characters to reach the first character +in our given subfont), then we increment |code| (and decrement |offset|) +until |offset| equals~0. + +@= + {int col, offset; + + if(rotation) + {int tmp; + + + tmp = input_size_x; + input_size_x = input_size_y; + input_size_y = tmp; + }@# + + if(mf_like) + {target_size_x = design_size * (x_resolution / dpi_x); + target_size_y = design_size * (x_resolution * y_scale / dpi_y); + } + else + target_size_x = target_size_y = design_size; + magstep_x = target_size_x / design_size; + magstep_y = target_size_y / design_size;@# + + pk_offset_x = offset_x * magstep_x + 0.5; + pk_offset_y = offset_y * magstep_y + 0.5; + tfm_offset_x = offset_x / (dpi_x / 72.27) / design_size; + tfm_offset_y = offset_y / (dpi_y / 72.27) / design_size;@# + + pk_width = input_size_x * mag_x * magstep_x + 0.5; /* without slant */ + pk_output_size_x = input_size_x * mag_x * magstep_x + + input_size_y * mag_y * magstep_y * slant + 0.5; + pk_output_size_y = input_size_y * mag_y * magstep_y + 0.5; + tfm_output_size_x = input_size_x * mag_x / + (dpi_x / 72.27) / design_size; + tfm_output_size_y = input_size_y * mag_y / + (dpi_y / 72.27) / design_size; + if(pk_output_size_x > MAX_CHAR_SIZE) + {fprintf(stderr, "Output character box width too big\n"); + exit(1); + } + if(pk_output_size_y > MAX_CHAR_SIZE) + {fprintf(stderr, "Output character box height too big\n"); + exit(1); + }@# + + for(col = 0; col < input_size_x; ++col) + grayrow[col] = HALFSCALE;@# + + if(!mf_like) + code = (min_char & 0xFF00) + min_2_byte; + else + {if((file_number < (unicode ? 0 : 1)) || (file_number >= 0x100)) + {fprintf(stderr, "Invalid subfile number\n"); + exit(1); + }@# + + if(unicode) + {offset = 0; + code = file_number * 0x100; + } + else + {offset = (file_number - 1) * 256 % nmb_2_bytes; + code = (min_char & 0xFF00) + min_2_byte + + (file_number - 1) * 256 / nmb_2_bytes * 0x100; + }@# + + while(offset--) + while(!b2_codes[code++ & 0xFF]) + /* eliminate invalid |b2_codes| */ + ;@# + + if(code > max_char) + {fprintf(stderr, "Invalid subfile number\n"); + exit(1); + } + } + + s_mag_x = mag_x * magstep_x * SCALE; + s_mag_y = mag_y * magstep_y * SCALE; + s_slant = slant * SCALE; + } + + +@ +All arrays of the \\{pixelrow} family contain gray values. While scaling +with non-integer values a pixel of the input bitmap will normally not align +with the pixel grid of the output bitmap (geometrically spoken). In this +case we first compute the fractions of input pixel rows scaled vertically +and add the corresponding gray values until a temporary row is produced. +Then we repeat this procedure horizontally pixel by pixel and write the +result into an output array. + + +@= +void make_pixel_array(void); + + +@ +@c +void make_pixel_array(void) + {unsigned char *prP; + unsigned char *temp_prP; + unsigned char *new_prP; + long *grP;@# + + register unsigned char *xP; + register unsigned char *nxP;@# + + register int row, col; + int rows_read = 0; + register int need_to_read_row = 1;@# + + long frac_row_to_fill = SCALE; + long frac_row_left = s_mag_y;@# + + int no_code = FALSE; + + + prP = pixelrow; + temp_prP = temp_pixelrow; + new_prP = new_pixelrow; + grP = grayrow; + out_char_p = out_char; /* will be increased by |write_row()| */@# + +again: + if(b2_codes[code & 0xFF]) /* a valid second byte? */ + {if(pk_files) + {bitmap = hbfGetBitmap(hbf, code); + bP = bitmap; + /* will be increased by |read_row()| */@# + + if(!bitmap) + empty_char = TRUE; + else + @@; + } + } + else + no_code = TRUE;@# + + if((code & 0xFF) == max_2_byte) + code += 0xFF - (max_2_byte - min_2_byte); /* go to next plane */ + if(code >= max_char) + {end_of_file = TRUE; + return; + }@# + + code++;@# + + if(no_code) + {no_code = FALSE; + goto again; + } + } + + +@ +@= + {if(pk_output_size_y == input_size_y) /* shortcut Y~scaling if possible */ + temp_prP = prP;@# + + curr_row = input_size_y - 1; /* only needed for rotated glyphs */ + for(row = 0; row < pk_output_size_y; ++row) + {@@; + @@; + } + } + + +@ +@= + if(pk_output_size_y == input_size_y) + /* shortcut Y~scaling if possible */ + read_row(prP); + else + {while(frac_row_left < frac_row_to_fill) + {if(need_to_read_row) + if(rows_read < input_size_y) + {read_row(prP); + ++rows_read; + }@# + + for(col = 0, xP = prP; col < input_size_x; ++col, ++xP) + grP[col] += frac_row_left * (*xP);@# + + frac_row_to_fill -= frac_row_left; + frac_row_left = s_mag_y; + need_to_read_row = 1; + }@# + + @@; + } + + +@ +Now |frac_row_left >= frac_row_to_fill|, so we can produce a row. + +@= + if(need_to_read_row) + if(rows_read < input_size_y) + {read_row(prP); + ++rows_read; + need_to_read_row = 0; + }@# + + for(col = 0, xP = prP, nxP = temp_prP; + col < input_size_x; ++col, ++xP, ++nxP) + {register long g; + + + g = grP[col] + frac_row_to_fill * (*xP); + g /= SCALE; + if(g > PIXEL_MAXVAL) + g = PIXEL_MAXVAL;@# + + *nxP = g; + grP[col] = HALFSCALE; + }@# + + frac_row_left -= frac_row_to_fill; + if(frac_row_left == 0) + {frac_row_left = s_mag_y; + need_to_read_row = 1; + } + frac_row_to_fill = SCALE; + + +@ +To implement the slant we move the starting point |nxP| to the right +according to the corresponding |y|~value. To simplify life only positive +shift values are allowed. + +We always append a white pixel to avoid artefacts at the end of the line +produced by the last line. This rule sets the second condition that the +slant must not be greater than~|1|---such a large slant would be unusable +anyway for typesetting purposes. + +@= + if(pk_width == input_size_x && s_slant == 0) + /* shortcut X~scaling if possible */ + write_row(temp_prP); + else + {register long g = HALFSCALE; + register long frac_col_to_fill = SCALE; + register long frac_col_left; + register int need_col = 0; + + + nxP = new_prP;@# + + frac_col_left = (pk_output_size_y - row) * s_slant; + while(frac_col_left >= frac_col_to_fill) + {*(nxP++) = 0; + frac_col_left -= frac_col_to_fill; + }@# + + if(frac_col_left > 0) + frac_col_to_fill -= frac_col_left;@# + + for(col = 0, xP = temp_prP; col < input_size_x; ++col, ++xP) + {frac_col_left = s_mag_x; + while(frac_col_left >= frac_col_to_fill) + {if(need_col) + {++nxP; + g = HALFSCALE; + }@# + + g += frac_col_to_fill * (*xP); + g /= SCALE; + if(g > PIXEL_MAXVAL) + g = PIXEL_MAXVAL;@# + + *nxP = g; + frac_col_left -= frac_col_to_fill; + frac_col_to_fill = SCALE; + need_col = 1; + }@# + + if(frac_col_left > 0) + {if(need_col) + {++nxP; + g = HALFSCALE; + need_col = 0; + }@# + + g += frac_col_left * (*xP); + frac_col_to_fill -= frac_col_left; + } + }@# + + @@; + } + + +@ +@= + if(frac_col_to_fill > 0) + {--xP; + g += frac_col_to_fill * (*xP); + }@# + + if(!need_col) + {g /= SCALE; + if(g > PIXEL_MAXVAL) + g = PIXEL_MAXVAL; + *nxP = g; + }@# + + *(++nxP) = 0; /* append a blank pixel */@# + + write_row(new_prP); + + +@ +|read_row()| reads a row from |bitmap[]| and converts it into a graymap row. +If the |rotation| flag has been set, we get the proper column instead (note +that in this case |input_size_x| already reflects the width of the rotated +glyph). + +@= +#ifdef __GNUC__ +__inline__ +#endif +void read_row(unsigned char *); + + +@ +@c +#ifdef __GNUC__ +__inline__ +#endif +void read_row(unsigned char *pixelrow) + {register int col, bitshift, offset; + register unsigned char *xP; + register unsigned char item = 0; + + if(rotation) + {bitshift = 7 - (curr_row % 8); + offset = (input_size_y + 7) / 8; + bP = bitmap + curr_row / 8; + for(col = 0, xP = pixelrow; col < input_size_x; ++col, ++xP) + {*xP = ((*bP >> bitshift) & 1) == 1 ? PIXEL_MAXVAL : 0; + bP += offset; + } + curr_row--; + } + else + {bitshift = -1; + for(col = 0, xP = pixelrow; col < input_size_x; ++col, ++xP) + {if(bitshift == -1) + {item = *(bP++); /* increase input bitmap pointer */ + bitshift = 7; + } + *xP = ((item >> bitshift) & 1) == 1 ? PIXEL_MAXVAL : 0; + --bitshift; + } + } + } + + +@ +|write_row()| converts the graymap back into a bitmap using a simple +threshold. + +@= +int threshold = 128; + + +@ +@= +#ifdef __GNUC__ +__inline__ +#endif +void write_row(unsigned char *); + + +@ +@c +#ifdef __GNUC__ +__inline__ +#endif +void write_row(unsigned char *pixelrow) + {register int col; + register unsigned char *xP; + + for(col = 0, xP = pixelrow; col < pk_output_size_x; ++col, ++xP) + *(out_char_p++) = (*xP >= threshold) ? 1 : 0; + /* increase output bitmap pointer */ + } + + +@ +Now comes the most interesting routine. The pixel array will be compressed +in sequences of black and white pixels. + +|SKIP0|, |SKIP1|, and |SKIP2| indicate how many blank lines will be skipped. +|PAINT_(x)| means that the next x~pixels will have the same color, then the +color changes. |NEW_ROW_(x)| is the first black pixel in the next row. + +An example: the pixel sequence 111100011001 [new row] 000111011110 will be +output as 4 3 2 2 1 77 3 1 4 1. + +Commands with an ending~`n' in its name indicate that the next n~bytes +should be read as the counter. Example: |SKIP1|~26 means `skip the next +26~rows'. + +For further details please refer to ``\mf---the program''. + +@d PAINT_(x) (x) /* $0 \le x \le 63$ */ +@d PAINT1 64 +@d PAINT2 65 +@d PAINT3 66 /* not used */@# + +@d SKIP0 70 +@d SKIP1 71 +@d SKIP2 72 +@d SKIP3 73 /* not used */@# + +@d NEW_ROW_(x) ((x) + 74) /* $0 \le x \le 164$ */@# + +@d NOOP 244 /* not used */ + +@= +void write_coding(void); + + +@ +The |goto start| instruction causes some compilers to complain about +``Unreachable code $\ldots$'' or something similar. + +@c +void write_coding(void) + {register int count, skip; + register unsigned char paint; + register int x, y; + register unsigned char *cp; + + x = 0; + y = 0; + cp = out_char + y * pk_output_size_x + x; + count = skip = 0; + paint = WHITE; + goto start;@# + + while (y < pk_output_size_y) + {@@; +start: + @@; + y++; + } + }@# + + +@ +@= + count = 0; + x = 0; + cp = out_char + y * pk_output_size_x + x;@# + + while(x < pk_output_size_x) + {if(*cp == paint) + count++; + else + {if(skip == 0) + {if(count <= 164) + fputc(NEW_ROW_(count), out); + else + {fputc(SKIP0, out);@# + + if(count < 256) + {fputc(PAINT1, out); + fputc(count, out); + } + else + {fputc(PAINT2, out); + fputc(count >> 8, out); + fputc(count & 0xFF, out); + } + } + } + else + {if(skip == 1) + fputc(SKIP0, out); + else + {if(skip < 256) + {fputc(SKIP1, out); + fputc(skip, out); + } + else + {fputc(SKIP2, out); + fputc(skip >> 8, out); + fputc(skip & 0xFF, out); + } + } + skip = 0; + if(count < 64) + fputc(PAINT_(count), out); + else if(count < 256) + {fputc(PAINT1, out); + fputc(count, out); + } + else + {fputc(PAINT2, out); + fputc(count >> 8, out); + fputc(count & 0xFF, out); + } + } + count = 0; + paint = BLACK; + break; + } + x++; + cp++; + } + if(x >= pk_output_size_x) + {skip++; + y++; + continue; + } + + +@ +@= + while(x < pk_output_size_x) + {if(*cp == paint) + count++; + else + {if(count < 64) + fputc(PAINT_(count), out); + else if(count < 256) + {fputc(PAINT1, out); + fputc(count, out); + } + else + {fputc(PAINT2, out); + fputc(count >> 8, out); + fputc(count & 0xFF, out); + } + count = 1; + paint = BLACK - paint; + } + x++; + cp++; + } + if(paint == BLACK) + {if(count < 64) + fputc(PAINT_(count), out); + else if(count < 256) + {fputc(PAINT1, out); + fputc(count, out); + } + else + {fputc(PAINT2, out); + fputc(count >> 8, out); + fputc(count & 0xFF, out); + } + paint = WHITE; + } + + + +@* The font metrics file. +This routine creates one \.{PL} file with the font properties. None of the +\TeX\ font dimensions are needed because you never will use CJK fonts +directly, and intercharacter stretching is handled by the \\{CJK} macro +\.{\\CJKglue}. (Other packages may define similar commands.) + +The name of the \.{PL} file will contain the running two digits in +\mf-like mode only. + +It makes sense \\{not} to compute the check sum automatically for two +reasons. Firstly, since \TeX's checksum algorithm is based on the character +width, the number of valid characters, and the designsize, there is a much +higher chance that two subfonts from different HBF fonts have the same check +sum than it is for ordinary fonts, because all characters have the same +width, usually 256~characters in a subfont, and very often the same design +size. Secondly, and this is more important, we create just one +\.{TFM} file for all subfonts regardless of the real number of characters +in a particular subfont. + +To have an identification string in the \.{TFM} file, we split it into +single bytes and use the \.{HEADER} command repeatedly. + +@= +void write_pl(void); + + +@ +@c +void write_pl(void) + {int i, pos; + char output_file[FILE_NAME_LENGTH + 1]; + long t, sc; + char *s; + char tfm_header[] = "Created by hbf2gf"; + + file_number--; /* for \mf-like mode */@# + + if(mf_like) + {if(unicode) + sprintf(output_file, "%s%02x.pl", output_name, file_number); + else + sprintf(output_file, "%s%02i.pl", output_name, file_number); + } + else + sprintf(output_file, "%s.pl", output_name);@# + + if(!(out = fopen(output_file, WRITE_TXT))) + {fprintf(stderr, "Couldn't open `%s'\n", output_file); + exit(1); + } + if(!quiet) + printf("\nWriting `%s'\n", output_file);@# + + fprintf(out,@/ + "\n(FAMILY %s%d)"@/ + "\n(CODINGSCHEME CJK-%s)", + output_name, file_number, font_encoding);@# + + fprintf(out,@/ + "\n(DESIGNSIZE R %.6f)"@/ + "\n(COMMENT DESIGNSIZE IS IN POINTS)"@/ + "\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"@/ + "\n(CHECKSUM O %lo)"@/ + "\n(FONTDIMEN"@/ + "\n (SLANT R %.6f)"@/ + "\n (SPACE R 0.0)"@/ + "\n (STRETCH R 0.0)"@/ + "\n (SHRINK R 0.0)"@/ + "\n (XHEIGHT R 1.0)"@/ + "\n (QUAD R 1.0)"@/ + "\n (EXTRASPACE R 0.0)"@/ + "\n )", design_size, checksum, slant);@# + + s = tfm_header; + i = strlen(s); + t = ((long)i) << 24; + sc = 16; + pos = 18;@# + + fprintf(out, "\n"); + while(i > 0) + {t |= ((long)(*(unsigned char *)s++)) << sc; + sc -= 8; + if(sc < 0) + {fprintf(out, "\n(HEADER D %d O %lo)", pos, t); + t = 0; + sc = 24; + pos++; + } + i--; + } + if(t) + fprintf(out, "\n(HEADER D %d O %lo)", pos, t); + fprintf(out, "\n");@# + + for(i = 0; i < 256; i++) + {fprintf(out,@/ + "\n(CHARACTER O %o"@/ + "\n (CHARWD R %.6f)"@/ + "\n (CHARHT R %.6f)"@/ + "\n (CHARDP R %.6f)"@/ + "\n (CHARIC R %.6f)"@/ + "\n )",@/ + i, + tfm_output_size_x + 2 * tfm_offset_x, + tfm_output_size_y + tfm_offset_y, + -tfm_offset_y, + slant * (tfm_output_size_y + tfm_offset_y)); + }@# + + fclose(out); + } + + + +@* The extended virtual font file for \Om. +The following is very similar to |write_pl()|; we simply map the glyphs +of the subfonts back to the original encoding positions. + +@= +void write_ovp(void); + + +@ +@c +void write_ovp(void) + {int c, i, nmb_subfonts, remainder, count, pos; + char output_file[FILE_NAME_LENGTH + 1]; + long t, sc; + char *s; + char ofm_header[] = "Created by hbf2gf"; + + nmb_subfonts = ((max_char - (min_char & 0xFF00)) / 256 * nmb_2_bytes) + / 256 + 1; + remainder = ((max_char - (min_char & 0xFF00)) / 256 * nmb_2_bytes) + % 256;@# + + /* correction for the last incomplete second byte range */ + for(count = 0; count < (max_char & 0xFF); count++) + if(b2_codes[count]) + remainder++; + if(remainder >= 256) + nmb_subfonts++;@# + + sprintf(output_file, "%s.ovp", output_name);@# + + if(!(out = fopen(output_file, WRITE_TXT))) + {fprintf(stderr, "Couldn't open `%s'\n", output_file); + exit(1); + } + if(!quiet) + printf("\nWriting `%s'\n", output_file);@# + + fprintf(out,@/ + "\n(VTITLE Omega virtual font created by hbf2gf)"@/ + "\n(DESIGNSIZE R %.6f)"@/ + "\n(COMMENT DESIGNSIZE IS IN POINTS)"@/ + "\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"@/ + "\n(CHECKSUM O %lo)"@/ + "\n(FONTDIMEN"@/ + "\n (SLANT R %.6f)"@/ + "\n (SPACE R 0.0)"@/ + "\n (STRETCH R 0.0)"@/ + "\n (SHRINK R 0.0)"@/ + "\n (XHEIGHT R 1.0)"@/ + "\n (QUAD R 1.0)"@/ + "\n (EXTRASPACE R 0.0)"@/ + "\n )", design_size, checksum, slant);@# + + s = ofm_header; + i = strlen(s); + t = ((long)i) << 24; + sc = 16; + pos = 18;@# + + fprintf(out, "\n"); + while(i > 0) + {t |= ((long)(*(unsigned char *)s++)) << sc; + sc -= 8; + if(sc < 0) + {fprintf(out, "\n(HEADER D %d O %lo)", pos, t); + t = 0; + sc = 24; + pos++; + } + i--; + } + if(t) + fprintf(out, "\n(HEADER D %d O %lo)", pos, t); + fprintf(out, "\n");@# + + for(i = 0; i < nmb_subfonts; i++) + {fprintf(out,@/ + "\n(MAPFONT D %i"@/ + "\n (FONTNAME %s%02i)"@/ + "\n (FONTCHECKSUM O %lo)"@/ + "\n (FONTAT R 1.0)"@/ + "\n (FONTDSIZE R %.6f)"@/ + "\n )", i, output_name, i + 1, checksum, design_size); + }@# + + for(c = min_char, i = 0, count = 0; c <= max_char; c++) + {if(b2_codes[c & 0xFF] == VALID_SUBCODE) + {fprintf(out,@/ + "\n(CHARACTER O %o"@/ + "\n (CHARWD R %.6f)"@/ + "\n (CHARHT R %.6f)"@/ + "\n (CHARDP R %.6f)"@/ + "\n (CHARIC R %.6f)"@/ + "\n (MAP"@/ + "\n (SELECTFONT D %i)"@/ + "\n (SETCHAR O %o)"@/ + "\n )"@/ + "\n )",@/ + c, + tfm_output_size_x + 2 * tfm_offset_x, + tfm_output_size_y + tfm_offset_y, + -tfm_offset_y, + slant * (tfm_output_size_y + tfm_offset_y), + i, + count);@# + + count++; + if(count == 256) + {count = 0; + i++; + } + } + else + continue; + }@# + + fclose(out); + } + + + +@* The job file. +This routine is the most system specific one. If your operating system needs +a different outline, make appropriate changes here. + +You have to call this batch file after \.{hbf2gf} has finished (if not in +\mf-like mode). It will transform the \.{GF} files into \.{PK} files and +delete the now unnecessary \.{GF} files, then transform the \.{PL} file into +a \.{TFM} file and copy it |nmb_files| times. The name of the job file is +|output_name|. + +@d EXTENSION_LENGTH 8 /* the maximal length of a file extension */@# + +@d GFTOPK_NAME "gftopk" +@d PLTOTF_NAME "pltotf" +@d OVP2OVF_NAME "ovp2ovf" + +@= +char job_extension[EXTENSION_LENGTH + 1]; +char rm_command[STRING_LENGTH + 1]; +char cp_command[STRING_LENGTH + 1]; +char pk_directory[STRING_LENGTH + 1]; +char tfm_directory[STRING_LENGTH + 1];@# + +int ofm_file = FALSE; + + +@ +@= +void write_job(void); + + +@ +@c +void write_job(void) + {FILE *out; + int i, j; + char buffer[FILE_NAME_LENGTH + 1]; + + + strcpy(buffer, output_name); + strcat(buffer, job_extension); + if(!(out = fopen(buffer, WRITE_TXT))) + {fprintf(stderr, "Couldn't open `%s'\n", buffer); + exit(1); + } + if(!quiet) + printf("\nWriting `%s'\n", buffer);@# + + if(pk_files) + {if(unicode) + {for(i = (min_char >> 8), j = 0; j < nmb_files; i++, j++) + fprintf(out,@/ + "%s %s%02x.gf %s%s%02x.%.0ipk\n"@/ + "%s %s%02x.gf\n",@/ + GFTOPK_NAME, output_name, i,@/ + pk_directory, output_name, i, + long_extension ? (int)(dpi_x * magstep_x + 0.5) : 0,@/ + rm_command, output_name, i); + } + else + {for(i = 1; i <= nmb_files; i++) + fprintf(out,@/ + "%s %s%02i.gf %s%s%02i.%.0ipk\n"@/ + "%s %s%02i.gf\n",@/ + GFTOPK_NAME, output_name, i,@/ + pk_directory, output_name, i, + long_extension ? (int)(dpi_x * magstep_x + 0.5) : 0,@/ + rm_command, output_name, i); + } + }@# + + if(tfm_files) + {fprintf(out,@/ + "\n"@/ + "%s %s.pl %s.tfm\n"@/ + "%s %s.pl\n"@/ + "\n",@/ + PLTOTF_NAME, output_name, output_name,@/ + rm_command, output_name);@# + + if(unicode) + {for(i = (min_char >> 8), j = 0; j < nmb_files; i++, j++) + fprintf(out,@/ + "%s %s.tfm %s%s%02x.tfm\n",@/ + cp_command, output_name, + tfm_directory, output_name, i); + } + else + {for(i = 1; i <= nmb_files; i++) + fprintf(out,@/ + "%s %s.tfm %s%s%02i.tfm\n",@/ + cp_command, output_name, + tfm_directory, output_name, i); + }@# + + fprintf(out,@/ + "\n"@/ + "%s %s.tfm",@/ + rm_command, output_name); + }@# + + if(ofm_file) + {fprintf(out,@/ + "\n"@/ + "%s %s.ovp %s.ovf %s.ofm\n"@/ + "%s %s.ovp\n"@/ + "\n",@/ + OVP2OVF_NAME, output_name, output_name, output_name,@/ + rm_command, output_name); + }@# + + fclose(out); + } + + + +@* The configuration file. +Here is a list with all necessary keywords (and parameters): +\medskip +\halign{\quad\.{#}\hfil&\quad#\hfil\cr + hbf\_header & the HBF header file name of the input font(s). \cr + output\_name & the name stem of the output files. \cr + & Should be equal to the name of the configuration file + in most cases.\cr + & A running two digit decimal number starting with + \.{01} will be appended. \cr + & (For Unicode fonts see the keyword \.{unicode} + below.) \cr + } +\bigskip +And now all optional keywords: +\medskip +\halign{\quad\.{#}\hfil&\quad#\hfil\cr + x\_offset & increases the character width. \cr + & Will be applied on both sides; \cr + & default is the value given in the HBF header + (\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr + & scaled to \\{design\/}size (in pixels). \cr + y\_offset & shifts all characters up or down; \cr + & default is the value given in the HBF header + (\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr + & scaled to \\{design\/}size (in pixels). \cr + design\_size & the design size (in points) of the font. \cr + & \.{x\_offset} and \.{y\_offset} refer to this + size. \cr + & Default is |10.0| \cr + target\_size & This command is obsolete now and will be + ignored.\cr + & \cr + slant & the slant of the font (given as $\Delta x / + \Delta y$). \cr + & Only values in the range |0 <= slant <= 1| + are allowed. \cr + & Default is |0.0| \cr + rotation & if set to `yes'. the glyphs are rotated + 90~degrees counter-clockwise. \cr + & The default offsets as given in the HBF header + will be ignored (and set to~|0|). \cr + & Default is `no'. \cr + & \cr + mag\_x & \cr + mag\_y & scaling values of the characters to reach + design size. \cr + & If only one magnification is given, x and y + values are assumed to be equal. \cr + & Default is \.{mag\_x} $=$ \.{mag\_y} $=$ |1.0| + \cr + threshold & A value between |1| and |254| defining a + threshold for converting the internal \cr + & graymap into the output bitmap; lower values + cut more pixels. \cr + & Default value is |128|. \cr + & \cr + comment & a comment describing the font; \cr + & default is none. \cr + & \cr + nmb\_fonts & the number of the fonts. \cr + & Default value is~|-1| for creating all + fonts. \cr + unicode & if `yes', a two digit hexadecimal number will + be used as a running number, \cr + & starting with the value of the first byte of + the first code range. \cr + & Default is `no'. \cr + min\_char & the minimum of the encoding range. \cr + & Specify this value if it is not identical to + the lowest code value \cr + & in the HBF file (to which it defaults). \cr + & \cr + dpi\_x & \cr + dpi\_y & the horizontal and vertical resolution (in + dpi) of the printer. \cr + & If only one resolution is given, x and y + values are assumed to be equal. \cr + & Default is |300|. \cr + checksum & a checksum to identify the \.{GF} files + with the appropriate \.{TFM} files. \cr + & The default of this 32~bit unsigned integer + is |0|. \cr + coding & a comment describing the coding scheme; \cr + & default is none. \cr + & \cr + pk\_directory & the destination directory of the + \.{PK} files; \cr + & default: none. \cr + & Attention! The batch file will not check + whether this directory exists. \cr + tfm\_directory & the destination directory of the + \.{TFM} files; \cr + & default: none. \cr + & Attention! The batch file will not check + whether this directory exists. \cr + pk\_files & whether to create \.{PK} files or not; \cr + & default is `yes'. \cr + tfm\_files & whether to create \.{TFM} files or not; \cr + & default is `yes'. \cr + ofm\_file & whether to create an \.{OFM} and an + \.{OVF} file or not; \cr + & default is `no'. \cr + long\_extension & if `yes', \.{PK} files will include the + resolution in the extension \cr + & (e.g. \.{gsso1201.300pk}). \cr + & This affects the batch file only (default is + `yes'). \cr + rm\_command & this shell command removes files; \cr + & default: `rm'. \cr + cp\_command & this shell command copies files; \cr + & default: `cp'. \cr + job\_extension & the extension of the batch file which calls + \.{GFtoPK} and \.{PLtoTF} \cr + & to convert the \.{GF} and the + \.{PL} files into \.{PK} and + \.{TFM} files; \cr + & default is none. \cr + } +\bigskip + +The searching algorithm (for the keywords) of \.{hbf2gf} is case +insensitive; it makes no difference whether you write for example \.{comment} +or \.{CommenT}. The keywords must start a line (be in the first column), and +the corresponding parameters must be on the same line with the keyword and +separated by at least one space or tabulator stop. Lines starting not with a +keyword are ignored. + +Key values \\{are} case sensitive (except \.{yes} and \.{no}). + +The default system dependent values are for \UNIX/-like operating systems; +if you use for example DOS, you must write +\medskip +\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr + long\_extension & no \cr + rm\_command & del \cr + cp\_command & copy \cr + job\_extension & .bat \cr + } +\medskip + +Both the values |pk_output_size_x| and |pk_output_size_y| must not exceed +|MAX_CHAR_SIZE|; \.{x\_offset} and \.{y\_offset} are related to the +design size (and not to the input size). + +In \mf-like mode, one \.{GF} file and one \.{PL} file will be computed +(depending on the command line options \.{-g} and \.{-p}), taking +|x_resolution| and |y_scale| from the command line. \.{nmb\_fonts} will +always be set to~|1|; no job file will be created. + + +@ +@d PRINTER_MIN_RES_X 50 +@d PRINTER_MIN_RES_Y 50 + +@= +char Buffer[STRING_LENGTH + 1]; + + +@ +@= +void read_config(void); + + +@ +If |config_file| isn't found in \mf-like mode we assume that the font +isn't a HBF font at all. + +@c +void read_config(void) + {HBF_BBOX *boxp; + char *real_config_file; + + + @@;@# + + real_config_file = TeX_search_cfg_file(config_file); + if(!real_config_file) + {if(mf_like) + {if(!quiet) + printf("Couldn't find `%s'\n", config_file); + exit(2); + } + else + {fprintf(stderr, "Couldn't find `%s'\n", config_file); + exit(1); + } + }@# + + if(!(config = fopen(real_config_file, READ_TXT))) + {if(!testing) + {fprintf(stderr, "Couldn't open `%s'\n", config_file); + exit(1); + } + else /* We reach this point only if no searching library is used */ + {if(!quiet) + fprintf(stderr, "Couldn't find or open `%s'\n", config_file); + exit(2); + } + }@# + + if(testing) + {if(!quiet) + printf("%s\n", real_config_file); + exit(0); + } + + @@; + @@;@# + + @@; + @@;@# + + fclose(config); + } + + +@ +Here we check whether we have to add an extension. + +@= + {int i, lastext = -1; + + for(i = 0; config_file[i]; i++) + if(config_file[i] == '.') + lastext = i; + else if (config_file[i] == '/' || + config_file[i] == ':' || + config_file[i] == '\\') + lastext = -1;@# + + if(lastext == -1) + strcat(config_file, ".cfg"); + } + + +@ +@= + {char hbf_header[STRING_LENGTH + 1]; + char *real_hbf_header; + + if(!fsearch("hbf_header")) + config_error("hbf_header"); + else + strcpy(hbf_header, Buffer);@# + + real_hbf_header = TeX_search_hbf_file(hbf_header); + if(!real_hbf_header) + {fprintf(stderr, "Couldn't find `%s'\n", hbf_header); + exit(1); + }@# + + hbfDebug = 1; /* we activate error messages of the HBF API + while scanning the HBF header file */@# + + if(!(hbf = hbfOpen(real_hbf_header))) + exit(1);@# + + hbfDebug = 0;@# + + boxp = hbfBitmapBBox(hbf); + input_size_x = boxp->hbf_height; /* will be checked later for rotation */ + input_size_y = boxp->hbf_width; + font_encoding = hbfProperty(hbf, "HBF_CODE_SCHEME");@# + + if(!fsearch("output_name")) + config_error("output_name"); + else + strcpy(output_name, Buffer); + } + + +@ +@= +int offset_x; +int offset_y;@# + +HBF_CHAR user_min_char; +int have_min_char = FALSE; + +@ +@= + {if(fsearch("nmb_files")) + nmb_files = atoi(Buffer); + if(fsearch("unicode")) + if(Buffer[0] == 'y' || Buffer[0] == 'Y') + unicode = TRUE; + if(fsearch("min_char")) + {user_min_char = strtoul(Buffer, (char **)NULL, 0); + have_min_char = TRUE; + }@# + + if(!mf_like) + {if(fsearch("pk_files")) + if(Buffer[0] == 'n' || Buffer[0] == 'N') + pk_files = FALSE; + if(fsearch("tfm_files")) + if(Buffer[0] == 'n' || Buffer[0] == 'N') + tfm_files = FALSE; + if(fsearch("ofm_file")) + if(Buffer[0] == 'y' || Buffer[0] == 'Y') + ofm_file = TRUE; + if(fsearch("long_extension")) + if(Buffer[0] == 'n' || Buffer[0] == 'N') + long_extension = FALSE; + }@# + + if(fsearch("slant")) + slant = atof(Buffer); + if(slant < 0.0 || slant > 1.0) + {fprintf(stderr, "Invalid slant\n"); + exit(1); + } + if(fsearch("rotation")) + if(Buffer[0] == 'y' || Buffer[0] == 'Y') + rotation = TRUE;@# + + if(fsearch("mag_x")) + mag_x = atof(Buffer); + if(fsearch("mag_y")) + mag_y = atof(Buffer); + if(!mag_x && !mag_y) + {mag_x = 1.0; + mag_y = 1.0; + } + if(mag_x && !mag_y) + mag_y = mag_x; + if(mag_y && !mag_x) + mag_x = mag_y; + if(mag_x <= 0.0) + {fprintf(stderr, "Invalid horizontal magnification\n"); + exit(1); + } + if(mag_y <= 0.0) + {fprintf(stderr, "Invalid vertical magnification\n"); + exit(1); + }@# + + if(fsearch("dpi_x")) + dpi_x = atoi(Buffer); + if(fsearch("dpi_y")) + dpi_y = atoi(Buffer); + if(!dpi_x && !dpi_y) + {dpi_x = 300; + dpi_y = 300; + } + if(dpi_x && !dpi_y) + dpi_y = dpi_x; + if(dpi_y && !dpi_x) + dpi_x = dpi_y; + if(dpi_x <= PRINTER_MIN_RES_X) + {fprintf(stderr, "Invalid horizontal printer resolution\n"); + exit(1); + } + if(dpi_y <= PRINTER_MIN_RES_Y) + {fprintf(stderr, "Invalid vertical printer resolution\n"); + exit(1); + }@# + + if(fsearch("design_size")) + design_size = atof(Buffer);@# + + if(fsearch("x_offset")) + offset_x = atoi(Buffer); + else + offset_x = rotation ? 0 : (boxp->hbf_xDisplacement * mag_x + 0.5); + if(fsearch("y_offset")) + offset_y = atoi(Buffer); + else + offset_y = rotation ? 0 : (boxp->hbf_yDisplacement * mag_y + 0.5); + if(!fsearch("comment")) + comment[0] = '\0'; + else + strcpy(comment, Buffer);@# + + if(fsearch("threshold")) + threshold = atoi(Buffer); + if(threshold <= 0 || threshold >= 255) + {fprintf(stderr, "Invalid threshold\n"); + exit(1); + }@# + + if(!fsearch("checksum")) + checksum = 0; + else + checksum = strtoul(Buffer, (char **)NULL, 0);@# + + if(!fsearch("coding")) + coding[0] = '\0'; + else + strcpy(coding, Buffer);@# + + if(!fsearch("pk_directory")) + pk_directory[0] = '\0'; + else + strcpy(pk_directory, Buffer);@# + + if(!fsearch("tfm_directory")) + tfm_directory[0] = '\0'; + else + strcpy(tfm_directory, Buffer);@# + + if(fsearch("rm_command")) + strcpy(rm_command, Buffer); + else + strcpy(rm_command, "rm");@# + + if(fsearch("cp_command")) + strcpy(cp_command, Buffer); + else + strcpy(cp_command, "cp");@# + + if(!fsearch("job_extension")) + job_extension[0] = '\0'; + else + {strncpy(job_extension, Buffer, EXTENSION_LENGTH); + job_extension[EXTENSION_LENGTH] = '\0'; + } + } + + +@ +The function |hbfGetCodeRange()| is an extension to the HBF API. + +Successive calls return the code ranges in ascending order; we only need the +extrema of the whole code range. + +In case |min_char| has been supplied in the configuration file, we use that +value instead. + +@= +HBF_CHAR min_char, max_char; + + +@ +@= + {const void *cp; + HBF_CHAR dummy; + + cp = hbfGetCodeRange(hbf, NULL, &min_char, &max_char); + for(; cp != NULL; cp = hbfGetCodeRange(hbf, cp, &dummy, &max_char)) + ;@# + + if(have_min_char) + min_char = user_min_char; + } + + +@ +The function |hbfGetByte2Range()| is an extension to the HBF API. + +Successive calls return the byte~2 ranges in ascending order. We raise +|VALID_SUBCODE| in the array |b2_codes[]| for all characters in subcode +ranges. + +@d VALID_SUBCODE 1 + +@= +char b2_codes[256]; +unsigned char min_2_byte, max_2_byte; +int nmb_2_bytes = 0; + + +@ +@= + {const void *b2r; + unsigned char dummy; + int i; + + for(i = 0; i < 256; i++) + b2_codes[i] = 0;@# + + b2r = hbfGetByte2Range(hbf, NULL, &min_2_byte, &max_2_byte); + dummy = min_2_byte; + for(; b2r != NULL; b2r = hbfGetByte2Range(hbf, b2r, &dummy, &max_2_byte)) + {for(i = dummy; i <= max_2_byte; i++) + b2_codes[i] = VALID_SUBCODE; + }@# + + for(i = 0; i < 256; i++) /* compute the number of valid |b2_codes| */ + if(b2_codes[i] == VALID_SUBCODE) + nmb_2_bytes++; + } + + +@ +This search routine is case insignificant. Each keyword must start a line; +the function checks whether the character before the keyword is a newline +character (|'\n'|). It also checks the presence of a parameter and fills +|Buffer| if existent. |fsearch()| returns~1 on success. + +@= +int fsearch(const char *); + + +@ +@c +int fsearch(const char *search_string) + {char *P, p; + const char *Q; + char temp_buffer[STRING_LENGTH + 1]; + char env_name[STRING_LENGTH + 1]; + char *env_p; + char *env_value; + char *Buf_p; + int Ch, ch, old_ch = '\n'; + int count = STRING_LENGTH; + + rewind(config); /* we start at offset~0 */@# + + do + {Q = search_string; + p = tolower(*Q); + Ch = fgetc(config); + ch = tolower(Ch); + while(!(ch == p && old_ch == '\n') && Ch != EOF) + /* search first character of |search_string|; + |'\n'| must be the character before */ + {old_ch = ch; + Ch = fgetc(config); + ch = tolower(Ch); + }@# + + for(;;) + {if(*(++Q) == '\0') + if((Ch = fgetc(config)) == ' ' || Ch == '\t') + /* there must be a space or a tab stop after the keyword */ + goto success; + Ch = fgetc(config); + if(tolower(Ch) != tolower(*Q)) + break; + } + } + while(Ch != EOF);@# + + return 0;@# + +success: + P = temp_buffer;@# + + while((Ch = fgetc(config)) == ' ' || Ch == '\t') + /* remove leading blanks and tabs */ + ; + while(Ch != '\n' && --count > 0 && Ch != EOF) /* fill |Buffer| */ + {*P++ = Ch; + Ch = fgetc(config); + } + *P = '\0';@# + + if (*temp_buffer) + @@; + else + *Buffer = '\0';@# + + return (*Buffer) ? 1 : 0; /* is there something in the buffer? */ + } + + +@ +To make the configuration file more flexible we allow environment variables +in the arguments. We scan the parameter stored in |temp_buffer| whether it +contains a `\.{\$}' character. If yes, the following code fragment tries to +get an environment variable name whose value will be then fetched with +|getenv()|. An environment variable name recognized by \.{hbf2gf} must start +with a letter or underscore; the other characters may be alphanumeric or an +underscore. You can surround the environment variable name with braces to +indicate where the name ends, e.g. \.{\$\{FOO\}}. The interpolated +configuration parameter will be truncated to |STRING_LENGTH| characters. If +you want to have `\.{\$}' you must write `\.{\$\$}'. + +Note that you should avoid to use such environment variables for specifying +the location of the configuration file in case you have support for a file +searching library like kpathsea. Its primary aim is to specify the target +directories for the \.{pk\_directory} and the \.{tfm\_directory} keywords. + +@= + {P = temp_buffer; + Buf_p = Buffer; + count = STRING_LENGTH - 1;@# + + while(*P && count > 0) + {env_p = env_name;@# + + if(*P == '$') + {P++; + if(*P == '$') + {*(Buf_p++) = *(P++); + count--; + continue; + } + while(*P == '{') @q } @> + P++; + if(!(isalpha(*P) || *P == '_')) + {fprintf(stderr,@/ + "Invalid environment variable name in configuration file\n"); + exit(1); + } + *(env_p++) = *(P++); + while(*P) + {if(isalnum(*P) || *P == '_') + *(env_p++) = *(P++); + else + {@q { @> while(*P == '}') + P++; + *env_p = '\0'; + break; + } + }@# + + env_value = getenv(env_name); + if(env_value) /* append the environment value to |Buffer| */ + {while(*env_value && count > 0) + {*(Buf_p++) = *(env_value++); + count--; + } + } + } + else + {*(Buf_p++) = *(P++); + count--; + } + } + *Buf_p = '\0'; + } + + +@ +If an error occurs, |config_error()| will leave the program with an error +message. + +@= +void config_error(const char *); + + +@ +@c +void config_error(const char *message) + {fprintf(stderr, "Couldn't find `%s' entry in configuration file\n", + message); + exit(1); + } + + + +@* File searching. + +We support three searching engines: emtexdir, kpathsea, and MiKTeX (which is +a Win32 port of kpathsea). For emtexdir, define |HAVE_EMTEXDIR| while +compiling. For kpathsea, define |HAVE_LIBKPATHSEA|. For MikTeX, define +|HAVE_MIKTEX|. If none of these macros is defined, a simple |fopen()| will +be used instead. + +@= +#if defined(HAVE_LIBKPATHSEA) +#include "kpathsea/kpathsea.h" + +#elif defined(HAVE_EMTEXDIR) +#include "emtexdir.h" + +#elif defined(HAVE_MIKTEX) +#include "miktex.h" +#endif + +@ +@= +#if defined(HAVE_EMTEXDIR) +char emtex_version_string[] = "emTeXdir"; +#elif !defined(HAVE_MIKTEX) +char no_version_string[] = "no search library"; +#endif + + +@ +@= +const char *TeX_search_version(void); + + +@ +@c +const char *TeX_search_version(void) + { +#if defined(HAVE_LIBKPATHSEA) + return kpathsea_version_string; +#elif defined(HAVE_EMTEXDIR) + return emtex_version_string; +#elif defined(HAVE_MIKTEX) + char buf[200]; + + strcpy(buf, "MiKTeX "); + miktex_get_miktex_version_string_ex(buf + 7, sizeof (buf) - 7); + + return buf; +#else + return no_version_string; +#endif + } + + +@ +@s emtex_dir int + +@= +#ifdef HAVE_EMTEXDIR +struct emtex_dir cfg_path, hbf_path; +#endif + + +@ +@= +#ifdef HAVE_EMTEXDIR +extern int setup_list(struct emtex_dir *, char *, const char *, unsigned); +int dir_setup(struct emtex_dir *, const char *, const char *, unsigned); +char *file_find(char *, struct emtex_dir *); +#endif + + +@ +We slightly modify |emtex_dir_setup()| (from the file \.{emtexdir.c}) to +output a warning in case the environment variable |env| isn't set properly. + +@c +#ifdef HAVE_EMTEXDIR +int dir_setup(ed, env, dir, flags) + struct emtex_dir *ed; + const char *env; + const char *dir; + unsigned flags; + + {const char *val; + char path[260]; + + ed->alloc = 0; + ed->used = 0; + ed->list = NULL;@# + + if(env != NULL && (val = getenv(env)) != NULL) + return setup_list(ed, path, val, flags); + else + fprintf(stderr, + "Environment variable `%s' not set; use current directory\n", + env);@# + + return TRUE; + } + + +@ +@= +char name_buffer[FILE_NAME_LENGTH + 1]; + + +@ +@c +char *file_find(name, list) + char *name; + struct emtex_dir *list; + + {if(emtex_dir_find(name_buffer, sizeof(name_buffer), list, name, EDF_CWD)) + return name_buffer;@# + + return NULL; + } +#endif + + +@ +For emtexdir we use the environment variables \.{HBFCFG} and \.{HBFONTS} for +configuration resp.\ HBF header files. + +@= +#if defined(HAVE_LIBKPATHSEA) + kpse_set_program_name(argv[0], "hbf2gf"); + kpse_init_prog("HBF2GF", 300, "cx", "cmr10");@# + +#elif defined(HAVE_EMTEXDIR) + if(!dir_setup(&cfg_path, "HBFCFG", NULL, EDS_BANG)) + {fprintf(stderr, + "Couldn't setup search path for configuration files\n"); + exit(1); + } + if(!dir_setup(&hbf_path, "HBFONTS", NULL, EDS_BANG)) + {fprintf(stderr, + "Couldn't setup search path for HBF header files\n"); + exit(1); + } +#endif + + +@ +Finally, here are the searching routines. A special format in the kpathsea +library for fonts which are neither PostScript nor TrueType (\.{MISCFONTS}) +is available with version~3.3 and newer. For older versions we use the path +for PostScript fonts (\.{T1FONTS}) to find HBF files. Configuration files +are searched in the path specified within \.{TEXCONFIG} for old kpathsea +versions, and within \.{HBF2GFINPUTS} for new versions. + +@= +char *TeX_search_cfg_file(char *); +char *TeX_search_hbf_file(char *); + + +@ +@c +#if defined(HAVE_LIBKPATHSEA) +char *TeX_search_cfg_file(char *name) + { + return kpse_find_file(name, kpse_program_text_format, TRUE); + }@# + + +char *TeX_search_hbf_file(char *name) + { + return kpse_find_file(name, kpse_miscfonts_format, TRUE); + }@# + + +#elif defined(HAVE_EMTEXDIR) +char *TeX_search_cfg_file(char *name) + {return file_find(name, &cfg_path); + }@# + + +char *TeX_search_hbf_file(char *name) + {return file_find(name, &hbf_path); + }@# + + +#elif defined(HAVE_MIKTEX) +char *TeX_search_cfg_file(char *name) + {char result[_MAX_PATH]; + + if (!miktex_find_input_file("hbf2gf", *name, result)) + return 0; + return strdup(result); + }@# + + +char *TeX_search_hbf_file(char *name) + {char result[_MAX_PATH]; + + + if (!miktex_find_miscfont_file(*name, result)) + return 0; + return strdup(result); + }@# + + +#else +char *TeX_search_cfg_file(char *name) + {return name; + }@# + + +char *TeX_search_hbf_file(char *name) + {return name; + } +#endif + + + +@* An example. +This is the example configuration file \.{b5so12.cfg} (for use with DOS or +OS/2 and the emtexdir searching engine): +\bigskip +\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr + hbf\_header & et24.hbf \cr + mag\_x & 2.076 \cr + x\_offset & 3 \cr + y\_offset & -8 \cr + comment & fanti songti 24x24 pixel font scaled and + adapted to 12 pt \cr + & \cr + design\_size & 12.0 \cr + & \cr + nmb\_fonts & -1 \cr + & \cr + output\_name & b5so12 \cr + & \cr + dpi\_x & 300 \cr + checksum & 123456789 \cr + coding & codingscheme Big 5 encoded TeX text \cr + & \cr + long\_extension & no \cr + job\_extension & .cmd \cr + rm\_command & del \cr + cp\_command & copy \cr + pk\_directory & \$HBF\_TARGET\\pk\\360dpi\\ \cr + tfm\_directory & \$HBF\_TARGET\\tfm\\ \cr + } +\bigskip +If you say e.g. +\medskip +\quad \.{set HBF\_TARGET=c:\\emtex\\texfonts} +\medskip +on your DOS prompt (or in your \.{autoexec.bat} file), then the interpolated +value of the \.{tfm\_directory} keyword is \.{c:\\emtex\\texfonts\\tfm\\}. +The HBF header file \.{et24.hbf} will be searched in the path specified by +the \.{HBFCFG} environment variable. +\bigskip +The call +\medskip +\quad \.{hbf2gf b5so12.cfg} +\medskip +creates the files +\medskip +\quad \.{b5so1201.gf}, \.{b5so1202.gf}, $\ldots$ , \.{b5so1255.gf}, +\.{b5so12.pl}, and \.{b5so12.cmd} +\bigskip +After calling +\medskip +\quad \.{b5so12.cmd} +\medskip +you will find the \.{PK} files in the +\.{c:\\emtex\\texfonts\\pk\\360dpi} directory and the \.{TFM} files in +the \.{c:\\emtex\\texfonts\\tfm} directory; all \.{GF} files and +\.{b5so12.pl} will be deleted. +\bigskip +The call +\medskip +\quad \.{hbf2gf -n b5so1220 417} +\medskip +creates two files: +\medskip +\quad \.{b5so1220.gf} and \.{b5so1220.pl} +\medskip +using the configuration file \.{b5so12.cfg}. The \.{GF} file would be +named \.{b5so1220.417gf} if the flag \.{-n} had not been used. + +\medskip + +It is possible to convert bitmap fonts to \.{PK} files almost +automatically. The HBF header file already has the entry +\.{HBF\_BITMAP\_BOUNDING\_BOX} which defines vertical and horizontal offsets +(in pixels), but these values are not in all cases optimal. If you omit +\.{x\_offset} and \.{y\_offset} in the configuration file, the third and +fourth parameter of \.{HBF\_BITMAP\_BOUNDING\_BOX} is used, scaled to design +size (to say it in other words: \.{x\_offset} and \.{y\_offset} will always +apply to the design size to be synchronous with the \.{TFM} files). + +Don't confuse scaling and magnification: Scaling here means that you choose +a (arbitrary) design size and compute scaling values (\.{mag\_x} and +\.{mag\_y}) which scales the bitmap to this particular design size at a +certain (arbitrarily chosen) resolution (\.{dpi\_x} and \.{dpi\_y}). +Magnification means that the scaled bitmap will be then magnified to a +certain target size while still using the font parameters (i.e., the +\.{TFM} file) of the design size. + +In the sample, you have a $24 \times 24$ bitmap font which will be scaled to +$12\,\hbox{pt}$ having a resolution of $300\,\hbox{dpi}$: +\medskip +\quad $1\,\hbox{pt}$ are $300 / 72.27 = 4.1511$ pixel; + +\quad $12\,\hbox{pt}$ are $4.1511 * 12 = 49.813$ pixel; + +\quad thus the theoretical scaling value is $49.813 / 24 = 2.076$. + +\medskip + +But especially for small sizes, this may not be the best value if the font +should harmonize with, say, Knuth's Computer Modern fonts. I recommend to +compute, say, 5~\.{PK} fonts, then check the CJK font with different \TeX\ +fonts to see whether the offsets and/or the scaling value is good. The +greater the design size the finer you can control the offsets---as an +example you could use a design size of $30\,\hbox{pt}$ (nevertheless there +is a compile-time constant |MAX_CHAR_SIZE| which limits the maximal +character size; default is 255~pixels). + +If you have found optimal offsets, you can produce many different +magnifications of the CJK font using the same set of \.{TFM} files +analogous to ordinary \TeX\ fonts; as a simplification, we assume that +\.{PK} files with a resolution of $300\,\hbox{dpi}$ and a design size of +$10\,\hbox{pt}$ have the extension `\.{.300pk}' (respectively come into a +`\.{300dpi}' subdirectory)---this is the reason why in the above example for +the $12\,\hbox{pt}$ design size a `\.{360dpi}' target directory has been +used. Now we can use the following formula: + + $$ \\{needed\_dpi} = \\{your\_horizontal\_resolution} * + {\\{your\_target\_size} \over 10.0} $$ + +Example: assuming that your printer has a resolution of +$300\times400\,\hbox{dpi}$, and you want $14.4\,\hbox{pt}$: + + $$ 300 * {14.4 \over 10.0} = 432 $$ + +The vertical scaling value is $400 / 300 = 1.3333$. Use these values now to +call \.{hbf2gf} in \mf-like mode: + +\quad \.{hbf2gf b5so1220 432 1.3333} + + + +@* Index. diff --git a/Build/source/texk/cjkutils/configure b/Build/source/texk/cjkutils/configure index b7cea8bbfc2..d0fb25cb6a4 100755 --- a/Build/source/texk/cjkutils/configure +++ b/Build/source/texk/cjkutils/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for CJK utils for TeX Live 4.7.0. +# Generated by GNU Autoconf 2.68 for CJK utils for TeX Live 4.8.2. # # Report bugs to . # @@ -570,12 +570,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='CJK utils for TeX Live' PACKAGE_TARNAME='cjk-utils-for-tex-live' -PACKAGE_VERSION='4.7.0' -PACKAGE_STRING='CJK utils for TeX Live 4.7.0' +PACKAGE_VERSION='4.8.2' +PACKAGE_STRING='CJK utils for TeX Live 4.8.2' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="hbf2gf/hbf.h" +ac_unique_file="cjkutils-4.8.2/hbf2gf/hbf.h" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -616,6 +616,9 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +CJKUTILS_TREE +WIN32_FALSE +WIN32_TRUE do_cweb_FALSE do_cweb_TRUE TEX @@ -1309,7 +1312,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures CJK utils for TeX Live 4.7.0 to adapt to many kinds of systems. +\`configure' configures CJK utils for TeX Live 4.8.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1380,7 +1383,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of CJK utils for TeX Live 4.7.0:";; + short | recursive ) echo "Configuration of CJK utils for TeX Live 4.8.2:";; esac cat <<\_ACEOF @@ -1492,7 +1495,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -CJK utils for TeX Live configure 4.7.0 +CJK utils for TeX Live configure 4.8.2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1972,7 +1975,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by CJK utils for TeX Live $as_me 4.7.0, which was +It was created by CJK utils for TeX Live $as_me 4.8.2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -7325,18 +7328,9 @@ fi # Define the identity of the package. PACKAGE='cjk-utils-for-tex-live' - VERSION='4.7.0' + VERSION='4.8.2' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} @@ -12543,7 +12537,7 @@ WARNING_CFLAGS=$kpse_cv_warning_cflags -ac_config_headers="$ac_config_headers hbf2gf/c-auto.h:hbf2gf/c-auto.in" +ac_config_headers="$ac_config_headers c-auto.h:c-auto.in" XX_CFLAGS=$WARNING_CFLAGS @@ -13048,7 +13042,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -CJK utils for TeX Live config.lt 4.7.0 +CJK utils for TeX Live config.lt 4.8.2 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -14268,7 +14262,71 @@ else fi -ac_config_files="$ac_config_files Makefile conv/Makefile hbf2gf/Makefile scripts/Makefile" + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native WIN32 or MINGW32" >&5 +$as_echo_n "checking for native WIN32 or MINGW32... " >&6; } +if ${kpse_cv_have_win32+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef WIN32 + choke me +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __MINGW32__ + choke me +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + kpse_cv_have_win32=mingw32 +else + kpse_cv_have_win32=native +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + kpse_cv_have_win32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_win32" >&5 +$as_echo "$kpse_cv_have_win32" >&6; } + + if test "x$kpse_cv_have_win32" != xno; then + WIN32_TRUE= + WIN32_FALSE='#' +else + WIN32_TRUE='#' + WIN32_FALSE= +fi + + +CJKUTILS_TREE=cjkutils-4.8.2 + + +ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF @@ -14404,6 +14462,10 @@ if test -z "${do_cweb_TRUE}" && test -z "${do_cweb_FALSE}"; then as_fn_error $? "conditional \"do_cweb\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then + as_fn_error $? "conditional \"WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -14813,7 +14875,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by CJK utils for TeX Live $as_me 4.7.0, which was +This file was extended by CJK utils for TeX Live $as_me 4.8.2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14879,7 +14941,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -CJK utils for TeX Live config.status 4.7.0 +CJK utils for TeX Live config.status 4.8.2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -15290,11 +15352,8 @@ do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "hbf2gf/c-auto.h") CONFIG_HEADERS="$CONFIG_HEADERS hbf2gf/c-auto.h:hbf2gf/c-auto.in" ;; + "c-auto.h") CONFIG_HEADERS="$CONFIG_HEADERS c-auto.h:c-auto.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "conv/Makefile") CONFIG_FILES="$CONFIG_FILES conv/Makefile" ;; - "hbf2gf/Makefile") CONFIG_FILES="$CONFIG_FILES hbf2gf/Makefile" ;; - "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/Build/source/texk/cjkutils/configure.ac b/Build/source/texk/cjkutils/configure.ac index 0459639b20e..7e754fdf6b1 100644 --- a/Build/source/texk/cjkutils/configure.ac +++ b/Build/source/texk/cjkutils/configure.ac @@ -1,21 +1,22 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl Copyright (C) 2009 Peter Breitenlohner +dnl Copyright (C) 2009, 2010 Peter Breitenlohner dnl dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([CJK utils for TeX Live], [4.7.0], [tex-k@tug.org]) +m4_define([cjk_version], [4.8.2])[]dnl using unmodified cjk/utils source tree +AC_INIT([CJK utils for TeX Live], cjk_version, [tex-k@tug.org]) AC_PREREQ([2.65]) -AC_CONFIG_SRCDIR([hbf2gf/hbf.h]) +AC_CONFIG_SRCDIR([cjkutils-]cjk_version[/hbf2gf/hbf.h]) AC_CONFIG_AUX_DIR([../../build-aux]) AC_CONFIG_MACRO_DIR([../../m4]) dnl Common code for all programs using libkpathsea. -KPSE_COMMON([cjkutils]) +KPSE_COMMON([cjkutils], [no-define]) -AC_CONFIG_HEADERS([hbf2gf/c-auto.h:hbf2gf/c-auto.in]) +AC_CONFIG_HEADERS([c-auto.h:c-auto.in]) dnl get Compiler flags right. XX_CFLAGS=$WARNING_CFLAGS @@ -61,6 +62,13 @@ if test x"$do_cweb" = xyes; then fi AM_CONDITIONAL([do_cweb], [test "x$do_cweb" = xyes]) -AC_CONFIG_FILES([Makefile conv/Makefile hbf2gf/Makefile scripts/Makefile]) +KPSE_COMPILER_WARNINGS + +KPSE_CHECK_WIN32 +AM_CONDITIONAL([WIN32], [test "x$kpse_cv_have_win32" != xno]) + +AC_SUBST([CJKUTILS_TREE], [cjkutils-]cjk_version) + +AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/Build/source/texk/cjkutils/conv/Makefile.am b/Build/source/texk/cjkutils/conv/Makefile.am deleted file mode 100644 index eafeaad23d4..00000000000 --- a/Build/source/texk/cjkutils/conv/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Makefile.am for the TeX Live subdirectory texk/cjkutils/conv/ -## -## Copyright (C) 2009 Peter Breitenlohner -## You may freely use, modify and/or distribute this file. -## -bin_PROGRAMS = bg5conv cefconv cef5conv cefsconv extconv sjisconv - -AM_CFLAGS = $(XX_CFLAGS) - diff --git a/Build/source/texk/cjkutils/conv/Makefile.in b/Build/source/texk/cjkutils/conv/Makefile.in deleted file mode 100644 index 61e2f21e821..00000000000 --- a/Build/source/texk/cjkutils/conv/Makefile.in +++ /dev/null @@ -1,561 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = bg5conv$(EXEEXT) cefconv$(EXEEXT) cef5conv$(EXEEXT) \ - cefsconv$(EXEEXT) extconv$(EXEEXT) sjisconv$(EXEEXT) -subdir = conv -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ - $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ - $(top_srcdir)/../../m4/kpse-warnings.m4 \ - $(top_srcdir)/../../m4/libtool.m4 \ - $(top_srcdir)/../../m4/ltoptions.m4 \ - $(top_srcdir)/../../m4/ltsugar.m4 \ - $(top_srcdir)/../../m4/ltversion.m4 \ - $(top_srcdir)/../../m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/hbf2gf/c-auto.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -bg5conv_SOURCES = bg5conv.c -bg5conv_OBJECTS = bg5conv.$(OBJEXT) -bg5conv_LDADD = $(LDADD) -cef5conv_SOURCES = cef5conv.c -cef5conv_OBJECTS = cef5conv.$(OBJEXT) -cef5conv_LDADD = $(LDADD) -cefconv_SOURCES = cefconv.c -cefconv_OBJECTS = cefconv.$(OBJEXT) -cefconv_LDADD = $(LDADD) -cefsconv_SOURCES = cefsconv.c -cefsconv_OBJECTS = cefsconv.$(OBJEXT) -cefsconv_LDADD = $(LDADD) -extconv_SOURCES = extconv.c -extconv_OBJECTS = extconv.$(OBJEXT) -extconv_LDADD = $(LDADD) -sjisconv_SOURCES = sjisconv.c -sjisconv_OBJECTS = sjisconv.$(OBJEXT) -sjisconv_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/hbf2gf -depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = bg5conv.c cef5conv.c cefconv.c cefsconv.c extconv.c \ - sjisconv.c -DIST_SOURCES = bg5conv.c cef5conv.c cefconv.c cefsconv.c extconv.c \ - sjisconv.c -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CTANGLE = @CTANGLE@ -CWEAVE = @CWEAVE@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KPATHSEA_DEPEND = @KPATHSEA_DEPEND@ -KPATHSEA_INCLUDES = @KPATHSEA_INCLUDES@ -KPATHSEA_LIBS = @KPATHSEA_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TEX = @TEX@ -VERSION = @VERSION@ -WARNING_CFLAGS = @WARNING_CFLAGS@ -XX_CFLAGS = @XX_CFLAGS@ -XX_CPPFLAGS = @XX_CPPFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CFLAGS = $(XX_CFLAGS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign conv/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign conv/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -bg5conv$(EXEEXT): $(bg5conv_OBJECTS) $(bg5conv_DEPENDENCIES) - @rm -f bg5conv$(EXEEXT) - $(LINK) $(bg5conv_OBJECTS) $(bg5conv_LDADD) $(LIBS) -cef5conv$(EXEEXT): $(cef5conv_OBJECTS) $(cef5conv_DEPENDENCIES) - @rm -f cef5conv$(EXEEXT) - $(LINK) $(cef5conv_OBJECTS) $(cef5conv_LDADD) $(LIBS) -cefconv$(EXEEXT): $(cefconv_OBJECTS) $(cefconv_DEPENDENCIES) - @rm -f cefconv$(EXEEXT) - $(LINK) $(cefconv_OBJECTS) $(cefconv_LDADD) $(LIBS) -cefsconv$(EXEEXT): $(cefsconv_OBJECTS) $(cefsconv_DEPENDENCIES) - @rm -f cefsconv$(EXEEXT) - $(LINK) $(cefsconv_OBJECTS) $(cefsconv_LDADD) $(LIBS) -extconv$(EXEEXT): $(extconv_OBJECTS) $(extconv_DEPENDENCIES) - @rm -f extconv$(EXEEXT) - $(LINK) $(extconv_OBJECTS) $(extconv_LDADD) $(LIBS) -sjisconv$(EXEEXT): $(sjisconv_OBJECTS) $(sjisconv_DEPENDENCIES) - @rm -f sjisconv$(EXEEXT) - $(LINK) $(sjisconv_OBJECTS) $(sjisconv_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg5conv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cef5conv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cefconv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cefsconv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extconv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sjisconv.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/Build/source/texk/cjkutils/conv/bg5conv.c b/Build/source/texk/cjkutils/conv/bg5conv.c deleted file mode 100644 index d8170b0be14..00000000000 --- a/Build/source/texk/cjkutils/conv/bg5conv.c +++ /dev/null @@ -1,34 +0,0 @@ -#define banner \ -"bg5conv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 94 "/home/wl/cvs/cjk/cjk-4.7.0/utils/Bg5conv/bg5conv.w" - -#include -#include - - -int main(int argc, char *argv[]) - -{int ch; - -fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if(ch>=0xA1&&ch<=0xFE) -{fprintf(stdout,"\177%c\177",ch); - -ch= fgetc(stdin); -if(!feof(stdin)) -fprintf(stdout,"%d\177",ch); -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/conv/cef5conv.c b/Build/source/texk/cjkutils/conv/cef5conv.c deleted file mode 100644 index 8d7447c9593..00000000000 --- a/Build/source/texk/cjkutils/conv/cef5conv.c +++ /dev/null @@ -1,136 +0,0 @@ -#define banner \ -"cef5conv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 108 "/home/wl/cvs/cjk/cjk-4.7.0/utils/CEFconv/cef5conv.w" - -#include -#include -#include - - -int main(int argc, char *argv[]) - -{int ch,i; -unsigned char in[16]; -unsigned char out[32]; -unsigned char*inp,*outp; - -fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if(ch>=0xA1&&ch<=0xFE) -{fprintf(stdout,"\177%c\177",ch); - -ch= fgetc(stdin); -if(!feof(stdin)) -fprintf(stdout,"%d\177",ch); -} -else if(ch=='&') - -{inp= in; -outp= out; -*inp= ch; -*(++inp)= fgetc(stdin); - -if(*inp=='C'&&!feof(stdin)) -{*(++inp)= fgetc(stdin); -if(*inp=='0'&&!feof(stdin)) -{*(outp++)= 'B'; -*(outp++)= 'g'; -*(outp++)= '5'; -} -else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'N'; -*(outp++)= 'S'; -*(outp++)= *inp; -} -else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'E'; -*(outp++)= 'F'; -*(outp++)= *inp; -} -else -goto no_macro; -} -else if(*inp=='U'&&!feof(stdin)) -{*(outp++)= 'U'; -*(outp++)= 'T'; -*(outp++)= 'F'; -*(outp++)= '8'; -} -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(*inp!='-'||feof(stdin)) -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*outp= '\0'; - -*(++inp)= fgetc(stdin); -if(*inp!=';'||feof(stdin)) -goto no_macro; - -outp= out; -fprintf(stdout,"\17772\177"); -while(*outp) -fputc(*(outp++),stdout); - -ch= fgetc(stdin); -continue; - -no_macro: -ch= *inp; -i= inp-in; -inp= in; -while(i--) -fputc(*(inp++),stdout); -continue; -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/conv/cefconv.c b/Build/source/texk/cjkutils/conv/cefconv.c deleted file mode 100644 index b501c175937..00000000000 --- a/Build/source/texk/cjkutils/conv/cefconv.c +++ /dev/null @@ -1,128 +0,0 @@ -#define banner \ -"cefconv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 100 "/home/wl/cvs/cjk/cjk-4.7.0/utils/CEFconv/cefconv.w" - -#include -#include -#include - - -int main(int argc, char *argv[]) - -{int ch,i; -unsigned char in[16]; -unsigned char out[32]; -unsigned char*inp,*outp; - -fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if(ch=='&') -{inp= in; -outp= out; -*inp= ch; -*(++inp)= fgetc(stdin); - -if(*inp=='C'&&!feof(stdin)) -{*(++inp)= fgetc(stdin); -if(*inp=='0'&&!feof(stdin)) -{*(outp++)= 'B'; -*(outp++)= 'g'; -*(outp++)= '5'; -} -else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'N'; -*(outp++)= 'S'; -*(outp++)= *inp; -} -else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'E'; -*(outp++)= 'F'; -*(outp++)= *inp; -} -else -goto no_macro; -} -else if(*inp=='U'&&!feof(stdin)) -{*(outp++)= 'U'; -*(outp++)= 'T'; -*(outp++)= 'F'; -*(outp++)= '8'; -} -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(*inp!='-'||feof(stdin)) -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*outp= '\0'; - -*(++inp)= fgetc(stdin); -if(*inp!=';'||feof(stdin)) -goto no_macro; - -outp= out; -fprintf(stdout,"\17772\177"); -while(*outp) -fputc(*(outp++),stdout); - -ch= fgetc(stdin); -continue; - -no_macro: -ch= *inp; -i= inp-in; -inp= in; -while(i--) -fputc(*(inp++),stdout); -continue; -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/conv/cefsconv.c b/Build/source/texk/cjkutils/conv/cefsconv.c deleted file mode 100644 index ddf608a38b2..00000000000 --- a/Build/source/texk/cjkutils/conv/cefsconv.c +++ /dev/null @@ -1,136 +0,0 @@ -#define banner \ -"cefsconv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 108 "/home/wl/cvs/cjk/cjk-4.7.0/utils/CEFconv/cefsconv.w" - -#include -#include -#include - - -int main(int argc, char *argv[]) - -{int ch,i; -unsigned char in[16]; -unsigned char out[32]; -unsigned char*inp,*outp; - -fprintf(stdout,"\\def\\CNSpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) -{fprintf(stdout,"\177%c\177",ch); - -ch= fgetc(stdin); -if(!feof(stdin)) -fprintf(stdout,"%d\177",ch); -} -else if(ch=='&') - -{inp= in; -outp= out; -*inp= ch; -*(++inp)= fgetc(stdin); - -if(*inp=='C'&&!feof(stdin)) -{*(++inp)= fgetc(stdin); -if(*inp=='0'&&!feof(stdin)) -{*(outp++)= 'B'; -*(outp++)= 'g'; -*(outp++)= '5'; -} -else if(*inp>='1'&&*inp<='7'&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'N'; -*(outp++)= 'S'; -*(outp++)= *inp; -} -else if((*inp=='X'||*inp=='Y')&&!feof(stdin)) -{*(outp++)= 'C'; -*(outp++)= 'E'; -*(outp++)= 'F'; -*(outp++)= *inp; -} -else -goto no_macro; -} -else if(*inp=='U'&&!feof(stdin)) -{*(outp++)= 'U'; -*(outp++)= 'T'; -*(outp++)= 'F'; -*(outp++)= '8'; -} -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(*inp!='-'||feof(stdin)) -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*(outp++)= '\177'; -*(outp++)= '\"'; -*(outp++)= '0'; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(++inp)= fgetc(stdin); -if(isxdigit(*inp)&&*inp<0x80&&!feof(stdin)) -*(outp++)= toupper(*inp); -else -goto no_macro; - -*(outp++)= '\177'; -*outp= '\0'; - -*(++inp)= fgetc(stdin); -if(*inp!=';'||feof(stdin)) -goto no_macro; - -outp= out; -fprintf(stdout,"\17772\177"); -while(*outp) -fputc(*(outp++),stdout); - -ch= fgetc(stdin); -continue; - -no_macro: -ch= *inp; -i= inp-in; -inp= in; -while(i--) -fputc(*(inp++),stdout); -continue; -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/conv/extconv.c b/Build/source/texk/cjkutils/conv/extconv.c deleted file mode 100644 index 2d8f3f88f7f..00000000000 --- a/Build/source/texk/cjkutils/conv/extconv.c +++ /dev/null @@ -1,35 +0,0 @@ -#define banner \ -"extconv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 94 "/home/wl/cvs/cjk/cjk-4.7.0/utils/extconv/extconv.w" - -#include -#include - - -int main(int argc, char *argv[]) - -{int ch; - - -fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if(ch>=0x81&&ch<=0xFE) -{fprintf(stdout,"\177%c\177",ch); - -ch= fgetc(stdin); -if(!feof(stdin)) -fprintf(stdout,"%d\177",ch); -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/conv/sjisconv.c b/Build/source/texk/cjkutils/conv/sjisconv.c deleted file mode 100644 index f655fa36637..00000000000 --- a/Build/source/texk/cjkutils/conv/sjisconv.c +++ /dev/null @@ -1,34 +0,0 @@ -#define banner \ -"sjisconv (CJK ver. 4.7.0)" \ - -/*2:*/ -#line 93 "/home/wl/cvs/cjk/cjk-4.7.0/utils/SJISconv/sjisconv.w" - -#include -#include - - -int main(int argc, char *argv[]) - -{int ch; - -fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); - -ch= fgetc(stdin); - -while(!feof(stdin)) -{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) -{fprintf(stdout,"\177%c\177",ch); - -ch= fgetc(stdin); -if(!feof(stdin)) -fprintf(stdout,"%d\177",ch); -} -else -fputc(ch,stdout); - -ch= fgetc(stdin); -} -exit(EXIT_SUCCESS); -return 0; -}/*:2*/ diff --git a/Build/source/texk/cjkutils/extconv.c b/Build/source/texk/cjkutils/extconv.c new file mode 100644 index 00000000000..98aa7cb764b --- /dev/null +++ b/Build/source/texk/cjkutils/extconv.c @@ -0,0 +1,34 @@ +#define banner \ +"extconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 94 "./cjkutils-4.8.2/extconv/extconv.w" + +#include +#include + + +int main(int argc,char*argv[]) +{int ch; + + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if(ch>=0x81&&ch<=0xFE) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ diff --git a/Build/source/texk/cjkutils/hbf2gf.c b/Build/source/texk/cjkutils/hbf2gf.c new file mode 100644 index 00000000000..ef5fc2e6112 --- /dev/null +++ b/Build/source/texk/cjkutils/hbf2gf.c @@ -0,0 +1,2242 @@ +#define banner \ +"hbf2gf (CJK ver. 4.8.2)" \ + \ + +#define TRUE 1 +#define FALSE 0 \ + +#define STRING_LENGTH 255 \ + +#define FILE_NAME_LENGTH 1024 \ + \ + +#define VERSION \ +"\n" \ +"Copyright (C) 1996-1999 Werner Lemberg.\n" \ +"There is NO warranty. You may redistribute this software\n" \ +"under the terms of the GNU General Public License\n" \ +"and the HBF library copyright.\n" \ +"\n" \ +"For more information about these matters, see the files\n" \ +"named COPYING and hbf.c.\n" \ +"\n" \ + +#define USAGE \ +"\n" \ +"Usage: hbf2gf [-q] configuration_file[.cfg]\n" \ +" hbf2gf [options] font_name x_resolution [y_scale | y_resolution]\n" \ +" hbf2gf -t [-q] font_name\n" \ +"\n" \ +" Convert a font in HBF format to TeX's GF resp. PK format.\n" \ +"\n" \ +" -q be silent\n" \ +" -p don't produce a PL file\n" \ +" -g don't produce a GF file\n" \ +" -n use no resolution in extension (only `.gf')\n" \ +" -t test for font_name (returns 0 on success)\n" \ +" --help print this message and exit\n" \ +" --version print version number and exit\n" \ +"\n" \ + +#define GF_ID 131 +#define PRE 247 \ + +#define header " hbf2gf output " \ + +#define BOC 67 +#define BOC1 68 +#define EOC 69 \ + +#define _2_16 65536.0 +#define _2_20 1048576.0 \ + +#define XXX1 239 +#define XXX2 240 +#define XXX3 241 +#define XXX4 242 \ + +#define YYY 243 \ + +#define POST 248 \ + +#define CHAR_LOC 245 +#define CHAR_LOC0 246 \ + +#define POSTPOST 249 +#define POSTPOST_ID 223 \ + +#define BLACK 1 +#define WHITE 0 \ + +#define PIXEL_MAXVAL 255 +#define SCALE 4096 +#define HALFSCALE 2048 \ + +#define MAX_CHAR_SIZE 1023 \ + +#define PAINT_(x) (x) +#define PAINT1 64 +#define PAINT2 65 +#define PAINT3 66 \ + +#define SKIP0 70 +#define SKIP1 71 +#define SKIP2 72 +#define SKIP3 73 \ + +#define NEW_ROW_(x) ((x) +74) \ + +#define NOOP 244 \ + +#define EXTENSION_LENGTH 8 \ + +#define GFTOPK_NAME "gftopk" +#define PLTOTF_NAME "pltotf" +#define OVP2OVF_NAME "ovp2ovf" \ + +#define PRINTER_MIN_RES_X 50 +#define PRINTER_MIN_RES_Y 50 \ + +#define VALID_SUBCODE 1 \ + +/*4:*/ +#line 191 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*10:*/ +#line 408 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef TM_IN_SYS_TIME +#include +#endif +#include "hbf.h" + + + +/*:10*//*69:*/ +#line 2469 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +#include "kpathsea/kpathsea.h" + +#elif defined(HAVE_EMTEXDIR) +#include "emtexdir.h" + +#elif defined(HAVE_MIKTEX) +#include "miktex.h" +#endif + +/*:69*/ +#line 192 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*11:*/ +#line 429 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_file(void); + + +/*:11*//*13:*/ +#line 491 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_pre(void); + + +/*:13*//*16:*/ +#line 579 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_data(void); + + +/*:16*//*20:*/ +#line 690 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_post(void); + + +/*:20*//*25:*/ +#line 834 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void fputl(long,FILE*); + + +/*:25*//*29:*/ +#line 994 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void make_pixel_array(void); + + +/*:29*//*36:*/ +#line 1222 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void read_row(unsigned char*); + + +/*:36*//*39:*/ +#line 1272 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void write_row(unsigned char*); + + +/*:39*//*41:*/ +#line 1325 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_coding(void); + + +/*:41*//*45:*/ +#line 1486 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_pl(void); + + +/*:45*//*47:*/ +#line 1583 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_ovp(void); + + +/*:47*//*50:*/ +#line 1728 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_job(void); + + +/*:50*//*54:*/ +#line 1977 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void read_config(void); + + +/*:54*//*64:*/ +#line 2308 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +int fsearch(const char*); + + +/*:64*//*67:*/ +#line 2447 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void config_error(const char*); + + +/*:67*//*71:*/ +#line 2490 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +const char*TeX_search_version(void); + + +/*:71*//*74:*/ +#line 2525 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +extern int setup_list(struct emtex_dir*,char*,const char*,unsigned); +int dir_setup(struct emtex_dir*,const char*,const char*,unsigned); +char*file_find(char*,struct emtex_dir*); +#endif + + +/*:74*//*79:*/ +#line 2613 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char*TeX_search_cfg_file(char*); +char*TeX_search_hbf_file(char*); + + +/*:79*/ +#line 193 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*2:*/ +#line 127 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +int nmb_files= -1; +int unicode= FALSE; + +int testing= FALSE; + +int mf_like= FALSE; +int file_number= 0; + +double x_resolution= 0.0; +double y_scale= 1.0; + +int pk_files= TRUE; +int tfm_files= TRUE; +int long_extension= TRUE; +int quiet= FALSE; + +char config_file[FILE_NAME_LENGTH+4+1]; + +char output_name[STRING_LENGTH+1]; + +FILE*config,*out; +HBF*hbf; + +#ifdef msdos +#define WRITE_BIN "wb" +#define WRITE_TXT "wt" +#define READ_BIN "rb" +#define READ_TXT "rt" +#else +#define WRITE_BIN "w" +#define WRITE_TXT "w" +#define READ_BIN "r" +#define READ_TXT "r" +#endif + +int end_of_file= FALSE; + + +/*:2*//*15:*/ +#line 538 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +long char_adr[256]; +long*char_adr_p; + +int pk_offset_x; + + +double tfm_offset_x; +int pk_offset_y; + +double tfm_offset_y; + +int input_size_x; +int input_size_y; +const char*font_encoding; +int pk_width; +int pk_output_size_x; + +double tfm_output_size_x; +int pk_output_size_y; +double tfm_output_size_y; + +double design_size= 10.0; +double target_size_x; +double target_size_y; +double magstep_x; +double magstep_y; +double slant; +int rotation; + +double mag_x; +double mag_y; + +int empty_char; +int last_char; + +int dot_count; + + + +/*:15*//*19:*/ +#line 667 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char coding[STRING_LENGTH+1]; +char comment[STRING_LENGTH+1]; + +unsigned long checksum; + +long pk_total_min_x; +long pk_total_max_x; +long pk_total_min_y; +long pk_total_max_y; + +int dpi_x; +int dpi_y; +double ppp_x; +double ppp_y; + + +/*:19*//*27:*/ +#line 871 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +HBF_CHAR code; +const unsigned char*bitmap; + +const unsigned char*bP; + +unsigned char out_char[MAX_CHAR_SIZE*MAX_CHAR_SIZE+1]; + +unsigned char*out_char_p; + +unsigned char pixelrow[MAX_CHAR_SIZE]; +unsigned char temp_pixelrow[MAX_CHAR_SIZE]; +unsigned char new_pixelrow[MAX_CHAR_SIZE+1]; + +int curr_row; + +long grayrow[MAX_CHAR_SIZE]; + +long s_mag_x,s_mag_y,s_slant; + + +/*:27*//*38:*/ +#line 1267 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +int threshold= 128; + + +/*:38*//*49:*/ +#line 1717 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char job_extension[EXTENSION_LENGTH+1]; +char rm_command[STRING_LENGTH+1]; +char cp_command[STRING_LENGTH+1]; +char pk_directory[STRING_LENGTH+1]; +char tfm_directory[STRING_LENGTH+1]; + +int ofm_file= FALSE; + + +/*:49*//*53:*/ +#line 1972 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char Buffer[STRING_LENGTH+1]; + + +/*:53*//*58:*/ +#line 2090 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +int offset_x; +int offset_y; + +HBF_CHAR user_min_char; +int have_min_char= FALSE; + +/*:58*//*60:*/ +#line 2247 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +HBF_CHAR min_char,max_char; + + +/*:60*//*62:*/ +#line 2274 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char b2_codes[256]; +unsigned char min_2_byte,max_2_byte; +int nmb_2_bytes= 0; + + +/*:62*//*70:*/ +#line 2481 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#if defined(HAVE_EMTEXDIR) +char emtex_version_string[]= "emTeXdir"; +#elif !defined(HAVE_MIKTEX) +char no_version_string[]= "no search library"; +#endif + + +/*:70*//*73:*/ +#line 2518 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +struct emtex_dir cfg_path,hbf_path; +#endif + + +/*:73*//*76:*/ +#line 2564 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char name_buffer[FILE_NAME_LENGTH+1]; + + +/*:76*/ +#line 194 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + + +int main(int argc,char*argv[]) +{char*p; + +/*78:*/ +#line 2586 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +kpse_set_program_name(argv[0],"hbf2gf"); +kpse_init_prog("HBF2GF",300,"cx","cmr10"); + +#elif defined(HAVE_EMTEXDIR) +if(!dir_setup(&cfg_path,"HBFCFG",NULL,EDS_BANG)) +{fprintf(stderr, +"Couldn't setup search path for configuration files\n"); +exit(1); +} +if(!dir_setup(&hbf_path,"HBFONTS",NULL,EDS_BANG)) +{fprintf(stderr, +"Couldn't setup search path for HBF header files\n"); +exit(1); +} +#endif + + +/*:78*/ +#line 200 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +/*7:*/ +#line 307 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +if(argc==2) +{if(strcmp(argv[1],"--help")==0) +/*6:*/ +#line 288 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{printf(USAGE); +exit(0); +} + + +/*:6*/ +#line 310 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +else if(strcmp(argv[1],"--version")==0) +/*5:*/ +#line 261 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{printf("\n"); +printf(banner); +printf(" (%s)\n",TeX_search_version()); +printf(VERSION); +exit(0); +} + + +/*:5*/ +#line 312 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +} + +while(argc> 1) +{p= argv[1]; +if(p[0]!='-') +break; +if(p[1]=='p') +tfm_files= FALSE; +else if(p[1]=='g') +pk_files= FALSE; +else if(p[1]=='n') +long_extension= FALSE; +else if(p[1]=='q') +quiet= TRUE; +else if(p[1]=='t') +testing= TRUE; + +argv++; +argc--; +} + +if(testing) +{if(argc!=2) +{fprintf(stderr,"Need exactly one parameter for `-t' option.\n"); +fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); +exit(1); +} +} +else if(argc<2||argc> 4) +{fprintf(stderr,"Invalid number of parameters.\n"); +fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); +exit(1); +} + + +/*:7*/ +#line 202 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +if(!quiet) +printf("\n%s\n\n",banner); + +strncpy(config_file,argv[1],FILE_NAME_LENGTH); +config_file[FILE_NAME_LENGTH]= '\0'; + +if(argc> 2||testing) +{int l= strlen(config_file); + +if(l> 2) +config_file[l-2]= '\0'; + +else +{if(!quiet) +printf("`%s' can't be a subfont created by hbf2gf\n", +config_file); +exit(2); +} + +mf_like= TRUE; +} + +read_config(); + +if(mf_like) +/*8:*/ +#line 352 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{if(unicode) +file_number= (int)strtol(&argv[1][strlen(argv[1])-2], +(char**)NULL,16); +else +file_number= atoi(&argv[1][strlen(argv[1])-2]); + +x_resolution= atof(argv[2]); +if(x_resolution 3) +{y_scale= atof(argv[3]); +if(y_scale<0.01) +{fprintf(stderr, +"Invalid vertical scaling factor or resolution\n"); +exit(1); +} +if(y_scale> 10.0) +y_scale= (double)x_resolution/y_scale; +} +} + + +/*:8*/ +#line 229 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +/*28:*/ +#line 903 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{int col,offset; + +if(rotation) +{int tmp; + + +tmp= input_size_x; +input_size_x= input_size_y; +input_size_y= tmp; +} + +if(mf_like) +{target_size_x= design_size*(x_resolution/dpi_x); +target_size_y= design_size*(x_resolution*y_scale/dpi_y); +} +else +target_size_x= target_size_y= design_size; +magstep_x= target_size_x/design_size; +magstep_y= target_size_y/design_size; + +pk_offset_x= offset_x*magstep_x+0.5; +pk_offset_y= offset_y*magstep_y+0.5; +tfm_offset_x= offset_x/(dpi_x/72.27)/design_size; +tfm_offset_y= offset_y/(dpi_y/72.27)/design_size; + +pk_width= input_size_x*mag_x*magstep_x+0.5; +pk_output_size_x= input_size_x*mag_x*magstep_x+ +input_size_y*mag_y*magstep_y*slant+0.5; +pk_output_size_y= input_size_y*mag_y*magstep_y+0.5; +tfm_output_size_x= input_size_x*mag_x/ +(dpi_x/72.27)/design_size; +tfm_output_size_y= input_size_y*mag_y/ +(dpi_y/72.27)/design_size; +if(pk_output_size_x> MAX_CHAR_SIZE) +{fprintf(stderr,"Output character box width too big\n"); +exit(1); +} +if(pk_output_size_y> MAX_CHAR_SIZE) +{fprintf(stderr,"Output character box height too big\n"); +exit(1); +} + +for(col= 0;col=0x100)) +{fprintf(stderr,"Invalid subfile number\n"); +exit(1); +} + +if(unicode) +{offset= 0; +code= file_number*0x100; +} +else +{offset= (file_number-1)*256%nmb_2_bytes; +code= (min_char&0xFF00)+min_2_byte+ +(file_number-1)*256/nmb_2_bytes*0x100; +} + +while(offset--) +while(!b2_codes[code++&0xFF]) + +; + +if(code> max_char) +{fprintf(stderr,"Invalid subfile number\n"); +exit(1); +} +} + +s_mag_x= mag_x*magstep_x*SCALE; +s_mag_y= mag_y*magstep_y*SCALE; +s_slant= slant*SCALE; +} + + +/*:28*/ +#line 231 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +/*9:*/ +#line 387 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{int j,max_numb; + +if(!mf_like) +{file_number= (unicode==TRUE?(min_char>>8):1); +if(nmb_files==-1) +max_numb= (unicode==TRUE?0x100:100); +else +max_numb= nmb_files; +} +else +max_numb= 1; + +for(j= 0;(j>24,f); +fputc(num>>16,f); +fputc(num>>8,f); +fputc(num,f); +} + + +/*:26*//*30:*/ +#line 999 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void make_pixel_array(void) +{unsigned char*prP; +unsigned char*temp_prP; +unsigned char*new_prP; +long*grP; + +register unsigned char*xP; +register unsigned char*nxP; + +register int row,col; +int rows_read= 0; +register int need_to_read_row= 1; + +long frac_row_to_fill= SCALE; +long frac_row_left= s_mag_y; + +int no_code= FALSE; + + +prP= pixelrow; +temp_prP= temp_pixelrow; +new_prP= new_pixelrow; +grP= grayrow; +out_char_p= out_char; + +again: +if(b2_codes[code&0xFF]) +{if(pk_files) +{bitmap= hbfGetBitmap(hbf,code); +bP= bitmap; + + +if(!bitmap) +empty_char= TRUE; +else +/*31:*/ +#line 1058 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{if(pk_output_size_y==input_size_y) +temp_prP= prP; + +curr_row= input_size_y-1; +for(row= 0;row PIXEL_MAXVAL) +g= PIXEL_MAXVAL; + +*nxP= g; +grP[col]= HALFSCALE; +} + +frac_row_left-= frac_row_to_fill; +if(frac_row_left==0) +{frac_row_left= s_mag_y; +need_to_read_row= 1; +} +frac_row_to_fill= SCALE; + + +/*:33*/ +#line 1092 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +} + + +/*:32*/ +#line 1064 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*34:*/ +#line 1140 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +if(pk_width==input_size_x&&s_slant==0) + +write_row(temp_prP); +else +{register long g= HALFSCALE; +register long frac_col_to_fill= SCALE; +register long frac_col_left; +register int need_col= 0; + + +nxP= new_prP; + +frac_col_left= (pk_output_size_y-row)*s_slant; +while(frac_col_left>=frac_col_to_fill) +{*(nxP++)= 0; +frac_col_left-= frac_col_to_fill; +} + +if(frac_col_left> 0) +frac_col_to_fill-= frac_col_left; + +for(col= 0,xP= temp_prP;col=frac_col_to_fill) +{if(need_col) +{++nxP; +g= HALFSCALE; +} + +g+= frac_col_to_fill*(*xP); +g/= SCALE; +if(g> PIXEL_MAXVAL) +g= PIXEL_MAXVAL; + +*nxP= g; +frac_col_left-= frac_col_to_fill; +frac_col_to_fill= SCALE; +need_col= 1; +} + +if(frac_col_left> 0) +{if(need_col) +{++nxP; +g= HALFSCALE; +need_col= 0; +} + +g+= frac_col_left*(*xP); +frac_col_to_fill-= frac_col_left; +} +} + +/*35:*/ +#line 1198 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +if(frac_col_to_fill> 0) +{--xP; +g+= frac_col_to_fill*(*xP); +} + +if(!need_col) +{g/= SCALE; +if(g> PIXEL_MAXVAL) +g= PIXEL_MAXVAL; +*nxP= g; +} + +*(++nxP)= 0; + +write_row(new_prP); + + +/*:35*/ +#line 1193 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +} + + +/*:34*/ +#line 1066 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +} +} + + +/*:31*/ +#line 1035 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +} +} +else +no_code= TRUE; + +if((code&0xFF)==max_2_byte) +code+= 0xFF-(max_2_byte-min_2_byte); +if(code>=max_char) +{end_of_file= TRUE; +return; +} + +code++; + +if(no_code) +{no_code= FALSE; +goto again; +} +} + + +/*:30*//*37:*/ +#line 1230 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void read_row(unsigned char*pixelrow) +{register int col,bitshift,offset; +register unsigned char*xP; +register unsigned char item= 0; + +if(rotation) +{bitshift= 7-(curr_row%8); +offset= (input_size_y+7)/8; +bP= bitmap+curr_row/8; +for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; +bP+= offset; +} +curr_row--; +} +else +{bitshift= -1; +for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; +--bitshift; +} +} +} + + +/*:37*//*40:*/ +#line 1280 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef __GNUC__ +__inline__ +#endif +void write_row(unsigned char*pixelrow) +{register int col; +register unsigned char*xP; + +for(col= 0,xP= pixelrow;col=threshold)?1:0; + +} + + +/*:40*//*42:*/ +#line 1333 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_coding(void) +{register int count,skip; +register unsigned char paint; +register int x,y; +register unsigned char*cp; + +x= 0; +y= 0; +cp= out_char+y*pk_output_size_x+x; +count= skip= 0; +paint= WHITE; +goto start; + +while(y>8,out); +fputc(count&0xFF,out); +} +} +} +else +{if(skip==1) +fputc(SKIP0,out); +else +{if(skip<256) +{fputc(SKIP1,out); +fputc(skip,out); +} +else +{fputc(SKIP2,out); +fputc(skip>>8,out); +fputc(skip&0xFF,out); +} +} +skip= 0; +if(count<64) +fputc(PAINT_(count),out); +else if(count<256) +{fputc(PAINT1,out); +fputc(count,out); +} +else +{fputc(PAINT2,out); +fputc(count>>8,out); +fputc(count&0xFF,out); +} +} +count= 0; +paint= BLACK; +break; +} +x++; +cp++; +} +if(x>=pk_output_size_x) +{skip++; +y++; +continue; +} + + +/*:43*/ +#line 1348 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +start: +/*44:*/ +#line 1425 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +while(x>8,out); +fputc(count&0xFF,out); +} +count= 1; +paint= BLACK-paint; +} +x++; +cp++; +} +if(paint==BLACK) +{if(count<64) +fputc(PAINT_(count),out); +else if(count<256) +{fputc(PAINT1,out); +fputc(count,out); +} +else +{fputc(PAINT2,out); +fputc(count>>8,out); +fputc(count&0xFF,out); +} +paint= WHITE; +} + + + +/*:44*/ +#line 1350 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +y++; +} +} + + +/*:42*//*46:*/ +#line 1491 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void write_pl(void) +{int i,pos; +char output_file[FILE_NAME_LENGTH+1]; +long t,sc; +char*s; +char tfm_header[]= "Created by hbf2gf"; + +file_number--; + +if(mf_like) +{if(unicode) +sprintf(output_file,"%s%02x.pl",output_name,file_number); +else +sprintf(output_file,"%s%02i.pl",output_name,file_number); +} +else +sprintf(output_file,"%s.pl",output_name); + +if(!(out= fopen(output_file,WRITE_TXT))) +{fprintf(stderr,"Couldn't open `%s'\n",output_file); +exit(1); +} +if(!quiet) +printf("\nWriting `%s'\n",output_file); + +fprintf(out, +"\n(FAMILY %s%d)" +"\n(CODINGSCHEME CJK-%s)", +output_name,file_number,font_encoding); + +fprintf(out, +"\n(DESIGNSIZE R %.6f)" +"\n(COMMENT DESIGNSIZE IS IN POINTS)" +"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" +"\n(CHECKSUM O %lo)" +"\n(FONTDIMEN" +"\n (SLANT R %.6f)" +"\n (SPACE R 0.0)" +"\n (STRETCH R 0.0)" +"\n (SHRINK R 0.0)" +"\n (XHEIGHT R 1.0)" +"\n (QUAD R 1.0)" +"\n (EXTRASPACE R 0.0)" +"\n )",design_size,checksum,slant); + +s= tfm_header; +i= strlen(s); +t= ((long)i)<<24; +sc= 16; +pos= 18; + +fprintf(out,"\n"); +while(i> 0) +{t|= ((long)(*(unsigned char*)s++))<=256) +nmb_subfonts++; + +sprintf(output_file,"%s.ovp",output_name); + +if(!(out= fopen(output_file,WRITE_TXT))) +{fprintf(stderr,"Couldn't open `%s'\n",output_file); +exit(1); +} +if(!quiet) +printf("\nWriting `%s'\n",output_file); + +fprintf(out, +"\n(VTITLE Omega virtual font created by hbf2gf)" +"\n(DESIGNSIZE R %.6f)" +"\n(COMMENT DESIGNSIZE IS IN POINTS)" +"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" +"\n(CHECKSUM O %lo)" +"\n(FONTDIMEN" +"\n (SLANT R %.6f)" +"\n (SPACE R 0.0)" +"\n (STRETCH R 0.0)" +"\n (SHRINK R 0.0)" +"\n (XHEIGHT R 1.0)" +"\n (QUAD R 1.0)" +"\n (EXTRASPACE R 0.0)" +"\n )",design_size,checksum,slant); + +s= ofm_header; +i= strlen(s); +t= ((long)i)<<24; +sc= 16; +pos= 18; + +fprintf(out,"\n"); +while(i> 0) +{t|= ((long)(*(unsigned char*)s++))<>8),j= 0;j>8),j= 0;jhbf_height; +input_size_y= boxp->hbf_width; +font_encoding= hbfProperty(hbf,"HBF_CODE_SCHEME"); + +if(!fsearch("output_name")) +config_error("output_name"); +else +strcpy(output_name,Buffer); +} + + +/*:57*/ +#line 2024 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*59:*/ +#line 2098 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{if(fsearch("nmb_files")) +nmb_files= atoi(Buffer); +if(fsearch("unicode")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +unicode= TRUE; +if(fsearch("min_char")) +{user_min_char= strtoul(Buffer,(char**)NULL,0); +have_min_char= TRUE; +} + +if(!mf_like) +{if(fsearch("pk_files")) +if(Buffer[0]=='n'||Buffer[0]=='N') +pk_files= FALSE; +if(fsearch("tfm_files")) +if(Buffer[0]=='n'||Buffer[0]=='N') +tfm_files= FALSE; +if(fsearch("ofm_file")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +ofm_file= TRUE; +if(fsearch("long_extension")) +if(Buffer[0]=='n'||Buffer[0]=='N') +long_extension= FALSE; +} + +if(fsearch("slant")) +slant= atof(Buffer); +if(slant<0.0||slant> 1.0) +{fprintf(stderr,"Invalid slant\n"); +exit(1); +} +if(fsearch("rotation")) +if(Buffer[0]=='y'||Buffer[0]=='Y') +rotation= TRUE; + +if(fsearch("mag_x")) +mag_x= atof(Buffer); +if(fsearch("mag_y")) +mag_y= atof(Buffer); +if(!mag_x&&!mag_y) +{mag_x= 1.0; +mag_y= 1.0; +} +if(mag_x&&!mag_y) +mag_y= mag_x; +if(mag_y&&!mag_x) +mag_x= mag_y; +if(mag_x<=0.0) +{fprintf(stderr,"Invalid horizontal magnification\n"); +exit(1); +} +if(mag_y<=0.0) +{fprintf(stderr,"Invalid vertical magnification\n"); +exit(1); +} + +if(fsearch("dpi_x")) +dpi_x= atoi(Buffer); +if(fsearch("dpi_y")) +dpi_y= atoi(Buffer); +if(!dpi_x&&!dpi_y) +{dpi_x= 300; +dpi_y= 300; +} +if(dpi_x&&!dpi_y) +dpi_y= dpi_x; +if(dpi_y&&!dpi_x) +dpi_x= dpi_y; +if(dpi_x<=PRINTER_MIN_RES_X) +{fprintf(stderr,"Invalid horizontal printer resolution\n"); +exit(1); +} +if(dpi_y<=PRINTER_MIN_RES_Y) +{fprintf(stderr,"Invalid vertical printer resolution\n"); +exit(1); +} + +if(fsearch("design_size")) +design_size= atof(Buffer); + +if(fsearch("x_offset")) +offset_x= atoi(Buffer); +else +offset_x= rotation?0:(boxp->hbf_xDisplacement*mag_x+0.5); +if(fsearch("y_offset")) +offset_y= atoi(Buffer); +else +offset_y= rotation?0:(boxp->hbf_yDisplacement*mag_y+0.5); +if(!fsearch("comment")) +comment[0]= '\0'; +else +strcpy(comment,Buffer); + +if(fsearch("threshold")) +threshold= atoi(Buffer); +if(threshold<=0||threshold>=255) +{fprintf(stderr,"Invalid threshold\n"); +exit(1); +} + +if(!fsearch("checksum")) +checksum= 0; +else +checksum= strtoul(Buffer,(char**)NULL,0); + +if(!fsearch("coding")) +coding[0]= '\0'; +else +strcpy(coding,Buffer); + +if(!fsearch("pk_directory")) +pk_directory[0]= '\0'; +else +strcpy(pk_directory,Buffer); + +if(!fsearch("tfm_directory")) +tfm_directory[0]= '\0'; +else +strcpy(tfm_directory,Buffer); + +if(fsearch("rm_command")) +strcpy(rm_command,Buffer); +else +strcpy(rm_command,"rm"); + +if(fsearch("cp_command")) +strcpy(cp_command,Buffer); +else +strcpy(cp_command,"cp"); + +if(!fsearch("job_extension")) +job_extension[0]= '\0'; +else +{strncpy(job_extension,Buffer,EXTENSION_LENGTH); +job_extension[EXTENSION_LENGTH]= '\0'; +} +} + + +/*:59*/ +#line 2025 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +/*61:*/ +#line 2252 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{const void*cp; +HBF_CHAR dummy; + +cp= hbfGetCodeRange(hbf,NULL,&min_char,&max_char); +for(;cp!=NULL;cp= hbfGetCodeRange(hbf,cp,&dummy,&max_char)) +; + +if(have_min_char) +min_char= user_min_char; +} + + +/*:61*/ +#line 2027 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +/*63:*/ +#line 2281 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{const void*b2r; +unsigned char dummy; +int i; + +for(i= 0;i<256;i++) +b2_codes[i]= 0; + +b2r= hbfGetByte2Range(hbf,NULL,&min_2_byte,&max_2_byte); +dummy= min_2_byte; +for(;b2r!=NULL;b2r= hbfGetByte2Range(hbf,b2r,&dummy,&max_2_byte)) +{for(i= dummy;i<=max_2_byte;i++) +b2_codes[i]= VALID_SUBCODE; +} + +for(i= 0;i<256;i++) +if(b2_codes[i]==VALID_SUBCODE) +nmb_2_bytes++; +} + + +/*:63*/ +#line 2028 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + + +fclose(config); +} + + +/*:55*//*65:*/ +#line 2313 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +int fsearch(const char*search_string) +{char*P,p; +const char*Q; +char temp_buffer[STRING_LENGTH+1]; +char env_name[STRING_LENGTH+1]; +char*env_p; +char*env_value; +char*Buf_p; +int Ch,ch,old_ch= '\n'; +int count= STRING_LENGTH; + +rewind(config); + +do +{Q= search_string; +p= tolower(*Q); +Ch= fgetc(config); +ch= tolower(Ch); +while(!(ch==p&&old_ch=='\n')&&Ch!=EOF) + + +{old_ch= ch; +Ch= fgetc(config); +ch= tolower(Ch); +} + +for(;;) +{if(*(++Q)=='\0') +if((Ch= fgetc(config))==' '||Ch=='\t') + +goto success; +Ch= fgetc(config); +if(tolower(Ch)!=tolower(*Q)) +break; +} +} +while(Ch!=EOF); + +return 0; + +success: +P= temp_buffer; + +while((Ch= fgetc(config))==' '||Ch=='\t') + +; +while(Ch!='\n'&&--count> 0&&Ch!=EOF) +{*P++= Ch; +Ch= fgetc(config); +} +*P= '\0'; + +if(*temp_buffer) +/*66:*/ +#line 2392 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +{P= temp_buffer; +Buf_p= Buffer; +count= STRING_LENGTH-1; + +while(*P&&count> 0) +{env_p= env_name; + +if(*P=='$') +{P++; +if(*P=='$') +{*(Buf_p++)= *(P++); +count--; +continue; +} +while(*P=='{') +P++; +if(!(isalpha(*P)||*P=='_')) +{fprintf(stderr, +"Invalid environment variable name in configuration file\n"); +exit(1); +} +*(env_p++)= *(P++); +while(*P) +{if(isalnum(*P)||*P=='_') +*(env_p++)= *(P++); +else +{while(*P=='}') +P++; +*env_p= '\0'; +break; +} +} + +env_value= getenv(env_name); +if(env_value) +{while(*env_value&&count> 0) +{*(Buf_p++)= *(env_value++); +count--; +} +} +} +else +{*(Buf_p++)= *(P++); +count--; +} +} +*Buf_p= '\0'; +} + + +/*:66*/ +#line 2367 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +else +*Buffer= '\0'; + +return(*Buffer)?1:0; +} + + +/*:65*//*68:*/ +#line 2452 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +void config_error(const char*message) +{fprintf(stderr,"Couldn't find `%s' entry in configuration file\n", +message); +exit(1); +} + + + +/*:68*//*72:*/ +#line 2495 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +const char*TeX_search_version(void) +{ +#if defined(HAVE_LIBKPATHSEA) +return kpathsea_version_string; +#elif defined(HAVE_EMTEXDIR) +return emtex_version_string; +#elif defined(HAVE_MIKTEX) +char buf[200]; + +strcpy(buf,"MiKTeX "); +miktex_get_miktex_version_string_ex(buf+7,sizeof(buf)-7); + +return buf; +#else +return no_version_string; +#endif +} + + +/*:72*//*75:*/ +#line 2537 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#ifdef HAVE_EMTEXDIR +int dir_setup(ed,env,dir,flags) +struct emtex_dir*ed; +const char*env; +const char*dir; +unsigned flags; + +{const char*val; +char path[260]; + +ed->alloc= 0; +ed->used= 0; +ed->list= NULL; + +if(env!=NULL&&(val= getenv(env))!=NULL) +return setup_list(ed,path,val,flags); +else +fprintf(stderr, +"Environment variable `%s' not set; use current directory\n", +env); + +return TRUE; +} + + +/*:75*//*77:*/ +#line 2569 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +char*file_find(name,list) +char*name; +struct emtex_dir*list; + +{if(emtex_dir_find(name_buffer,sizeof(name_buffer),list,name,EDF_CWD)) +return name_buffer; + +return NULL; +} +#endif + + +/*:77*//*80:*/ +#line 2619 "./cjkutils-4.8.2/hbf2gf/hbf2gf.w" + +#if defined(HAVE_LIBKPATHSEA) +char*TeX_search_cfg_file(char*name) +{ +return kpse_find_file(name,kpse_program_text_format,TRUE); +} + + +char*TeX_search_hbf_file(char*name) +{ +return kpse_find_file(name,kpse_miscfonts_format,TRUE); +} + + +#elif defined(HAVE_EMTEXDIR) +char*TeX_search_cfg_file(char*name) +{return file_find(name,&cfg_path); +} + + +char*TeX_search_hbf_file(char*name) +{return file_find(name,&hbf_path); +} + + +#elif defined(HAVE_MIKTEX) +char*TeX_search_cfg_file(char*name) +{char result[_MAX_PATH]; + +if(!miktex_find_input_file("hbf2gf",*name,result)) +return 0; +return strdup(result); +} + + +char*TeX_search_hbf_file(char*name) +{char result[_MAX_PATH]; + + +if(!miktex_find_miscfont_file(*name,result)) +return 0; +return strdup(result); +} + + +#else +char*TeX_search_cfg_file(char*name) +{return name; +} + + +char*TeX_search_hbf_file(char*name) +{return name; +} +#endif + + + +/*:80*/ diff --git a/Build/source/texk/cjkutils/hbf2gf.dvi b/Build/source/texk/cjkutils/hbf2gf.dvi new file mode 100644 index 00000000000..d93ae552196 Binary files /dev/null and b/Build/source/texk/cjkutils/hbf2gf.dvi differ diff --git a/Build/source/texk/cjkutils/hbf2gf.idx b/Build/source/texk/cjkutils/hbf2gf.idx new file mode 100644 index 00000000000..7a9f86cc1cc --- /dev/null +++ b/Build/source/texk/cjkutils/hbf2gf.idx @@ -0,0 +1,326 @@ +\I\.{\_\_GNUC\_\_}, 36, 37, 39, 40. +\I\&{\_\_inline\_\_}, 36, 37, 39, 40. +\I\.{\_MAX\_PATH}, 80. +\I\.{\_2\_16}, \[19], 23. +\I\.{\_2\_20}, \[19], 21. +\I\\{again}, \[30]. +\I\\{alloc}, 75. +\I\\{argc}, \[4], 7, 8. +\I\\{argv}, \[4], 7, 8, 78. +\I\\{atof}, 8, 59. +\I\\{atoi}, 8, 59. +\I\\{banner}, \[1], 4, 5. +\I\\{bitmap}, \[27], 30, 36, 37. +\I\\{bitshift}, \[37]. +\I\.{BLACK}, \[27], 43, 44. +\I\.{BOC}, \[18]. +\I\.{BOC1}, \[18]. +\I\\{boxp}, \[55], 57, 59. +\I\\{bP}, \[27], 30, 37. +\I\\{buf}, \[72]. +\I\\{Buf\_p}, \[65], 66. +\I\\{buffer}, \[51]. +\I\\{Buffer}, \[53], 57, 59, 64, 65, 66. +\I\\{b2\_codes}, 28, 30, 48, \[62], 63. +\I\\{b2r}, \[63]. +\I\|{c}, \[48]. +\I\\{cfg\_path}, \[73], 78, 80. +\I\\{ch}, \[65]. +\I\\{Ch}, \[65]. +\I\\{char\_adr}, \[15], 17, 23. +\I\\{char\_adr\_p}, \[15], 17, 18, 23. +\I\.{CHAR\_LOC}, \[23]. +\I\.{CHAR\_LOC0}, \[23]. +\I\\{checksum}, \[19], 23, 46, 48, 59. +\I\\{code}, \[27], 28, 30. +\I\\{coding}, \[19], 22, 59. +\I\\{col}, \[28], \[30], 32, 33, 34, \[37], \[40]. +\I\\{comment}, \[19], 22, 59. +\I\\{config}, \[2], 55, 65. +\I\\{config\_error}, 57, \[67], \[68]. +\I\\{config\_file}, \[2], 4, 55, 56. +\I\\{count}, \[42], 43, 44, \[48], \[65], 66. +\I\\{cp}, \[42], 43, 44, \[61]. +\I\\{cp\_command}, \[49], 51, 59. +\I\\{curr\_row}, \[27], 31, 37. +\I\\{design\_size}, \[15], 21, 28, 46, 48, 59. +\I\\{designsize}, \[21], 23. +\I\\{dir}, \[75]. +\I\\{dir\_setup}, \[74], \[75], 78. +\I\\{dot\_count}, \[15], 17, 18. +\I\\{dpi\_x}, \[19], 21, 28, 51, 59. +\I\\{dpi\_y}, \[19], 21, 28, 59. +\I\\{dummy}, \[61], \[63]. +\I\\{ed}, \[75]. +\I\.{EDF\_CWD}, 77. +\I\.{EDS\_BANG}, 78. +\I\\{empty\_char}, \[15], 18, 30. +\I\&{emtex\_dir}, 73, 74, 75, 77. +\I\\{emtex\_dir\_find}, 77. +\I\\{emtex\_dir\_setup}, 75. +\I\\{emtex\_version\_string}, \[70], 72. +\I\\{end\_of\_file}, \[2], 9, 17, 18, 27, 30. +\I\\{env}, \[75]. +\I\\{env\_name}, \[65], 66. +\I\\{env\_p}, \[65], 66. +\I\\{env\_value}, \[65], 66. +\I\.{EOC}, \[18]. +\I\.{EOF}, 27, 65. +\I\\{exit}, 4, 5, 6, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 78. +\I\.{EXTENSION\_LENGTH}, \[49], 59. +\I\|{f}, \[26]. +\I\.{FALSE}, \[2], 7, 18, 30, 49, 58, 59. +\I\\{fclose}, 12, 46, 48, 51, 55. +\I\\{fflush}, 18. +\I\\{fgetc}, 65. +\I\\{file\_find}, \[74], \[77], 80. +\I\\{file\_name}, 4. +\I\.{FILE\_NAME\_LENGTH}, \[2], 4, 12, 46, 48, 51, 76. +\I\\{file\_number}, \[2], 8, 9, 12, 28, 46. +\I\\{flags}, \[75]. +\I\\{font\_encoding}, \[15], 46, 57. +\I\\{fopen}, 12, 46, 48, 51, 55, 69. +\I\\{fprintf}, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 75, 78. +\I\\{fputc}, 14, 18, 22, 23, 24, 26, 43, 44. +\I\\{fputl}, 18, 23, 24, \[25], \[26]. +\I\\{fputs}, 14, 22. +\I\\{frac\_col\_left}, \[34]. +\I\\{frac\_col\_to\_fill}, \[34], 35. +\I\\{frac\_row\_left}, \[30], 32, 33. +\I\\{frac\_row\_to\_fill}, \[30], 32, 33. +\I\\{fsearch}, 57, 59, \[64], \[65]. +\I\\{ftell}, 18, 22, 23, 24. +\I\|{g}, \[33], \[34]. +\I\\{getenv}, 66, 75. +\I\.{GF\_ID}, \[13], 14, 24. +\I\.{GFTOPK\_NAME}, \[49], 51. +\I\\{grayrow}, \[27], 28, 30. +\I\\{grP}, \[30], 32, 33. +\I\.{HALFSCALE}, \[27], 28, 33, 34. +\I\.{HAVE\_CONFIG\_H}, 10. +\I\.{HAVE\_EMTEXDIR}, 69, 70, 72, 73, 74, 75, 78, 80. +\I\.{HAVE\_LIBKPATHSEA}, 69, 72, 78, 80. +\I\.{HAVE\_MIKTEX}, 69, 70, 72, 80. +\I\\{have\_min\_char}, \[58], 59, 61. +\I\&{HBF}, 2. +\I\\{hbf}, \[2], 4, 30, 57, 61, 63. +\I\&{HBF\_BBOX}, 55. +\I\&{HBF\_CHAR}, 27, 58, 60, 61. +\I\\{hbf\_header}, \[57]. +\I\\{hbf\_height}, 57. +\I\\{hbf\_path}, \[73], 78, 80. +\I\\{hbf\_width}, 57. +\I\\{hbf\_xDisplacement}, 59. +\I\\{hbf\_yDisplacement}, 59. +\I\\{hbfBitmapBBox}, 57. +\I\\{hbfClose}, 4. +\I\\{hbfDebug}, 57. +\I\\{hbfGetBitmap}, 30. +\I\\{hbfGetByte2Range}, 62, 63. +\I\\{hbfGetCodeRange}, 60, 61. +\I\\{hbfOpen}, 57. +\I\\{hbfProperty}, 57. +\I\\{header}, \[13], 14. +\I\|{i}, \[21], \[46], \[48], \[51], \[56], \[63]. +\I\\{input\_size\_x}, \[15], 28, 32, 33, 34, 36, 37, 57. +\I\\{input\_size\_y}, \[15], 28, 31, 32, 33, 37, 57. +\I\\{isalnum}, 66. +\I\\{isalpha}, 66. +\I\\{item}, \[37]. +\I\|{j}, \[9], \[51]. +\I\\{job\_extension}, \[49], 51, 59. +\I\\{kpathsea\_version\_string}, 72. +\I\\{kpse\_find\_file}, 80. +\I\\{kpse\_init\_prog}, 78. +\I\\{kpse\_miscfonts\_format}, 80. +\I\\{kpse\_program\_text\_format}, 80. +\I\\{kpse\_set\_program\_name}, 78. +\I\|{l}, \[4]. +\I\\{last\_char}, \[15], 17, 18, 23. +\I\\{lastext}, \[56]. +\I\\{list}, 75, \[77]. +\I\\{localtime}, 14. +\I\\{long\_extension}, \[2], 7, 12, 51, 59. +\I\\{mag\_x}, \[15], 28, 59. +\I\\{mag\_y}, \[15], 28, 59. +\I\\{magstep\_x}, \[15], 21, 28, 51. +\I\\{magstep\_y}, \[15], 21, 28. +\I\\{main}, \[4]. +\I\\{make\_pixel\_array}, 18, 27, \[29], \[30]. +\I\\{max\_char}, 28, 30, 48, \[60], 61. +\I\.{MAX\_CHAR\_SIZE}, 23, \[27], 28, 52, 81. +\I\\{max\_numb}, \[9]. +\I\\{max\_2\_byte}, 30, \[62], 63. +\I\\{message}, \[68]. +\I\\{mf\_like}, \[2], 4, 9, 12, 28, 46, 55, 59. +\I\\{miktex\_find\_input\_file}, 80. +\I\\{miktex\_find\_miscfont\_file}, 80. +\I\\{miktex\_get\_miktex\_version\_string\_ex}, 72. +\I\\{min\_char}, 9, 28, 48, 51, \[60], 61. +\I\\{min\_2\_byte}, 28, 30, \[62], 63. +\I$\msdos$, 2. +\I\\{name}, \[77], \[80]. +\I\\{name\_buffer}, \[76], 77. +\I\\{need\_col}, \[34], 35. +\I\\{need\_to\_read\_row}, \[30], 32, 33. +\I\\{new\_pixelrow}, \[27], 30. +\I\\{new\_prP}, \[30], 34, 35. +\I\.{NEW\_ROW\_}, \[41], 43. +\I\\{nmb\_files}, \[2], 3, 9, 49, 51, 59. +\I\\{nmb\_subfonts}, \[48]. +\I\\{nmb\_2\_bytes}, 28, 48, \[62], 63. +\I\\{no\_code}, \[30]. +\I\\{no\_version\_string}, \[70], 72. +\I\.{NOOP}, \[41]. +\I\\{num}, \[26]. +\I\\{nxP}, \[30], 33, 34, 35. +\I\\{offset}, \[28], \[37]. +\I\\{offset\_x}, 28, \[58], 59. +\I\\{offset\_y}, 28, \[58], 59. +\I\\{ofm\_file}, 4, \[49], 51, 59. +\I\\{ofm\_header}, \[48]. +\I\\{old\_ch}, \[65]. +\I\\{out}, \[2], 12, 14, 18, 22, 23, 24, 43, 44, 46, 48, \[51]. +\I\\{out\_char}, \[27], 30, 42, 43. +\I\\{out\_char\_p}, \[27], 30, 40. +\I\\{out\_s}, \[14]. +\I\\{output\_file}, \[12], \[46], \[48]. +\I\\{output\_name}, \[2], 12, 46, 48, 49, 51, 57. +\I\.{OVP2OVF\_NAME}, \[49], 51. +\I\|{P}, \[65]. +\I\|{p}, \[4], \[65]. +\I\\{paint}, \[42], 43, 44. +\I\.{PAINT\_}, \[41], 43, 44. +\I\.{PAINT1}, \[41], 43, 44. +\I\.{PAINT2}, \[41], 43, 44. +\I\.{PAINT3}, \[41]. +\I\\{path}, \[75]. +\I\.{PIXEL\_MAXVAL}, \[27], 33, 34, 35, 37. +\I\\{pixelrow}, \[27], 30, \[37], \[40]. +\I\\{pk\_directory}, \[49], 51, 59. +\I\\{pk\_dx}, 19, \[21], 23. +\I\\{pk\_files}, \[2], 7, 12, 18, 30, 51, 59. +\I\\{pk\_offset\_x}, \[15], 18, 21, 28. +\I\\{pk\_offset\_y}, \[15], 18, 21, 28. +\I\\{pk\_output\_size\_x}, \[15], 18, 21, 28, 40, 42, 43, 44, 52. +\I\\{pk\_output\_size\_y}, \[15], 18, 21, 28, 31, 32, 34, 42, 52. +\I\\{pk\_total\_max\_x}, \[19], 21, 23. +\I\\{pk\_total\_max\_y}, \[19], 21, 23. +\I\\{pk\_total\_min\_x}, \[19], 21, 23. +\I\\{pk\_total\_min\_y}, \[19], 21, 23. +\I\\{pk\_width}, \[15], 21, 28, 34. +\I\.{PLTOTF\_NAME}, \[49], 51. +\I\\{pos}, \[46], \[48]. +\I\.{POST}, \[23], 24. +\I\\{post\_adr}, \[21], 23, 24. +\I\.{POSTPOST}, \[24]. +\I\.{POSTPOST\_ID}, \[24]. +\I\\{ppp\_x}, \[19], 21, 23. +\I\\{ppp\_y}, \[19], 21, 23. +\I\.{PRE}, \[13], 14. +\I\.{PRINTER\_MIN\_RES\_X}, 8, \[53], 59. +\I\.{PRINTER\_MIN\_RES\_Y}, \[53], 59. +\I\\{printf}, 4, 5, 6, 12, 18, 46, 48, 51, 55. +\I\\{prP}, \[30], 31, 32, 33. +\I\|{Q}, \[65]. +\I\\{quiet}, \[2], 4, 7, 12, 18, 46, 48, 51, 55. +\I\.{READ\_BIN}, \[2]. +\I\\{read\_config}, 4, \[54], \[55]. +\I\\{read\_row}, 27, 30, 32, 33, \[36], \[37]. +\I\.{READ\_TXT}, \[2], 55. +\I\\{real\_config\_file}, \[55]. +\I\\{real\_hbf\_header}, \[57]. +\I\\{remainder}, \[48]. +\I\\{result}, \[80]. +\I\\{rewind}, 65. +\I\\{rm\_command}, \[49], 51, 59. +\I\\{rotation}, \[15], 28, 36, 37, 59. +\I\\{row}, \[30], 31, 34. +\I\\{rows\_read}, \[30], 32, 33. +\I\|{s}, \[14], \[46], \[48]. +\I\\{s\_mag\_x}, \[27], 28, 34. +\I\\{s\_mag\_y}, \[27], 28, 30, 32, 33. +\I\\{s\_slant}, \[27], 28, 34. +\I\\{sc}, \[46], \[48]. +\I\.{SCALE}, \[27], 28, 30, 33, 34, 35. +\I\\{search\_string}, \[65]. +\I\\{secs\_now}, \[14]. +\I\\{setup\_list}, \[74], 75. +\I\\{skip}, \[42], 43. +\I\.{SKIP0}, \[41], 43. +\I\.{SKIP1}, \[41], 43. +\I\.{SKIP2}, \[41], 43. +\I\.{SKIP3}, \[41]. +\I\\{slant}, \[15], 28, 46, 48, 52, 59. +\I\\{special\_adr}, \[21], 22, 23. +\I\\{sprintf}, 12, 46, 48. +\I\\{start}, \[42]. +\I\\{stderr}, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 75, 78. +\I\\{stdout}, 18. +\I\\{strcat}, 14, 51, 56. +\I\\{strcmp}, 7. +\I\\{strcpy}, 14, 51, 57, 59, 72. +\I\\{strdup}, 80. +\I\\{strftime}, 14. +\I\.{STRING\_LENGTH}, \[2], 19, 49, 53, 57, 65, 66. +\I\\{strlen}, 4, 8, 14, 22, 46, 48. +\I\\{strncpy}, 4, 59. +\I\\{strtol}, 8. +\I\\{strtoul}, 59. +\I\\{success}, \[65]. +\I\|{t}, \[46], \[48]. +\I\\{target\_size\_x}, \[15], 28. +\I\\{target\_size\_y}, \[15], 28. +\I\\{temp}, \[21], 24. +\I\\{temp\_buffer}, \[65], 66. +\I\\{temp\_pixelrow}, \[27], 30. +\I\\{temp\_prP}, \[30], 31, 33, 34. +\I\\{testing}, \[2], 4, 7, 55. +\I\\{TeX\_search\_cfg\_file}, 55, \[79], \[80]. +\I\\{TeX\_search\_hbf\_file}, 57, \[79], \[80]. +\I\\{TeX\_search\_version}, 5, \[71], \[72]. +\I\\{tfm\_directory}, \[49], 51, 59. +\I\\{tfm\_files}, \[2], 4, 7, 51, 59. +\I\\{tfm\_header}, \[46]. +\I\\{tfm\_offset\_x}, \[15], 21, 28, 46, 48. +\I\\{tfm\_offset\_y}, \[15], 28, 46, 48. +\I\\{tfm\_output\_size\_x}, \[15], 21, 28, 46, 48. +\I\\{tfm\_output\_size\_y}, \[15], 28, 46, 48. +\I\\{tfm\_width}, 19, \[21], 23. +\I\\{threshold}, \[38], 40, 59. +\I\\{time}, 14. +\I\\{time\_now}, \[14]. +\I\&{tm}, 14. +\I\.{TM\_IN\_SYS\_TIME}, 10. +\I\\{tmp}, \[28]. +\I\\{tolower}, 65. +\I\.{TRUE}, \[2], 4, 7, 9, 30, 59, 75, 80. +\I\\{unicode}, \[2], 8, 9, 12, 28, 46, 51, 59. +\I\.{USAGE}, \[6]. +\I\\{used}, 75. +\I\\{user\_min\_char}, \[58], 59, 61. +\I\\{val}, \[75]. +\I\.{VALID\_SUBCODE}, 48, \[62], 63. +\I\.{VERSION}, \[5]. +\I\.{WHITE}, \[27], 42, 44. +\I\.{WRITE\_BIN}, \[2], 12. +\I\\{write\_coding}, 18, \[41], \[42]. +\I\\{write\_data}, 11, 12, 15, \[16], \[17]. +\I\\{write\_file}, 4, 9, \[11], \[12]. +\I\\{write\_job}, 4, \[50], \[51]. +\I\\{write\_ovp}, 4, \[47], \[48]. +\I\\{write\_pl}, 4, \[45], \[46], 47. +\I\\{write\_post}, 11, 12, 19, \[20], \[21]. +\I\\{write\_pre}, 11, 12, \[13], \[14]. +\I\\{write\_row}, 30, 34, 35, 38, \[39], \[40]. +\I\.{WRITE\_TXT}, \[2], 46, 48, 51. +\I\|{x}, \[42]. +\I\\{x\_resolution}, \[2], 4, 8, 12, 28, 52. +\I\\{xP}, \[30], 32, 33, 34, 35, \[37], \[40]. +\I\.{XXX1}, \[22]. +\I\.{XXX2}, \[22]. +\I\.{XXX3}, \[22]. +\I\.{XXX4}, \[22]. +\I\|{y}, \[42]. +\I\\{y\_scale}, \[2], 4, 8, 28, 52. +\I\.{YYY}, \[22]. diff --git a/Build/source/texk/cjkutils/hbf2gf.scn b/Build/source/texk/cjkutils/hbf2gf.scn new file mode 100644 index 00000000000..0d39715d758 --- /dev/null +++ b/Build/source/texk/cjkutils/hbf2gf.scn @@ -0,0 +1,56 @@ +\I\X66:Check for environment variables\X +\U65. +\I\X8:Check other arguments\X +\U4. +\I\X61:Get code range\X +\U55. +\I\X63:Get sub code range\X +\U55. +\I\X2, 15, 19, 27, 38, 49, 53, 58, 60, 62, 70, 73, 76:Global variables\X +\U4. +\I\X56:Handle extension\X +\U55. +\I\X10, 69:Include files\X +\U4. +\I\X78:Initialize \TeX\ file searching\X +\U4. +\I\X28:Initialize variables\X +\U4. +\I\X57:Necessary parameters\X +\U55. +\I\X59:Optional parameters\X +\U55. +\I\X23:Post section\X +\U21. +\I\X24:Postpost section\X +\U21. +\I\X6:Print help information\X +\U7. +\I\X5:Print version\X +\U7. +\I\X44:Process rest of line\X +\U42. +\I\X33:Produce a temporary row\X +\U32. +\I\X11, 13, 16, 20, 25, 29, 36, 39, 41, 45, 47, 50, 54, 64, 67, 71, 74, +79:Prototypes\X +\U4. +\I\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[\,]} +and write it into \PB{\\{out\_char}[\,]}\X +\U31. +\I\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}\X +\U31. +\I\X31:Scale row by row\X +\U30. +\I\X7:Scan options\X +\U4. +\I\X43:Search blank lines\X +\U42. +\I\X22:Special section\X +\U21. +\I\X18:Write character\X +\U17. +\I\X9:Write files\X +\U4. +\I\X35:Write out a row\X +\U34. diff --git a/Build/source/texk/cjkutils/hbf2gf.tex b/Build/source/texk/cjkutils/hbf2gf.tex new file mode 100644 index 00000000000..95b6024f3b2 --- /dev/null +++ b/Build/source/texk/cjkutils/hbf2gf.tex @@ -0,0 +1,2928 @@ +\input cwebmac +% This is the cweb file hbf2gf.w of the CJK package ver. 4.8.2 29-Dec-2008 + +% Copyright (C) 1994-2008 Werner Lemberg +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +% To print this CWEB file you should (but not must) use the CWEAVE of the +% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say +% +% cweave +ai hbf2gf.w +% +% This (fully compatible) CWEAVE can transform CWEB-files with alternative +% output rules (look at the position of braces below!) the author (it's me +% too :-) prefer. Otherwise this file will be formatted traditionally. + +\font\meta=logo10 +\def\mf{{\meta META}\-{\meta FONT}} +\def\Om{\char "0A} % Omega symbol + +\def\title{hbf2gf (CJK Version 4.8.2)} + +\def\topofcontents{ + \null\vfill + \centerline{\titlefont The {\ttitlefont hbf2gf} program} + \vskip 20pt + \centerline{(CJK Version 4.8.2)} + \vfill} + +\def\botofcontents{ + \vfill + \noindent + Copyright \copyright~1996-1999 by Werner Lemberg + \bigskip\noindent + Permission is granted to make and distribute verbatim copies of this + document provided that the copyright notice and this permission notice are + preserved on all copies. + + \smallskip\noindent + Permission is granted to copy and distribute modified versions of this + document under the conditions for verbatim copying, provided that the + entire resulting derived work is distributed under the terms of a + permission notice identical to this one.} + +\pageno=\contentspagenumber \advance\pageno by 1 +\let\maybe=\iftrue +\fullpageheight=240mm +\pageheight=223mm +\pagewidth=158mm +\setpage +\frenchspacing + + +\def\msdos{\.{msdos}} + + + + + +\N{1}{1}Introduction. +This is the \.{hbf2gf} program by Werner Lemberg +(\.{wl@gnu.org}). + +The ``banner line'' defined here should be changed whenever \.{hbf2gf} is +modified. + +\Y\B\4\D$\\{banner}$ \5 +\.{"hbf2gf\ (CJK\ ver.\ 4.}\)\.{8.2)"}\par +\fi + +\M{2} +\.{hbf2gf} is intended to convert Hanzi Bitmap Fonts (HBF) into \TeX\ +generic font files (\.{GF} files) according to the \\{CJK} package, which +\.{hbf2gf} is part of. + +The outline of \.{hbf2gf} is simple: a CJK (Chinese/Japanese/Korean) bitmap +file will be scaled and written in at most \PB{\\{nmb\_files}} \.{GF} files, +each +file containing \PB{\T{256}}~characters (except the last and possibly the first +one). In the normal case it's not necessary to compute the right value of +\PB{\\{nmb\_files}} because \.{hbf2gf} will do this; you should use \PB{${-}% +\T{1}$} instead to +indicate this. See the last section for an example. + +Alternatively you can call \.{hbf2gf} similar to \mf, i.e., the program will +compute one font on demand. This mode will be used if two or three input +parameters instead of one are given: the font name, the horizontal +resolution, and optionally a vertical scaling factor or resolution to allow +modes for e.g.\ $300\times600\,\hbox{dpi}$ printers. \.{hbf2gf} will extract +the configuration file name from the font name; if this file isn't found, +the program exits with error code~\PB{\T{2}} (this is useful for scripts like +\.{mktexpk}). If the configuration file is found but an error occurs while +computing the font, error code~\PB{\T{1}} is returned. In case of success, the +exit +code is zero. + +The characters in the input font files are completely described by the HBF +header file. This program uses the HBF API implementation of Ross Paterson +(\.{ross@soi.city.ac.uk}; with small extensions). You will find a +description of the HBF standard at \.{ftp.ifcss.org}. + +A batch file created by \.{hbf2gf} too (if the program computes a whole set +of subfonts) will convert the \.{GF} files to \.{PK} files using +\.{GFtoPK}, a part of every \TeX\ package. + +\Y\B\4\D$\.{TRUE}$ \5 +\T{1}\par +\B\4\D$\.{FALSE}$ \5 +\T{0}\Y\par +\B\4\D$\.{STRING\_LENGTH}$ \5 +\T{255}\C{ the maximal length of an input string in the configuration file }\par +\B\4\D$\.{FILE\_NAME\_LENGTH}$ \5 +\T{1024}\C{ the maximal length (including the path) of a filename }\Y\par +\Y\B\4\X2:Global variables\X${}\E{}$\6 +\&{int} \\{nmb\_files}${}\K{-}\T{1}{}$;\C{ create all files by default }\6 +\&{int} \\{unicode}${}\K\.{FALSE}{}$;\C{ whether a Unicode font should be +processed }\7 +\&{int} \\{testing}${}\K\.{FALSE}{}$;\C{ whether we test only the font name }\7 +\&{int} \\{mf\_like}${}\K\.{FALSE}{}$;\C{ whether we are in the \mf-like mode }% +\6 +\&{int} \\{file\_number}${}\K\T{0}{}$;\C{ the subfont number }\7 +\&{double} \\{x\_resolution}${}\K\T{0.0}{}$;\C{ the second and third input +parameter }\6 +\&{double} \\{y\_scale}${}\K\T{1.0}{}$;\7 +\&{int} \\{pk\_files}${}\K\.{TRUE}{}$;\C{ command line options }\6 +\&{int} \\{tfm\_files}${}\K\.{TRUE};{}$\6 +\&{int} \\{long\_extension}${}\K\.{TRUE};{}$\6 +\&{int} \\{quiet}${}\K\.{FALSE}{}$;\7 +\&{char} ${}\\{config\_file}[\.{FILE\_NAME\_LENGTH}+\T{4}+\T{1}]{}$;\C{ we +probably must add `\.{.cfg}' }\6 +\&{char} ${}\\{output\_name}[\.{STRING\_LENGTH}+\T{1}]{}$;\7 +\&{FILE} ${}{*}\\{config},{}$ ${}{*}\\{out};{}$\6 +\&{HBF} ${}{*}\\{hbf}{}$;\7 +\8\#\&{ifdef} ${}\msdos{}$\C{ if we compile under DOS or OS/2 }\6 +\8\#\&{define} \.{WRITE\_BIN} \5\.{"wb"}\6 +\8\#\&{define} \.{WRITE\_TXT} \5\.{"wt"}\6 +\8\#\&{define} \.{READ\_BIN} \5\.{"rb"}\6 +\8\#\&{define} \.{READ\_TXT} \5\.{"rt"}\6 +\8\#\&{else}\6 +\8\#\&{define} \.{WRITE\_BIN} \5\.{"w"}\6 +\8\#\&{define} \.{WRITE\_TXT} \5\.{"w"}\6 +\8\#\&{define} \.{READ\_BIN} \5\.{"r"}\6 +\8\#\&{define} \.{READ\_TXT} \5\.{"r"}\6 +\8\#\&{endif}\7 +\&{int} \\{end\_of\_file}${}\K\.{FALSE}{}$;\par +\As15, 19, 27, 38, 49, 53, 58, 60, 62, 70, 73\ETs76. +\U4.\fi + +\M{3} +One \.{PL} file will be created additionally, which describes the font +metrics in a readable way. Because all CJK characters have identical +bounding boxes, one metrics file is enough---the batch job created by +\.{hbf2gf} calls \.{PLtoTF} to produce this \.{TFM} file and then copies +it into \PB{\\{nmb\_files}} metrics files. There usually will be a discrepancy +between the number of characters in the last \.{GF} file and the +\.{TFM} file, but this does not harm. + +If you specify the \.{ofm\_file} option in the configuration file, an +extended virtual property file (such files have the extension \.{.ovp}) for +the \Om\ system is written; this will be then converted with +\.{ovp2ovf} into an \.{OFM} and an \.{OVF} file to map all the subfonts +into one large virtual font. + + + +\fi + +\N{1}{4}The main routine. +The main routine takes \PB{\\{file\_name}}, \PB{\\{x\_resolution}}, and \PB{% +\\{y\_scale}} as command +line parameters if in \mf-like mode, otherwise \PB{\\{config\_file}} as the +only +argument. \PB{\\{read\_config}(\,)} scans the configuration file and fills the +global +variables, \PB{\\{write\_file}(\,)} writes the \.{GF} files, \PB{\\{write\_pl}(% +\,)} and +\PB{\\{write\_ovp}(\,)} write the \.{PL} and \.{OVP} files respectively, and +\PB{\\{write\_job}(\,)} the batch file. + +\Y\B\X10:Include files\X\6 +\X11:Prototypes\X\6 +\X2:Global variables\X\7 +\&{int} \\{main}(\&{int} \\{argc}${},\39{}$\&{char} ${}{*}\\{argv}[\,]){}$\1\1% +\2\2\6 +${}\{{}$\1\6 +\&{char} ${}{*}\|p;{}$\7 +\X78:Initialize \TeX\ file searching\X\7 +\X7:Scan options\X\7 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"\\n\%s\\n\\n"},\39\\{banner}){}$;\2\7 +${}\\{strncpy}(\\{config\_file},\39\\{argv}[\T{1}],\39\.{FILE\_NAME% +\_LENGTH});{}$\6 +${}\\{config\_file}[\.{FILE\_NAME\_LENGTH}]\K\.{'\\0'}{}$;\7 +\&{if} ${}(\\{argc}>\T{2}\V\\{testing}){}$\5 +${}\{{}$\1\6 +\&{int} \|l${}\K\\{strlen}(\\{config\_file});{}$\7 +\&{if} ${}(\|l>\T{2}){}$\1\5 +${}\\{config\_file}[\|l-\T{2}]\K\.{'\\0'}{}$;\C{ strip subfont number from file +name }\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"`\%s'\ can't\ be\ a\ sub}\)\.{font\ created\ by\ hbf2}\)\.{gf% +\\n"},\39\\{config\_file});{}$\2\6 +\\{exit}(\T{2});\6 +\4${}\}{}$\2\7 +${}\\{mf\_like}\K\.{TRUE};{}$\6 +\4${}\}{}$\2\7 +\\{read\_config}(\,);\C{ will call \PB{\\{exit}(\T{1})} on errors }\7 +\&{if} (\\{mf\_like})\1\5 +\X8:Check other arguments\X\2\7 +\X28:Initialize variables\X\7 +\X9:Write files\X\7 +\&{if} (\\{tfm\_files})\1\5 +\\{write\_pl}(\,);\2\6 +\&{if} (\\{ofm\_file})\1\5 +\\{write\_ovp}(\,);\2\6 +\&{if} ${}(\R\\{mf\_like}){}$\1\5 +\\{write\_job}(\,);\2\7 +\\{hbfClose}(\\{hbf});\7 +\\{exit}(\T{0});\6 +\&{return} \T{0};\C{ never reached }\6 +\4${}\}{}$\2\par +\fi + +\M{5} +\Y\B\4\D$\.{VERSION}$ \6 +\.{"\\n"}\6 +\.{"Copyright\ (C)\ 1996-}\)\.{1999\ Werner\ Lemberg.}\)\.{\\n"}\6 +\.{"There\ is\ NO\ warrant}\)\.{y.\ \ You\ may\ redistri}\)\.{bute\ this\ +software\\n}\)\.{"}\6 +\.{"under\ the\ terms\ of\ }\)\.{the\ GNU\ General\ Publ}\)\.{ic\ License\\n"}\6 +\.{"and\ the\ HBF\ library}\)\.{\ copyright.\\n"}\6 +\.{"\\n"}\6 +\.{"For\ more\ informatio}\)\.{n\ about\ these\ matter}\)\.{s,\ see\ the\ files% +\\n"}\6 +\.{"named\ COPYING\ and\ h}\)\.{bf.c.\\n"}\6 +\.{"\\n"}\par +\Y\B\4\X5:Print version\X${}\E{}$\6 +${}\{{}$\1\6 +\\{printf}(\.{"\\n"});\6 +\\{printf}(\\{banner});\6 +${}\\{printf}(\.{"\ (\%s)\\n"},\39\\{TeX\_search\_version}(\,));{}$\6 +\\{printf}(\.{VERSION});\6 +\\{exit}(\T{0});\6 +\4${}\}{}$\2\par +\U7.\fi + +\M{6} +\Y\B\4\D$\.{USAGE}$ \6 +\.{"\\n"}\6 +\.{"Usage:\ hbf2gf\ [-q]\ }\)\.{configuration\_file[.}\)\.{cfg]\\n"}\6 +\.{"\ \ \ \ \ \ \ hbf2gf\ [opti}\)\.{ons]\ font\_name\ x\_res}\)\.{olution\ [y% +\_scale\ |\ y}\)\.{\_resolution]\\n"}\6 +\.{"\ \ \ \ \ \ \ hbf2gf\ -t\ [-}\)\.{q]\ font\_name\\n"}\6 +\.{"\\n"}\6 +\.{"\ \ Convert\ a\ font\ in}\)\.{\ HBF\ format\ to\ TeX's}\)\.{\ GF\ resp.\ PK% +\ format.}\)\.{\\n"}\6 +\.{"\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ -q\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ be\ silent\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ -p\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ don't\ produce\ a}\)\.{% +\ PL\ file\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ -g\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ don't\ produce\ a}\)\.{% +\ GF\ file\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ -n\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ use\ no\ resoluti}\)% +\.{on\ in\ extension\ (onl}\)\.{y\ `.gf')\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ -t\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ test\ for\ font\_n}\)% +\.{ame\ (returns\ 0\ on\ su}\)\.{ccess)\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ --help\ \ \ \ }\)\.{\ \ \ \ \ print\ this\ mess}\)\.{age\ +and\ exit\\n"}\6 +\.{"\ \ \ \ \ \ \ \ \ --version\ }\)\.{\ \ \ \ \ print\ version\ n}\)\.{umber\ +and\ exit\\n"}\6 +\.{"\\n"}\par +\Y\B\4\X6:Print help information\X${}\E{}$\6 +${}\{{}$\1\6 +\\{printf}(\.{USAGE});\6 +\\{exit}(\T{0});\6 +\4${}\}{}$\2\par +\U7.\fi + +\M{7} +Three options can be specified to the program (\.{-p}, \.{-g}, and \.{-n}) +if in \mf-like mode to suppress creation of a \.{PL} resp.\ a +\.{GF} file, and to force a `\.{.gf}' extension (instead of +e.g.\ `\.{.300gf}'). The corresponding setting of a particular switch in the +configuration file is ignored then. + +Additionally, the option \.{-t} tests whether the specified subfont name +leads to an \.{hbf2gf} configuration file. It returns 0 on success and prints +out the name of that configuration file (provided the \.{-q} switch isn't +set). This test isn't a thorough one; it only removes the last two characters +and checks whether a configuration file with that name exists. + +\Y\B\4\X7:Scan options\X${}\E{}$\6 +\&{if} ${}(\\{argc}\E\T{2}){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{strcmp}(\\{argv}[\T{1}],\39\.{"--help"})\E\T{0}){}$\1\5 +\X6:Print help information\X\2\6 +\&{else} \&{if} ${}(\\{strcmp}(\\{argv}[\T{1}],\39\.{"--version"})\E\T{0}){}$\1% +\5 +\X5:Print version\X\2\6 +\4${}\}{}$\2\7 +\&{while} ${}(\\{argc}>\T{1}){}$\5 +${}\{{}$\1\6 +${}\|p\K\\{argv}[\T{1}];{}$\6 +\&{if} ${}(\|p[\T{0}]\I\.{'-'}){}$\1\5 +\&{break};\2\6 +\&{if} ${}(\|p[\T{1}]\E\.{'p'}){}$\1\5 +${}\\{tfm\_files}\K\.{FALSE};{}$\2\6 +\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'g'}){}$\1\5 +${}\\{pk\_files}\K\.{FALSE};{}$\2\6 +\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'n'}){}$\1\5 +${}\\{long\_extension}\K\.{FALSE};{}$\2\6 +\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'q'}){}$\1\5 +${}\\{quiet}\K\.{TRUE};{}$\2\6 +\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'t'}){}$\1\5 +${}\\{testing}\K\.{TRUE}{}$;\2\7 +${}\\{argv}\PP;{}$\6 +${}\\{argc}\MM;{}$\6 +\4${}\}{}$\2\7 +\&{if} (\\{testing})\5 +${}\{{}$\1\6 +\&{if} ${}(\\{argc}\I\T{2}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Need\ exactly\ one\ pa}\)\.{rameter\ for\ `-t'% +\ opt}\)\.{ion.\\n"});{}$\6 +${}\\{fprintf}(\\{stderr},\39\.{"Try\ `hbf2gf\ --help'}\)\.{\ for\ more\ +informatio}\)\.{n.\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else} \&{if} ${}(\\{argc}<\T{2}\V\\{argc}>\T{4}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ number\ of\ p}\)\.{arameters.% +\\n"});{}$\6 +${}\\{fprintf}(\\{stderr},\39\.{"Try\ `hbf2gf\ --help'}\)\.{\ for\ more\ +informatio}\)\.{n.\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\Y\par +\U4.\fi + +\M{8} +If the (optional) argument is larger than~\PB{\T{10}}, we treat it as a value +for +the vertical resolution (in dpi), otherwise as a vertical scaling factor. + +\Y\B\4\X8:Check other arguments\X${}\E{}$\6 +${}\{{}$\1\6 +\&{if} (\\{unicode})\1\5 +${}\\{file\_number}\K{}$(\&{int}) \\{strtol}${}({\AND}\\{argv}[\T{1}][% +\\{strlen}(\\{argv}[\T{1}])-\T{2}],\39{}$(\&{char} ${}{*}{*}){}$ ${}\NULL,\39% +\T{16});{}$\2\6 +\&{else}\1\5 +${}\\{file\_number}\K\\{atoi}({\AND}\\{argv}[\T{1}][\\{strlen}(\\{argv}[% +\T{1}])-\T{2}]){}$;\2\7 +${}\\{x\_resolution}\K\\{atof}(\\{argv}[\T{2}]);{}$\6 +\&{if} ${}(\\{x\_resolution}<\.{PRINTER\_MIN\_RES\_X}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{resolution% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{if} ${}(\\{argc}>\T{3}){}$\5 +${}\{{}$\1\6 +${}\\{y\_scale}\K\\{atof}(\\{argv}[\T{3}]);{}$\6 +\&{if} ${}(\\{y\_scale}<\T{0.01}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ sc}\)\.{aling\ factor\ or\ +reso}\)\.{lution\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{y\_scale}>\T{10.0}){}$\1\5 +${}\\{y\_scale}\K{}$(\&{double}) \\{x\_resolution}${}/\\{y\_scale};{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\U4.\fi + +\M{9} +If \PB{\\{unicode}} is \PB{\.{TRUE}}, the start value of the running number +appended to +the base name of the output font files is taken from the HBF header file, +otherwise it starts with~`\.{01}'. \PB{\\{min\_char}} represents the lower +bound of +the code range. + +If we are in \mf-like mode, \PB{\\{file\_number}} is taken from the command +line, +and \PB{\\{max\_numb}} will be set to~\PB{\T{1}}. + +\Y\B\4\X9:Write files\X${}\E{}$\6 +${}\{{}$\1\6 +\&{int} \|j${},{}$ \\{max\_numb};\7 +\&{if} ${}(\R\\{mf\_like}){}$\5 +${}\{{}$\1\6 +${}\\{file\_number}\K(\\{unicode}\E\.{TRUE}\?(\\{min\_char}\GG\T{8}):\T{1});{}$% +\6 +\&{if} ${}(\\{nmb\_files}\E{-}\T{1}){}$\1\5 +${}\\{max\_numb}\K(\\{unicode}\E\.{TRUE}\?\T{\^100}:\T{100});{}$\2\6 +\&{else}\1\5 +${}\\{max\_numb}\K\\{nmb\_files};{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +${}\\{max\_numb}\K\T{1}{}$;\2\7 +\&{for} ${}(\|j\K\T{0};{}$ ${}(\|j<\\{max\_numb})\W\R\\{end\_of\_file};{}$ ${}% +\\{file\_number}\PP,\39\|j\PP){}$\1\5 +\\{write\_file}(\,);\2\7 +${}\\{nmb\_files}\K\|j{}$;\C{ the real number of output font files }\6 +\4${}\}{}$\2\par +\U4.\fi + +\M{10} +\Y\B\4\X10:Include files\X${}\E{}$\6 +\8\#\&{ifdef} \.{HAVE\_CONFIG\_H}\6 +\8\#\&{include} \.{}\6 +\8\#\&{endif}\6 +\8\#\&{include} \.{}\6 +\8\#\&{include} \.{}\6 +\8\#\&{include} \.{}\6 +\8\#\&{include} \.{}\6 +\8\#\&{include} \.{}\6 +\8\#\&{ifdef} \.{TM\_IN\_SYS\_TIME}\6 +\8\#\&{include} \.{}\6 +\8\#\&{endif}\6 +\8\#\&{include} \.{"hbf.h"}\par +\A69. +\U4.\fi + +\N{1}{11}The functions. +The first function to be described is \PB{\\{write\_file}(\,)}. Each \.{GF} +file +consists of three sections: a preamble, a data section, and a postamble. The +functions \PB{\\{write\_pre}(\,)}, \PB{\\{write\_data}(\,)}, and \PB{\\{write% +\_post}(\,)} handle this. + +\Y\B\4\X11:Prototypes\X${}\E{}$\6 +\&{void} \\{write\_file}(\&{void});\par +\As13, 16, 20, 25, 29, 36, 39, 41, 45, 47, 50, 54, 64, 67, 71, 74\ETs79. +\U4.\fi + +\M{12} +In \mf-like mode we create font file name extensions similar to \mf\ if +the \.{-n} option isn't specified; otherwise only `\.{.gf}' will be appended. + +\Y\B\&{void} \\{write\_file}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\7 +\&{if} (\\{pk\_files})\5 +${}\{{}$\1\6 +\&{if} (\\{mf\_like})\5 +${}\{{}$\1\6 +\&{if} (\\{unicode})\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.\%.0igf"},{}$\6 +\\{output\_name}${},\39\\{file\_number},\39\\{long\_extension}\?(\&{int})(\\{x% +\_resolution}+\T{0.5}):\T{0});{}$\2\6 +\&{else}\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.\%.0igf"},{}$\6 +\\{output\_name}${},\39\\{file\_number},\39\\{long\_extension}\?(\&{int})(\\{x% +\_resolution}+\T{0.5}):\T{0});{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} (\\{unicode})\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.gf"},\39\\{output\_name},\39% +\\{file\_number});{}$\2\6 +\&{else}\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.gf"},\39\\{output\_name},\39% +\\{file\_number});{}$\2\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_BIN}))){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% +\_file});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"Writing\ `\%s'\ "},\39\\{output\_file}){}$;\2\7 +\\{write\_pre}(\,);\6 +\\{write\_data}(\,);\6 +\\{write\_post}(\,);\6 +\\{fclose}(\\{out});\7 +\&{if} ${}(\R\\{quiet}){}$\1\5 +\\{printf}(\.{"\\n"});\2\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +\\{write\_data}(\,);\2\6 +\4${}\}{}$\2\par +\fi + +\M{13} +The preamble has two bytes at the very beginning, \PB{\.{PRE}} and \PB{\.{GF% +\_ID}}. \PB{\.{PRE}} +starts the preamble, and \PB{\.{GF\_ID}} is the Generic Font Identity Byte. The +next +bytes are a string in Pascal format containing a header, the date, and the +time. Strings in Pascal format start with the length of the string and have +no terminating NULL byte. + +\Y\B\4\D$\.{GF\_ID}$ \5 +\T{131}\par +\B\4\D$\.{PRE}$ \5 +\T{247}\Y\par +\B\4\D$\\{header}$ \5 +\.{"\ hbf2gf\ output\ "}\par +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_pre}(\&{void});\par +\fi + +\M{14} +\Y\B\&{void} \\{write\_pre}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{char} \\{out\_s}[\T{40}]${},{}$ \|s[\T{20}];\6 +\&{time\_t} \\{secs\_now};\6 +\&{struct} \&{tm} ${}{*}\\{time\_now};{}$\7 +${}\\{strcpy}(\\{out\_s},\39\\{header}){}$;\7 +${}\\{secs\_now}\K\\{time}(\NULL){}$;\C{ system date and time }\6 +${}\\{time\_now}\K\\{localtime}({\AND}\\{secs\_now});{}$\6 +${}\\{strftime}(\|s,\39\T{20},\39\.{"\%Y.\%m.\%d:\%H.\%M"},\39\\{time% +\_now});{}$\6 +${}\\{strcat}(\\{out\_s},\39\|s){}$;\7 +${}\\{fputc}(\.{PRE},\39\\{out});{}$\6 +${}\\{fputc}(\.{GF\_ID},\39\\{out});{}$\6 +${}\\{fputc}(\\{strlen}(\\{out\_s}),\39\\{out});{}$\6 +${}\\{fputs}(\\{out\_s},\39\\{out});{}$\6 +\4${}\}{}$\2\par +\fi + +\M{15} +\PB{\\{write\_data}(\,)} produces the middle part of the \.{GF} file. It first +sets +\PB{\\{char\_adr\_p}} equal to the address of \PB{\\{char\_adr}[\,]} which will +contain file +offsets of the compressed characters. + +\PB{\\{input\_size\_x}} and \PB{\\{input\_size\_y}} reflect the original +dimensions of the +bitmap font, \PB{\\{pk\_output\_size\_x}} and \PB{\\{pk\_output\_size\_y}} +contain the width and +height of the output character box (in pixels), \PB{\\{pk\_offset\_x}} and +\PB{\\{pk\_offset\_y}} define the baseline of the font. The same names starting +with +`\\{tfm\_}' instead of `\\{pk\_}' are used for \.{TFM} files (values are +multiples of design size). \PB{\\{mag\_x}} and \PB{\\{mag\_y}} hold the scaling +factors +which are needed to reach \PB{\\{design\_size}}. \PB{\\{slant}} defines the +slant ($\Delta +x / \Delta y$), \PB{\\{target\_size\_x}} and \PB{\\{target\_size\_y}} will be +the final +dimensions; \PB{$\\{magstep\_x}\K\\{target\_size\_x}/\\{design\_size}$} is % +\TeX's +\.{\\magstep}. + +The \CEE/ standard specifies that all global values will be automatically +set to~\PB{\T{0}} if no initialization value is given. + +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{long} \\{char\_adr}[\T{256}];\6 +\&{long} ${}{*}\\{char\_adr\_p}{}$;\7 +\&{int} \\{pk\_offset\_x};\C{ horizontal offset (increase character width a +bit; will be applied on both the left and the right side) }\6 +\&{double} \\{tfm\_offset\_x};\6 +\&{int} \\{pk\_offset\_y};\C{ vertical offset (must be configured to desired +font size) }\6 +\&{double} \\{tfm\_offset\_y};\7 +\&{int} \\{input\_size\_x};\6 +\&{int} \\{input\_size\_y};\6 +\&{const} \&{char} ${}{*}\\{font\_encoding}{}$;\C{ taken from the HBF file }\6 +\&{int} \\{pk\_width};\C{ without slant }\6 +\&{int} \\{pk\_output\_size\_x};\C{ the output character box dimensions without +offsets }\6 +\&{double} \\{tfm\_output\_size\_x};\6 +\&{int} \\{pk\_output\_size\_y};\6 +\&{double} \\{tfm\_output\_size\_y};\7 +\&{double} \\{design\_size}${}\K\T{10.0}{}$;\C{ in points }\6 +\&{double} \\{target\_size\_x};\C{ in points }\6 +\&{double} \\{target\_size\_y};\6 +\&{double} \\{magstep\_x};\6 +\&{double} \\{magstep\_y};\6 +\&{double} \\{slant};\6 +\&{int} \\{rotation};\7 +\&{double} \\{mag\_x};\C{ horizontal and vertical magnification values }\6 +\&{double} \\{mag\_y};\7 +\&{int} \\{empty\_char};\C{ a flag whether the character does not exist or is +empty }\6 +\&{int} \\{last\_char};\C{ the last valid character in a \.{GF} file }\7 +\&{int} \\{dot\_count};\C{ this counts the processed characters; + every ten characters a dot is output to the screen }\par +\fi + +\M{16} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_data}(\&{void});\par +\fi + +\M{17} +\Y\B\&{void} \\{write\_data}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +${}\\{dot\_count}\K\T{0};{}$\6 +${}\\{char\_adr\_p}\K\\{char\_adr}{}$;\7 +\&{for} ${}(\\{last\_char}\K\T{0};{}$ ${}(\\{last\_char}<\T{256})\W\R\\{end\_of% +\_file};{}$ ${}\\{last\_char}\PP){}$\1\5 +\X18:Write character\X\2\6 +\4${}\}{}$\2\par +\fi + +\M{18} +The code in this section saves the current file position first and calls +\PB{\\{make\_pixel\_array}(\,)}, which expands and scales the character bitmap. + +\PB{\.{BOC}} (and \PB{\.{BOC1}}), the Begin Of Character command byte, must be +followed by +the character code and the dimensions of the character as explained in +``\mf---the program'' (corrected by vertical and horizontal offsets). + +\PB{\\{write\_coding}(\,)} compresses and outputs the bitmap; \PB{\.{EOC}} (End +Of Character) +finishes the current character. + +\Y\B\4\D$\.{BOC}$ \5 +\T{67}\par +\B\4\D$\.{BOC1}$ \5 +\T{68}\C{ simplified version of \PB{\.{BOC}} }\par +\B\4\D$\.{EOC}$ \5 +\T{69}\par +\Y\B\4\X18:Write character\X${}\E{}$\6 +${}\{{}$\1\6 +\&{if} ${}(\\{dot\_count}\PP\MOD\T{10}\E\T{0}{}$)\C{ a progress report for +impatient users }\1\6 +\&{if} ${}(\\{pk\_files}\W\R\\{quiet}){}$\5 +${}\{{}$\1\6 +\\{printf}(\.{"."});\6 +\\{fflush}(\\{stdout});\6 +\4${}\}{}$\2\2\7 +${}\\{empty\_char}\K\.{FALSE};{}$\6 +\\{make\_pixel\_array}(\,);\6 +\&{if} (\\{end\_of\_file})\1\5 +\&{return};\2\7 +\&{if} (\\{pk\_files})\5 +${}\{{}$\1\6 +${}{*}\\{char\_adr\_p}\K\\{ftell}(\\{out});{}$\6 +${}\\{char\_adr\_p}\PP{}$;\7 +\&{if} (\\{empty\_char})\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{BOC1},\39\\{out});{}$\6 +\\{fputc}((\&{unsigned} \&{char}) \\{last\_char}${},\39\\{out});{}$\6 +${}\\{fputc}(\T{0},\39\\{out});{}$\6 +${}\\{fputc}(\T{0},\39\\{out});{}$\6 +${}\\{fputc}(\T{0},\39\\{out});{}$\6 +${}\\{fputc}(\T{0},\39\\{out});{}$\6 +${}\\{fputc}(\.{EOC},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{BOC},\39\\{out});{}$\6 +${}\\{fputl}(\\{last\_char},\39\\{out});{}$\6 +${}\\{fputl}({-}\T{1\$L},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_offset\_x},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_output\_size\_x}+\\{pk\_offset\_x},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_offset\_y},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_output\_size\_y}+\\{pk\_offset\_y},\39\\{out}){}$;\7 +\\{write\_coding}(\,);\7 +${}\\{fputc}(\.{EOC},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\U17.\fi + +\M{19} +The current \.{GF} file will be completed with data written by +\PB{\\{write\_post}(\,)}. The end consists of three sections: ``special'', +``post'', +and ``postpost''. The first contains material not used by \TeX\ itself but +which can be used by other programs like \.{GFtoDVI} or for documentary +purposes (\PB{\\{coding}[\,]} and \PB{\\{comment}[\,]}). The second describes +the font as a +whole, and the last marks the end of the file. + +\PB{\\{pk\_total\_min\_x}} up to \PB{\\{pk\_total\_max\_y}} define the greatest +bounding box of +this file (including offsets); the horizontal character escapement after +drawing the character is \PB{\\{pk\_dx}}. \PB{\\{tfm\_width}} is the width in +multiples of +the design size ignoring the target size. + +\Y\B\4\D$\.{\_2\_16}$ \5 +\T{65536.0}\C{ $2^{16}$ }\par +\B\4\D$\.{\_2\_20}$ \5 +\T{1048576.0}\C{ $2^{20}$ }\par +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{char} ${}\\{coding}[\.{STRING\_LENGTH}+\T{1}]{}$;\C{ a comment describing +the font encoding }\6 +\&{char} ${}\\{comment}[\.{STRING\_LENGTH}+\T{1}]{}$;\C{ a comment describing +the font }\7 +\&{unsigned} \&{long} \\{checksum};\7 +\&{long} \\{pk\_total\_min\_x};\6 +\&{long} \\{pk\_total\_max\_x};\6 +\&{long} \\{pk\_total\_min\_y};\6 +\&{long} \\{pk\_total\_max\_y};\7 +\&{int} \\{dpi\_x};\C{ printer resolution }\6 +\&{int} \\{dpi\_y};\6 +\&{double} \\{ppp\_x};\C{ pixels per point }\6 +\&{double} \\{ppp\_y};\par +\fi + +\M{20} +To clarify the meaning of these values see the sections about the metrics +and configuration file also. + +\TeX\ defines that 72.27~points are exactly 1~inch. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_post}(\&{void});\par +\fi + +\M{21} +\Y\B\&{void} \\{write\_post}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{long} \\{special\_adr};\6 +\&{long} \\{post\_adr};\7 +\&{long} \\{designsize}${}\K\\{design\_size}*\.{\_2\_20}{}$;\C{ design size $* +2^{20}$ }\7 +\&{int} \\{pk\_dx};\6 +\&{long} \\{tfm\_width};\7 +\&{int} \|i;\6 +\&{long} \\{temp};\7 +${}\\{ppp\_x}\K\\{dpi\_x}/\T{72.27}*\\{magstep\_x};{}$\6 +${}\\{ppp\_y}\K\\{dpi\_y}/\T{72.27}*\\{magstep\_y}{}$;\7 +${}\\{pk\_total\_min\_x}\K\\{pk\_offset\_x};{}$\6 +${}\\{pk\_total\_max\_x}\K\\{pk\_output\_size\_x}+\T{2}*\\{pk\_offset\_x};{}$\6 +${}\\{pk\_total\_min\_y}\K\\{pk\_offset\_y};{}$\6 +${}\\{pk\_total\_max\_y}\K\\{pk\_output\_size\_y}+\\{pk\_offset\_y}{}$;\7 +${}\\{pk\_dx}\K\\{pk\_width}+\T{2}*\\{pk\_offset\_x}{}$;\C{ no slant }\6 +${}\\{tfm\_width}\K(\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x})*\.{\_2% +\_20}{}$;\C{ width in multiples of design size $* 2^{20}$ }\7 +\X22:Special section\X\6 +\X23:Post section\X\6 +\X24:Postpost section\X\6 +\4${}\}{}$\2\par +\fi + +\M{22} +\.{XXXn} will be followed by n~bytes representing the length of a string +which follows immediately. \PB{\.{YYY}} is a 32~bit integer which is normally +connected with the preceding string (but not used here). \PB{\\{special\_adr}} +contains the address of the ``special section''. All items here are +optional. + +\Y\B\4\D$\.{XXX1}$ \5 +\T{239}\C{ these are all special command bytes }\par +\B\4\D$\.{XXX2}$ \5 +\T{240}\C{ not used }\par +\B\4\D$\.{XXX3}$ \5 +\T{241}\C{ not used }\par +\B\4\D$\.{XXX4}$ \5 +\T{242}\C{ not used }\Y\par +\B\4\D$\.{YYY}$ \5 +\T{243}\C{ not used }\par +\Y\B\4\X22:Special section\X${}\E{}$\6 +$\\{special\_adr}\K\\{ftell}(\\{out}){}$;\7 +\&{if} ${}({*}\\{coding}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{XXX1},\39\\{out}){}$;\C{ \PB{\.{XXX1}} implies a string length % +\PB{$<$ \T{256}} }\6 +${}\\{fputc}(\\{strlen}(\\{coding}),\39\\{out});{}$\6 +${}\\{fputs}(\\{coding},\39\\{out});{}$\6 +\4${}\}{}$\2\7 +\&{if} ${}({*}\\{comment}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{XXX1},\39\\{out});{}$\6 +${}\\{fputc}(\\{strlen}(\\{comment}),\39\\{out});{}$\6 +${}\\{fputs}(\\{comment},\39\\{out});{}$\6 +\4${}\}{}$\2\par +\U21.\fi + +\M{23} +All character offsets collected in \PB{\\{char\_adr}} will be written to the +output +file. \PB{\\{fputl}(\,)} writes a 32~bit integer into a file. + +\PB{\.{CHAR\_LOC0}} (and \PB{\.{CHAR\_LOC}}) is the first byte of a character +locator +(i.e., offset, character code, and width information). \PB{\.{POST}} starts the +postamble, and \PB{\\{post\_adr}} points to the beginning byte of the +postamble. + +\Y\B\4\D$\.{POST}$ \5 +\T{248}\Y\par +\B\4\D$\.{CHAR\_LOC}$ \5 +\T{245}\par +\B\4\D$\.{CHAR\_LOC0}$ \5 +\T{246}\C{ simplified version of \PB{\.{CHAR\_LOC}} }\par +\Y\B\4\X23:Post section\X${}\E{}$\6 +$\\{post\_adr}\K\\{ftell}(\\{out});{}$\6 +${}\\{fputc}(\.{POST},\39\\{out});{}$\6 +${}\\{fputl}(\\{special\_adr},\39\\{out}){}$;\7 +${}\\{fputl}(\\{designsize},\39\\{out});{}$\6 +${}\\{fputl}(\\{checksum},\39\\{out});{}$\6 +${}\\{fputl}(\\{ppp\_x}*\.{\_2\_16},\39\\{out});{}$\6 +${}\\{fputl}(\\{ppp\_y}*\.{\_2\_16},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_total\_min\_x},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_total\_max\_x},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_total\_min\_y},\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_total\_max\_y},\39\\{out}){}$;\7 +${}\\{char\_adr\_p}\K\\{char\_adr}{}$;\7 +\&{if} ${}(\\{pk\_dx}<\T{256}){}$\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{last\_char};{}$ ${}\|i\PP{}$)\C{ the +character locators }\6 +${}\{{}$\1\6 +${}\\{fputc}(\.{CHAR\_LOC0},\39\\{out});{}$\6 +${}\\{fputc}(\|i,\39\\{out});{}$\6 +${}\\{fputc}(\\{pk\_dx},\39\\{out});{}$\6 +${}\\{fputl}(\\{tfm\_width},\39\\{out});{}$\6 +${}\\{fputl}({*}\\{char\_adr\_p}\PP,\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\C{ will only happen if \PB{$\.{MAX\_CHAR\_SIZE}\G\T{256}$} }\6 +${}\{{}$\1\6 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{last\_char};{}$ ${}\|i\PP){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{CHAR\_LOC},\39\\{out});{}$\6 +${}\\{fputc}(\|i,\39\\{out});{}$\6 +${}\\{fputl}(\\{pk\_dx}*\.{\_2\_16},\39\\{out});{}$\6 +${}\\{fputl}(\T{0},\39\\{out});{}$\6 +${}\\{fputl}(\\{tfm\_width},\39\\{out});{}$\6 +${}\\{fputl}({*}\\{char\_adr\_p}\PP,\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\U21.\fi + +\M{24} +\PB{\.{POSTPOST}} starts the section after the postamble. To get all +information in +a \.{GF} file, you must start here. The very last bytes of the file have +the value \PB{\.{POSTPOST\_ID}} (the file is filled with at least 4 of these +bytes +until a file length of a multiple of~4 is reached). Going backwards a +\PB{\.{GF\_ID}} will be next, then comes the address of the postamble section. + +Jumping to the postamble, a \PB{\.{POST}} byte comes first, then the address of +the special section, and afterwards all character offsets. These offsets and +addresses describe the whole file. + +\Y\B\4\D$\.{POSTPOST}$ \5 +\T{249}\par +\B\4\D$\.{POSTPOST\_ID}$ \5 +\T{223}\par +\Y\B\4\X24:Postpost section\X${}\E{}$\6 +$\\{fputc}(\.{POSTPOST},\39\\{out});{}$\6 +${}\\{fputl}(\\{post\_adr},\39\\{out});{}$\6 +${}\\{fputc}(\.{GF\_ID},\39\\{out});{}$\6 +${}\\{temp}\K\\{ftell}(\\{out});{}$\6 +${}\|i\K(\&{int})(\\{temp}\MOD\T{4})+\T{4};{}$\6 +\&{while} ${}(\|i\MM){}$\1\5 +${}\\{fputc}(\.{POSTPOST\_ID},\39\\{out}){}$;\2\par +\U21.\fi + +\M{25} +\TeX\ wants the most significant byte first. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} ${}\\{fputl}(\&{long},\39{}$\&{FILE} ${}{*}){}$;\par +\fi + +\M{26} +\Y\B\&{void} \\{fputl}(\&{long} \\{num}${},\39{}$\&{FILE} ${}{*}\|f){}$\1\1\2\2% +\6 +${}\{{}$\1\6 +${}\\{fputc}(\\{num}\GG\T{24},\39\|f);{}$\6 +${}\\{fputc}(\\{num}\GG\T{16},\39\|f);{}$\6 +${}\\{fputc}(\\{num}\GG\T{8},\39\|f);{}$\6 +${}\\{fputc}(\\{num},\39\|f);{}$\6 +\4${}\}{}$\2\par +\fi + +\M{27} +\PB{\\{make\_pixel\_array}(\,)} scales a character into the array \PB{\\{out% +\_char}[\,]} where +each \\{byte} represents one pixel, contrary to the input file where each +\\{bit} is used to store the character bitmap. \PB{\.{BLACK}} indicates a black +pixel. + +The scaling routine was modeled after the program \.{pnmscale} of the +\.{pbmplus} package. \.{pbmplus} was designed to handle arbitrary pictures, +and bitmaps are only a special case of a graymap with values from~0 for +white up to \PB{$\.{PIXEL\_MAXVAL}\K\T{255}$} for black. + +If \PB{\.{EOF}} is encountered, \PB{\\{end\_of\_file}} is set and the function +returns +immediately. + +\Y\B\4\D$\.{BLACK}$ \5 +\T{1}\par +\B\4\D$\.{WHITE}$ \5 +\T{0}\Y\par +\B\4\D$\.{PIXEL\_MAXVAL}$ \5 +\T{255}\par +\B\4\D$\.{SCALE}$ \5 +\T{4096}\par +\B\4\D$\.{HALFSCALE}$ \5 +\T{2048}\Y\par +\B\4\D$\.{MAX\_CHAR\_SIZE}$ \5 +\T{1023}\par +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{HBF\_CHAR} \\{code};\6 +\&{const} \&{unsigned} \&{char} ${}{*}\\{bitmap}{}$;\C{ a proper input bitmap +array will be allocated by the HBF API }\6 +\&{const} \&{unsigned} \&{char} ${}{*}\\{bP}{}$;\7 +\&{unsigned} \&{char} ${}\\{out\_char}[\.{MAX\_CHAR\_SIZE}*\.{MAX\_CHAR\_SIZE}+% +\T{1}]{}$;\C{ the output bitmap array }\6 +\&{unsigned} \&{char} ${}{*}\\{out\_char\_p}{}$;\7 +\&{unsigned} \&{char} \\{pixelrow}[\.{MAX\_CHAR\_SIZE}];\6 +\&{unsigned} \&{char} \\{temp\_pixelrow}[\.{MAX\_CHAR\_SIZE}];\6 +\&{unsigned} \&{char} ${}\\{new\_pixelrow}[\.{MAX\_CHAR\_SIZE}+\T{1}]{}$;\C{ we +need space to append a white pixel }\7 +\&{int} \\{curr\_row};\C{ for \PB{\\{read\_row}(\,)} if we access the glyph +rotated }\6 +\&{long} \\{grayrow}[\.{MAX\_CHAR\_SIZE}];\7 +\&{long} \\{s\_mag\_x}${},{}$ \\{s\_mag\_y}${},{}$ \\{s\_slant};\par +\fi + +\M{28} +We need to initialize the \PB{\\{grayrow}[\,]} array together with some other +variables. + +Two steps are necessary to compute the \PB{\\{code}} if we are in the \mf-like +mode. Assuming that we search the code \.{0xXXYY}, we first set \PB{\\{code}} +to +the value \.{0xXXAA}, where \.{0xAA} is equal to \PB{\\{min\_2\_byte}} (getting +\PB{\\{offset}} as the number of remaining characters to reach the first +character +in our given subfont), then we increment \PB{\\{code}} (and decrement \PB{% +\\{offset}}) +until \PB{\\{offset}} equals~0. + +\Y\B\4\X28:Initialize variables\X${}\E{}$\6 +${}\{{}$\1\6 +\&{int} \\{col}${},{}$ \\{offset};\7 +\&{if} (\\{rotation})\5 +${}\{{}$\1\6 +\&{int} \\{tmp};\7 +${}\\{tmp}\K\\{input\_size\_x};{}$\6 +${}\\{input\_size\_x}\K\\{input\_size\_y};{}$\6 +${}\\{input\_size\_y}\K\\{tmp};{}$\6 +\4${}\}{}$\2\7 +\&{if} (\\{mf\_like})\5 +${}\{{}$\1\6 +${}\\{target\_size\_x}\K\\{design\_size}*(\\{x\_resolution}/\\{dpi\_x});{}$\6 +${}\\{target\_size\_y}\K\\{design\_size}*(\\{x\_resolution}*\\{y\_scale}/\\{dpi% +\_y});{}$\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +${}\\{target\_size\_x}\K\\{target\_size\_y}\K\\{design\_size};{}$\2\6 +${}\\{magstep\_x}\K\\{target\_size\_x}/\\{design\_size};{}$\6 +${}\\{magstep\_y}\K\\{target\_size\_y}/\\{design\_size}{}$;\7 +${}\\{pk\_offset\_x}\K\\{offset\_x}*\\{magstep\_x}+\T{0.5};{}$\6 +${}\\{pk\_offset\_y}\K\\{offset\_y}*\\{magstep\_y}+\T{0.5};{}$\6 +${}\\{tfm\_offset\_x}\K\\{offset\_x}/(\\{dpi\_x}/\T{72.27})/\\{design% +\_size};{}$\6 +${}\\{tfm\_offset\_y}\K\\{offset\_y}/(\\{dpi\_y}/\T{72.27})/\\{design% +\_size}{}$;\7 +${}\\{pk\_width}\K\\{input\_size\_x}*\\{mag\_x}*\\{magstep\_x}+\T{0.5}{}$;\C{ +without slant }\6 +${}\\{pk\_output\_size\_x}\K\\{input\_size\_x}*\\{mag\_x}*\\{magstep\_x}+% +\\{input\_size\_y}*\\{mag\_y}*\\{magstep\_y}*\\{slant}+\T{0.5};{}$\6 +${}\\{pk\_output\_size\_y}\K\\{input\_size\_y}*\\{mag\_y}*\\{magstep\_y}+% +\T{0.5};{}$\6 +${}\\{tfm\_output\_size\_x}\K\\{input\_size\_x}*\\{mag\_x}/(\\{dpi\_x}/% +\T{72.27})/\\{design\_size};{}$\6 +${}\\{tfm\_output\_size\_y}\K\\{input\_size\_y}*\\{mag\_y}/(\\{dpi\_y}/% +\T{72.27})/\\{design\_size};{}$\6 +\&{if} ${}(\\{pk\_output\_size\_x}>\.{MAX\_CHAR\_SIZE}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Output\ character\ bo}\)\.{x\ width\ too\ big% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{pk\_output\_size\_y}>\.{MAX\_CHAR\_SIZE}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Output\ character\ bo}\)\.{x\ height\ too\ big% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{for} ${}(\\{col}\K\T{0};{}$ ${}\\{col}<\\{input\_size\_x};{}$ ${}\PP% +\\{col}){}$\1\5 +${}\\{grayrow}[\\{col}]\K\.{HALFSCALE}{}$;\2\7 +\&{if} ${}(\R\\{mf\_like}){}$\1\5 +${}\\{code}\K(\\{min\_char}\AND\T{\^FF00})+\\{min\_2\_byte};{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}((\\{file\_number}<(\\{unicode}\?\T{0}:\T{1}))\V(\\{file\_number}\G% +\T{\^100})){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ subfile\ num}\)\.{ber\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{if} (\\{unicode})\5 +${}\{{}$\1\6 +${}\\{offset}\K\T{0};{}$\6 +${}\\{code}\K\\{file\_number}*\T{\^100};{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{offset}\K(\\{file\_number}-\T{1})*\T{256}\MOD\\{nmb\_2\_bytes};{}$\6 +${}\\{code}\K(\\{min\_char}\AND\T{\^FF00})+\\{min\_2\_byte}+(\\{file\_number}-% +\T{1})*\T{256}/\\{nmb\_2\_bytes}*\T{\^100};{}$\6 +\4${}\}{}$\2\7 +\&{while} ${}(\\{offset}\MM){}$\1\6 +\&{while} ${}(\R\\{b2\_codes}[\\{code}\PP\AND\T{\^FF}]{}$)\C{ eliminate invalid +\PB{\\{b2\_codes}} }\1\6 +;\2\2\7 +\&{if} ${}(\\{code}>\\{max\_char}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ subfile\ num}\)\.{ber\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +${}\\{s\_mag\_x}\K\\{mag\_x}*\\{magstep\_x}*\.{SCALE};{}$\6 +${}\\{s\_mag\_y}\K\\{mag\_y}*\\{magstep\_y}*\.{SCALE};{}$\6 +${}\\{s\_slant}\K\\{slant}*\.{SCALE};{}$\6 +\4${}\}{}$\2\par +\U4.\fi + +\M{29} +All arrays of the \\{pixelrow} family contain gray values. While scaling +with non-integer values a pixel of the input bitmap will normally not align +with the pixel grid of the output bitmap (geometrically spoken). In this +case we first compute the fractions of input pixel rows scaled vertically +and add the corresponding gray values until a temporary row is produced. +Then we repeat this procedure horizontally pixel by pixel and write the +result into an output array. + + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{make\_pixel\_array}(\&{void});\par +\fi + +\M{30} +\Y\B\&{void} \\{make\_pixel\_array}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{unsigned} \&{char} ${}{*}\\{prP};{}$\6 +\&{unsigned} \&{char} ${}{*}\\{temp\_prP};{}$\6 +\&{unsigned} \&{char} ${}{*}\\{new\_prP};{}$\6 +\&{long} ${}{*}\\{grP}{}$;\7 +\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\6 +\&{register} \&{unsigned} \&{char} ${}{*}\\{nxP}{}$;\7 +\&{register} \&{int} \\{row}${},{}$ \\{col};\6 +\&{int} \\{rows\_read}${}\K\T{0};{}$\6 +\&{register} \&{int} \\{need\_to\_read\_row}${}\K\T{1}{}$;\7 +\&{long} \\{frac\_row\_to\_fill}${}\K\.{SCALE};{}$\6 +\&{long} \\{frac\_row\_left}${}\K\\{s\_mag\_y}{}$;\7 +\&{int} \\{no\_code}${}\K\.{FALSE};{}$\7 +${}\\{prP}\K\\{pixelrow};{}$\6 +${}\\{temp\_prP}\K\\{temp\_pixelrow};{}$\6 +${}\\{new\_prP}\K\\{new\_pixelrow};{}$\6 +${}\\{grP}\K\\{grayrow};{}$\6 +${}\\{out\_char\_p}\K\\{out\_char}{}$;\C{ will be increased by \PB{\\{write% +\_row}(\,)} }\7 +\4\\{again}:\6 +\&{if} ${}(\\{b2\_codes}[\\{code}\AND\T{\^FF}]{}$)\C{ a valid second byte? }\6 +${}\{{}$\1\6 +\&{if} (\\{pk\_files})\5 +${}\{{}$\1\6 +${}\\{bitmap}\K\\{hbfGetBitmap}(\\{hbf},\39\\{code});{}$\6 +${}\\{bP}\K\\{bitmap}{}$;\C{ will be increased by \PB{\\{read\_row}(\,)} }\7 +\&{if} ${}(\R\\{bitmap}){}$\1\5 +${}\\{empty\_char}\K\.{TRUE};{}$\2\6 +\&{else}\1\5 +\X31:Scale row by row\X\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +${}\\{no\_code}\K\.{TRUE}{}$;\2\7 +\&{if} ${}((\\{code}\AND\T{\^FF})\E\\{max\_2\_byte}){}$\1\5 +${}\\{code}\MRL{+{\K}}\T{\^FF}-(\\{max\_2\_byte}-\\{min\_2\_byte}){}$;\C{ go to +next plane }\2\6 +\&{if} ${}(\\{code}\G\\{max\_char}){}$\5 +${}\{{}$\1\6 +${}\\{end\_of\_file}\K\.{TRUE};{}$\6 +\&{return};\6 +\4${}\}{}$\2\7 +${}\\{code}\PP{}$;\7 +\&{if} (\\{no\_code})\5 +${}\{{}$\1\6 +${}\\{no\_code}\K\.{FALSE};{}$\6 +\&{goto} \\{again};\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\fi + +\M{31} +\Y\B\4\X31:Scale row by row\X${}\E{}$\6 +${}\{{}$\1\6 +\&{if} ${}(\\{pk\_output\_size\_y}\E\\{input\_size\_y}{}$)\C{ shortcut +Y~scaling if possible }\1\6 +${}\\{temp\_prP}\K\\{prP}{}$;\2\7 +${}\\{curr\_row}\K\\{input\_size\_y}-\T{1}{}$;\C{ only needed for rotated +glyphs }\6 +\&{for} ${}(\\{row}\K\T{0};{}$ ${}\\{row}<\\{pk\_output\_size\_y};{}$ ${}\PP% +\\{row}){}$\5 +${}\{{}$\1\6 +\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}\X\6 +\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[\,]} +and write it into \PB{\\{out\_char}[\,]}\X\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\U30.\fi + +\M{32} +\Y\B\4\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}% +\X${}\E{}$\6 +\&{if} ${}(\\{pk\_output\_size\_y}\E\\{input\_size\_y}{}$)\C{ shortcut +Y~scaling if possible }\1\6 +\\{read\_row}(\\{prP});\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{while} ${}(\\{frac\_row\_left}<\\{frac\_row\_to\_fill}){}$\5 +${}\{{}$\1\6 +\&{if} (\\{need\_to\_read\_row})\1\6 +\&{if} ${}(\\{rows\_read}<\\{input\_size\_y}){}$\5 +${}\{{}$\1\6 +\\{read\_row}(\\{prP});\6 +${}\PP\\{rows\_read};{}$\6 +\4${}\}{}$\2\2\7 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{prP};{}$ ${}\\{col}<\\{input\_size% +\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\1\5 +${}\\{grP}[\\{col}]\MRL{+{\K}}\\{frac\_row\_left}*({*}\\{xP}){}$;\2\7 +${}\\{frac\_row\_to\_fill}\MRL{-{\K}}\\{frac\_row\_left};{}$\6 +${}\\{frac\_row\_left}\K\\{s\_mag\_y};{}$\6 +${}\\{need\_to\_read\_row}\K\T{1};{}$\6 +\4${}\}{}$\2\7 +\X33:Produce a temporary row\X\6 +\4${}\}{}$\2\par +\U31.\fi + +\M{33} +Now \PB{$\\{frac\_row\_left}\G\\{frac\_row\_to\_fill}$}, so we can produce a +row. + +\Y\B\4\X33:Produce a temporary row\X${}\E{}$\6 +\&{if} (\\{need\_to\_read\_row})\1\6 +\&{if} ${}(\\{rows\_read}<\\{input\_size\_y}){}$\5 +${}\{{}$\1\6 +\\{read\_row}(\\{prP});\6 +${}\PP\\{rows\_read};{}$\6 +${}\\{need\_to\_read\_row}\K\T{0};{}$\6 +\4${}\}{}$\2\2\7 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{prP},\39\\{nxP}\K\\{temp\_prP};{}$ ${}% +\\{col}<\\{input\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP},\39\PP\\{nxP}){}$\5 +${}\{{}$\1\6 +\&{register} \&{long} \|g;\7 +${}\|g\K\\{grP}[\\{col}]+\\{frac\_row\_to\_fill}*({*}\\{xP});{}$\6 +${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 +\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 +${}\|g\K\.{PIXEL\_MAXVAL}{}$;\2\7 +${}{*}\\{nxP}\K\|g;{}$\6 +${}\\{grP}[\\{col}]\K\.{HALFSCALE};{}$\6 +\4${}\}{}$\2\7 +${}\\{frac\_row\_left}\MRL{-{\K}}\\{frac\_row\_to\_fill};{}$\6 +\&{if} ${}(\\{frac\_row\_left}\E\T{0}){}$\5 +${}\{{}$\1\6 +${}\\{frac\_row\_left}\K\\{s\_mag\_y};{}$\6 +${}\\{need\_to\_read\_row}\K\T{1};{}$\6 +\4${}\}{}$\2\6 +${}\\{frac\_row\_to\_fill}\K\.{SCALE}{}$;\par +\U32.\fi + +\M{34} +To implement the slant we move the starting point \PB{\\{nxP}} to the right +according to the corresponding \PB{\|y}~value. To simplify life only positive +shift values are allowed. + +We always append a white pixel to avoid artefacts at the end of the line +produced by the last line. This rule sets the second condition that the +slant must not be greater than~\PB{\T{1}}---such a large slant would be +unusable +anyway for typesetting purposes. + +\Y\B\4\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[% +\,]} and write it into \PB{\\{out\_char}[\,]}\X${}\E{}$\6 +\&{if} ${}(\\{pk\_width}\E\\{input\_size\_x}\W\\{s\_slant}\E\T{0}{}$)\C{ +shortcut X~scaling if possible }\1\6 +\\{write\_row}(\\{temp\_prP});\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{register} \&{long} \|g${}\K\.{HALFSCALE};{}$\6 +\&{register} \&{long} \\{frac\_col\_to\_fill}${}\K\.{SCALE};{}$\6 +\&{register} \&{long} \\{frac\_col\_left};\6 +\&{register} \&{int} \\{need\_col}${}\K\T{0};{}$\7 +${}\\{nxP}\K\\{new\_prP}{}$;\7 +${}\\{frac\_col\_left}\K(\\{pk\_output\_size\_y}-\\{row})*\\{s\_slant};{}$\6 +\&{while} ${}(\\{frac\_col\_left}\G\\{frac\_col\_to\_fill}){}$\5 +${}\{{}$\1\6 +${}{*}(\\{nxP}\PP)\K\T{0};{}$\6 +${}\\{frac\_col\_left}\MRL{-{\K}}\\{frac\_col\_to\_fill};{}$\6 +\4${}\}{}$\2\7 +\&{if} ${}(\\{frac\_col\_left}>\T{0}){}$\1\5 +${}\\{frac\_col\_to\_fill}\MRL{-{\K}}\\{frac\_col\_left}{}$;\2\7 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{temp\_prP};{}$ ${}\\{col}<\\{input% +\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 +${}\{{}$\1\6 +${}\\{frac\_col\_left}\K\\{s\_mag\_x};{}$\6 +\&{while} ${}(\\{frac\_col\_left}\G\\{frac\_col\_to\_fill}){}$\5 +${}\{{}$\1\6 +\&{if} (\\{need\_col})\5 +${}\{{}$\1\6 +${}\PP\\{nxP};{}$\6 +${}\|g\K\.{HALFSCALE};{}$\6 +\4${}\}{}$\2\7 +${}\|g\MRL{+{\K}}\\{frac\_col\_to\_fill}*({*}\\{xP});{}$\6 +${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 +\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 +${}\|g\K\.{PIXEL\_MAXVAL}{}$;\2\7 +${}{*}\\{nxP}\K\|g;{}$\6 +${}\\{frac\_col\_left}\MRL{-{\K}}\\{frac\_col\_to\_fill};{}$\6 +${}\\{frac\_col\_to\_fill}\K\.{SCALE};{}$\6 +${}\\{need\_col}\K\T{1};{}$\6 +\4${}\}{}$\2\7 +\&{if} ${}(\\{frac\_col\_left}>\T{0}){}$\5 +${}\{{}$\1\6 +\&{if} (\\{need\_col})\5 +${}\{{}$\1\6 +${}\PP\\{nxP};{}$\6 +${}\|g\K\.{HALFSCALE};{}$\6 +${}\\{need\_col}\K\T{0};{}$\6 +\4${}\}{}$\2\7 +${}\|g\MRL{+{\K}}\\{frac\_col\_left}*({*}\\{xP});{}$\6 +${}\\{frac\_col\_to\_fill}\MRL{-{\K}}\\{frac\_col\_left};{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\7 +\X35:Write out a row\X\6 +\4${}\}{}$\2\par +\U31.\fi + +\M{35} +\Y\B\4\X35:Write out a row\X${}\E{}$\6 +\&{if} ${}(\\{frac\_col\_to\_fill}>\T{0}){}$\5 +${}\{{}$\1\6 +${}\MM\\{xP};{}$\6 +${}\|g\MRL{+{\K}}\\{frac\_col\_to\_fill}*({*}\\{xP});{}$\6 +\4${}\}{}$\2\7 +\&{if} ${}(\R\\{need\_col}){}$\5 +${}\{{}$\1\6 +${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 +\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 +${}\|g\K\.{PIXEL\_MAXVAL};{}$\2\6 +${}{*}\\{nxP}\K\|g;{}$\6 +\4${}\}{}$\2\7 +${}{*}(\PP\\{nxP})\K\T{0}{}$;\C{ append a blank pixel }\7 +\\{write\_row}(\\{new\_prP});\par +\U34.\fi + +\M{36} +\PB{\\{read\_row}(\,)} reads a row from \PB{\\{bitmap}[\,]} and converts it +into a graymap row. +If the \PB{\\{rotation}} flag has been set, we get the proper column instead +(note +that in this case \PB{\\{input\_size\_x}} already reflects the width of the +rotated +glyph). + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 +\&{\_\_inline\_\_}\6 +\8\#\&{endif}\6 +\&{void} \\{read\_row}(\&{unsigned} \&{char} ${}{*}){}$;\par +\fi + +\M{37} +\Y\B\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 +\&{\_\_inline\_\_}\6 +\8\#\&{endif}\6 +\&{void} \\{read\_row}(\&{unsigned} \&{char} ${}{*}\\{pixelrow}){}$\1\1\2\2\6 +${}\{{}$\1\6 +\&{register} \&{int} \\{col}${},{}$ \\{bitshift}${},{}$ \\{offset};\6 +\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\6 +\&{register} \&{unsigned} \&{char} \\{item}${}\K\T{0};{}$\7 +\&{if} (\\{rotation})\5 +${}\{{}$\1\6 +${}\\{bitshift}\K\T{7}-(\\{curr\_row}\MOD\T{8});{}$\6 +${}\\{offset}\K(\\{input\_size\_y}+\T{7})/\T{8};{}$\6 +${}\\{bP}\K\\{bitmap}+\\{curr\_row}/\T{8};{}$\6 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{input% +\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 +${}\{{}$\1\6 +${}{*}\\{xP}\K(({*}\\{bP}\GG\\{bitshift})\AND\T{1})\E\T{1}\?\.{PIXEL\_MAXVAL}:% +\T{0};{}$\6 +${}\\{bP}\MRL{+{\K}}\\{offset};{}$\6 +\4${}\}{}$\2\6 +${}\\{curr\_row}\MM;{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{bitshift}\K{-}\T{1};{}$\6 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{input% +\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{bitshift}\E{-}\T{1}){}$\5 +${}\{{}$\1\6 +${}\\{item}\K{*}(\\{bP}\PP){}$;\C{ increase input bitmap pointer }\6 +${}\\{bitshift}\K\T{7};{}$\6 +\4${}\}{}$\2\6 +${}{*}\\{xP}\K((\\{item}\GG\\{bitshift})\AND\T{1})\E\T{1}\?\.{PIXEL\_MAXVAL}:% +\T{0};{}$\6 +${}\MM\\{bitshift};{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\fi + +\M{38} +\PB{\\{write\_row}(\,)} converts the graymap back into a bitmap using a simple +threshold. + +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{int} \\{threshold}${}\K\T{128}{}$;\par +\fi + +\M{39} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 +\&{\_\_inline\_\_}\6 +\8\#\&{endif}\6 +\&{void} \\{write\_row}(\&{unsigned} \&{char} ${}{*}){}$;\par +\fi + +\M{40} +\Y\B\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 +\&{\_\_inline\_\_}\6 +\8\#\&{endif}\6 +\&{void} \\{write\_row}(\&{unsigned} \&{char} ${}{*}\\{pixelrow}){}$\1\1\2\2\6 +${}\{{}$\1\6 +\&{register} \&{int} \\{col};\6 +\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\7 +\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{pk\_output% +\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\1\5 +${}{*}(\\{out\_char\_p}\PP)\K({*}\\{xP}\G\\{threshold})\?\T{1}:\T{0}{}$;\C{ +increase output bitmap pointer }\2\6 +\4${}\}{}$\2\par +\fi + +\M{41} +Now comes the most interesting routine. The pixel array will be compressed +in sequences of black and white pixels. + +\PB{\.{SKIP0}}, \PB{\.{SKIP1}}, and \PB{\.{SKIP2}} indicate how many blank +lines will be skipped. +\PB{\.{PAINT\_}(\|x)} means that the next x~pixels will have the same color, +then the +color changes. \PB{\.{NEW\_ROW\_}(\|x)} is the first black pixel in the next +row. + +An example: the pixel sequence 111100011001 [new row] 000111011110 will be +output as 4 3 2 2 1 77 3 1 4 1. + +Commands with an ending~`n' in its name indicate that the next n~bytes +should be read as the counter. Example: \PB{\.{SKIP1}}~26 means `skip the next +26~rows'. + +For further details please refer to ``\mf---the program''. + +\Y\B\4\D$\.{PAINT\_}(\|x)$ \5 +(\|x)\C{ $0 \le x \le 63$ }\par +\B\4\D$\.{PAINT1}$ \5 +\T{64}\par +\B\4\D$\.{PAINT2}$ \5 +\T{65}\par +\B\4\D$\.{PAINT3}$ \5 +\T{66}\C{ not used }\Y\par +\B\4\D$\.{SKIP0}$ \5 +\T{70}\par +\B\4\D$\.{SKIP1}$ \5 +\T{71}\par +\B\4\D$\.{SKIP2}$ \5 +\T{72}\par +\B\4\D$\.{SKIP3}$ \5 +\T{73}\C{ not used }\Y\par +\B\4\D$\.{NEW\_ROW\_}(\|x)$ \5 +$((\|x)+\T{74}{}$)\C{ $0 \le x \le 164$ }\Y\par +\B\4\D$\.{NOOP}$ \5 +\T{244}\C{ not used }\par +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_coding}(\&{void});\par +\fi + +\M{42} +The \PB{\&{goto} \\{start}} instruction causes some compilers to complain about +``Unreachable code $\ldots$'' or something similar. + +\Y\B\&{void} \\{write\_coding}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{register} \&{int} \\{count}${},{}$ \\{skip};\6 +\&{register} \&{unsigned} \&{char} \\{paint};\6 +\&{register} \&{int} \|x${},{}$ \|y;\6 +\&{register} \&{unsigned} \&{char} ${}{*}\\{cp};{}$\7 +${}\|x\K\T{0};{}$\6 +${}\|y\K\T{0};{}$\6 +${}\\{cp}\K\\{out\_char}+\|y*\\{pk\_output\_size\_x}+\|x;{}$\6 +${}\\{count}\K\\{skip}\K\T{0};{}$\6 +${}\\{paint}\K\.{WHITE};{}$\6 +\&{goto} \\{start};\7 +\&{while} ${}(\|y<\\{pk\_output\_size\_y}){}$\5 +${}\{{}$\1\6 +\X43:Search blank lines\X\6 +\4\\{start}:\5 +\X44:Process rest of line\X\6 +${}\|y\PP;{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\Y\par +\fi + +\M{43} +\Y\B\4\X43:Search blank lines\X${}\E{}$\6 +$\\{count}\K\T{0};{}$\6 +${}\|x\K\T{0};{}$\6 +${}\\{cp}\K\\{out\_char}+\|y*\\{pk\_output\_size\_x}+\|x{}$;\7 +\&{while} ${}(\|x<\\{pk\_output\_size\_x}){}$\5 +${}\{{}$\1\6 +\&{if} ${}({*}\\{cp}\E\\{paint}){}$\1\5 +${}\\{count}\PP;{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}(\\{skip}\E\T{0}){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{count}\Z\T{164}){}$\1\5 +${}\\{fputc}(\.{NEW\_ROW\_}(\\{count}),\39\\{out});{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{SKIP0},\39\\{out}){}$;\7 +\&{if} ${}(\\{count}<\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 +${}\\{fputc}(\\{count},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}(\\{skip}\E\T{1}){}$\1\5 +${}\\{fputc}(\.{SKIP0},\39\\{out});{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}(\\{skip}<\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{SKIP1},\39\\{out});{}$\6 +${}\\{fputc}(\\{skip},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{SKIP2},\39\\{out});{}$\6 +${}\\{fputc}(\\{skip}\GG\T{8},\39\\{out});{}$\6 +${}\\{fputc}(\\{skip}\AND\T{\^FF},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +${}\\{skip}\K\T{0};{}$\6 +\&{if} ${}(\\{count}<\T{64}){}$\1\5 +${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 +\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 +${}\\{fputc}(\\{count},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +${}\\{count}\K\T{0};{}$\6 +${}\\{paint}\K\.{BLACK};{}$\6 +\&{break};\6 +\4${}\}{}$\2\6 +${}\|x\PP;{}$\6 +${}\\{cp}\PP;{}$\6 +\4${}\}{}$\2\6 +\&{if} ${}(\|x\G\\{pk\_output\_size\_x}){}$\5 +${}\{{}$\1\6 +${}\\{skip}\PP;{}$\6 +${}\|y\PP;{}$\6 +\&{continue};\6 +\4${}\}{}$\2\par +\U42.\fi + +\M{44} +\Y\B\4\X44:Process rest of line\X${}\E{}$\6 +\&{while} ${}(\|x<\\{pk\_output\_size\_x}){}$\5 +${}\{{}$\1\6 +\&{if} ${}({*}\\{cp}\E\\{paint}){}$\1\5 +${}\\{count}\PP;{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{if} ${}(\\{count}<\T{64}){}$\1\5 +${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 +\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 +${}\\{fputc}(\\{count},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +${}\\{count}\K\T{1};{}$\6 +${}\\{paint}\K\.{BLACK}-\\{paint};{}$\6 +\4${}\}{}$\2\6 +${}\|x\PP;{}$\6 +${}\\{cp}\PP;{}$\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{paint}\E\.{BLACK}){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{count}<\T{64}){}$\1\5 +${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 +\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 +${}\\{fputc}(\\{count},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 +${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 +\4${}\}{}$\2\6 +${}\\{paint}\K\.{WHITE};{}$\6 +\4${}\}{}$\2\par +\U42.\fi + +\N{1}{45}The font metrics file. +This routine creates one \.{PL} file with the font properties. None of the +\TeX\ font dimensions are needed because you never will use CJK fonts +directly, and intercharacter stretching is handled by the \\{CJK} macro +\.{\\CJKglue}. (Other packages may define similar commands.) + +The name of the \.{PL} file will contain the running two digits in +\mf-like mode only. + +It makes sense \\{not} to compute the check sum automatically for two +reasons. Firstly, since \TeX's checksum algorithm is based on the character +width, the number of valid characters, and the designsize, there is a much +higher chance that two subfonts from different HBF fonts have the same check +sum than it is for ordinary fonts, because all characters have the same +width, usually 256~characters in a subfont, and very often the same design +size. Secondly, and this is more important, we create just one +\.{TFM} file for all subfonts regardless of the real number of characters +in a particular subfont. + +To have an identification string in the \.{TFM} file, we split it into +single bytes and use the \.{HEADER} command repeatedly. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_pl}(\&{void});\par +\fi + +\M{46} +\Y\B\&{void} \\{write\_pl}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{int} \|i${},{}$ \\{pos};\6 +\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\6 +\&{long} \|t${},{}$ \\{sc};\6 +\&{char} ${}{*}\|s;{}$\6 +\&{char} \\{tfm\_header}[\,]${}\K\.{"Created\ by\ hbf2gf"};{}$\7 +${}\\{file\_number}\MM{}$;\C{ for \mf-like mode }\7 +\&{if} (\\{mf\_like})\5 +${}\{{}$\1\6 +\&{if} (\\{unicode})\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.pl"},\39\\{output\_name},\39% +\\{file\_number});{}$\2\6 +\&{else}\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.pl"},\39\\{output\_name},\39% +\\{file\_number});{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s.pl"},\39\\{output\_name}){}$;\2\7 +\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_TXT}))){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% +\_file});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{output\_file}){}$;\2\7 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(FAMILY\ \%s\%d)"}\6 +\.{"\\n(CODINGSCHEME\ CJK}\)\.{-\%s)"}${},\39\\{output\_name},\39\\{file% +\_number},\39\\{font\_encoding}){}$;\7 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(DESIGNSIZE\ R\ \%.6}\)\.{f)"}\6 +\.{"\\n(COMMENT\ DESIGNSI}\)\.{ZE\ IS\ IN\ POINTS)"}\6 +\.{"\\n(COMMENT\ OTHER\ SI}\)\.{ZES\ ARE\ MULTIPLES\ OF}\)\.{\ DESIGNSIZE)"}\6 +\.{"\\n(CHECKSUM\ O\ \%lo)"}\6 +\.{"\\n(FONTDIMEN"}\6 +\.{"\\n\ \ \ (SLANT\ R\ \%.6f)}\)\.{"}\6 +\.{"\\n\ \ \ (SPACE\ R\ 0.0)"}\6 +\.{"\\n\ \ \ (STRETCH\ R\ 0.0}\)\.{)"}\6 +\.{"\\n\ \ \ (SHRINK\ R\ 0.0)}\)\.{"}\6 +\.{"\\n\ \ \ (XHEIGHT\ R\ 1.0}\)\.{)"}\6 +\.{"\\n\ \ \ (QUAD\ R\ 1.0)"}\6 +\.{"\\n\ \ \ (EXTRASPACE\ R\ }\)\.{0.0)"}\6 +\.{"\\n\ \ \ )"}${},\39\\{design\_size},\39\\{checksum},\39\\{slant}){}$;\7 +${}\|s\K\\{tfm\_header};{}$\6 +${}\|i\K\\{strlen}(\|s);{}$\6 +${}\|t\K{}$((\&{long}) \|i)${}\LL\T{24};{}$\6 +${}\\{sc}\K\T{16};{}$\6 +${}\\{pos}\K\T{18}{}$;\7 +${}\\{fprintf}(\\{out},\39\.{"\\n"});{}$\6 +\&{while} ${}(\|i>\T{0}){}$\5 +${}\{{}$\1\6 +${}\|t\MRL{{\OR}{\K}}((\&{long})({*}{}$(\&{unsigned} \&{char} ${}{*}){}$ \|s${}% +\PP))\LL\\{sc};{}$\6 +${}\\{sc}\MRL{-{\K}}\T{8};{}$\6 +\&{if} ${}(\\{sc}<\T{0}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% +\39\|t);{}$\6 +${}\|t\K\T{0};{}$\6 +${}\\{sc}\K\T{24};{}$\6 +${}\\{pos}\PP;{}$\6 +\4${}\}{}$\2\6 +${}\|i\MM;{}$\6 +\4${}\}{}$\2\6 +\&{if} (\|t)\1\5 +${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% +\39\|t);{}$\2\6 +${}\\{fprintf}(\\{out},\39\.{"\\n"}){}$;\7 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(CHARACTER\ O\ \%o"}\6 +\.{"\\n\ \ \ (CHARWD\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARHT\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARDP\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARIC\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ )"}${},{}$\6 +\|i${},\39\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x},\39\\{tfm\_output% +\_size\_y}+\\{tfm\_offset\_y},\39{-}\\{tfm\_offset\_y},\39\\{slant}*(\\{tfm% +\_output\_size\_y}+\\{tfm\_offset\_y}));{}$\6 +\4${}\}{}$\2\7 +\\{fclose}(\\{out});\6 +\4${}\}{}$\2\par +\fi + +\N{1}{47}The extended virtual font file for \Om. +The following is very similar to \PB{\\{write\_pl}(\,)}; we simply map the +glyphs +of the subfonts back to the original encoding positions. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_ovp}(\&{void});\par +\fi + +\M{48} +\Y\B\&{void} \\{write\_ovp}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{int} \|c${},{}$ \|i${},{}$ \\{nmb\_subfonts}${},{}$ \\{remainder}${},{}$ % +\\{count}${},{}$ \\{pos};\6 +\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\6 +\&{long} \|t${},{}$ \\{sc};\6 +\&{char} ${}{*}\|s;{}$\6 +\&{char} \\{ofm\_header}[\,]${}\K\.{"Created\ by\ hbf2gf"};{}$\7 +${}\\{nmb\_subfonts}\K((\\{max\_char}-(\\{min\_char}\AND\T{\^FF00}))/\T{256}*% +\\{nmb\_2\_bytes})/\T{256}+\T{1};{}$\6 +${}\\{remainder}\K((\\{max\_char}-(\\{min\_char}\AND\T{\^FF00}))/\T{256}*\\{nmb% +\_2\_bytes})\MOD\T{256}{}$;\C{ correction for the last incomplete second byte +range }\6 +\&{for} ${}(\\{count}\K\T{0};{}$ ${}\\{count}<(\\{max\_char}\AND\T{\^FF});{}$ +${}\\{count}\PP){}$\1\6 +\&{if} (\\{b2\_codes}[\\{count}])\1\5 +${}\\{remainder}\PP;{}$\2\2\6 +\&{if} ${}(\\{remainder}\G\T{256}){}$\1\5 +${}\\{nmb\_subfonts}\PP{}$;\2\7 +${}\\{sprintf}(\\{output\_file},\39\.{"\%s.ovp"},\39\\{output\_name}){}$;\7 +\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_TXT}))){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% +\_file});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{output\_file}){}$;\2\7 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(VTITLE\ Omega\ vir}\)\.{tual\ font\ created\ by}\)\.{\ hbf2gf)"}\6 +\.{"\\n(DESIGNSIZE\ R\ \%.6}\)\.{f)"}\6 +\.{"\\n(COMMENT\ DESIGNSI}\)\.{ZE\ IS\ IN\ POINTS)"}\6 +\.{"\\n(COMMENT\ OTHER\ SI}\)\.{ZES\ ARE\ MULTIPLES\ OF}\)\.{\ DESIGNSIZE)"}\6 +\.{"\\n(CHECKSUM\ O\ \%lo)"}\6 +\.{"\\n(FONTDIMEN"}\6 +\.{"\\n\ \ \ (SLANT\ R\ \%.6f)}\)\.{"}\6 +\.{"\\n\ \ \ (SPACE\ R\ 0.0)"}\6 +\.{"\\n\ \ \ (STRETCH\ R\ 0.0}\)\.{)"}\6 +\.{"\\n\ \ \ (SHRINK\ R\ 0.0)}\)\.{"}\6 +\.{"\\n\ \ \ (XHEIGHT\ R\ 1.0}\)\.{)"}\6 +\.{"\\n\ \ \ (QUAD\ R\ 1.0)"}\6 +\.{"\\n\ \ \ (EXTRASPACE\ R\ }\)\.{0.0)"}\6 +\.{"\\n\ \ \ )"}${},\39\\{design\_size},\39\\{checksum},\39\\{slant}){}$;\7 +${}\|s\K\\{ofm\_header};{}$\6 +${}\|i\K\\{strlen}(\|s);{}$\6 +${}\|t\K{}$((\&{long}) \|i)${}\LL\T{24};{}$\6 +${}\\{sc}\K\T{16};{}$\6 +${}\\{pos}\K\T{18}{}$;\7 +${}\\{fprintf}(\\{out},\39\.{"\\n"});{}$\6 +\&{while} ${}(\|i>\T{0}){}$\5 +${}\{{}$\1\6 +${}\|t\MRL{{\OR}{\K}}((\&{long})({*}{}$(\&{unsigned} \&{char} ${}{*}){}$ \|s${}% +\PP))\LL\\{sc};{}$\6 +${}\\{sc}\MRL{-{\K}}\T{8};{}$\6 +\&{if} ${}(\\{sc}<\T{0}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% +\39\|t);{}$\6 +${}\|t\K\T{0};{}$\6 +${}\\{sc}\K\T{24};{}$\6 +${}\\{pos}\PP;{}$\6 +\4${}\}{}$\2\6 +${}\|i\MM;{}$\6 +\4${}\}{}$\2\6 +\&{if} (\|t)\1\5 +${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% +\39\|t);{}$\2\6 +${}\\{fprintf}(\\{out},\39\.{"\\n"}){}$;\7 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{nmb\_subfonts};{}$ ${}\|i\PP){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(MAPFONT\ D\ \%i"}\6 +\.{"\\n\ \ \ (FONTNAME\ \%s\%0}\)\.{2i)"}\6 +\.{"\\n\ \ \ (FONTCHECKSUM\ }\)\.{O\ \%lo)"}\6 +\.{"\\n\ \ \ (FONTAT\ R\ 1.0)}\)\.{"}\6 +\.{"\\n\ \ \ (FONTDSIZE\ R\ \%}\)\.{.6f)"}\6 +\.{"\\n\ \ \ )"}${},\39\|i,\39\\{output\_name},\39\|i+\T{1},\39\\{checksum},\39% +\\{design\_size});{}$\6 +\4${}\}{}$\2\7 +\&{for} ${}(\|c\K\\{min\_char},\39\|i\K\T{0},\39\\{count}\K\T{0};{}$ ${}\|c\Z% +\\{max\_char};{}$ ${}\|c\PP){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{b2\_codes}[\|c\AND\T{\^FF}]\E\.{VALID\_SUBCODE}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n(CHARACTER\ O\ \%o"}\6 +\.{"\\n\ \ \ (CHARWD\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARHT\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARDP\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (CHARIC\ R\ \%.6f}\)\.{)"}\6 +\.{"\\n\ \ \ (MAP"}\6 +\.{"\\n\ \ \ \ \ \ (SELECTFONT}\)\.{\ D\ \%i)"}\6 +\.{"\\n\ \ \ \ \ \ (SETCHAR\ O\ }\)\.{\%o)"}\6 +\.{"\\n\ \ \ \ \ \ )"}\6 +\.{"\\n\ \ \ )"}${},{}$\6 +\|c${},\39\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x},\39\\{tfm\_output% +\_size\_y}+\\{tfm\_offset\_y},\39{-}\\{tfm\_offset\_y},\39\\{slant}*(\\{tfm% +\_output\_size\_y}+\\{tfm\_offset\_y}),\39\|i,\39\\{count}){}$;\7 +${}\\{count}\PP;{}$\6 +\&{if} ${}(\\{count}\E\T{256}){}$\5 +${}\{{}$\1\6 +${}\\{count}\K\T{0};{}$\6 +${}\|i\PP;{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\1\5 +\&{continue};\2\6 +\4${}\}{}$\2\7 +\\{fclose}(\\{out});\6 +\4${}\}{}$\2\par +\fi + +\N{1}{49}The job file. +This routine is the most system specific one. If your operating system needs +a different outline, make appropriate changes here. + +You have to call this batch file after \.{hbf2gf} has finished (if not in +\mf-like mode). It will transform the \.{GF} files into \.{PK} files and +delete the now unnecessary \.{GF} files, then transform the \.{PL} file into +a \.{TFM} file and copy it \PB{\\{nmb\_files}} times. The name of the job file +is +\PB{\\{output\_name}}. + +\Y\B\4\D$\.{EXTENSION\_LENGTH}$ \5 +\T{8}\C{ the maximal length of a file extension }\Y\par +\B\4\D$\.{GFTOPK\_NAME}$ \5 +\.{"gftopk"}\par +\B\4\D$\.{PLTOTF\_NAME}$ \5 +\.{"pltotf"}\par +\B\4\D$\.{OVP2OVF\_NAME}$ \5 +\.{"ovp2ovf"}\par +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{char} ${}\\{job\_extension}[\.{EXTENSION\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}\\{rm\_command}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}\\{cp\_command}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}\\{pk\_directory}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}\\{tfm\_directory}[\.{STRING\_LENGTH}+\T{1}]{}$;\7 +\&{int} \\{ofm\_file}${}\K\.{FALSE}{}$;\par +\fi + +\M{50} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{write\_job}(\&{void});\par +\fi + +\M{51} +\Y\B\&{void} \\{write\_job}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{FILE} ${}{*}\\{out};{}$\6 +\&{int} \|i${},{}$ \|j;\6 +\&{char} ${}\\{buffer}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\7 +${}\\{strcpy}(\\{buffer},\39\\{output\_name});{}$\6 +${}\\{strcat}(\\{buffer},\39\\{job\_extension});{}$\6 +\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{buffer},\39\.{WRITE\_TXT}))){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39% +\\{buffer});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{buffer}){}$;\2\7 +\&{if} (\\{pk\_files})\5 +${}\{{}$\1\6 +\&{if} (\\{unicode})\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K(\\{min\_char}\GG\T{8}),\39\|j\K\T{0};{}$ ${}\|j<\\{nmb% +\_files};{}$ ${}\|i\PP,\39\|j\PP){}$\1\5 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\%s\ \%s\%02x.gf\ \%s\%s\%0}\)\.{2x.\%.0ipk\\n"}\6 +\.{"\%s\ \%s\%02x.gf\\n"}${},{}$\6 +\.{GFTOPK\_NAME}${},\39\\{output\_name},\39\|i,{}$\6 +\\{pk\_directory}${},\39\\{output\_name},\39\|i,\39\\{long\_extension}\?(% +\&{int})(\\{dpi\_x}*\\{magstep\_x}+\T{0.5}):\T{0},{}$\6 +\\{rm\_command}${},\39\\{output\_name},\39\|i);{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K\T{1};{}$ ${}\|i\Z\\{nmb\_files};{}$ ${}\|i\PP){}$\1\5 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\%s\ \%s\%02i.gf\ \%s\%s\%0}\)\.{2i.\%.0ipk\\n"}\6 +\.{"\%s\ \%s\%02i.gf\\n"}${},{}$\6 +\.{GFTOPK\_NAME}${},\39\\{output\_name},\39\|i,{}$\6 +\\{pk\_directory}${},\39\\{output\_name},\39\|i,\39\\{long\_extension}\?(% +\&{int})(\\{dpi\_x}*\\{magstep\_x}+\T{0.5}):\T{0},{}$\6 +\\{rm\_command}${},\39\\{output\_name},\39\|i);{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\7 +\&{if} (\\{tfm\_files})\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n"}\6 +\.{"\%s\ \%s.pl\ \%s.tfm\\n"}\6 +\.{"\%s\ \%s.pl\\n"}\6 +\.{"\\n"}${},{}$\6 +\.{PLTOTF\_NAME}${},\39\\{output\_name},\39\\{output\_name},{}$\6 +\\{rm\_command}${},\39\\{output\_name}){}$;\7 +\&{if} (\\{unicode})\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K(\\{min\_char}\GG\T{8}),\39\|j\K\T{0};{}$ ${}\|j<\\{nmb% +\_files};{}$ ${}\|i\PP,\39\|j\PP){}$\1\5 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\%s\ \%s.tfm\ \%s\%s\%02x.}\)\.{tfm\\n"}${},{}$\6 +\\{cp\_command}${},\39\\{output\_name},\39\\{tfm\_directory},\39\\{output% +\_name},\39\|i);{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K\T{1};{}$ ${}\|i\Z\\{nmb\_files};{}$ ${}\|i\PP){}$\1\5 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\%s\ \%s.tfm\ \%s\%s\%02i.}\)\.{tfm\\n"}${},{}$\6 +\\{cp\_command}${},\39\\{output\_name},\39\\{tfm\_directory},\39\\{output% +\_name},\39\|i);{}$\2\6 +\4${}\}{}$\2\7 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n"}\6 +\.{"\%s\ \%s.tfm"}${},{}$\6 +\\{rm\_command}${},\39\\{output\_name});{}$\6 +\4${}\}{}$\2\7 +\&{if} (\\{ofm\_file})\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{out},{}$\6 +\.{"\\n"}\6 +\.{"\%s\ \%s.ovp\ \%s.ovf\ \%s}\)\.{.ofm\\n"}\6 +\.{"\%s\ \%s.ovp\\n"}\6 +\.{"\\n"}${},{}$\6 +\.{OVP2OVF\_NAME}${},\39\\{output\_name},\39\\{output\_name},\39\\{output% +\_name},{}$\6 +\\{rm\_command}${},\39\\{output\_name});{}$\6 +\4${}\}{}$\2\7 +\\{fclose}(\\{out});\6 +\4${}\}{}$\2\par +\fi + +\N{1}{52}The configuration file. +Here is a list with all necessary keywords (and parameters): +\medskip +\halign{\quad\.{#}\hfil&\quad#\hfil\cr +hbf\_header & the HBF header file name of the input font(s). \cr +output\_name & the name stem of the output files. \cr +& Should be equal to the name of the configuration file +in most cases.\cr +& A running two digit decimal number starting with +\.{01} will be appended. \cr +& (For Unicode fonts see the keyword \.{unicode} +below.) \cr +} +\bigskip +And now all optional keywords: +\medskip +\halign{\quad\.{#}\hfil&\quad#\hfil\cr +x\_offset & increases the character width. \cr +& Will be applied on both sides; \cr +& default is the value given in the HBF header +(\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr +& scaled to \\{design\/}size (in pixels). \cr +y\_offset & shifts all characters up or down; \cr +& default is the value given in the HBF header +(\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr +& scaled to \\{design\/}size (in pixels). \cr +design\_size & the design size (in points) of the font. \cr +& \.{x\_offset} and \.{y\_offset} refer to this +size. \cr +& Default is \PB{\T{10.0}} \cr +target\_size & This command is obsolete now and will be +ignored.\cr +& \cr +slant & the slant of the font (given as $\Delta x / +\Delta y$). \cr +& Only values in the range \PB{$\T{0}\Z\\{slant}\Z\T{1}$} +are allowed. \cr +& Default is \PB{\T{0.0}} \cr +rotation & if set to `yes'. the glyphs are rotated +90~degrees counter-clockwise. \cr +& The default offsets as given in the HBF header +will be ignored (and set to~\PB{\T{0}}). \cr +& Default is `no'. \cr +& \cr +mag\_x & \cr +mag\_y & scaling values of the characters to reach +design size. \cr +& If only one magnification is given, x and y +values are assumed to be equal. \cr +& Default is \.{mag\_x} $=$ \.{mag\_y} $=$ \PB{\T{1.0}} +\cr +threshold & A value between \PB{\T{1}} and \PB{\T{254}} defining a +threshold for converting the internal \cr +& graymap into the output bitmap; lower values +cut more pixels. \cr +& Default value is \PB{\T{128}}. \cr +& \cr +comment & a comment describing the font; \cr +& default is none. \cr +& \cr +nmb\_fonts & the number of the fonts. \cr +& Default value is~\PB{${-}\T{1}$} for creating all +fonts. \cr +unicode & if `yes', a two digit hexadecimal number will +be used as a running number, \cr +& starting with the value of the first byte of +the first code range. \cr +& Default is `no'. \cr +min\_char & the minimum of the encoding range. \cr +& Specify this value if it is not identical to +the lowest code value \cr +& in the HBF file (to which it defaults). \cr +& \cr +dpi\_x & \cr +dpi\_y & the horizontal and vertical resolution (in +dpi) of the printer. \cr +& If only one resolution is given, x and y +values are assumed to be equal. \cr +& Default is \PB{\T{300}}. \cr +checksum & a checksum to identify the \.{GF} files +with the appropriate \.{TFM} files. \cr +& The default of this 32~bit unsigned integer +is \PB{\T{0}}. \cr +coding & a comment describing the coding scheme; \cr +& default is none. \cr +& \cr +pk\_directory & the destination directory of the +\.{PK} files; \cr +& default: none. \cr +& Attention! The batch file will not check +whether this directory exists. \cr +tfm\_directory & the destination directory of the +\.{TFM} files; \cr +& default: none. \cr +& Attention! The batch file will not check +whether this directory exists. \cr +pk\_files & whether to create \.{PK} files or not; \cr +& default is `yes'. \cr +tfm\_files & whether to create \.{TFM} files or not; \cr +& default is `yes'. \cr +ofm\_file & whether to create an \.{OFM} and an +\.{OVF} file or not; \cr +& default is `no'. \cr +long\_extension & if `yes', \.{PK} files will include the +resolution in the extension \cr +& (e.g. \.{gsso1201.300pk}). \cr +& This affects the batch file only (default is +`yes'). \cr +rm\_command & this shell command removes files; \cr +& default: `rm'. \cr +cp\_command & this shell command copies files; \cr +& default: `cp'. \cr +job\_extension & the extension of the batch file which calls +\.{GFtoPK} and \.{PLtoTF} \cr +& to convert the \.{GF} and the +\.{PL} files into \.{PK} and +\.{TFM} files; \cr +& default is none. \cr +} +\bigskip + +The searching algorithm (for the keywords) of \.{hbf2gf} is case +insensitive; it makes no difference whether you write for example \.{comment} +or \.{CommenT}. The keywords must start a line (be in the first column), and +the corresponding parameters must be on the same line with the keyword and +separated by at least one space or tabulator stop. Lines starting not with a +keyword are ignored. + +Key values \\{are} case sensitive (except \.{yes} and \.{no}). + +The default system dependent values are for \UNIX/-like operating systems; +if you use for example DOS, you must write +\medskip +\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr +long\_extension & no \cr +rm\_command & del \cr +cp\_command & copy \cr +job\_extension & .bat \cr +} +\medskip + +Both the values \PB{\\{pk\_output\_size\_x}} and \PB{\\{pk\_output\_size\_y}} +must not exceed +\PB{\.{MAX\_CHAR\_SIZE}}; \.{x\_offset} and \.{y\_offset} are related to the +design size (and not to the input size). + +In \mf-like mode, one \.{GF} file and one \.{PL} file will be computed +(depending on the command line options \.{-g} and \.{-p}), taking +\PB{\\{x\_resolution}} and \PB{\\{y\_scale}} from the command line. \.{nmb% +\_fonts} will +always be set to~\PB{\T{1}}; no job file will be created. + + +\fi + +\M{53} +\Y\B\4\D$\.{PRINTER\_MIN\_RES\_X}$ \5 +\T{50}\par +\B\4\D$\.{PRINTER\_MIN\_RES\_Y}$ \5 +\T{50}\par +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{char} ${}\\{Buffer}[\.{STRING\_LENGTH}+\T{1}]{}$;\par +\fi + +\M{54} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{read\_config}(\&{void});\par +\fi + +\M{55} +If \PB{\\{config\_file}} isn't found in \mf-like mode we assume that the font +isn't a HBF font at all. + +\Y\B\&{void} \\{read\_config}(\&{void})\1\1\2\2\6 +${}\{{}$\1\6 +\&{HBF\_BBOX} ${}{*}\\{boxp};{}$\6 +\&{char} ${}{*}\\{real\_config\_file};{}$\7 +\X56:Handle extension\X\7 +${}\\{real\_config\_file}\K\\{TeX\_search\_cfg\_file}(\\{config\_file});{}$\6 +\&{if} ${}(\R\\{real\_config\_file}){}$\5 +${}\{{}$\1\6 +\&{if} (\\{mf\_like})\5 +${}\{{}$\1\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{config\_file});{}$\2\6 +\\{exit}(\T{2});\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{config% +\_file});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\7 +\&{if} ${}(\R(\\{config}\K\\{fopen}(\\{real\_config\_file},\39\.{READ% +\_TXT}))){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\R\\{testing}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{config% +\_file});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{else}\C{ We reach this point only if no searching library is used }\6 +${}\{{}$\1\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ or\ op}\)\.{en\ `\%s'\\n"},\39% +\\{config\_file});{}$\2\6 +\\{exit}(\T{2});\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\7 +\&{if} (\\{testing})\5 +${}\{{}$\1\6 +\&{if} ${}(\R\\{quiet}){}$\1\5 +${}\\{printf}(\.{"\%s\\n"},\39\\{real\_config\_file});{}$\2\6 +\\{exit}(\T{0});\6 +\4${}\}{}$\2\6 +\X57:Necessary parameters\X\6 +\X59:Optional parameters\X\7 +\X61:Get code range\X\6 +\X63:Get sub code range\X\7 +\\{fclose}(\\{config});\6 +\4${}\}{}$\2\par +\fi + +\M{56} +Here we check whether we have to add an extension. + +\Y\B\4\X56:Handle extension\X${}\E{}$\6 +${}\{{}$\1\6 +\&{int} \|i${},{}$ \\{lastext}${}\K{-}\T{1};{}$\7 +\&{for} ${}(\|i\K\T{0};{}$ \\{config\_file}[\|i]; ${}\|i\PP){}$\1\6 +\&{if} ${}(\\{config\_file}[\|i]\E\.{'.'}){}$\1\5 +${}\\{lastext}\K\|i;{}$\2\6 +\&{else} \&{if} ${}(\\{config\_file}[\|i]\E\.{'/'}\V\\{config\_file}[\|i]\E% +\.{':'}\V\\{config\_file}[\|i]\E\.{'\\\\'}){}$\1\5 +${}\\{lastext}\K{-}\T{1}{}$;\2\2\7 +\&{if} ${}(\\{lastext}\E{-}\T{1}){}$\1\5 +${}\\{strcat}(\\{config\_file},\39\.{".cfg"});{}$\2\6 +\4${}\}{}$\2\par +\U55.\fi + +\M{57} +\Y\B\4\X57:Necessary parameters\X${}\E{}$\6 +${}\{{}$\1\6 +\&{char} ${}\\{hbf\_header}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}{*}\\{real\_hbf\_header};{}$\7 +\&{if} ${}(\R\\{fsearch}(\.{"hbf\_header"})){}$\1\5 +\\{config\_error}(\.{"hbf\_header"});\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{hbf\_header},\39\\{Buffer}){}$;\2\7 +${}\\{real\_hbf\_header}\K\\{TeX\_search\_hbf\_file}(\\{hbf\_header});{}$\6 +\&{if} ${}(\R\\{real\_hbf\_header}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{hbf% +\_header});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +${}\\{hbfDebug}\K\T{1}{}$;\C{ we activate error messages of the HBF API + while scanning the HBF header file }\7 +\&{if} ${}(\R(\\{hbf}\K\\{hbfOpen}(\\{real\_hbf\_header}))){}$\1\5 +\\{exit}(\T{1});\2\7 +${}\\{hbfDebug}\K\T{0}{}$;\7 +${}\\{boxp}\K\\{hbfBitmapBBox}(\\{hbf});{}$\6 +${}\\{input\_size\_x}\K\\{boxp}\MG\\{hbf\_height}{}$;\C{ will be checked later +for rotation }\6 +${}\\{input\_size\_y}\K\\{boxp}\MG\\{hbf\_width};{}$\6 +${}\\{font\_encoding}\K\\{hbfProperty}(\\{hbf},\39\.{"HBF\_CODE\_SCHEME"}){}$;\7 +\&{if} ${}(\R\\{fsearch}(\.{"output\_name"})){}$\1\5 +\\{config\_error}(\.{"output\_name"});\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{output\_name},\39\\{Buffer});{}$\2\6 +\4${}\}{}$\2\par +\U55.\fi + +\M{58} +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{int} \\{offset\_x};\6 +\&{int} \\{offset\_y};\7 +\&{HBF\_CHAR} \\{user\_min\_char};\6 +\&{int} \\{have\_min\_char}${}\K\.{FALSE}{}$;\par +\fi + +\M{59} +\Y\B\4\X59:Optional parameters\X${}\E{}$\6 +${}\{{}$\1\6 +\&{if} (\\{fsearch}(\.{"nmb\_files"}))\1\5 +${}\\{nmb\_files}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{if} (\\{fsearch}(\.{"unicode"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 +${}\\{unicode}\K\.{TRUE};{}$\2\2\6 +\&{if} (\\{fsearch}(\.{"min\_char"}))\5 +${}\{{}$\1\6 +${}\\{user\_min\_char}\K\\{strtoul}(\\{Buffer},\39{}$(\&{char} ${}{*}{*}){}$ +${}\NULL,\39\T{0});{}$\6 +${}\\{have\_min\_char}\K\.{TRUE};{}$\6 +\4${}\}{}$\2\7 +\&{if} ${}(\R\\{mf\_like}){}$\5 +${}\{{}$\1\6 +\&{if} (\\{fsearch}(\.{"pk\_files"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 +${}\\{pk\_files}\K\.{FALSE};{}$\2\2\6 +\&{if} (\\{fsearch}(\.{"tfm\_files"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 +${}\\{tfm\_files}\K\.{FALSE};{}$\2\2\6 +\&{if} (\\{fsearch}(\.{"ofm\_file"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 +${}\\{ofm\_file}\K\.{TRUE};{}$\2\2\6 +\&{if} (\\{fsearch}(\.{"long\_extension"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 +${}\\{long\_extension}\K\.{FALSE};{}$\2\2\6 +\4${}\}{}$\2\7 +\&{if} (\\{fsearch}(\.{"slant"}))\1\5 +${}\\{slant}\K\\{atof}(\\{Buffer});{}$\2\6 +\&{if} ${}(\\{slant}<\T{0.0}\V\\{slant}>\T{1.0}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ slant\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} (\\{fsearch}(\.{"rotation"}))\1\6 +\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 +${}\\{rotation}\K\.{TRUE}{}$;\2\2\7 +\&{if} (\\{fsearch}(\.{"mag\_x"}))\1\5 +${}\\{mag\_x}\K\\{atof}(\\{Buffer});{}$\2\6 +\&{if} (\\{fsearch}(\.{"mag\_y"}))\1\5 +${}\\{mag\_y}\K\\{atof}(\\{Buffer});{}$\2\6 +\&{if} ${}(\R\\{mag\_x}\W\R\\{mag\_y}){}$\5 +${}\{{}$\1\6 +${}\\{mag\_x}\K\T{1.0};{}$\6 +${}\\{mag\_y}\K\T{1.0};{}$\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{mag\_x}\W\R\\{mag\_y}){}$\1\5 +${}\\{mag\_y}\K\\{mag\_x};{}$\2\6 +\&{if} ${}(\\{mag\_y}\W\R\\{mag\_x}){}$\1\5 +${}\\{mag\_x}\K\\{mag\_y};{}$\2\6 +\&{if} ${}(\\{mag\_x}\Z\T{0.0}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{magnification% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{mag\_y}\Z\T{0.0}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ ma}\)\.{gnification% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{if} (\\{fsearch}(\.{"dpi\_x"}))\1\5 +${}\\{dpi\_x}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{if} (\\{fsearch}(\.{"dpi\_y"}))\1\5 +${}\\{dpi\_y}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{if} ${}(\R\\{dpi\_x}\W\R\\{dpi\_y}){}$\5 +${}\{{}$\1\6 +${}\\{dpi\_x}\K\T{300};{}$\6 +${}\\{dpi\_y}\K\T{300};{}$\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{dpi\_x}\W\R\\{dpi\_y}){}$\1\5 +${}\\{dpi\_y}\K\\{dpi\_x};{}$\2\6 +\&{if} ${}(\\{dpi\_y}\W\R\\{dpi\_x}){}$\1\5 +${}\\{dpi\_x}\K\\{dpi\_y};{}$\2\6 +\&{if} ${}(\\{dpi\_x}\Z\.{PRINTER\_MIN\_RES\_X}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{printer\ resolution% +\\n}\)\.{"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\\{dpi\_y}\Z\.{PRINTER\_MIN\_RES\_Y}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ pr}\)\.{inter\ resolution% +\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{if} (\\{fsearch}(\.{"design\_size"}))\1\5 +${}\\{design\_size}\K\\{atof}(\\{Buffer}){}$;\2\7 +\&{if} (\\{fsearch}(\.{"x\_offset"}))\1\5 +${}\\{offset\_x}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{else}\1\5 +${}\\{offset\_x}\K\\{rotation}\?\T{0}:(\\{boxp}\MG\\{hbf\_xDisplacement}*\\{mag% +\_x}+\T{0.5});{}$\2\6 +\&{if} (\\{fsearch}(\.{"y\_offset"}))\1\5 +${}\\{offset\_y}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{else}\1\5 +${}\\{offset\_y}\K\\{rotation}\?\T{0}:(\\{boxp}\MG\\{hbf\_yDisplacement}*\\{mag% +\_y}+\T{0.5});{}$\2\6 +\&{if} ${}(\R\\{fsearch}(\.{"comment"})){}$\1\5 +${}\\{comment}[\T{0}]\K\.{'\\0'};{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{comment},\39\\{Buffer}){}$;\2\7 +\&{if} (\\{fsearch}(\.{"threshold"}))\1\5 +${}\\{threshold}\K\\{atoi}(\\{Buffer});{}$\2\6 +\&{if} ${}(\\{threshold}\Z\T{0}\V\\{threshold}\G\T{255}){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ threshold\\n}\)\.{"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\7 +\&{if} ${}(\R\\{fsearch}(\.{"checksum"})){}$\1\5 +${}\\{checksum}\K\T{0};{}$\2\6 +\&{else}\1\5 +${}\\{checksum}\K\\{strtoul}(\\{Buffer},\39{}$(\&{char} ${}{*}{*}){}$ ${}\NULL,% +\39\T{0}){}$;\2\7 +\&{if} ${}(\R\\{fsearch}(\.{"coding"})){}$\1\5 +${}\\{coding}[\T{0}]\K\.{'\\0'};{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{coding},\39\\{Buffer}){}$;\2\7 +\&{if} ${}(\R\\{fsearch}(\.{"pk\_directory"})){}$\1\5 +${}\\{pk\_directory}[\T{0}]\K\.{'\\0'};{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{pk\_directory},\39\\{Buffer}){}$;\2\7 +\&{if} ${}(\R\\{fsearch}(\.{"tfm\_directory"})){}$\1\5 +${}\\{tfm\_directory}[\T{0}]\K\.{'\\0'};{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{tfm\_directory},\39\\{Buffer}){}$;\2\7 +\&{if} (\\{fsearch}(\.{"rm\_command"}))\1\5 +${}\\{strcpy}(\\{rm\_command},\39\\{Buffer});{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{rm\_command},\39\.{"rm"}){}$;\2\7 +\&{if} (\\{fsearch}(\.{"cp\_command"}))\1\5 +${}\\{strcpy}(\\{cp\_command},\39\\{Buffer});{}$\2\6 +\&{else}\1\5 +${}\\{strcpy}(\\{cp\_command},\39\.{"cp"}){}$;\2\7 +\&{if} ${}(\R\\{fsearch}(\.{"job\_extension"})){}$\1\5 +${}\\{job\_extension}[\T{0}]\K\.{'\\0'};{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}\\{strncpy}(\\{job\_extension},\39\\{Buffer},\39\.{EXTENSION\_LENGTH});{}$\6 +${}\\{job\_extension}[\.{EXTENSION\_LENGTH}]\K\.{'\\0'};{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\par +\U55.\fi + +\M{60} +The function \PB{\\{hbfGetCodeRange}(\,)} is an extension to the HBF API. + +Successive calls return the code ranges in ascending order; we only need the +extrema of the whole code range. + +In case \PB{\\{min\_char}} has been supplied in the configuration file, we use +that +value instead. + +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{HBF\_CHAR} \\{min\_char}${},{}$ \\{max\_char};\par +\fi + +\M{61} +\Y\B\4\X61:Get code range\X${}\E{}$\6 +${}\{{}$\1\6 +\&{const} \&{void} ${}{*}\\{cp};{}$\6 +\&{HBF\_CHAR} \\{dummy};\7 +${}\\{cp}\K\\{hbfGetCodeRange}(\\{hbf},\39\NULL,\39{\AND}\\{min\_char},\39{% +\AND}\\{max\_char});{}$\6 +\&{for} ( ; ${}\\{cp}\I\NULL;{}$ ${}\\{cp}\K\\{hbfGetCodeRange}(\\{hbf},\39% +\\{cp},\39{\AND}\\{dummy},\39{\AND}\\{max\_char})){}$\1\5 +;\2\7 +\&{if} (\\{have\_min\_char})\1\5 +${}\\{min\_char}\K\\{user\_min\_char};{}$\2\6 +\4${}\}{}$\2\par +\U55.\fi + +\M{62} +The function \PB{\\{hbfGetByte2Range}(\,)} is an extension to the HBF API. + +Successive calls return the byte~2 ranges in ascending order. We raise +\PB{\.{VALID\_SUBCODE}} in the array \PB{\\{b2\_codes}[\,]} for all characters +in subcode +ranges. + +\Y\B\4\D$\.{VALID\_SUBCODE}$ \5 +\T{1}\par +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{char} \\{b2\_codes}[\T{256}];\6 +\&{unsigned} \&{char} \\{min\_2\_byte}${},{}$ \\{max\_2\_byte};\6 +\&{int} \\{nmb\_2\_bytes}${}\K\T{0}{}$;\par +\fi + +\M{63} +\Y\B\4\X63:Get sub code range\X${}\E{}$\6 +${}\{{}$\1\6 +\&{const} \&{void} ${}{*}\\{b2r};{}$\6 +\&{unsigned} \&{char} \\{dummy};\6 +\&{int} \|i;\7 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP){}$\1\5 +${}\\{b2\_codes}[\|i]\K\T{0}{}$;\2\7 +${}\\{b2r}\K\\{hbfGetByte2Range}(\\{hbf},\39\NULL,\39{\AND}\\{min\_2\_byte},% +\39{\AND}\\{max\_2\_byte});{}$\6 +${}\\{dummy}\K\\{min\_2\_byte};{}$\6 +\&{for} ( ; ${}\\{b2r}\I\NULL;{}$ ${}\\{b2r}\K\\{hbfGetByte2Range}(\\{hbf},\39% +\\{b2r},\39{\AND}\\{dummy},\39{\AND}\\{max\_2\_byte})){}$\5 +${}\{{}$\1\6 +\&{for} ${}(\|i\K\\{dummy};{}$ ${}\|i\Z\\{max\_2\_byte};{}$ ${}\|i\PP){}$\1\5 +${}\\{b2\_codes}[\|i]\K\.{VALID\_SUBCODE};{}$\2\6 +\4${}\}{}$\2\7 +\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP{}$)\C{ compute the +number of valid \PB{\\{b2\_codes}} }\1\6 +\&{if} ${}(\\{b2\_codes}[\|i]\E\.{VALID\_SUBCODE}){}$\1\5 +${}\\{nmb\_2\_bytes}\PP;{}$\2\2\6 +\4${}\}{}$\2\par +\U55.\fi + +\M{64} +This search routine is case insignificant. Each keyword must start a line; +the function checks whether the character before the keyword is a newline +character (\PB{\.{'\\n'}}). It also checks the presence of a parameter and +fills +\PB{\\{Buffer}} if existent. \PB{\\{fsearch}(\,)} returns~1 on success. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{int} \\{fsearch}(\&{const} \&{char} ${}{*}){}$;\par +\fi + +\M{65} +\Y\B\&{int} \\{fsearch}(\&{const} \&{char} ${}{*}\\{search\_string}){}$\1\1\2\2% +\6 +${}\{{}$\1\6 +\&{char} ${}{*}\|P,{}$ \|p;\6 +\&{const} \&{char} ${}{*}\|Q;{}$\6 +\&{char} ${}\\{temp\_buffer}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}\\{env\_name}[\.{STRING\_LENGTH}+\T{1}];{}$\6 +\&{char} ${}{*}\\{env\_p};{}$\6 +\&{char} ${}{*}\\{env\_value};{}$\6 +\&{char} ${}{*}\\{Buf\_p};{}$\6 +\&{int} \\{Ch}${},{}$ \\{ch}${},{}$ \\{old\_ch}${}\K\.{'\\n'};{}$\6 +\&{int} \\{count}${}\K\.{STRING\_LENGTH};{}$\7 +\\{rewind}(\\{config});\C{ we start at offset~0 }\7 +\&{do}\5 +${}\{{}$\1\6 +${}\|Q\K\\{search\_string};{}$\6 +${}\|p\K\\{tolower}({*}\|Q);{}$\6 +${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 +${}\\{ch}\K\\{tolower}(\\{Ch});{}$\6 +\&{while} ${}(\R(\\{ch}\E\|p\W\\{old\_ch}\E\.{'\\n'})\W\\{Ch}\I\.{EOF}{}$)\C{ +search first character of \PB{\\{search\_string}}; + \PB{\.{'\\n'}} must be the character before }\6 +${}\{{}$\1\6 +${}\\{old\_ch}\K\\{ch};{}$\6 +${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 +${}\\{ch}\K\\{tolower}(\\{Ch});{}$\6 +\4${}\}{}$\2\7 +\&{for} ( ; ; \,)\5 +${}\{{}$\1\6 +\&{if} ${}({*}(\PP\|Q)\E\.{'\\0'}){}$\1\6 +\&{if} ${}((\\{Ch}\K\\{fgetc}(\\{config}))\E\.{'\ '}\V\\{Ch}\E\.{'\\t'}{}$)\C{ +there must be a space or a tab stop after the keyword }\1\6 +\&{goto} \\{success};\2\2\6 +${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 +\&{if} ${}(\\{tolower}(\\{Ch})\I\\{tolower}({*}\|Q)){}$\1\5 +\&{break};\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\5 +\&{while} ${}(\\{Ch}\I\.{EOF}){}$;\7 +\&{return} \T{0};\7 +\4\\{success}:\5 +${}\|P\K\\{temp\_buffer}{}$;\7 +\&{while} ${}((\\{Ch}\K\\{fgetc}(\\{config}))\E\.{'\ '}\V\\{Ch}\E\.{'\\t'}{}$)% +\C{ remove leading blanks and tabs }\1\6 +;\2\6 +\&{while} ${}(\\{Ch}\I\.{'\\n'}\W\MM\\{count}>\T{0}\W\\{Ch}\I\.{EOF}{}$)\C{ +fill \PB{\\{Buffer}} }\6 +${}\{{}$\1\6 +${}{*}\|P\PP\K\\{Ch};{}$\6 +${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 +\4${}\}{}$\2\6 +${}{*}\|P\K\.{'\\0'}{}$;\7 +\&{if} ${}({*}\\{temp\_buffer}){}$\1\5 +\X66:Check for environment variables\X\2\6 +\&{else}\1\5 +${}{*}\\{Buffer}\K\.{'\\0'}{}$;\2\7 +\&{return} ${}({*}\\{Buffer})\?\T{1}:\T{0}{}$;\C{ is there something in the +buffer? }\6 +\4${}\}{}$\2\par +\fi + +\M{66} +To make the configuration file more flexible we allow environment variables +in the arguments. We scan the parameter stored in \PB{\\{temp\_buffer}} whether +it +contains a `\.{\$}' character. If yes, the following code fragment tries to +get an environment variable name whose value will be then fetched with +\PB{\\{getenv}(\,)}. An environment variable name recognized by \.{hbf2gf} must +start +with a letter or underscore; the other characters may be alphanumeric or an +underscore. You can surround the environment variable name with braces to +indicate where the name ends, e.g. \.{\$\{FOO\}}. The interpolated +configuration parameter will be truncated to \PB{\.{STRING\_LENGTH}} +characters. If +you want to have `\.{\$}' you must write `\.{\$\$}'. + +Note that you should avoid to use such environment variables for specifying +the location of the configuration file in case you have support for a file +searching library like kpathsea. Its primary aim is to specify the target +directories for the \.{pk\_directory} and the \.{tfm\_directory} keywords. + +\Y\B\4\X66:Check for environment variables\X${}\E{}$\6 +${}\{{}$\1\6 +${}\|P\K\\{temp\_buffer};{}$\6 +${}\\{Buf\_p}\K\\{Buffer};{}$\6 +${}\\{count}\K\.{STRING\_LENGTH}-\T{1}{}$;\7 +\&{while} ${}({*}\|P\W\\{count}>\T{0}){}$\5 +${}\{{}$\1\6 +${}\\{env\_p}\K\\{env\_name}{}$;\7 +\&{if} ${}({*}\|P\E\.{'\$'}){}$\5 +${}\{{}$\1\6 +${}\|P\PP;{}$\6 +\&{if} ${}({*}\|P\E\.{'\$'}){}$\5 +${}\{{}$\1\6 +${}{*}(\\{Buf\_p}\PP)\K{*}(\|P\PP);{}$\6 +${}\\{count}\MM;{}$\6 +\&{continue};\6 +\4${}\}{}$\2\6 +\&{while} ${}({*}\|P\E\.{'\{'}){}$\1\5 +${}\|P\PP;{}$\2\6 +\&{if} ${}(\R(\\{isalpha}({*}\|P)\V{*}\|P\E\.{'\_'})){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},{}$\6 +\.{"Invalid\ environment}\)\.{\ variable\ name\ in\ co}\)\.{nfiguration\ file% +\\n"});\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +${}{*}(\\{env\_p}\PP)\K{*}(\|P\PP);{}$\6 +\&{while} ${}({*}\|P){}$\5 +${}\{{}$\1\6 +\&{if} ${}(\\{isalnum}({*}\|P)\V{*}\|P\E\.{'\_'}){}$\1\5 +${}{*}(\\{env\_p}\PP)\K{*}(\|P\PP);{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +\&{while} ${}({*}\|P\E\.{'\}'}){}$\1\5 +${}\|P\PP;{}$\2\6 +${}{*}\\{env\_p}\K\.{'\\0'};{}$\6 +\&{break};\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\7 +${}\\{env\_value}\K\\{getenv}(\\{env\_name});{}$\6 +\&{if} (\\{env\_value})\C{ append the environment value to \PB{\\{Buffer}} }\6 +${}\{{}$\1\6 +\&{while} ${}({*}\\{env\_value}\W\\{count}>\T{0}){}$\5 +${}\{{}$\1\6 +${}{*}(\\{Buf\_p}\PP)\K{*}(\\{env\_value}\PP);{}$\6 +${}\\{count}\MM;{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +\&{else}\5 +${}\{{}$\1\6 +${}{*}(\\{Buf\_p}\PP)\K{*}(\|P\PP);{}$\6 +${}\\{count}\MM;{}$\6 +\4${}\}{}$\2\6 +\4${}\}{}$\2\6 +${}{*}\\{Buf\_p}\K\.{'\\0'};{}$\6 +\4${}\}{}$\2\par +\U65.\fi + +\M{67} +If an error occurs, \PB{\\{config\_error}(\,)} will leave the program with an +error +message. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{void} \\{config\_error}(\&{const} \&{char} ${}{*}){}$;\par +\fi + +\M{68} +\Y\B\&{void} \\{config\_error}(\&{const} \&{char} ${}{*}\\{message}){}$\1\1\2\2% +\6 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\ }\)\.{entry\ in\ +configurati}\)\.{on\ file\\n"},\39\\{message});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\par +\fi + +\N{1}{69}File searching. + +We support three searching engines: emtexdir, kpathsea, and MiKTeX (which is +a Win32 port of kpathsea). For emtexdir, define \PB{\.{HAVE\_EMTEXDIR}} while +compiling. For kpathsea, define \PB{\.{HAVE\_LIBKPATHSEA}}. For MikTeX, define +\PB{\.{HAVE\_MIKTEX}}. If none of these macros is defined, a simple \PB{% +\\{fopen}(\,)} will +be used instead. + +\Y\B\4\X10:Include files\X${}\mathrel+\E{}$\6 +\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 +\8\#\&{include} \.{"kpathsea/kpathsea.h}\)\.{"}\6 +\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 +\8\#\&{include} \.{"emtexdir.h"}\6 +\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\6 +\8\#\&{include} \.{"miktex.h"}\6 +\8\#\&{endif}\par +\fi + +\M{70} +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\8\#\&{if} \&{defined} (\.{HAVE\_EMTEXDIR})\6 +\&{char} \\{emtex\_version\_string}[\,]${}\K\.{"emTeXdir"};{}$\6 +\8\#\&{elif} ${}\R{}$\&{defined} (\.{HAVE\_MIKTEX})\6 +\&{char} \\{no\_version\_string}[\,]${}\K\.{"no\ search\ library"};{}$\6 +\8\#\&{endif}\par +\fi + +\M{71} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{const} \&{char} ${}{*}\\{TeX\_search\_version}(\&{void}){}$;\par +\fi + +\M{72} +\Y\B\&{const} \&{char} ${}{*}\\{TeX\_search\_version}(\&{void}){}$\1\1\2\2\6 +${}\{{}$\6 +\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\1\6 +\&{return} \\{kpathsea\_version\_string};\6 +\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 +\&{return} \\{emtex\_version\_string};\6 +\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\7 +\&{char} \\{buf}[\T{200}];\7 +${}\\{strcpy}(\\{buf},\39\.{"MiKTeX\ "});{}$\6 +${}\\{miktex\_get\_miktex\_version\_string\_ex}(\\{buf}+\T{7},\39{}$\&{sizeof} +(\\{buf})${}-\T{7});{}$\6 +\&{return} \\{buf};\6 +\8\#\&{else}\6 +\&{return} \\{no\_version\_string};\6 +\8\#\&{endif}\6 +\4${}\}{}$\2\par +\fi + +\M{73} +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 +\&{struct} \&{emtex\_dir} \\{cfg\_path}${},{}$ \\{hbf\_path};\6 +\8\#\&{endif}\par +\fi + +\M{74} +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 +\&{extern} \&{int} \\{setup\_list}(\&{struct} \&{emtex\_dir} ${}{*},\39{}$% +\&{char} ${}{*},\39{}$\&{const} \&{char} ${}{*},\39\&{unsigned});{}$\6 +\&{int} \\{dir\_setup}(\&{struct} \&{emtex\_dir} ${}{*},\39{}$\&{const} % +\&{char} ${}{*},\39{}$\&{const} \&{char} ${}{*},\39\&{unsigned});{}$\6 +\&{char} ${}{*}{}$\\{file\_find}(\&{char} ${}{*},\39{}$\&{struct} \&{emtex% +\_dir} ${}{*});{}$\6 +\8\#\&{endif}\par +\fi + +\M{75} +We slightly modify \PB{\\{emtex\_dir\_setup}(\,)} (from the file % +\.{emtexdir.c}) to +output a warning in case the environment variable \PB{\\{env}} isn't set +properly. + +\Y\B\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 +\&{int} ${}\\{dir\_setup}(\\{ed},\39\\{env},\39\\{dir},\39\\{flags}){}$\1\1\6 +\&{struct} \&{emtex\_dir} ${}{*}\\{ed};{}$\6 +\&{const} \&{char} ${}{*}\\{env};{}$\6 +\&{const} \&{char} ${}{*}\\{dir};{}$\6 +\&{unsigned} \\{flags};\2\2\6 +${}\{{}$\1\6 +\&{const} \&{char} ${}{*}\\{val};{}$\6 +\&{char} \\{path}[\T{260}];\7 +${}\\{ed}\MG\\{alloc}\K\T{0};{}$\6 +${}\\{ed}\MG\\{used}\K\T{0};{}$\6 +${}\\{ed}\MG\\{list}\K\NULL{}$;\7 +\&{if} ${}(\\{env}\I\NULL\W(\\{val}\K\\{getenv}(\\{env}))\I\NULL){}$\1\5 +\&{return} \\{setup\_list}${}(\\{ed},\39\\{path},\39\\{val},\39\\{flags});{}$\2% +\6 +\&{else}\1\5 +${}\\{fprintf}(\\{stderr},\39\.{"Environment\ variabl}\)\.{e\ `\%s'\ not\ set;\ +use\ }\)\.{current\ directory\\n"},\39\\{env}){}$;\2\7 +\&{return} \.{TRUE};\6 +\4${}\}{}$\2\par +\fi + +\M{76} +\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 +\&{char} ${}\\{name\_buffer}[\.{FILE\_NAME\_LENGTH}+\T{1}]{}$;\par +\fi + +\M{77} +\Y\B\&{char} ${}{*}\\{file\_find}(\\{name},\39\\{list}){}$\1\1\6 +\&{char} ${}{*}\\{name};{}$\6 +\&{struct} \&{emtex\_dir} ${}{*}\\{list};\2\2{}$\6 +${}\{{}$\1\6 +\&{if} ${}(\\{emtex\_dir\_find}(\\{name\_buffer},\39{}$\&{sizeof} (\\{name% +\_buffer})${},\39\\{list},\39\\{name},\39\.{EDF\_CWD})){}$\1\5 +\&{return} \\{name\_buffer};\2\7 +\&{return} ${}\NULL;{}$\6 +\4${}\}{}$\2\6 +\8\#\&{endif}\par +\fi + +\M{78} +For emtexdir we use the environment variables \.{HBFCFG} and \.{HBFONTS} for +configuration resp.\ HBF header files. + +\Y\B\4\X78:Initialize \TeX\ file searching\X${}\E{}$\6 +\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 +$\\{kpse\_set\_program\_name}(\\{argv}[\T{0}],\39\.{"hbf2gf"});{}$\6 +${}\\{kpse\_init\_prog}(\.{"HBF2GF"},\39\T{300},\39\.{"cx"},\39\.{"cmr10"}){}$;% +\7 +\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 +\&{if} ${}(\R\\{dir\_setup}({\AND}\\{cfg\_path},\39\.{"HBFCFG"},\39\NULL,\39% +\.{EDS\_BANG})){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ setup\ sear}\)\.{ch\ path\ for\ +configur}\)\.{ation\ files\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\&{if} ${}(\R\\{dir\_setup}({\AND}\\{hbf\_path},\39\.{"HBFONTS"},\39\NULL,\39% +\.{EDS\_BANG})){}$\5 +${}\{{}$\1\6 +${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ setup\ sear}\)\.{ch\ path\ for\ HBF\ +head}\)\.{er\ files\\n"});{}$\6 +\\{exit}(\T{1});\6 +\4${}\}{}$\2\6 +\8\#\&{endif}\par +\U4.\fi + +\M{79} +Finally, here are the searching routines. A special format in the kpathsea +library for fonts which are neither PostScript nor TrueType (\.{MISCFONTS}) +is available with version~3.3 and newer. For older versions we use the path +for PostScript fonts (\.{T1FONTS}) to find HBF files. Configuration files +are searched in the path specified within \.{TEXCONFIG} for old kpathsea +versions, and within \.{HBF2GFINPUTS} for new versions. + +\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 +\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*});{}$\6 +\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}){}$;\par +\fi + +\M{80} +\Y\B\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 +\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{kpse\_find\_file}${}(\\{name},\39\\{kpse\_program\_text\_format},% +\39\.{TRUE});{}$\6 +\4${}\}{}$\2\7 +\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{kpse\_find\_file}${}(\\{name},\39\\{kpse\_miscfonts\_format},\39% +\.{TRUE});{}$\6 +\4${}\}{}$\2\7 +\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\7 +\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{file\_find}${}(\\{name},\39{\AND}\\{cfg\_path});{}$\6 +\4${}\}{}$\2\7 +\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{file\_find}${}(\\{name},\39{\AND}\\{hbf\_path});{}$\6 +\4${}\}{}$\2\7 +\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\7 +\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{char} \\{result}[\.{\_MAX\_PATH}];\7 +\&{if} ${}(\R\\{miktex\_find\_input\_file}(\.{"hbf2gf"},\39{*}\\{name},\39% +\\{result})){}$\1\5 +\&{return} \T{0};\2\6 +\&{return} \\{strdup}(\\{result});\6 +\4${}\}{}$\2\7 +\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{char} \\{result}[\.{\_MAX\_PATH}];\7 +\&{if} ${}(\R\\{miktex\_find\_miscfont\_file}({*}\\{name},\39\\{result})){}$\1\5 +\&{return} \T{0};\2\6 +\&{return} \\{strdup}(\\{result});\6 +\4${}\}{}$\2\7 +\8\#\&{else}\7 +\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{name};\6 +\4${}\}{}$\2\7 +\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% +\2\6 +${}\{{}$\1\6 +\&{return} \\{name};\6 +\4${}\}{}$\2\6 +\8\#\&{endif}\par +\fi + +\N{1}{81}An example. +This is the example configuration file \.{b5so12.cfg} (for use with DOS or +OS/2 and the emtexdir searching engine): +\bigskip +\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr +hbf\_header & et24.hbf \cr +mag\_x & 2.076 \cr +x\_offset & 3 \cr +y\_offset & -8 \cr +comment & fanti songti 24x24 pixel font scaled and +adapted to 12 pt \cr +& \cr +design\_size & 12.0 \cr +& \cr +nmb\_fonts & -1 \cr +& \cr +output\_name & b5so12 \cr +& \cr +dpi\_x & 300 \cr +checksum & 123456789 \cr +coding & codingscheme Big 5 encoded TeX text \cr +& \cr +long\_extension & no \cr +job\_extension & .cmd \cr +rm\_command & del \cr +cp\_command & copy \cr +pk\_directory & \$HBF\_TARGET\\pk\\360dpi\\ \cr +tfm\_directory & \$HBF\_TARGET\\tfm\\ \cr +} +\bigskip +If you say e.g. +\medskip +\quad \.{set HBF\_TARGET=c:\\emtex\\texfonts} +\medskip +on your DOS prompt (or in your \.{autoexec.bat} file), then the interpolated +value of the \.{tfm\_directory} keyword is \.{c:\\emtex\\texfonts\\tfm\\}. +The HBF header file \.{et24.hbf} will be searched in the path specified by +the \.{HBFCFG} environment variable. +\bigskip +The call +\medskip +\quad \.{hbf2gf b5so12.cfg} +\medskip +creates the files +\medskip +\quad \.{b5so1201.gf}, \.{b5so1202.gf}, $\ldots$ , \.{b5so1255.gf}, +\.{b5so12.pl}, and \.{b5so12.cmd} +\bigskip +After calling +\medskip +\quad \.{b5so12.cmd} +\medskip +you will find the \.{PK} files in the +\.{c:\\emtex\\texfonts\\pk\\360dpi} directory and the \.{TFM} files in +the \.{c:\\emtex\\texfonts\\tfm} directory; all \.{GF} files and +\.{b5so12.pl} will be deleted. +\bigskip +The call +\medskip +\quad \.{hbf2gf -n b5so1220 417} +\medskip +creates two files: +\medskip +\quad \.{b5so1220.gf} and \.{b5so1220.pl} +\medskip +using the configuration file \.{b5so12.cfg}. The \.{GF} file would be +named \.{b5so1220.417gf} if the flag \.{-n} had not been used. + +\medskip + +It is possible to convert bitmap fonts to \.{PK} files almost +automatically. The HBF header file already has the entry +\.{HBF\_BITMAP\_BOUNDING\_BOX} which defines vertical and horizontal offsets +(in pixels), but these values are not in all cases optimal. If you omit +\.{x\_offset} and \.{y\_offset} in the configuration file, the third and +fourth parameter of \.{HBF\_BITMAP\_BOUNDING\_BOX} is used, scaled to design +size (to say it in other words: \.{x\_offset} and \.{y\_offset} will always +apply to the design size to be synchronous with the \.{TFM} files). + +Don't confuse scaling and magnification: Scaling here means that you choose +a (arbitrary) design size and compute scaling values (\.{mag\_x} and +\.{mag\_y}) which scales the bitmap to this particular design size at a +certain (arbitrarily chosen) resolution (\.{dpi\_x} and \.{dpi\_y}). +Magnification means that the scaled bitmap will be then magnified to a +certain target size while still using the font parameters (i.e., the +\.{TFM} file) of the design size. + +In the sample, you have a $24 \times 24$ bitmap font which will be scaled to +$12\,\hbox{pt}$ having a resolution of $300\,\hbox{dpi}$: +\medskip +\quad $1\,\hbox{pt}$ are $300 / 72.27 = 4.1511$ pixel; + +\quad $12\,\hbox{pt}$ are $4.1511 * 12 = 49.813$ pixel; + +\quad thus the theoretical scaling value is $49.813 / 24 = 2.076$. + +\medskip + +But especially for small sizes, this may not be the best value if the font +should harmonize with, say, Knuth's Computer Modern fonts. I recommend to +compute, say, 5~\.{PK} fonts, then check the CJK font with different \TeX\ +fonts to see whether the offsets and/or the scaling value is good. The +greater the design size the finer you can control the offsets---as an +example you could use a design size of $30\,\hbox{pt}$ (nevertheless there +is a compile-time constant \PB{\.{MAX\_CHAR\_SIZE}} which limits the maximal +character size; default is 255~pixels). + +If you have found optimal offsets, you can produce many different +magnifications of the CJK font using the same set of \.{TFM} files +analogous to ordinary \TeX\ fonts; as a simplification, we assume that +\.{PK} files with a resolution of $300\,\hbox{dpi}$ and a design size of +$10\,\hbox{pt}$ have the extension `\.{.300pk}' (respectively come into a +`\.{300dpi}' subdirectory)---this is the reason why in the above example for +the $12\,\hbox{pt}$ design size a `\.{360dpi}' target directory has been +used. Now we can use the following formula: + +$$ \\{needed\_dpi} = \\{your\_horizontal\_resolution} * +{\\{your\_target\_size} \over 10.0} $$ + +Example: assuming that your printer has a resolution of +$300\times400\,\hbox{dpi}$, and you want $14.4\,\hbox{pt}$: + +$$ 300 * {14.4 \over 10.0} = 432 $$ + +The vertical scaling value is $400 / 300 = 1.3333$. Use these values now to +call \.{hbf2gf} in \mf-like mode: + +\quad \.{hbf2gf b5so1220 432 1.3333} + + + +\fi + +\N{1}{82}Index. +\fi + +\inx +\fin +\con diff --git a/Build/source/texk/cjkutils/hbf2gf/Makefile.am b/Build/source/texk/cjkutils/hbf2gf/Makefile.am deleted file mode 100644 index 4137e3977d1..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/Makefile.am +++ /dev/null @@ -1,63 +0,0 @@ -## Makefile.am for the TeX Live subdirectory texk/cjkutils/hbf2gf/ -## -## Copyright (C) 2009 Peter Breitenlohner -## You may freely use, modify and/or distribute this file. -## -INCLUDES = $(KPATHSEA_INCLUDES) -AM_CPPFLAGS = -Dunix -DHAVE_LIBKPATHSEA $(XX_CPPFLAGS) -AM_CFLAGS = $(XX_CFLAGS) - -bin_PROGRAMS = hbf2gf - -hbf2gf_SOURCES = \ - hbf.c \ - hbf.h \ - hbf2gf.c - -CWEB_SRC = hbf2gf.w -CWEB_TEX = hbf2gf.tex hbf2gf.idx hbf2gf.scn -CWEB_DVI = hbf2gf.dvi - -hbf2gf_DEPENDENCIES = $(KPATHSEA_DEPEND) - -LDADD = $(KPATHSEA_LIBS) - -## Rebuild libkpathsea -@KPATHSEA_RULE@ - -dist_man1_MANS = hbf2gf.1 - -EXTRA_DIST = $(CWEB_SRC) $(CWEB_TEX) $(CWEB_DVI) cfg - -CLEANFILES = hbf2gf.log hbf2gf.toc - -hbf2gf.dvi: $(CWEB_TEX) - TEXINPUTS=.:$(srcdir):$$TEXINPUTS $(TEX) hbf2gf.tex - -# Running cweave in order to create hbf2gf.tex generates in addition -# hbf2gf.idx and hbf2gf.scn; we must rerun cweave when they are not -# up to date (even if hbf2gf.tex is up to date). Thus the sub-make. -# -hbf2gf.tex hbf2gf.idx hbf2gf.scn: hbf2gf.w - $(MAKE) $(AM_MAKEFLAGS) do-cweave -do-cweave: hbf2gf.w .FORCE - $(CWEAVE) +ai $< -.PHONY: do-cweave .FORCE - -if do_cweb -all-local: hbf2gf.dvi -hbf2gf.c: hbf2gf.w - $(CTANGLE) $< -else -all-local: -endif - -## Not used -## -EXTRA_DIST += \ - emdir.c \ - emdir.h \ - emtexdir.c \ - emtexdir.h \ - hbf2gf.def - diff --git a/Build/source/texk/cjkutils/hbf2gf/Makefile.in b/Build/source/texk/cjkutils/hbf2gf/Makefile.in deleted file mode 100644 index 77b5ea82aae..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/Makefile.in +++ /dev/null @@ -1,655 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -bin_PROGRAMS = hbf2gf$(EXEEXT) -subdir = hbf2gf -DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/c-auto.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ - $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ - $(top_srcdir)/../../m4/kpse-warnings.m4 \ - $(top_srcdir)/../../m4/libtool.m4 \ - $(top_srcdir)/../../m4/ltoptions.m4 \ - $(top_srcdir)/../../m4/ltsugar.m4 \ - $(top_srcdir)/../../m4/ltversion.m4 \ - $(top_srcdir)/../../m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = c-auto.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" -PROGRAMS = $(bin_PROGRAMS) -am_hbf2gf_OBJECTS = hbf.$(OBJEXT) hbf2gf.$(OBJEXT) -hbf2gf_OBJECTS = $(am_hbf2gf_OBJECTS) -hbf2gf_LDADD = $(LDADD) -am__DEPENDENCIES_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(hbf2gf_SOURCES) -DIST_SOURCES = $(hbf2gf_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -man1dir = $(mandir)/man1 -NROFF = nroff -MANS = $(dist_man1_MANS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CTANGLE = @CTANGLE@ -CWEAVE = @CWEAVE@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KPATHSEA_DEPEND = @KPATHSEA_DEPEND@ -KPATHSEA_INCLUDES = @KPATHSEA_INCLUDES@ -KPATHSEA_LIBS = @KPATHSEA_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TEX = @TEX@ -VERSION = @VERSION@ -WARNING_CFLAGS = @WARNING_CFLAGS@ -XX_CFLAGS = @XX_CFLAGS@ -XX_CPPFLAGS = @XX_CPPFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -INCLUDES = $(KPATHSEA_INCLUDES) -AM_CPPFLAGS = -Dunix -DHAVE_LIBKPATHSEA $(XX_CPPFLAGS) -AM_CFLAGS = $(XX_CFLAGS) -hbf2gf_SOURCES = \ - hbf.c \ - hbf.h \ - hbf2gf.c - -CWEB_SRC = hbf2gf.w -CWEB_TEX = hbf2gf.tex hbf2gf.idx hbf2gf.scn -CWEB_DVI = hbf2gf.dvi -hbf2gf_DEPENDENCIES = $(KPATHSEA_DEPEND) -LDADD = $(KPATHSEA_LIBS) -dist_man1_MANS = hbf2gf.1 -EXTRA_DIST = $(CWEB_SRC) $(CWEB_TEX) $(CWEB_DVI) cfg emdir.c emdir.h \ - emtexdir.c emtexdir.h hbf2gf.def -CLEANFILES = hbf2gf.log hbf2gf.toc -all: c-auto.h - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hbf2gf/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign hbf2gf/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -c-auto.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status hbf2gf/c-auto.h -$(srcdir)/c-auto.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f c-auto.h stamp-h1 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -hbf2gf$(EXEEXT): $(hbf2gf_OBJECTS) $(hbf2gf_DEPENDENCIES) - @rm -f hbf2gf$(EXEEXT) - $(LINK) $(hbf2gf_OBJECTS) $(hbf2gf_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hbf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hbf2gf.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man1: $(dist_man1_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) c-auto.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) c-auto.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) c-auto.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) c-auto.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) $(MANS) c-auto.h all-local -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-man - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man1 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-man - -uninstall-man: uninstall-man1 - -.MAKE: all install-am install-strip - -.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-man1 \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-man uninstall-man1 - - -@KPATHSEA_RULE@ - -hbf2gf.dvi: $(CWEB_TEX) - TEXINPUTS=.:$(srcdir):$$TEXINPUTS $(TEX) hbf2gf.tex - -# Running cweave in order to create hbf2gf.tex generates in addition -# hbf2gf.idx and hbf2gf.scn; we must rerun cweave when they are not -# up to date (even if hbf2gf.tex is up to date). Thus the sub-make. -# -hbf2gf.tex hbf2gf.idx hbf2gf.scn: hbf2gf.w - $(MAKE) $(AM_MAKEFLAGS) do-cweave -do-cweave: hbf2gf.w .FORCE - $(CWEAVE) +ai $< -.PHONY: do-cweave .FORCE - -@do_cweb_TRUE@all-local: hbf2gf.dvi -@do_cweb_TRUE@hbf2gf.c: hbf2gf.w -@do_cweb_TRUE@ $(CTANGLE) $< -@do_cweb_FALSE@all-local: - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/Build/source/texk/cjkutils/hbf2gf/c-auto.in b/Build/source/texk/cjkutils/hbf2gf/c-auto.in deleted file mode 100644 index 4505a71684d..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/c-auto.in +++ /dev/null @@ -1,192 +0,0 @@ -/* hbf2gf/c-auto.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `bcmp' function. */ -#undef HAVE_BCMP - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getwd' function. */ -#undef HAVE_GETWD - -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the `memcmp' function. */ -#undef HAVE_MEMCMP - -/* Define to 1 if you have the `memcpy' function. */ -#undef HAVE_MEMCPY - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the `mktemp' function. */ -#undef HAVE_MKTEMP - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you are using GNU libc or otherwise have global variables - `program_invocation_name' and `program_invocation_short_name'. */ -#undef HAVE_PROGRAM_INVOCATION_NAME - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if you have the `rindex' function. */ -#undef HAVE_RINDEX - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if `st_mtim' is a member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_MTIM - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/README b/Build/source/texk/cjkutils/hbf2gf/cfg/README deleted file mode 100644 index 689d59e7397..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/README +++ /dev/null @@ -1,10 +0,0 @@ -In this directory you find some hbf2gf configuration files for common CJK -bitmap fonts. - -No paths are specified for the HBF files -- under web2c you should add the -path for these fonts to the `MISCFONTS' variable in texmf.cnf; under emTeX -you should set the environment variable `HBFONTS'. - -The font paths used here in the config files of this directory are TDS -compliant; only the `HBF_TARGET' environment variable is used (an example -would be `set HBF_TARGET=/usr/local/TeX/texmf/fonts'). diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/b5ka12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/b5ka12.cfg deleted file mode 100644 index f5c142f0235..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/b5ka12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header ntukai48.hbf -mag_x 1 -threshold 128 -comment Big 5 normal 48x48 pixel font scaled and adapted to 12pt - -design_size 12 - -x_offset 2 -y_offset -12 - -nmb_files -1 - -output_name b5ka12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme Big 5 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/ntu/b5ka12/ -tfm_directory $HBF_TARGET/tfm/ntu/b5ka12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/b5kr12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/b5kr12.cfg deleted file mode 100644 index 9d9da2c1a2f..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/b5kr12.cfg +++ /dev/null @@ -1,30 +0,0 @@ - -hbf_header ntukai48.hbf -mag_x 1 -threshold 128 -comment Big 5 normal 48x48 pixel font rotated, scaled and adapted to 12pt - -design_size 12 - -x_offset 2 -y_offset -10 - -rotation yes - -nmb_files -1 - -output_name b5kr12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme Big 5 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/ntu/b5kr12/ -tfm_directory $HBF_TARGET/tfm/ntu/b5kr12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/b5so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/b5so12.cfg deleted file mode 100644 index dc0bcd9fbf0..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/b5so12.cfg +++ /dev/null @@ -1,31 +0,0 @@ - -hbf_header et24.hbf -mag_x 2.076 -threshold 128 -comment fanti songti 24x24 pixel font magnified and adapted for 12pt - -design_size 12.0 - -x_offset 3 -y_offset -8 - -nmb_files -1 - -output_name b5so12 - -checksum 123456789 - -dpi_x 300 - -tfm_files yes -pk_files no - -coding codingscheme Big 5 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/eten/b5so12/ -tfm_directory $HBF_TARGET/tfm/eten/b5so12/ - - rm_command del - cp_command copy - long_extension no - job_extension .cmd diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c1so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c1so12.cfg deleted file mode 100644 index de5b32b3efc..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c1so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-1.hbf -mag_x 1 -threshold 128 -comment CNS plane 1 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c1so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 1 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c1so12/ -tfm_directory $HBF_TARGET/tfm/cns/c1so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c2so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c2so12.cfg deleted file mode 100644 index 969af8fae14..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c2so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-2.hbf -mag_x 1 -threshold 128 -comment CNS plane 2 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c2so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 2 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c2so12/ -tfm_directory $HBF_TARGET/tfm/cns/c2so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c3so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c3so12.cfg deleted file mode 100644 index 0e65768ee5e..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c3so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-3.hbf -mag_x 1 -threshold 128 -comment CNS plane 3 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c3so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 3 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c3so12/ -tfm_directory $HBF_TARGET/tfm/cns/c3so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c4so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c4so12.cfg deleted file mode 100644 index 8ea3a8b270c..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c4so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-4.hbf -mag_x 1 -threshold 128 -comment CNS plane 4 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c4so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 4 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c4so12/ -tfm_directory $HBF_TARGET/tfm/cns/c4so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c5so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c5so12.cfg deleted file mode 100644 index 1b81c90a0d3..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c5so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-5.hbf -mag_x 1 -threshold 128 -comment CNS plane 5 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c5so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 5 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c5so12/ -tfm_directory $HBF_TARGET/tfm/cns/c5so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c6so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c6so12.cfg deleted file mode 100644 index 5b9c912ce53..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c6so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-6.hbf -mag_x 1 -threshold 128 -comment CNS plane 6 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c6so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 6 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c6so12/ -tfm_directory $HBF_TARGET/tfm/cns/c6so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/c7so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/c7so12.cfg deleted file mode 100644 index 051b2601426..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/c7so12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-7.hbf -mag_x 1 -threshold 128 -comment CNS plane 7 song 40x40 pixel font scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name c7so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme CNS plane 7 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/c7so12/ -tfm_directory $HBF_TARGET/tfm/cns/c7so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/csso12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/csso12.cfg deleted file mode 100644 index 9ad91b0c574..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/csso12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header cns40-b5.hbf -mag_x 1 -threshold 128 -comment CNS song 40x40 pixel font (Bg5 encoded) scaled and adapted to 12pt - -design_size 12.0 - -x_offset 2 -y_offset -8 - -nmb_files -1 - -output_name csso12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme Big 5 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/cns/csso12/ -tfm_directory $HBF_TARGET/tfm/cns/csso12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/gsfs14.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/gsfs14.cfg deleted file mode 100644 index 4b397aca464..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/gsfs14.cfg +++ /dev/null @@ -1,27 +0,0 @@ - -hbf_header jfs56.hbf -mag_x 1 -threshold 128 -comment jianti fansongti 56x56 pixel font scaled and adapted to 14.4pt - -design_size 14.4 - -y_offset -13 - -nmb_files -1 - -output_name gsfs14 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme GuoBiao encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/ccdos/gsfs14/ -tfm_directory $HBF_TARGET/tfm/ccdos/gsfs14/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/j2so12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/j2so12.cfg deleted file mode 100644 index 7e0d70b5c0f..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/j2so12.cfg +++ /dev/null @@ -1,30 +0,0 @@ - -hbf_header jisksp40.hbf -mag_x 1.0 -threshold 128 -comment supplemental kanji normal 40x40 pixel font scaled and adapted to 12pt - -design_size 12 - -min_char 0x2121 - -x_offset 2 -y_offset -7 - -nmb_files -1 - -output_name j2so12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme JIS2 encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/jisx0212/j2so12/ -tfm_directory $HBF_TARGET/tfm/jisx0212/j2so12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/jsso12.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/jsso12.cfg deleted file mode 100644 index 9bdfc7b1e8a..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/jsso12.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -hbf_header kanji48.hbf -mag_x 0.83 -threshold 128 -comment kanji normal 48x48 pixel font scaled and adapted to 12pt - -design_size 12 - -x_offset 2 -y_offset -7 - -nmb_files -1 - -output_name jsso12 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme JIS encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/jisx0208/jsso12/ -tfm_directory $HBF_TARGET/tfm/jisx0208/jsso12/ diff --git a/Build/source/texk/cjkutils/hbf2gf/cfg/ksso17.cfg b/Build/source/texk/cjkutils/hbf2gf/cfg/ksso17.cfg deleted file mode 100644 index c82f7e7eee4..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/cfg/ksso17.cfg +++ /dev/null @@ -1,27 +0,0 @@ - -hbf_header hanja65.hbf -mag_x 1 -threshold 128 -comment hanja normal 65x65 pixel font scaled and adapted to 17.28pt - -design_size 17.28 - -y_offset -16 - -nmb_files -1 - -output_name ksso17 - -checksum 123456789 - -dpi_x 300 - -pk_files no -tfm_files yes - - long_extension no - -coding codingscheme KS encoded TeX text - -pk_directory $HBF_TARGET/pk/modeless/ksc5601/ksso17/ -tfm_directory $HBF_TARGET/tfm/ksc5601/ksso17/ diff --git a/Build/source/texk/cjkutils/hbf2gf/emdir.c b/Build/source/texk/cjkutils/hbf2gf/emdir.c deleted file mode 100644 index 4e759c83eb2..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/emdir.c +++ /dev/null @@ -1,109 +0,0 @@ -/* emdir.c -- Written by Eberhard Mattes, donated to the public domain */ - -#include "emdir.h" - -#ifdef OS2 - -#undef HPS -#define INCL_DOSFILEMGR -#include -#include - -#define FHDIR(b) (*(HDIR *)(b)->reserved) - -static void fconv (struct ll_findbuffer *dst, const FILEFINDBUF *src) -{ - dst->attr = src->attrFile; - dst->time = *(unsigned *)&src->ftimeLastWrite; - dst->date = *(unsigned *)&src->fdateLastWrite; - dst->size = src->cbFile; - strcpy (dst->name, src->achName); -} - - -int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) -{ - USHORT rc; - ULONG count; - HDIR hdir; - FILEFINDBUF ffbuf; - - hdir = HDIR_CREATE; - count = 1; - rc = DosFindFirst ((PSZ)path, &hdir, attr, &ffbuf, sizeof (ffbuf), - &count, 0L); - if (rc != 0 || count != 1) - return 0; - FHDIR (buffer) = hdir; - fconv (buffer, &ffbuf); - return 1; -} - - -int ll_findnext (struct ll_findbuffer *buffer) -{ - USHORT rc; - ULONG count; - HDIR hdir; - FILEFINDBUF ffbuf; - - hdir = FHDIR (buffer); - count = 1; - rc = DosFindNext (hdir, &ffbuf, sizeof (ffbuf), &count); - if (rc != 0 || count != 1) - { - DosFindClose (hdir); - return 0; - } - fconv (buffer, &ffbuf); - return 1; -} - - -#elif defined(DJGPP) - -/* djgpp support by Hartmut Schirmer (hsc@techfak.uni-kiel.de), May 30, 1997 */ - -#include -#include - -static int ll_attr = 0; -int ll_findnext (struct ll_findbuffer *buffer) -{ - int res; - do { - res = _dos_findnext ((struct find_t *)buffer); - if (res != 0) return 0; - } while ( (buffer->attrib&ll_attr) == 0); - return 1; -} - -int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) -{ - int res; - ll_attr = attr; - res = _dos_findfirst((char *)path, attr, (struct find_t *)buffer); - if (res != 0) return 0; - if ( (buffer->attrib&ll_attr) == 0) - return ll_findnext(buffer); - return 1; -} - -#elif !defined(__EMX__) /* if not OS2 nor DJGPP nor __EMX__ defined */ - -/* Not tested */ - -#include - -int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer) -{ - return _dos_findfirst (path, attr, (struct find_t *)buffer) == 0; -} - - -int ll_findnext (struct ll_findbuffer *buffer) -{ - return _dos_findnext ((struct find_t *)buffer) == 0; -} - -#endif diff --git a/Build/source/texk/cjkutils/hbf2gf/emdir.h b/Build/source/texk/cjkutils/hbf2gf/emdir.h deleted file mode 100644 index 0606d476ab1..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/emdir.h +++ /dev/null @@ -1,25 +0,0 @@ -/* emdir.h -- Written by Eberhard Mattes, donated to the public domain */ - -#if defined(DJGPP) - -/* djgpp support by Hartmut Schirmer (hsc@techfak.uni-kiel.de), May 30, 1997 */ -#include -#define ll_findbuffer find_t -#define attr attrib - -#else - -struct ll_findbuffer -{ - char reserved[21]; - unsigned char attr; - unsigned time; - unsigned date; - long size; - char name[257]; -}; - -#endif - -int ll_findfirst (const char *path, int attr, struct ll_findbuffer *buffer); -int ll_findnext (struct ll_findbuffer *buffer); diff --git a/Build/source/texk/cjkutils/hbf2gf/emtexdir.c b/Build/source/texk/cjkutils/hbf2gf/emtexdir.c deleted file mode 100644 index 9a35570adb3..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/emtexdir.c +++ /dev/null @@ -1,405 +0,0 @@ -/* emtexdir.c -- written by Eberhard Mattes, donated to the public domain */ - -#if defined (__EMX__) -#include -#else -#include "emdir.h" -#endif -#if defined(DJGPP) || defined(GO32) -#include -#endif -#include -#include -#include -#include -#include "emtexdir.h" - -#define FALSE 0 -#define TRUE 1 - -void (*emtex_dir_find_callback)(const char *name, int ok) = NULL; - -static int setup_add (struct emtex_dir *dst, const char *path) -{ - char *p; - - if (dst->used >= dst->alloc) - { - dst->alloc += 8; - dst->list = realloc (dst->list, dst->alloc * sizeof (*dst->list)); - if (dst->list == NULL) - return (FALSE); - } - p = strdup (path); - if (p == NULL) - return (FALSE); - dst->list[dst->used++] = p; - return (TRUE); -} - - -static int setup_subdir (struct emtex_dir *dst, char *path, size_t add, - unsigned flags, int recurse) -{ - int ok, i, end, len; -#if defined (__EMX__) - struct _find find; -#else - struct ll_findbuffer find; -#endif - - i = dst->used; - strcpy (path + add, "*.*"); -#if defined (__EMX__) - ok = __findfirst (path, 0x10, &find) == 0; -#else - ok = ll_findfirst (path, 0x10, &find); -#endif - while (ok) - { - if ((find.attr & 0x10) - && !(strcmp (find.name, ".") == 0 || strcmp (find.name, "..") == 0)) - { - len = strlen (find.name); - memcpy (path + add, find.name, len); - path[add+len] = '\\'; - path[add+len+1] = 0; - if (!setup_add (dst, path)) - return (FALSE); - } -#if defined (__EMX__) - ok = __findnext (&find) == 0; -#else - ok = ll_findnext (&find); -#endif - } - if (recurse) - { - end = dst->used; - while (i < end) - { - strcpy (path, dst->list[i]); - if (!setup_subdir (dst, path, strlen (path), flags, TRUE)) - return (FALSE); - ++i; - } - } - return (TRUE); -} - - -static int setup_dir (struct emtex_dir *dst, char *path, - const char *base_dir, size_t base_dir_len, - const char *sub_dir, - unsigned flags) -{ - size_t i, len; - - memcpy (path, base_dir, base_dir_len); - i = base_dir_len; - if ((flags & EDS_BANG) && sub_dir == NULL) - { - flags &= ~(EDS_ONESUBDIR|EDS_ALLSUBDIR); - if (i >= 2 && path[i-1] == '!' && path[i-2] == '!') - { - flags |= EDS_ALLSUBDIR; - i -= 2; - } - else if (i >= 1 && path[i-1] == '!') - { - flags |= EDS_ONESUBDIR; - --i; - } - } - if (sub_dir != NULL && *sub_dir != 0) - { - if (i != 0 && path[i-1] != ':' && path[i-1] != '/' && path[i-1] != '\\') - path[i++] = '\\'; - len = strlen (sub_dir); - memcpy (path+i, sub_dir, len); - i += len; - } - if (path[i-1] != ':' && path[i-1] != '/' && path[i-1] != '\\') - path[i++] = '\\'; - path[i] = 0; - if (!setup_add (dst, path)) - return (FALSE); - if (flags & EDS_ALLSUBDIR) - return (setup_subdir (dst, path, i, flags, TRUE)); - else if (flags & EDS_ONESUBDIR) - return (setup_subdir (dst, path, i, flags, FALSE)); - else - return (TRUE); -} - - -/*static */int setup_list (struct emtex_dir *dst, char *path, - const char *list, unsigned flags) -{ - const char *end; - size_t i; - - for (;;) - { - while (*list == ' ' || *list == '\t') - ++list; - if (*list == 0) - return (TRUE); - end = list; - while (*end != 0 && *end != ';') - ++end; - i = end - list; - while (i > 0 && (list[i-1] == ' ' || list[i-1] == '\t')) - --i; - if (i != 0 && !setup_dir (dst, path, list, i, NULL, flags)) - return (FALSE); - if (*end == 0) - return (TRUE); - list = end + 1; - } -} - - -int emtex_dir_setup (struct emtex_dir *ed, const char *env, const char *dir, - unsigned flags) -{ - const char *val; - char path[260]; - - ed->alloc = 0; - ed->used = 0; - ed->list = NULL; - if (env != NULL && (val = getenv (env)) != NULL) - return (setup_list (ed, path, val, flags)); - else if ((val = getenv ("EMTEXDIR")) != NULL) - return (setup_dir (ed, path, val, strlen (val), dir, flags)); - else - return (setup_dir (ed, path, "\\emtex", 6, dir, flags)); -} - - -static void pretty (char *path, unsigned flags) -{ - char *p; - - if (flags & EDF_FSLASH) - for (p = path; *p != 0; ++p) - if (*p == '\\') - *p = '/'; -} - - -#define ADDCHAR(C) \ - if (dst_size < 1) return (EDT_TOOLONG); \ - *dst++ = (C); --dst_size - -int emtex_dir_trunc (char *dst, size_t dst_size, const char *src, - unsigned flags, int method) -{ - int len, truncated, dot; - - if (src[0] != 0 && src[1] == ':') - { - ADDCHAR (src[0]); - ADDCHAR (src[1]); - src += 2; - } - - truncated = FALSE; dot = FALSE; len = 0; - for (;;) - { - switch (*src) - { - case 0: - ADDCHAR (0); - return (truncated ? EDT_CHANGED : EDT_UNCHANGED); - - case ':': - return (EDT_INVALID); - - case '/': - case '\\': - ADDCHAR (*src); - len = 0; dot = FALSE; - break; - - case '.': - if (dot) - return (EDT_INVALID); - ADDCHAR (*src); - - /* ".." is allowed -- don't return EDT_INVALID for the next - dot. */ - - if (!(len == 0 && src[1] == '.' - && (src[2] == 0 || src[2] == '/' || src[2] == '\\'))) - { - len = 0; dot = TRUE; - } - break; - - default: - if (dot && len == 3) - truncated = TRUE; - else if (!dot && len == 8) - { - truncated = TRUE; - if (method == 0) - { - dst[-3] = dst[-2]; - dst[-2] = dst[-1]; - dst[-1] = *src; - } - } - else - { - ADDCHAR (*src); - ++len; - } - break; - } - ++src; - } -} - - -static int find2 (const char *name, unsigned flags) -{ - int ok; - - ok = (access (name, 4) == 0); - if (flags & EDF_TRACE) - emtex_dir_find_callback (name, ok); - return (ok); -} - - -static int find1 (char *path, size_t path_size, const char *dir, - const char *fname, unsigned flags) -{ - char buf[260]; - int method, rc; - size_t len, tmp; - - len = 0; - if (dir != NULL) - { - tmp = strlen (dir); - if (tmp >= sizeof (buf)) - return (FALSE); - memcpy (buf, dir, tmp); - len = tmp; - } - tmp = strlen (fname); - if (len + tmp >= sizeof (buf)) - return (FALSE); - memcpy (buf + len, fname, tmp + 1); - len += tmp; -#if 0 /* wkim */ -/* disabled for Win95's long file name support */ -/* -- Wonkoo Kim (wkim+@pitt.edu), May 18, 1997 */ - if (_osmode == DOS_MODE) - { - rc = emtex_dir_trunc (path, path_size, buf, flags, EDT_5_PLUS_3); - if ((rc == EDT_UNCHANGED || rc == EDT_CHANGED) && find2 (path, flags)) - { - pretty (path, flags); - return (TRUE); - } - rc = emtex_dir_trunc (path, path_size, buf, flags, EDT_8); - if (rc == EDT_CHANGED && find2 (path, flags)) - { - pretty (path, flags); - return (TRUE); - } - return (FALSE); - } - else -#endif /* wkim */ - { - if (len < path_size && find2 (buf, flags)) - { - memcpy (path, buf, len + 1); - pretty (path, flags); - return (TRUE); - } - for (method = 0; method < 2; ++method) - { - rc = emtex_dir_trunc (path, path_size, buf, flags, method); - if (rc == EDT_CHANGED && find2 (path, flags)) - { - pretty (path, flags); - return (TRUE); - } - } - return (FALSE); - } -} - - -int emtex_dir_find (char *path, size_t path_size, - const struct emtex_dir *ed, - const char *fname, unsigned flags) -{ - int i, absp; - const char *p; - - absp = FALSE; - for (p = fname; *p != 0; ++p) - if (*p == ':' || *p == '/' || *p == '\\') - { - absp = TRUE; - break; - } - - if (absp) - return (find1 (path, path_size, NULL, fname, flags)); - - if ((flags & EDF_CWD) && find1 (path, path_size, NULL, fname, flags)) - return (TRUE); - - for (i = 0; i < ed->used; ++i) - if (find1 (path, path_size, ed->list[i], fname, flags)) - return (TRUE); - return (FALSE); -} - - -#if defined (TEST) - -#include - -int main (int argc, char *argv[]) -{ - struct emtex_dir ed; - int i; - unsigned flags1, flags2; - char path[260]; - - if (argc != 6) - { - puts ("Usage: emtexdir "); - return (1); - } - - flags1 = (unsigned)strtol (argv[1], NULL, 0); - flags2 = (unsigned)strtol (argv[2], NULL, 0); - - if (!emtex_dir_setup (&ed, argv[3], argv[4], flags1)) - { - fputs ("emtex_dir_setup failed\n", stderr); - return (2); - } - - printf ("Directories:\n"); - for (i = 0; i < ed.used; ++i) - printf (" %s\n", ed.list[i]); - - if (!emtex_dir_find (path, sizeof (path), &ed, argv[5], flags2)) - puts ("File not found"); - else - printf ("Path: %s\n", path); - return (0); -} - -#endif diff --git a/Build/source/texk/cjkutils/hbf2gf/emtexdir.h b/Build/source/texk/cjkutils/hbf2gf/emtexdir.h deleted file mode 100644 index a9a986db05b..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/emtexdir.h +++ /dev/null @@ -1,57 +0,0 @@ -/* emtexdir.h -- written by Eberhard Mattes, donated to the public domain */ - -#if !defined (_EMTEXDIR_H) -#define _EMTEXDIR_H - -#if defined (__cplusplus) -extern "C" { -#endif - - -/* Flags for emtex_dir_setup */ - -#define EDS_ONESUBDIR 0x0001 -#define EDS_ALLSUBDIR 0x0002 -#define EDS_BANG 0x0004 - -/* Flags for emtex_dir_find */ - -#define EDF_CWD 0x0001 -#define EDF_FSLASH 0x0002 -#define EDF_TRACE 0x8000 - -/* Methods for emtex_dir_trunc */ - -#define EDT_5_PLUS_3 0 /* 5+3.3 */ -#define EDT_8 1 /* 8.3 */ - -/* Return values for emtex_dir_trunc */ - -#define EDT_UNCHANGED 0 /* Path name not changed */ -#define EDT_CHANGED 1 /* Path name truncated */ -#define EDT_TOOLONG 2 /* Path name too long */ -#define EDT_INVALID 3 /* Path name invalid */ - -struct emtex_dir -{ - char **list; - int used; - int alloc; -}; - -extern void (*emtex_dir_find_callback)(const char *name, int ok); - -int emtex_dir_setup (struct emtex_dir *ed, const char *env, const char *dir, - unsigned flags); - -int emtex_dir_find (char *path, size_t path_size, const struct emtex_dir *ed, - const char *fname, unsigned flags); - -int emtex_dir_trunc (char *dst, size_t dst_size, const char *src, - unsigned flags, int method); - -#if defined (__cplusplus) -} -#endif - -#endif /* !defined (_EMTEXDIR_H) */ diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf.c b/Build/source/texk/cjkutils/hbf2gf/hbf.c deleted file mode 100644 index 6056555d704..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf.c +++ /dev/null @@ -1,1496 +0,0 @@ -/* - * Copyright 1993,1994,1995,2005 by Ross Paterson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. 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. - * - * - * Ross Paterson - * 17 October 1995 - * - * The following people have supplied bug fixes: - * - * Simon Chow - * Fung Fung Lee - * Man-Chi Pong - * Steven Simpson - * Charles Wang - * Werner Lemberg - * - * Ross no longer maintains this code. Please send bug reports to - * Werner Lemberg . - * - */ - -/* - * Two C interfaces to HBF files. - * - * The multiple interfaces make this code rather messy; I intend - * to clean it up as experience is gained on what is really needed. - * - * There are also two modes of operation: - * - the default is to read each bitmap from its file as demanded - * - if IN_MEMORY is defined, the whole bitmap file is held in memory. - * In this case, if running under Unix, the bitmap files may be gzipped - * (but the filename used in the HBF file should be the name of the - * file before it was gzipped). - */ -#include -#include -#include -#include -#include -#include "hbf.h" - -#ifdef __MSDOS__ -#define msdos -#endif - -/* - * if the linker complains about an unresolved identifier '_strdup', - * uncomment the following definition. - */ -/* #define NO_STRDUP */ - -#ifdef __STDC__ -# define _(x) x -#else -# define _(x) () -#endif - -#define reg register - -typedef int bool; -#define TRUE 1 -#define FALSE 0 - -#define Bit(n) (1<<(7 - (n))) - -/* - * Messy file system issues - */ - -#ifdef unix -#define PATH_DELIMITER ':' -#define RelativeFileName(fn) ((fn)[0] != '/') -#define LocalFileName(fn) (strchr(fn, '/') == NULL) -#endif /* unix */ -#ifdef msdos -#define PATH_DELIMITER ';' -#define HasDrive(fn) (isalpha((fn)[0]) && (fn)[1] == ':') -#ifdef __EMX__ -#define RelativeFileName(fn) (! HasDrive(fn) && \ - !((fn)[0] == '\\' || (fn)[0] == '/')) -#define LocalFileName(fn) (! HasDrive(fn) && \ - strchr(fn, '\\') == NULL && \ - strchr(fn, '/') == NULL) -#else -#define RelativeFileName(fn) (! HasDrive(fn) && (fn)[0] != '\\') -#define LocalFileName(fn) (! HasDrive(fn) && strchr(fn, '\\') == NULL) -#endif /* __EMX__ */ -#define READ_BINARY "rb" -#endif /* msdos */ -#ifdef vms -#define PATH_DELIMITER ',' -#define RelativeFileName(fn) (strchr(fn, ':') == NULL && ((fn)[0] != '[' || (fn)[1] == '.' || (fn)[1] == '-')) -#define LocalFileName(fn) (strchr(fn, ':') == NULL && strchr(fn, ']') == NULL) -#endif - -#ifndef RelativeFileName -#define RelativeFileName(fn) FALSE -#endif - -#ifndef LocalFileName -#define LocalFileName(fn) FALSE -#endif - -#ifndef READ_BINARY -#define READ_BINARY "r" -#endif - -#define MAX_FILENAME 1024 - -/* - * Internal structures - */ - -typedef unsigned char byte; - -#define PROPERTY struct _PROPERTY -#define BM_FILE struct _BM_FILE -#define B2_RANGE struct _B2_RANGE -#define CODE_RANGE struct _CODE_RANGE - -PROPERTY { - char *prop_name; - char *prop_value; - PROPERTY *prop_next; -}; - -BM_FILE { - char *bmf_name; -#ifdef IN_MEMORY - byte *bmf_contents; -#else - FILE *bmf_file; -#endif - long bmf_size; - BM_FILE *bmf_next; -}; - -B2_RANGE { - byte b2r_start; - byte b2r_finish; - B2_RANGE *b2r_next; -}; - -typedef unsigned short CHAR; -typedef unsigned int CHAR_INDEX; /* character index in file */ -#define BAD_CHAR_INDEX 0xffff - -CODE_RANGE { - CHAR code_start; - CHAR code_finish; - BM_FILE *code_bm_file; - long code_offset; - CHAR_INDEX code_pos; - bool code_transposed; - bool code_inverted; - CODE_RANGE *code_next; -}; - -/* - * Extended internal version of HBF - */ - -typedef struct { - /* fields corresponding to the definition */ - HBF public; - /* plus internal stuff */ - char *filename; - byte *bitmap_buffer; - unsigned int b2_size; /* number of legal byte-2's */ - PROPERTY *property; - B2_RANGE *byte_2_range; - CODE_RANGE *code_range; - BM_FILE *bm_file; -} HBF_STRUCT; - -#define FirstByte(code) ((code)>>8) -#define SecondByte(code) ((code)&0xff) -#define MakeCode(byte1,byte2) (((byte1)<<8)|(byte2)) - -/* size of a bitmap in the file (may be affected by transposition) */ -#define FileBitmapSize(hbfFile,cp) \ - ((cp)->code_transposed ? \ - (hbfBitmapBBox(hbfFile)->hbf_height + 7)/8 * \ - hbfBitmapBBox(hbfFile)->hbf_width : \ - HBF_BitmapSize(hbfFile)) - -#define NEW(type) ((type *)malloc((unsigned)(sizeof(type)))) - -#define QUOTE '"' - -#define MAXLINE 1024 - -#ifdef WIN32 -#define strdup(x) _strdup(x) -#else - extern char *strdup _((const char *s)); -#endif - -static void add_b2r _((B2_RANGE **last_b2r, int start, int finish)); -static bool add_code_range _((HBF_STRUCT *hbf, const char *line)); -static void add_property _((HBF_STRUCT *hbf, const char *lp)); -static CHAR_INDEX b2_pos _((HBF_STRUCT *hbf, HBF_CHAR code)); -static int b2_size _((B2_RANGE *b2r)); -static void clear_bbox _((HBF_BBOX *bbox)); -static void clear_record _((HBF_STRUCT *hbf)); -static char *concat _((const char *dir, int dirlen, const char *stem)); -static char *expand_filename _((const char *name, const char *filename)); -static const byte *get_bitmap - _((HBF_STRUCT *hbf, HBF_CHAR code, byte *buffer)); -static byte *local_buffer _((HBF_STRUCT *hbf)); -static void invert _((byte *buffer, unsigned length)); -#ifdef IN_MEMORY -static bool read_bitmap_file _((BM_FILE *bmf, FILE *f)); -static bool copy_transposed - _((HBF *hbf, byte *bitmap, const byte *source)); -#else -static bool get_transposed _((HBF *hbf, FILE *f, byte *bitmap)); -#endif -static bool match _((const char *lp, const char *sp)); -static bool parse_file _((FILE *f, HBF_STRUCT *hbf)); -static FILE *path_open - _((const char *path, const char *filename, char **fullp)); -static bool real_open _((const char *filename, HBF_STRUCT *hbf)); - -/* Error reporting */ - -int hbfDebug; /* set this for error reporting */ - -#ifdef __STDC__ -#include - -static void -eprintf(const char *fmt, ...) -{ - if (hbfDebug) { - va_list args; - - (void)fprintf(stderr, "HBF: "); - va_start(args, fmt); - (void)vfprintf(stderr, fmt, args); - va_end(args); - (void)fprintf(stderr, "\n"); - } -} -#else /* ! __STDC__ */ -/* poor man's variable-length argument list */ -static void -eprintf(fmt, x1, x2, x3, x4, x5, x6, x7, x8, x9) - const char *fmt; - int x1, x2, x3, x4, x5, x6, x7, x8, x9; -{ - if (hbfDebug) { - (void)fprintf(stderr, "HBF: "); - (void)fprintf(stderr, fmt, x1, x2, x3, x4, x5, x6, x7, x8, x9); - (void)fprintf(stderr, "\n"); - } -} -#endif /* __STDC__ */ - -static void -clear_bbox(HBF_BBOX *bbox) -{ - bbox->hbf_width = bbox->hbf_height = 0; - bbox->hbf_xDisplacement = bbox->hbf_yDisplacement = 0; -} - -static void -clear_record(HBF_STRUCT *hbf) -{ - clear_bbox(&(hbf->public.hbf_bitmap_bbox)); - clear_bbox(&(hbf->public.hbf_font_bbox)); - hbf->property = NULL; - hbf->filename = NULL; - hbf->bitmap_buffer = NULL; - hbf->byte_2_range = NULL; - hbf->code_range = NULL; - hbf->bm_file = NULL; -} - -/* - * Byte-2 ranges - */ - -static void -add_b2r(reg B2_RANGE **last_b2r, int start, int finish) -{ -reg B2_RANGE *b2r; - - b2r = NEW(B2_RANGE); - while (*last_b2r != NULL && (*last_b2r)->b2r_start < start) - last_b2r = &((*last_b2r)->b2r_next); - b2r->b2r_next = *last_b2r; - b2r->b2r_start = start; - b2r->b2r_finish = finish; - *last_b2r = b2r; -} - -static CHAR_INDEX -b2_pos(HBF_STRUCT *hbf, HBF_CHAR code) -{ -reg B2_RANGE *b2r; -reg unsigned c; -reg CHAR_INDEX pos; - - c = SecondByte(code); - pos = 0; - for (b2r = hbf->byte_2_range; b2r != NULL; b2r = b2r->b2r_next) - if (b2r->b2r_start <= c && c <= b2r->b2r_finish) - return pos + c - b2r->b2r_start; - else - pos += b2r->b2r_finish - b2r->b2r_start + 1; - return BAD_CHAR_INDEX; -} - -static int -b2_size(reg B2_RANGE *b2r) -{ -reg int size; - - size = 0; - for ( ; b2r != NULL; b2r = b2r->b2r_next) - size += b2r->b2r_finish - b2r->b2r_start + 1; - return size; -} - -/* map a position to a character code */ -static long -code_of(HBF_STRUCT *hbf, long pos) -{ - long code; - int residue; -reg B2_RANGE *b2r; - - code = pos / hbf->b2_size * 256; - residue = pos % hbf->b2_size; - for (b2r = hbf->byte_2_range; b2r != NULL; b2r = b2r->b2r_next) - if (b2r->b2r_start + residue <= b2r->b2r_finish) - return code + b2r->b2r_start + residue; - else - residue -= b2r->b2r_finish - b2r->b2r_start + 1; - /* should never get here */ - return 0L; -} - -/* - * String stuff - */ - -static bool -match(reg const char *lp, reg const char *sp) -{ - while (*lp == *sp && *sp != '\0') { - lp++; - sp++; - } - return (*lp == '\0' || isspace(*lp)) && *sp == '\0'; -} - -#ifdef NO_STRDUP -char * -strdup(const char *s) -{ - char *new_s; - - new_s = malloc((unsigned)strlen(s) + 1); - strcpy(new_s, s); - return new_s; -} -#endif - -/* - * Properties - */ - -static void -add_property(reg HBF_STRUCT *hbf, const char *lp) -{ -reg PROPERTY *prop; - char tmp[MAXLINE]; -reg char *tp; - - prop = NEW(PROPERTY); - - tp = tmp; - while (*lp != '\0' && ! isspace(*lp)) - *tp++ = *lp++; - *tp = '\0'; - prop->prop_name = strdup(tmp); - - while (*lp != '\0' && isspace(*lp)) - lp++; - - tp = tmp; - if (*lp == QUOTE) { - lp++; - while (*lp != '\0' && ! (*lp == QUOTE && *++lp != QUOTE)) - *tp++ = *lp++; - } - else - for (;;) { - while (*lp != '\0' && ! isspace(*lp)) - *tp++ = *lp++; - while (*lp != '\0' && isspace(*lp)) - lp++; - if (*lp == '\0') - break; - *tp++ = ' '; - } - *tp = '\0'; - prop->prop_value = strdup(tmp); - - prop->prop_next = hbf->property; - hbf->property = prop; -} - -const char * -hbfProperty(HBF *hbfFile, const char *propName) -{ -reg HBF_STRUCT *hbf; -reg PROPERTY *prop; - - hbf = (HBF_STRUCT *)hbfFile; - for (prop = hbf->property; prop != NULL; prop = prop->prop_next) - if (strcmp(prop->prop_name, propName) == 0) - return prop->prop_value; - return NULL; -} - -/* - * Compatability routines - */ - -const char * -HBF_GetProperty(HBF *handle, const char *propertyName) -{ - return hbfProperty(handle, propertyName); -} - -int -HBF_GetFontBoundingBox(HBF_Handle handle, - unsigned int *width, unsigned int *height, - int *xDisplacement, int *yDisplacement) -{ - if (width != NULL) - *width = hbfFontBBox(handle)->hbf_width; - if (height != NULL) - *height = hbfFontBBox(handle)->hbf_height; - if (xDisplacement != NULL) - *xDisplacement = hbfFontBBox(handle)->hbf_xDisplacement; - if (yDisplacement != NULL) - *yDisplacement = hbfFontBBox(handle)->hbf_yDisplacement; - return 0; -} - -int -HBF_GetBitmapBoundingBox(HBF_Handle handle, - unsigned int *width, unsigned int *height, - int *xDisplacement, int *yDisplacement) -{ - if (width != NULL) - *width = hbfBitmapBBox(handle)->hbf_width; - if (height != NULL) - *height = hbfBitmapBBox(handle)->hbf_height; - if (xDisplacement != NULL) - *xDisplacement = hbfBitmapBBox(handle)->hbf_xDisplacement; - if (yDisplacement != NULL) - *yDisplacement = hbfBitmapBBox(handle)->hbf_yDisplacement; - return 0; -} - -/* - * Prepend a directory to a relative filename. - */ -static char * -concat(const char *dir, /* not necessarily null-terminated */ - int dirlen, /* number of significant chars in dir */ - const char *stem) /* relative filename */ -{ - char *fullname; - - if (dirlen == 0) /* null: current directory */ - return strdup(stem); -#ifdef unix - fullname = malloc(dirlen + strlen(stem) + 2); - (void)sprintf(fullname, "%.*s/%s", dirlen, dir, stem); -#else -#ifdef msdos - fullname = malloc(dirlen + strlen(stem) + 2); - (void)sprintf(fullname, "%.*s\\%s", dirlen, dir, stem); -#else -#ifdef vms - if (dir[dirlen-1] == ']' && stem[0] == '[' && stem[1] == '-') { - dirlen--; - stem++; - fullname = malloc(dirlen + strlen(stem) + 2); - (void)sprintf(fullname, "%.*s.%s", dirlen, dir, stem); - } - else { - if (dir[dirlen-1] == ']' && stem[0] == '[' && stem[1] == '.') { - dirlen--; - stem++; - } - fullname = malloc(dirlen + strlen(stem) + 1); - (void)sprintf(fullname, "%.*s%s", dirlen, dir, stem); - } -#else - fullname = strdup(stem); -#endif /* vms */ -#endif /* msdos */ -#endif /* unix */ - return fullname; -} - -/* - * Bitmap files - * - * If the host operating system has a heirarchical file system and - * the bitmap file name is relative, it is relative to the directory - * containing the HBF file. - */ -static char * -expand_filename(const char *name, const char *hbf_name) -{ -#ifdef unix -reg char *s; -reg int size; - - size = name[0] != '/' && (s = strrchr(hbf_name, '/')) != NULL ? - s - hbf_name + 1 : 0; - s = malloc((unsigned)size + strlen(name) + 1); - (void)sprintf(s, "%.*s%s", size, hbf_name, name); - return s; -#else -#ifdef msdos -reg char *s; -reg int size; - -#ifdef __EMX__ - s = (unsigned char *)hbf_name + strlen((unsigned char *)hbf_name) - 1; - for(;;) { - if (*s == '\\' || *s == '/') - break; - if (s == hbf_name) { - s = NULL; - break; - } - s--; - } - - size = HasDrive(name) ? 0 : - (name[0] == '\\' || name[0] == '/') ? - (HasDrive(hbf_name) ? 2 : 0) : - s != NULL ? s - hbf_name + 1 : 0; -#else - size = HasDrive(name) ? 0 : - name[0] == '\\' ? (HasDrive(hbf_name) ? 2 : 0) : - (s = strrchr(hbf_name, '\\')) != NULL ? - s - hbf_name + 1 : 0; -#endif /* __EMX__ */ - s = malloc((unsigned)size + strlen(name) + 1); - (void)sprintf(s, "%.*s%s", size, hbf_name, name); - return s; -#else -#ifdef vms -reg char *s; -reg const char *copyto; -reg int size; - - if ((s = strchr(hbf_name, ']')) != NULL && RelativeFileName(name)) - return concat(hbf_name, (s - hbf_name) + 1, name); - - copyto = hbf_name; - if ((s = strstr(copyto, "::")) != NULL && strstr(name, "::") == NULL) - copyto = s+2; - if ((s = strchr(copyto, ':')) != NULL && strchr(name, ':') == NULL) - copyto = s+1; - size = copyto - hbf_name; - s = malloc((unsigned)size + strlen(name) + 1); - (void)sprintf(s, "%.*s%s", size, hbf_name, name); - return s; -#else - return strdup(name); -#endif /* vms */ -#endif /* msdos */ -#endif /* unix */ -} - -static BM_FILE * -find_file(HBF_STRUCT *hbf, const char *filename) -{ - BM_FILE **fp; -reg BM_FILE *file; - FILE *f; - char *bmfname; -#ifdef IN_MEMORY -#ifdef unix - bool from_pipe; -#endif -#endif - - for (fp = &(hbf->bm_file); *fp != NULL; fp = &((*fp)->bmf_next)) { - bmfname = strrchr((*fp)->bmf_name, '/'); - bmfname = (bmfname) ? bmfname + 1 : (*fp)->bmf_name; - if (strcmp(bmfname, filename) == 0) - return *fp; - } - - file = NEW(BM_FILE); - if (file == NULL) { - eprintf("out of memory"); - return NULL; - } - file->bmf_name = expand_filename(filename, hbf->filename); - if (file->bmf_name == NULL) { - free((char *)file); - return NULL; - } - f = fopen(file->bmf_name, READ_BINARY); -#ifdef IN_MEMORY -#ifdef unix - from_pipe = FALSE; - if (f == NULL) { - char tmp[400]; - - sprintf(tmp, "%s.gz", file->bmf_name); - if ((f = fopen(tmp, "r")) != NULL) { - fclose(f); - sprintf(tmp, "gzcat %s.gz", file->bmf_name); - if ((f = popen(tmp, "r")) != NULL) - from_pipe = TRUE; - } - } -#endif /* unix */ -#endif /* IN_MEMORY */ - if (f == NULL) { - eprintf("can't open bitmap file '%s'", file->bmf_name); - free(file->bmf_name); - free((char *)file); - return NULL; - } -#ifdef IN_MEMORY - if (! read_bitmap_file(file, f)) { - free(file->bmf_name); - free((char *)file); - return NULL; - } -#ifdef unix - if (from_pipe) - pclose(f); - else - fclose(f); -#else /* ! unix */ - fclose(f); -#endif /* ! unix */ -#else /* ! IN_MEMORY */ - file->bmf_file = f; - fseek(f, 0L, 2); - file->bmf_size = ftell(f); -#endif /* ! IN_MEMORY */ - file->bmf_next = NULL; - *fp = file; - return file; -} - -#ifdef IN_MEMORY -#define GRAIN_SIZE 512 - -static bool -read_bitmap_file(BM_FILE *bmf, FILE *f) -{ - byte *contents, *cp; - long size; - int c; - - size = 0; - cp = contents = (byte *)malloc((unsigned)GRAIN_SIZE); - if (contents == NULL) { - eprintf("not enough space for bitmap file"); - return NULL; - } - while ((c = getc(f)) != EOF) { - if (size%GRAIN_SIZE == 0) { - contents = (byte *)realloc((char *)contents, - (unsigned)(size + GRAIN_SIZE)); - if (contents == NULL) { - eprintf("not enough space for bitmap file"); - return NULL; - } - cp = contents + size; - } - *cp++ = c; - size++; - } - bmf->bmf_size = size; - bmf->bmf_contents = (byte *)realloc((char *)contents, (unsigned)size); - return TRUE; -} -#endif /* IN_MEMORY */ - -/* - * Code ranges - */ - -/* check that a code range fits within its bitmap file */ -static bool -too_short(HBF_STRUCT *hbf, CODE_RANGE *cp) -{ - int bm_size; - long offset, end_offset; - BM_FILE *bmf; - long start, finish; - - bm_size = FileBitmapSize(&(hbf->public), cp); - offset = cp->code_offset; - start = cp->code_start; - finish = cp->code_finish; - end_offset = offset + bm_size * - (hbf->b2_size*(long)FirstByte(finish) + - b2_pos(hbf, finish) - cp->code_pos + 1); - bmf = cp->code_bm_file; - if (end_offset <= bmf->bmf_size) - return FALSE; - /* bitmap file is too short: produce a specific error message */ - if (offset > bmf->bmf_size) - eprintf("bitmap file '%s' is shorter than offset 0x%04lx", - bmf->bmf_name, offset); - else if (offset + bm_size > bmf->bmf_size) - eprintf("bitmap file '%s' too short: no room for any bitmaps at offset 0x%04lx", - bmf->bmf_name, offset); - else - eprintf("bitmap file '%s' is too short - code range appears to be 0x%04lx-0x%04lx", - bmf->bmf_name, - start, - code_of(hbf, cp->code_pos + - (bmf->bmf_size - offset)/bm_size) - 1); - return TRUE; -} - -static const char * -skip_word(int n, const char *s) -{ - for ( ; n > 0; n--) { - while (*s != '\0' && ! isspace(*s)) - s++; - while (*s != '\0' && isspace(*s)) - s++; - } - return s; -} - -/* optional keywords at the end of a CODE_RANGE line */ -static void -parse_keywords(CODE_RANGE *cp, const char *s) -{ - for (s = skip_word(4, s) ; *s != '\0'; s = skip_word(1, s)) { - switch (*s) { - case 's': case 'S': case 't': case 'T': - /* keyword "sideways" or "transposed" */ - cp->code_transposed = TRUE; - break; - case 'i': case 'I': - /* keyword "inverted" */ - cp->code_inverted = TRUE; - } - } -} - -static bool -add_code_range(HBF_STRUCT *hbf, const char *line) -{ - CODE_RANGE *cp; - CODE_RANGE **cpp; - long start, finish; - long offset; - char filename[MAXLINE]; - BM_FILE *bmf; - CHAR_INDEX b2pos; - - if (sscanf(line, "HBF_CODE_RANGE %li-%li %s %li", - &start, &finish, filename, &offset) != 4) { - eprintf("syntax error in HBF_CODE_RANGE"); - return FALSE; - } - /* code ranges are checked in real_open() */ - if ((bmf = find_file(hbf, filename)) == NULL) - return FALSE; - if ((cp = NEW(CODE_RANGE)) == NULL) { - eprintf("out of memory"); - return FALSE; - } - - cp->code_start = (CHAR)start; - cp->code_finish = (CHAR)finish; - cp->code_bm_file = bmf; - cp->code_offset = offset; - cp->code_transposed = cp->code_inverted = FALSE; - parse_keywords(cp, line); - /* insert it in order */ - for (cpp = &hbf->code_range; - *cpp != NULL && (*cpp)->code_finish < start; - cpp = &((*cpp)->code_next)) - ; - if (*cpp != NULL && (*cpp)->code_start <= finish) { - eprintf("code ranges overlap"); - return FALSE; - } - cp->code_next = *cpp; - *cpp = cp; - - /* set code_pos, and check range */ - if (start > finish) { - eprintf("illegal code range 0x%04lx-0x%04lx", start, finish); - return FALSE; - } - if ((b2pos = b2_pos(hbf, start)) == BAD_CHAR_INDEX) { - eprintf("illegal start code 0x%04lx", start); - return FALSE; - } - cp->code_pos = hbf->b2_size*(long)FirstByte(start) + b2pos; - if ((b2pos = b2_pos(hbf, finish)) == BAD_CHAR_INDEX) { - eprintf("illegal finish code 0x%04lx", finish); - return FALSE; - } - /* check that the bitmap file has enough bitmaps */ - return ! too_short(hbf, cp); -} - -/* - * Reading and parsing of an HBF file - */ - -/* get line, truncating to len, and trimming trailing spaces */ -static bool -get_line(char *buf, int len, FILE *f) -{ - int c; - char *bp; - - bp = buf; - for (;;) { - if ((c = getc(f)) == EOF) { - eprintf("unexpected end of file"); - return FALSE; - } - if (c == '\n' || c == '\r') { - /* trim trailing space */ - while (bp > buf && isspace(*(bp-1))) - bp--; - *bp = '\0'; - return TRUE; - } - if (len > 0) { - *bp++ = c; - len--; - } - } -} - -/* get next non-COMMENT line */ -static bool -get_text_line(char *buf, int len, FILE *f) -{ - while (get_line(buf, len, f)) - if (*buf != '\0' && ! match(buf, "COMMENT")) - return TRUE; - return FALSE; -} - -static bool -get_property(const char *line, const char *keyword, HBF_STRUCT *hbf) -{ - if (! match(line, keyword)) { - eprintf("%s expected", keyword); - return FALSE; - } - add_property(hbf, line); - return TRUE; -} - -static bool -get_bbox(const char *line, const char *keyword, HBF_BBOX *bbox) -{ - int w, h, xd, yd; - - if (! match(line, keyword) || - sscanf(line + strlen(keyword), "%i %i %i %i", - &w, &h, &xd, &yd) != 4) { - eprintf("%s expected", keyword); - return FALSE; - } - if (w <= 0 || h <= 0) { - eprintf("illegal %s dimensions %dx%d", keyword, w, h); - return FALSE; - } - bbox->hbf_width = w; - bbox->hbf_height = h; - bbox->hbf_xDisplacement = xd; - bbox->hbf_yDisplacement = yd; - return TRUE; -} - -/* - * HBFHeaderFile ::= - * 'HBF_START_FONT' version EOLN - * 'HBF_CODE_SCHEME' word ... EOLN - * 'FONT' fontName EOLN - * 'SIZE' ptsize xres yres EOLN - * 'HBF_BITMAP_BOUNDING_BOX' w h xd yd EOLN - * 'FONTBOUNDINGBOX' w h xd yd EOLN - * X11R5FontPropertySection - * 'CHARS' n EOLN - * HBFByte2RangeSection - * HBFCodeRangeSection - * 'HBF_END_FONT' EOLN . - * - * This implementation allows extra lines before HBF_END_FONT. - * Anything after HBF_END_FONT is ignored. - */ - -static bool -parse_file(FILE *f, reg HBF_STRUCT *hbf) -{ - char line[MAXLINE]; - int start, finish; - - if (! get_text_line(line, MAXLINE, f) || - ! get_property(line, "HBF_START_FONT", hbf)) - return FALSE; - - if (! get_text_line(line, MAXLINE, f) || - ! get_property(line, "HBF_CODE_SCHEME", hbf)) - return FALSE; - - if (! get_text_line(line, MAXLINE, f) || - ! get_property(line, "FONT", hbf)) - return FALSE; - - if (! get_text_line(line, MAXLINE, f) || - ! get_property(line, "SIZE", hbf)) - return FALSE; - - if (! get_text_line(line, MAXLINE, f) || - ! get_bbox(line, "HBF_BITMAP_BOUNDING_BOX", - &(hbf->public.hbf_bitmap_bbox))) - return FALSE; - - if (! get_text_line(line, MAXLINE, f) || - ! get_bbox(line, "FONTBOUNDINGBOX", &(hbf->public.hbf_font_bbox))) - return FALSE; - - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - if (match(line, "STARTPROPERTIES")) { - for (;;) { - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - if (match(line, "ENDPROPERTIES")) - break; - add_property(hbf, line); - } - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - } - - if (match(line, "CHARS")) - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - - if (match(line, "HBF_START_BYTE_2_RANGES")) { - for (;;) { - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - if (match(line, "HBF_END_BYTE_2_RANGES")) - break; - if (sscanf(line, "HBF_BYTE_2_RANGE %i-%i", - &start, &finish) != 2) { - eprintf("HBF_BYTE_2_RANGE expected"); - return FALSE; - } - add_b2r(&(hbf->byte_2_range), start, finish); - } - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - } - else - add_b2r(&(hbf->byte_2_range), 0, 0xff); - hbf->b2_size = b2_size(hbf->byte_2_range); - - if (! match(line, "HBF_START_CODE_RANGES")) { - eprintf("HBF_START_CODE_RANGES expected"); - return FALSE; - } - for (;;) { - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - if (match(line, "HBF_END_CODE_RANGES")) - break; - if (! add_code_range(hbf, line)) - return FALSE; - } - - for (;;) { - if (! get_text_line(line, MAXLINE, f)) - return FALSE; - if (match(line, "HBF_END_FONT")) - break; - /* treat extra lines as properties (for private extensions) */ - add_property(hbf, line); - } - - return TRUE; -} - -static FILE * -path_open(const char *path, const char *filename, char **fullp) -{ - if (LocalFileName(filename) && path != NULL) { -#ifdef PATH_DELIMITER - int len; - char *fullname; - FILE *f; - const char *p_next; - - len = strlen(filename); - for (;;) { - p_next = strchr(path, PATH_DELIMITER); - if (p_next == NULL) - p_next = path + strlen(path); - fullname = concat(path, p_next - path, filename); - if ((f = fopen(fullname, "r")) != NULL) { - *fullp = fullname; - return f; - } - free(fullname); - if (*p_next == '\0') - break; - path = p_next + 1; - } -#endif - return NULL; - } - else { - *fullp = strdup(filename); - return fopen(*fullp, "r"); - } -} - -static bool -real_open(const char *filename, reg HBF_STRUCT *hbf) -{ - FILE *f; - - f = path_open(getenv("HBFPATH"), filename, &(hbf->filename)); - if (f == NULL) { - eprintf("can't read file '%s'", filename); - return FALSE; - } - if (! parse_file(f, hbf)) { - fclose(f); - return FALSE; - } - fclose(f); - return TRUE; -} - -HBF * -hbfOpen(const char *filename) -{ -reg HBF_STRUCT *hbf; - - if ((hbf = NEW(HBF_STRUCT)) == NULL) { - eprintf("can't allocate HBF structure"); - return NULL; - } - clear_record(hbf); - if (real_open(filename, hbf)) - return &(hbf->public); - hbfClose(&(hbf->public)); - return NULL; -} - -int -HBF_OpenFont(const char *filename, HBF **ptrHandleStorage) -{ - return (*ptrHandleStorage = hbfOpen(filename)) == NULL ? -1 : 0; -} - -/* - * Close files, free everything associated with the HBF. - */ - -int -HBF_CloseFont(HBF *hbfFile) -{ -reg HBF_STRUCT *hbf; - PROPERTY *prop_ptr, *prop_next; - B2_RANGE *b2r_ptr, *b2r_next; - CODE_RANGE *code_ptr, *code_next; - BM_FILE *bmf_ptr, *bmf_next; - int status; - - status = 0; - hbf = (HBF_STRUCT *)hbfFile; - - if (hbf->filename != NULL) - free(hbf->filename); - if (hbf->bitmap_buffer != NULL) - free(hbf->bitmap_buffer); - - for (prop_ptr = hbf->property; - prop_ptr != NULL; - prop_ptr = prop_next) { - prop_next = prop_ptr->prop_next; - free(prop_ptr->prop_name); - free(prop_ptr->prop_value); - free((char *)prop_ptr); - } - - for (b2r_ptr = hbf->byte_2_range; - b2r_ptr != NULL; - b2r_ptr = b2r_next) { - b2r_next = b2r_ptr->b2r_next; - free((char *)b2r_ptr); - } - - for (code_ptr = hbf->code_range; - code_ptr != NULL; - code_ptr = code_next) { - code_next = code_ptr->code_next; - free((char *)code_ptr); - } - - for (bmf_ptr = hbf->bm_file; - bmf_ptr != NULL; - bmf_ptr = bmf_next) { - bmf_next = bmf_ptr->bmf_next; -#ifdef IN_MEMORY - free((char *)(bmf_ptr->bmf_contents)); -#else - if (bmf_ptr->bmf_file != NULL && - fclose(bmf_ptr->bmf_file) < 0) - status = -1; -#endif - free(bmf_ptr->bmf_name); - free((char *)bmf_ptr); - } - - free((char *)hbf); - - return status; -} - -void -hbfClose(HBF *hbfFile) -{ - (void)HBF_CloseFont(hbfFile); -} - -/* - * Fetch a bitmap - */ - -const byte * -hbfGetBitmap(HBF *hbf, HBF_CHAR code) -{ - return get_bitmap((HBF_STRUCT *)hbf, code, (byte *)NULL); -} - -int -HBF_GetBitmap(HBF *hbf, HBF_CHAR code, byte *buffer) -{ - return get_bitmap((HBF_STRUCT *)hbf, code, buffer) == NULL ? -1 : 0; -} - -/* - * Internal function to fetch a bitmap. - * If buffer is non-null, it must be used. - */ -static const byte * -get_bitmap(reg HBF_STRUCT *hbf, HBF_CHAR code, byte *buffer) -{ - CHAR_INDEX pos, b2pos; -reg CODE_RANGE *cp; - BM_FILE *bmf; - int bm_size; - long offset; - - if ((b2pos = b2_pos(hbf, code)) == BAD_CHAR_INDEX) - return NULL; - pos = hbf->b2_size*FirstByte(code) + b2pos; - for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) - if (cp->code_start <= code && code <= cp->code_finish) { - bmf = cp->code_bm_file; - bm_size = FileBitmapSize(&(hbf->public), cp); - offset = cp->code_offset + - (long)(pos - cp->code_pos) * bm_size; -#ifdef IN_MEMORY - if (buffer == NULL && - ! cp->code_transposed && ! cp->code_inverted) - return bmf->bmf_contents + offset; -#endif /* IN_MEMORY */ - if (buffer == NULL && - ((buffer = local_buffer(hbf)) == NULL)) - return NULL; -#ifdef IN_MEMORY - if (cp->code_transposed) - copy_transposed(&(hbf->public), - buffer, - bmf->bmf_contents + offset); - else - memcpy((char *)buffer, - (char *)(bmf->bmf_contents + offset), - bm_size); -#else /* ! IN_MEMORY */ - if (fseek(bmf->bmf_file, offset, 0) != 0) { - eprintf("seek error on code 0x%04x", code); - return NULL; - } - if (cp->code_transposed ? - ! get_transposed(&(hbf->public), bmf->bmf_file, - buffer) : - fread((char *)buffer, - bm_size, 1, bmf->bmf_file) != 1) { - eprintf("read error on code 0x%04x", code); - return NULL; - } -#endif /* IN_MEMORY */ - if (cp->code_inverted) - invert(buffer, HBF_BitmapSize(&(hbf->public))); - return buffer; - } - eprintf("code 0x%04x out of range", code); - return NULL; -} - -static byte * -local_buffer(HBF_STRUCT *hbf) -{ - if (hbf->bitmap_buffer == NULL && - (hbf->bitmap_buffer = (byte *)malloc(HBF_BitmapSize(&(hbf->public)))) == NULL) { - eprintf("out of memory"); - return NULL; - } - return hbf->bitmap_buffer; -} - -static void -invert(byte *buffer, unsigned int length) -{ - for ( ; length > 0; length--) - *buffer++ ^= 0xff; -} - -#ifdef IN_MEMORY -static bool -copy_transposed(HBF *hbf, reg byte *bitmap, reg const byte *source) -{ -reg byte *pos; -reg byte *bm_end; - int x; - int width; -reg int row_size; -reg int c; -reg int imask, omask; - - width = hbfBitmapBBox(hbf)->hbf_width; - row_size = HBF_RowSize(hbf); - bm_end = bitmap + HBF_BitmapSize(hbf); - (void)memset((char *)bitmap, '\0', HBF_BitmapSize(hbf)); - for (x = 0; x < width; x++) { - pos = bitmap + x/8; - omask = Bit(x%8); - /* y = 0 */ - for (;;) { - c = *source++; - for (imask = Bit(0); imask != 0; imask >>= 1) { - /* - * At this point, - * - * imask == Bit(y%8) - * pos == bitmap + y*row_size + x/8 - * - * We examine bit y of row x of the input, - * setting bit x of row y of the output if - * required, by applying omask to *pos. - */ - if ((c & imask) != 0) - *pos |= omask; - /* if (++y > height) goto end_column */ - pos += row_size; - if (pos >= bm_end) - goto end_column; - } - } -end_column: - ; - } - return TRUE; -} -#else /* ! IN_MEMORY */ -static bool -get_transposed(HBF *hbf, FILE *f, reg byte *bitmap) -{ -reg byte *pos; -reg byte *bm_end; - int x; - int width; -reg int row_size; -reg int c; -reg int imask, omask; - - width = hbfBitmapBBox(hbf)->hbf_width; - row_size = HBF_RowSize(hbf); - bm_end = bitmap + HBF_BitmapSize(hbf); - (void)memset((char *)bitmap, '\0', HBF_BitmapSize(hbf)); - for (x = 0; x < width; x++) { - pos = bitmap + x/8; - omask = Bit(x%8); - /* y = 0 */ - for (;;) { - if ((c = getc(f)) == EOF) - return FALSE; - for (imask = Bit(0); imask != 0; imask >>= 1) { - /* - * At this point, - * - * imask == Bit(y%8) - * pos == bitmap + y*row_size + x/8 - * - * We examine bit y of row x of the input, - * setting bit x of row y of the output if - * required, by applying omask to *pos. - */ - if ((c & imask) != 0) - *pos |= omask; - /* if (++y > height) goto end_column */ - pos += row_size; - if (pos >= bm_end) - goto end_column; - } - } -end_column: - ; - } - return TRUE; -} -#endif /* ! IN_MEMORY */ - -/* - * Call function on each valid code in ascending order. - */ -void -hbfForEach(reg HBF *hbfFile, void (*func)(HBF *, HBF_CHAR)) -{ - HBF_STRUCT *hbf; - CODE_RANGE *cp; -reg B2_RANGE *b2r; -reg unsigned byte1, byte2; -reg unsigned finish; - - hbf = (HBF_STRUCT *)hbfFile; - for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) { - byte1 = FirstByte(cp->code_start); - byte2 = SecondByte(cp->code_start); - while (MakeCode(byte1, byte2) <= cp->code_finish) { - for (b2r = hbf->byte_2_range; - b2r != NULL; - b2r = b2r->b2r_next) { - if (byte2 < b2r->b2r_start) - byte2 = b2r->b2r_start; - finish = b2r->b2r_finish; - if (byte1 == FirstByte(cp->code_finish) && - finish > SecondByte(cp->code_finish)) - finish = SecondByte(cp->code_finish); - while (byte2 <= finish) { - (*func)(hbfFile, - MakeCode(byte1, byte2)); - byte2++; - } - } - byte1++; - byte2 = 0; - } - } -} - -const char * -hbfFileName(HBF *hbf) -{ - return ((HBF_STRUCT *)hbf)->filename; -} - -long -hbfChars(HBF *hbfFile) -{ - HBF_STRUCT *hbf; - CODE_RANGE *cp; - long num_chars; - - hbf = (HBF_STRUCT *)hbfFile; - num_chars = 0; - for (cp = hbf->code_range; cp != NULL; cp = cp->code_next) - num_chars += - hbf->b2_size*FirstByte(cp->code_finish) + - b2_pos(hbf, cp->code_finish) - - (hbf->b2_size*FirstByte(cp->code_start) + - b2_pos(hbf, cp->code_start)) + 1; - return num_chars; -} - -/* - * Functions also implemented as macros - */ - -#ifdef hbfBitmapBBox -#undef hbfBitmapBBox -#endif - -HBF_BBOX * -hbfBitmapBBox(HBF *hbf) -{ - return &(hbf->hbf_bitmap_bbox); -} - -#ifdef hbfFontBBox -#undef hbfFontBBox -#endif - -HBF_BBOX * -hbfFontBBox(HBF *hbf) -{ - return &(hbf->hbf_font_bbox); -} - -const void * -hbfGetByte2Range(HBF *hbfFile, const void *b2r_pointer, - byte *startp, byte *finishp) -{ - HBF_STRUCT *hbf; - const B2_RANGE *b2r; - - hbf = (HBF_STRUCT *)hbfFile; - if (b2r_pointer == NULL) - b2r = hbf->byte_2_range; - else - b2r = ((const B2_RANGE *)b2r_pointer)->b2r_next; - if(b2r == NULL) - return NULL; - *startp = b2r->b2r_start; - *finishp = b2r->b2r_finish; - return (const void *)b2r; -} - -const void * -hbfGetCodeRange(HBF *hbfFile, const void *code_pointer, - HBF_CHAR *startp, HBF_CHAR *finishp) -{ - HBF_STRUCT *hbf; - const CODE_RANGE *cp; - - hbf = (HBF_STRUCT *)hbfFile; - if (code_pointer == NULL) - cp = hbf->code_range; - else - cp = ((const CODE_RANGE *)code_pointer)->code_next; - if(cp == NULL) - return NULL; - *startp = cp->code_start; - *finishp = cp->code_finish; - return (const void *)cp; -} diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf.h b/Build/source/texk/cjkutils/hbf2gf/hbf.h deleted file mode 100644 index 34f5940a71b..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 1993,1994,1995,2005 by Ross Paterson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 3. 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. - * - * - * Two interfaces to HBF files -- take your pick. - * - * Ross Paterson - * - * Ross no longer maintains this code. Please send bug reports to - * Werner Lemberg . - * - */ -#ifndef _HBF_ -#define _HBF_ - -#ifndef __STDC__ -# ifndef const -# define const -# endif -#endif - -/* - * #1: a lightweight C interface. - */ - -typedef unsigned int HBF_CHAR; - -typedef struct { - unsigned short hbf_width; - unsigned short hbf_height; - short hbf_xDisplacement; - short hbf_yDisplacement; -} HBF_BBOX; - -typedef struct { - /* fields corresponding to the definition */ - HBF_BBOX hbf_bitmap_bbox; /* HBF_BITMAP_BOUNDING_BOX */ - HBF_BBOX hbf_font_bbox; /* FONTBOUNDINGBOX */ -} HBF; - -extern HBF *hbfOpen( -#ifdef __STDC__ - const char *filename -#endif - ); - -extern void hbfClose( -#ifdef __STDC__ - HBF *hbf -#endif - ); - -extern const char *hbfProperty( -#ifdef __STDC__ - HBF *hbf, - const char *propName -#endif - ); - -extern const unsigned char *hbfGetBitmap( -#ifdef __STDC__ - HBF *hbf, - HBF_CHAR code -#endif - ); - -extern void hbfForEach( -#ifdef __STDC__ - HBF *hbf, - void (*func)(HBF *sameHbf, HBF_CHAR code) -#endif - ); - -extern const char *hbfFileName( -#ifdef __STDC__ - HBF *hbf -#endif - ); - -extern long hbfChars( -#ifdef __STDC__ - HBF *hbf -#endif - ); - -extern HBF_BBOX *hbfBitmapBBox( -#ifdef __STDC__ - HBF *hbf -#endif - ); -/* but defined here as a macro */ -#define hbfBitmapBBox(hbf) (&((hbf)->hbf_bitmap_bbox)) - -extern HBF_BBOX *hbfFontBBox( -#ifdef __STDC__ - HBF *hbf -#endif - ); -/* but defined here as a macro */ -#define hbfFontBBox(hbf) (&((hbf)->hbf_font_bbox)) - -#define HBF_RowSize(hbf)\ - ((hbfBitmapBBox(hbf)->hbf_width + 7)/8) - -#define HBF_BitmapSize(hbf)\ - (HBF_RowSize(hbf) * hbfBitmapBBox(hbf)->hbf_height) - -#define HBF_GetBit(hbf,bitmap,x,y)\ - (((bitmap)[(y)*HBF_RowSize(hbf) + (x)/8]>>(7 - (x)%8))&01) - -extern int hbfDebug; /* set non-zero for error reporting */ - -extern const void *hbfGetCodeRange( -#ifdef __STDC__ - HBF *hbfFile, - const void *code_pointer, - HBF_CHAR *startp, - HBF_CHAR *finishp -#endif - ); - -extern const void *hbfGetByte2Range( -#ifdef __STDC__ - HBF *hbfFile, - const void *b2r_pointer, - unsigned char *startp, - unsigned char *finishp -#endif - ); - -/* - * #2: taken from Appendix 2 of the HBF draft. - */ - -typedef unsigned int HBF_HzCode; -typedef unsigned char HBF_Byte ; -typedef HBF_Byte * HBF_BytePtr ; -typedef HBF * HBF_Handle ; -typedef HBF_Handle * HBF_HandlePtr ; -typedef char * String ; - -extern int HBF_OpenFont( -#ifdef __STDC__ - const char * filename, - HBF_HandlePtr ptrHandleStorage -#endif -); - -extern int HBF_CloseFont( -#ifdef __STDC__ - HBF_Handle handle -#endif -); - -extern const char * HBF_GetProperty( -#ifdef __STDC__ - HBF_Handle handle, - const char * propertyName -#endif -); - -extern int HBF_GetFontBoundingBox( -#ifdef __STDC__ - HBF_Handle handle, - unsigned int *width, - unsigned int *height, - int *xDisplacement, - int *yDisplacement -#endif -); - -extern int HBF_GetBitmapBoundingBox( -#ifdef __STDC__ - HBF_Handle handle, - unsigned int *width, - unsigned int *height, - int *xDisplacement, - int *yDisplacement -#endif -); - -extern int HBF_GetBitmap( -#ifdef __STDC__ - HBF_Handle handle, - HBF_HzCode hanziCode, - HBF_BytePtr ptrBitmapBuffer -#endif -); - -#endif /* ! _HBF_ */ diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.1 b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.1 deleted file mode 100644 index 1fdff00cee1..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.1 +++ /dev/null @@ -1,754 +0,0 @@ -.\" man page for hbf2gf -.\" -.\" Copyright (C) 1994-2006 Werner Lemberg -.\" -.\" 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 in doc/COPYING; if not, write to the Free -.\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -.\" MA 02110-1301 USA -.\" -. -.TH HBF2GF 1 17-Oct-2006 "CJK Version 4.7.0" -.SH NAME -hbf2gf \- convert a CJK bitmap font into subfonts usable by TeX and Omega. -. -. -.SH SYNOPSIS -.na -.nh -.B hbf2gf -.RB [ -q ] -.IR \%configuration-file [ .cfg ] -.br -.B hbf2gf -'in +\n(.ku -.RB [ -q ] -.RB [ -p ] -.RB [ -g ] -.RB [ -n ] -.I \%subfont-name \%x-resolution -.RI [ \%y-scale \ | \ \%y-resolution ] -.br -.in -.B hbf2gf -.B -t -.RB [ -q ] -.I \%subfont-name -.br -.B "hbf2gf --version" -| -.B --help -.ad -.hy -. -. -. -.\" ==== -.\" ==== macro definitions -.\" ==== -. -.\" here we define \TeX for troff and nroff -.if t .ds TX \fRT\h'-0.1667m'\v'0.20v'E\v'-0.20v'\h'-0.125m'X\fP -.if n .ds TX TeX -. -.\" and here the same for \LaTeX -.if t \{\ -.ie '\*(.T'dvi' \ -.ds LX \fRL\h'-0.36m'\v'-0.15v'\s-3A\s0\h'-0.15m'\v'0.15v'\fP\*(TX -.el .ds LX \fRL\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\fP\*(TX -.\} -.if n .ds LX LaTeX -. -.\" \LaTeXe -.\" note that we need \vareps for TeX instead of \eps which can only be -.\" accessed with the \N escape sequence (in the Math Italic font) -.if t \{\ -.ie '\*(.T'dvi' .ds LE \*(LX\h'0.15m'2\v'0.20v'\f(MI\N'34'\fP\v'-0.20v' -.el .ds LE \*(LX\h'0.15m'2\v'0.20v'\(*e\v'-0.20v' -.\} -.if n .ds LE LaTeX\ 2e -. -.\" a definition for \Delta -.if t .ds DE \(*D -.if n .ds DE Delta_ -. -.\" a typewriter font -.if t \{\ -.de C -\fC\\$1\fP\\$2 -.. -.\} -.if n \{\ -.de C -\\$1\\$2 -.. -.\} -. -.\" an addition to .TP to allow two labels for the same item -.de TQ -.br -.ns -.TP -.. -. -.\" ==== -.\" ==== end of macro definitions -.\" ==== -. -. -. -.SH DESCRIPTION -CJK bitmap fonts can't be directly used with \*(TX -because the number of characters in such fonts exceeds\ 256, the limit of a -\*(TX -font. -Thus it is necessary to split these fonts into subfonts, and this is -exactly what -.B hbf2gf -does. -.PP -As the name says, -.B hbf2gf -uses CJK fonts in a certain format which is called -.B Hanzi Bitmap Font -.RB ( HBF ) -format. -It simply consists of the CJK bitmap file(s) and a text file in a format -very similar to the BDF format of the X\ Window System which describes the -bitmap font files: the encoding, the size, etc. -The produced -.C GF -files can then be converted with -.B gftopk -into standard -.C PK -files. -.PP -.B hbf2gf -can be called in three modes: -. -.PP -.in +2m -.B hbf2gf -.RB [ -q ] -.IR configuration-file [ .cfg ] -.PP -.in +5m -This call normally creates a set of -.C GF -files, one -.C PL -file, and a batch file which must be executed after -.B hbf2gf -has finished. -This script will then call -.B gftopk -to convert all -.C GF -files into -.C PK -files, and it will call -.B pltotf -to convert the -.C PL -file into a -.C TFM -file. -Finally it will copy the -.C TFM -file so that each -.C PK -file has its -.C TFM -file (which are all identical). -.PP -.in +5m -If -.B ofm_file -is set to \(oqyes\(cq in the configuration file, -.C OFM -and -.C OVF -files will be created too. -. -.PP -.in +5m -.B -q -makes -.B hbf2gf -quiet. -.PP -.in +2m -.na -.nh -.B hbf2gf -'in +\n(.ku -.RB [ -q ] -.RB [ -p ] -.RB [ -g ] -.RB [ -n ] -.I \%subfont-name \%x-resolution -.RI [ \%y-scale \ | \ \%y-resolution ] -.ad -.hy -.PP -.in +5m -This mode is intended for use with -.B \%mktexpk -and its derivates. -Only one -.C GF -file together with a -.C PL -file for the given subfont will be computed, taking the horizontal -resolution and a vertical scaling factor (if the value is smaller than\ 10) -resp. the vertical resolution (otherwise) from the command line, ignoring -the -.B nmb_fonts -parameter of the configuration file. -The last two characters (which are interpreted as the subfont number) are -stripped to get the name for the configuration file (which must end with -\(oq\c -.C \&.cfg \(cq). -No job file will be created. -If option -.B -p -is set, no -.C PL -file is created. -If -.B -g -is set, no -.C GF -file is created. -The extension can be controlled with -.BR -n ; -if set, the extension is \(oq\c -.C \&.gf \(cq, -otherwise \(oq\c -.C \&. <\c -.IR resolution >\c -.C gf \(cq. -.B -q -makes -.B hbf2gf -quiet. -. -.PP -.in +2m -.na -.nh -.B hbf2gf -'in +\n(.ku -.B -t -.RB [ -q ] -.I \%subfont-name -.ad -.hy -.PP -.in +5m -This mode is intended for use with scripts like -.BR \%mktexpk ; -it tests whether the specified subfont name leads to an -.B hbf2gf -configuration file. -It returns 0 on success and prints out the name of that configuration file -(provided the -.B -q -switch isn't set). -This test isn't a thorough one; it only removes the last two characters -and checks whether a configuration file with that name exists. -.PP -See the next section for more details about configuration files. -.PP -Specifying the option -.B --version -returns the current version of -.B hbf2gf -and the used file search library (e.g.\ \c -.BR kpathsea ). -Usage information is shown with the -.B --help -parameter. -. -. -.SH "CONFIGURATION FILE" -Here a sample configuration file (\c -.C gsfs14.cfg ) -for a 56\(mu56 Chinese font in GB encoding; note that all information -about the font is in the -.C jfs56.hbf -file. -See the -.B "FILE SEARCHING" -section how HBF fonts and -.B hbf2gf -configuration files are found. -See the -.B AVAILABILITY -section where to get CJK fonts together with its -.C HBF -files: -.PP -.if t \fC -.nf - hbf_header jfs56.hbf - mag_x 1 - threshold 128 - comment jianti fansongti 56x56 pixel font - - design_size 14.4 - - y_offset -13 - - nmb_files -1 - - output_name gsfs14 - - checksum 123456789 - - dpi_x 300 - - pk_files no - tfm_files yes - - coding codingscheme GuoBiao encoded TeX text - - pk_directory $HBF_TARGET/pk/modeless/gb2312/gsfs14/ - tfm_directory $HBF_TARGET/tfm/gb2312/gsfs14/ -.fi -.if t \fP -.PP -A configuration file is a plain text file consisting of keywords and its -arguments. -A keyword must start a line, otherwise the whole line will be ignored. -If the word starting a line is not a keyword, the line will be ignored too. -Empty lines will also be skipped. -The search for keywords is case insensitive; in contrast, the arguments will -be taken exactly as given (except \(oqyes\(cq and \(oqno\(cq which can be written with -uppercase or lowercase letters). -Each keyword has one argument which must be separated by whitespace (blanks -or tabs) from the keyword and must be on the same line. -Each line must not be longer than 256 characters. -.PP -You can use environment variables in the configuration file. -The escape character starting an environment variable in the configuration -file is always \(oq\c -.C $ \(cq, -even for operating systems like DOS which has other conventions. -.B hbf2gf -recognizes only environment variable names which start with a letter or an -underscore, followed by alphanumeric characters or underscores. -You can surround the variable with braces to indicate where the variable -name ends, for example -.C ${FOO} . -To get a dollar sign you must write \(oq\c -.C $$ \(cq. -The expansion of environment variables in hbf2gf itself (without the help of -either kpathsea, emtexdir, or MiKTeX searching routines) is very limited; -this feature has been carried over from previous versions. -It can't expand variables set in texmf.cnf; it also can't handle more than -one directory as the variable's value. -.B Don't use it except for the \(oqpk_directory\(cq and \(oqtfm_directory\(cq -.B parameters! -.PP -This is the list of all necessary keywords: -.TP -.B hbf_header -The HBF header file name of the input font(s). -.B hbf2gf -uses the given searching mechanism (kpathsea, emtexdir, or MiKTeX) to locate -this file. -.TP -.B output_name -The name stem of the output files. -A running two digit decimal number starting with \(oq\c -.C 01 \(cq -will be appended. -For Unicode fonts see the keyword -.B unicode -below. -This value is in almost all cases identical to the name of the configuration -file. -.PP -And now all optional keywords: -.TP -.B x_offset -Increases the character width. -Will be applied on both sides; default for non-rotated glyphs is the value -given in the HBF header -.RB ( HBF_BITMAP_BOUNDING_BOX ) -scaled to -.B design_size -(in pixels). -.TP -.B y_offset -Shifts all characters up or down; default for non-rotated glyphs is the value -given in the HBF header -.RB ( HBF_BITMAP_BOUNDING_BOX ) -scaled to -.B design_size -(in pixels). -.TP -.B design_size -The design size (in points) of the font. -.B x_offset -and -.B y_offset -refer to this size. -Default is\ 10.0. -.TP -.B slant -The slant of the font (given as \*(DEx\ /\ \*(DEy). -Only values in the range 0\ \(<=\ \fBslant\fP\ \(<=\ 1 are allowed. -Default is\ 0.0. -.TP -.B rotation -If set to \(oqyes\(cq, all glyphs will be rotated 90\ degrees counter-clockwise. -The default offsets as given in the HBF header will be ignored (and set -to\ 0). -Default is \(oqno\(cq. -.TP -.B mag_x -.TQ -.B mag_y -Scaling values of the characters to reach design size. -If only one magnification is given, x and y values are assumed to be equal. -Default is \fBmag_x\fP\ =\ \fBmag_y\fP\ =\ 1.0. -.PP -.TP -.B threshold -A value between 1 and\ 254 defining a threshold for converting the internal -graymap into the output bitmap; lower values cut more pixels. -Default value is\ 128. -.PP -.TP -.B comment -A comment describing the font; default is none. -.PP -.TP -.B nmb_fonts -The number of subfonts to create. -Default value is -1 for creating all fonts. -.TP -.B unicode -If \(oqyes\(cq, a two digit hexadecimal number will be used as a running number, -starting with the value of the first byte of the first code range. -Default is \(oqno\(cq. -.TP -.B min_char -The minimum value of the encoding. -You should set this value to get correct subfile offsets if it is not -identical to the lowest character code in the HBF file. -.PP -.TP -.B dpi_x -.TQ -.B dpi_y -The horizontal and vertical resolution (in dpi) of the printer. -If only one resolution is given, x and y values are assumed to be equal. -Default is\ 300. -.TP -.B checksum -A checksum to identify the -.C GF -files with the appropriate -.C TFM -files. -The default value of this unsigned 32bit integer is\ 0. -.TP -.B coding -A comment describing the coding scheme; default is none. -.PP -.TP -.B pk_directory -The destination directory of the -.C PK -files; default: none. -Attention! -The batch file will not check whether this directory exists. -.TP -.B tfm_directory -The destination directory of the -.C TFM -files; default: none. -Attention! -The batch file will not check whether this directory exists. -.TP -.B pk_files -Whether to create -.C PK -files or not; default is \(oqyes\(cq. -.TP -.B tfm_files -Whether to create -.C TFM -files or not; default is \(oqyes\(cq. -.TP -.B ofm_file -Whether to create an -.C OPL -file or not; default is \(oqno\(cq. -The batch file will then use -.B ovp2ovf -of the Omega distribution to convert it into an -.C OFM -and an -.C OVF -file. -The -.C OPL -file simply maps all subfonts back to a single Omega font. -.TP -.B long_extension -If \(oqyes\(cq, -.C PK -files will include the resolution in the extension (e.g. -.C gsso1201.300pk ). -This affects the batch file only (default is \(oqyes\(cq). -.TP -.B rm_command -The shell command to remove files; default: \(oqrm\(cq. -.TP -.B cp_command -The shell command to copy files; default: \(oqcp\(cq. -.TP -.B job_extension -The extension of the batch file which calls -.B gftopk -and -.B pltotf -to convert the -.C GF -and the -.C PL -files into -.C PK -and -.C TFM -files respectively; default is none. -. -. -.SH "FILE SEARCHING" -.B hbf2gf -uses either the -.BR kpathsea , -.BR emtexdir , -or -.B MiKTeX -library for searching files -.RB ( emtexdir -will work only on operating systems which have an MS-DOSish background, -i.e., MS-DOS, OS/2, Windows; -.B MiKTeX -is for Win32 systems). -. -.SS kpathsea -Please note that older versions of -.B kpathsea -(<3.2) have no special means to seach for program related files. -Additionally, versions older than 3.3 have no default path for miscellaneous -fonts, thus we use the paths for PostScript related stuff if necessary for -fonts resp. configuration files. -The actual version of kpathsea is displayed on screen if you call -.B hbf2gf -.BR --version . -.PP -Here is a table of the file type and the corresponding -.B kpathsea -variables. -.PP -Version\ 3.3 and newer (this won't change again in the future!): -.PP -.in +4m -.ta 2i -.br -.C "\&.hbf MISCFONTS" -.br -.C "\&.cfg HBF2GFINPUTS" -.PP -Version\ 3.2: -.PP -.in +4m -.ta 2i -.br -.C "\&.hbf T1FONTS" -.br -.C "\&.cfg HBF2GFINPUTS" -.PP -And here the same for pre-3.2-versions of -.B kpathsea: -.PP -.in +4m -.ta 2i -.br -.C "\&.hbf T1FONTS" -.br -.C "\&.cfg TEXCONFIG" -.PP -Finally, the same for versions\ \(<=2.6: -.PP -.in +4m -.ta 2i -.br -.C "\&.hbf DVIPSHEADERS" -.br -.C "\&.cfg TEXCONFIG" -.PP -Please consult the info files of -.B kpathsea -for details on these variables. -The decision which naming scheme to use for variables will be done during -compilation. -.PP -You should set the -.C TEXMFCNF -variable to the directory where your -.C texmf.cnf -configuration file resides. -.PP -Here is the proper command to find out to which value a -.B kpathsea -variable is set (we use -.C MISCFONTS -as an example). -This is especially useful if a variable isn't set in -.C texmf.cnf -or in the environment, thus pointing to the default value which is -hard-coded into the -.B kpathsea -library. -.PP -.in +2m -.C "kpsewhich -progname=hbf2gf -expand-var='$MISCFONTS'" -.PP -We select the program name also since it is possible to specify -variables which are searched only for a certain program -- in our -example it would be -.C MISCFONTS.hbf2gf . -.PP -A similar but not identical method is to say -.PP -.in +2m -.C "kpsewhich -progname=hbf2gf -show-path='misc fonts'" -.PP -[A full list of format types can be obtained by saying \(oq\c -.C "kpsewhich --help" \(cq -on the command line prompt.] -This is exactly the how -.B hbf2gf -searches for files; the disadvantage is that all variables are expanded -which can cause very long strings. -. -.SS emtexdir -.PP -Here the list of suffixes and its related environment variables to be set in -.C autoexec.bat -(resp. in -.C config.sys -for OS/2): -.PP -.in +4m -.ta 2i -.br -.C "\&.hbf HBFONTS" -.br -.C "\&.cfg HBFCFG" -.PP -If one of the variables isn't set, a warning message is emitted. -The current directory will always be searched. -As usual, one exclamation mark appended to a directory path causes -subdirectories one level deep to be searched, two exclamation marks causes -all subdirectories to be searched. -Example: -.PP -.in +2m -.C HBFONTS=c:\\\\fonts\\\\hbf!!;d:\\\\myfonts\\\\hbf! -.PP -Constructions like \(oq\c -.C c:\\\\fonts!!\\\\hbf \(cq -aren't possible. -. -.SS MikTeX -.PP -Please consult the documentation files of -.B MiKTeX -for more details. -. -. -.SH LIMITATIONS -The x and y output size must not exceed -.BR MAX_CHAR_SIZE , -which is defined at compile time; its default value is 1023\ (pixel). -. -. -.SH "SEE ALSO" -.BR ttf2pk (1) -.PP -.C hbf2gf.w : -'in +\n(.ku -this is the source code written in -.B CWEB -which can be converted into a pretty-printed \*(TX -document using -.BR cweave . -The CJK package also contains a preformatted -.C hbf2gf.dvi -file. -.PP -the -.B CJK -documentation files (\c -.C hbf2gf.txt ). -.PP -the -.B Hanzi Bitmap File -.RB ( HBF ) -standard version\ 1.3; available at -.C ftp.ifcss.org -.PP -the Omega documentation available at -.C ftp.ens.fr -and the CTAN hosts and mirrors. -. -. -.SH FILES -.TP -.C *.cfg -The -.B hbf2gf -configuration scripts -.TP -.C *.hbf -HBF header files which describe fixed-width bitmap fonts. -Note that the bitmap font name(s) themselves as specified in the header files -are irrelevant for -.BR hbf2gf . -. -. -.SH AVAILABILITY -.B hbf2gf -is part of the CJK macro package for \*(LE -available at the CTAN hosts and its mirrors. -.PP -CJK fonts together with HBF header files can be found at -.C ftp.ifcss.org -and its mirrors. -. -. -.SH AUTHORS -Werner Lemberg -.C -.br -Ross Paterson (the HBF API) -.C diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.c b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.c deleted file mode 100644 index 5ff4bf891a8..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.c +++ /dev/null @@ -1,2242 +0,0 @@ -#define banner \ -"hbf2gf (CJK ver. 4.7.0)" \ - \ - -#define TRUE 1 -#define FALSE 0 \ - -#define STRING_LENGTH 255 \ - -#define FILE_NAME_LENGTH 1024 \ - \ - -#define HBF2GF_VERSION \ -"\n" \ -"Copyright (C) 1996-1999 Werner Lemberg.\n" \ -"There is NO warranty. You may redistribute this software\n" \ -"under the terms of the GNU General Public License\n" \ -"and the HBF library copyright.\n" \ -"\n" \ -"For more information about these matters, see the files\n" \ -"named COPYING and hbf.c.\n" \ -"\n" \ - -#define USAGE \ -"\n" \ -"Usage: hbf2gf [-q] configuration_file[.cfg]\n" \ -" hbf2gf [options] font_name x_resolution [y_scale | y_resolution]\n" \ -" hbf2gf -t [-q] font_name\n" \ -"\n" \ -" Convert a font in HBF format to TeX's GF resp. PK format.\n" \ -"\n" \ -" -q be silent\n" \ -" -p don't produce a PL file\n" \ -" -g don't produce a GF file\n" \ -" -n use no resolution in extension (only `.gf')\n" \ -" -t test for font_name (returns 0 on success)\n" \ -" --help print this message and exit\n" \ -" --version print version number and exit\n" \ -"\n" \ - -#define GF_ID 131 -#define PRE 247 \ - -#define header " hbf2gf output " \ - -#define BOC 67 -#define BOC1 68 -#define EOC 69 \ - -#define _2_16 65536.0 -#define _2_20 1048576.0 \ - -#define XXX1 239 -#define XXX2 240 -#define XXX3 241 -#define XXX4 242 \ - -#define YYY 243 \ - -#define POST 248 \ - -#define CHAR_LOC 245 -#define CHAR_LOC0 246 \ - -#define POSTPOST 249 -#define POSTPOST_ID 223 \ - -#define BLACK 1 -#define WHITE 0 \ - -#define PIXEL_MAXVAL 255 -#define SCALE 4096 -#define HALFSCALE 2048 \ - -#define MAX_CHAR_SIZE 1023 \ - -#define PAINT_(x) (x) -#define PAINT1 64 -#define PAINT2 65 -#define PAINT3 66 \ - -#define SKIP0 70 -#define SKIP1 71 -#define SKIP2 72 -#define SKIP3 73 \ - -#define NEW_ROW_(x) ((x) +74) \ - -#define NOOP 244 \ - -#define EXTENSION_LENGTH 8 \ - -#define GFTOPK_NAME "gftopk" -#define PLTOTF_NAME "pltotf" -#define OVP2OVF_NAME "ovp2ovf" \ - -#define PRINTER_MIN_RES_X 50 -#define PRINTER_MIN_RES_Y 50 \ - -#define VALID_SUBCODE 1 \ - -/*4:*/ -#line 191 "hbf2gf.w" - -/*10:*/ -#line 408 "hbf2gf.w" - -#ifdef HAVE_CONFIG_H -#include "c-auto.h" -#endif -#include -#include -#include -#include -#include -#ifdef TM_IN_SYS_TIME -#include -#endif -#include "hbf.h" - - - -/*:10*//*69:*/ -#line 2469 "hbf2gf.w" - -#if defined(HAVE_LIBKPATHSEA) -#include "kpathsea/kpathsea.h" - -#elif defined(HAVE_EMTEXDIR) -#include "emtexdir.h" - -#elif defined(HAVE_MIKTEX) -#include "miktex.h" -#endif - -/*:69*/ -#line 192 "hbf2gf.w" - -/*11:*/ -#line 429 "hbf2gf.w" - -void write_file(void); - - -/*:11*//*13:*/ -#line 491 "hbf2gf.w" - -void write_pre(void); - - -/*:13*//*16:*/ -#line 579 "hbf2gf.w" - -void write_data(void); - - -/*:16*//*20:*/ -#line 690 "hbf2gf.w" - -void write_post(void); - - -/*:20*//*25:*/ -#line 834 "hbf2gf.w" - -void fputl(long,FILE*); - - -/*:25*//*29:*/ -#line 994 "hbf2gf.w" - -void make_pixel_array(void); - - -/*:29*//*36:*/ -#line 1222 "hbf2gf.w" - -#ifdef __GNUC__ -__inline__ -#endif -void read_row(unsigned char*); - - -/*:36*//*39:*/ -#line 1272 "hbf2gf.w" - -#ifdef __GNUC__ -__inline__ -#endif -void write_row(unsigned char*); - - -/*:39*//*41:*/ -#line 1325 "hbf2gf.w" - -void write_coding(void); - - -/*:41*//*45:*/ -#line 1486 "hbf2gf.w" - -void write_pl(void); - - -/*:45*//*47:*/ -#line 1583 "hbf2gf.w" - -void write_ovp(void); - - -/*:47*//*50:*/ -#line 1728 "hbf2gf.w" - -void write_job(void); - - -/*:50*//*54:*/ -#line 1977 "hbf2gf.w" - -void read_config(void); - - -/*:54*//*64:*/ -#line 2308 "hbf2gf.w" - -int fsearch(const char*); - - -/*:64*//*67:*/ -#line 2447 "hbf2gf.w" - -void config_error(const char*); - - -/*:67*//*71:*/ -#line 2490 "hbf2gf.w" - -const char*TeX_search_version(void); - - -/*:71*//*74:*/ -#line 2525 "hbf2gf.w" - -#ifdef HAVE_EMTEXDIR -extern int setup_list(struct emtex_dir*,char*,const char*,unsigned); -int dir_setup(struct emtex_dir*,const char*,const char*,unsigned); -char*file_find(char*,struct emtex_dir*); -#endif - - -/*:74*//*79:*/ -#line 2613 "hbf2gf.w" - -char*TeX_search_cfg_file(char*); -char*TeX_search_hbf_file(char*); - - -/*:79*/ -#line 193 "hbf2gf.w" - -/*2:*/ -#line 127 "hbf2gf.w" - -int nmb_files= -1; -int unicode= FALSE; - -int testing= FALSE; - -int mf_like= FALSE; -int file_number= 0; - -double x_resolution= 0.0; -double y_scale= 1.0; - -int pk_files= TRUE; -int tfm_files= TRUE; -int long_extension= TRUE; -int quiet= FALSE; - -char config_file[FILE_NAME_LENGTH+4+1]; - -char output_name[STRING_LENGTH+1]; - -FILE*config,*out; -HBF*hbf; - -#ifdef msdos -#define WRITE_BIN "wb" -#define WRITE_TXT "wt" -#define READ_BIN "rb" -#define READ_TXT "rt" -#else -#define WRITE_BIN "w" -#define WRITE_TXT "w" -#define READ_BIN "r" -#define READ_TXT "r" -#endif - -int end_of_file= FALSE; - - -/*:2*//*15:*/ -#line 538 "hbf2gf.w" - -long char_adr[256]; -long*char_adr_p; - -int pk_offset_x; - - -double tfm_offset_x; -int pk_offset_y; - -double tfm_offset_y; - -int input_size_x; -int input_size_y; -const char*font_encoding; -int pk_width; -int pk_output_size_x; - -double tfm_output_size_x; -int pk_output_size_y; -double tfm_output_size_y; - -double design_size= 10.0; -double target_size_x; -double target_size_y; -double magstep_x; -double magstep_y; -double slant; -int rotation; - -double mag_x; -double mag_y; - -int empty_char; -int last_char; - -int dot_count; - - - -/*:15*//*19:*/ -#line 667 "hbf2gf.w" - -char coding[STRING_LENGTH+1]; -char comment[STRING_LENGTH+1]; - -unsigned long checksum; - -long pk_total_min_x; -long pk_total_max_x; -long pk_total_min_y; -long pk_total_max_y; - -int dpi_x; -int dpi_y; -double ppp_x; -double ppp_y; - - -/*:19*//*27:*/ -#line 871 "hbf2gf.w" - -HBF_CHAR code; -const unsigned char*bitmap; - -const unsigned char*bP; - -unsigned char out_char[MAX_CHAR_SIZE*MAX_CHAR_SIZE+1]; - -unsigned char*out_char_p; - -unsigned char pixelrow[MAX_CHAR_SIZE]; -unsigned char temp_pixelrow[MAX_CHAR_SIZE]; -unsigned char new_pixelrow[MAX_CHAR_SIZE+1]; - -int curr_row; - -long grayrow[MAX_CHAR_SIZE]; - -long s_mag_x,s_mag_y,s_slant; - - -/*:27*//*38:*/ -#line 1267 "hbf2gf.w" - -int threshold= 128; - - -/*:38*//*49:*/ -#line 1717 "hbf2gf.w" - -char job_extension[EXTENSION_LENGTH+1]; -char rm_command[STRING_LENGTH+1]; -char cp_command[STRING_LENGTH+1]; -char pk_directory[STRING_LENGTH+1]; -char tfm_directory[STRING_LENGTH+1]; - -int ofm_file= FALSE; - - -/*:49*//*53:*/ -#line 1972 "hbf2gf.w" - -char Buffer[STRING_LENGTH+1]; - - -/*:53*//*58:*/ -#line 2090 "hbf2gf.w" - -int offset_x; -int offset_y; - -HBF_CHAR user_min_char; -int have_min_char= FALSE; - -/*:58*//*60:*/ -#line 2247 "hbf2gf.w" - -HBF_CHAR min_char,max_char; - - -/*:60*//*62:*/ -#line 2274 "hbf2gf.w" - -char b2_codes[256]; -unsigned char min_2_byte,max_2_byte; -int nmb_2_bytes= 0; - - -/*:62*//*70:*/ -#line 2481 "hbf2gf.w" - -#if defined(HAVE_EMTEXDIR) -char emtex_version_string[]= "emTeXdir"; -#elif !defined(HAVE_MIKTEX) -char no_version_string[]= "no search library"; -#endif - - -/*:70*//*73:*/ -#line 2518 "hbf2gf.w" - -#ifdef HAVE_EMTEXDIR -struct emtex_dir cfg_path,hbf_path; -#endif - - -/*:73*//*76:*/ -#line 2564 "hbf2gf.w" - -char name_buffer[FILE_NAME_LENGTH+1]; - - -/*:76*/ -#line 194 "hbf2gf.w" - - - -int main(int argc,char*argv[]) -{char*p; - -/*78:*/ -#line 2586 "hbf2gf.w" - -#if defined(HAVE_LIBKPATHSEA) -kpse_set_program_name(argv[0],"hbf2gf"); -kpse_init_prog("HBF2GF",300,"cx","cmr10"); - -#elif defined(HAVE_EMTEXDIR) -if(!dir_setup(&cfg_path,"HBFCFG",NULL,EDS_BANG)) -{fprintf(stderr, -"Couldn't setup search path for configuration files\n"); -exit(1); -} -if(!dir_setup(&hbf_path,"HBFONTS",NULL,EDS_BANG)) -{fprintf(stderr, -"Couldn't setup search path for HBF header files\n"); -exit(1); -} -#endif - - -/*:78*/ -#line 200 "hbf2gf.w" - - -/*7:*/ -#line 307 "hbf2gf.w" - -if(argc==2) -{if(strcmp(argv[1],"--help")==0) -/*6:*/ -#line 288 "hbf2gf.w" - -{printf(USAGE); -exit(0); -} - - -/*:6*/ -#line 310 "hbf2gf.w" - -else if(strcmp(argv[1],"--version")==0) -/*5:*/ -#line 261 "hbf2gf.w" - -{printf("\n"); -printf(banner); -printf(" (%s)\n",TeX_search_version()); -printf(HBF2GF_VERSION); -exit(0); -} - - -/*:5*/ -#line 312 "hbf2gf.w" - -} - -while(argc> 1) -{p= argv[1]; -if(p[0]!='-') -break; -if(p[1]=='p') -tfm_files= FALSE; -else if(p[1]=='g') -pk_files= FALSE; -else if(p[1]=='n') -long_extension= FALSE; -else if(p[1]=='q') -quiet= TRUE; -else if(p[1]=='t') -testing= TRUE; - -argv++; -argc--; -} - -if(testing) -{if(argc!=2) -{fprintf(stderr,"Need exactly one parameter for `-t' option.\n"); -fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); -exit(1); -} -} -else if(argc<2||argc> 4) -{fprintf(stderr,"Invalid number of parameters.\n"); -fprintf(stderr,"Try `hbf2gf --help' for more information.\n"); -exit(1); -} - - -/*:7*/ -#line 202 "hbf2gf.w" - - -if(!quiet) -printf("\n%s\n\n",banner); - -strncpy(config_file,argv[1],FILE_NAME_LENGTH); -config_file[FILE_NAME_LENGTH]= '\0'; - -if(argc> 2||testing) -{int l= strlen(config_file); - -if(l> 2) -config_file[l-2]= '\0'; - -else -{if(!quiet) -printf("`%s' can't be a subfont created by hbf2gf\n", -config_file); -exit(2); -} - -mf_like= TRUE; -} - -read_config(); - -if(mf_like) -/*8:*/ -#line 352 "hbf2gf.w" - -{if(unicode) -file_number= (int)strtol(&argv[1][strlen(argv[1])-2], -(char**)NULL,16); -else -file_number= atoi(&argv[1][strlen(argv[1])-2]); - -x_resolution= atof(argv[2]); -if(x_resolution 3) -{y_scale= atof(argv[3]); -if(y_scale<0.01) -{fprintf(stderr, -"Invalid vertical scaling factor or resolution\n"); -exit(1); -} -if(y_scale> 10.0) -y_scale= (double)x_resolution/y_scale; -} -} - - -/*:8*/ -#line 229 "hbf2gf.w" - - -/*28:*/ -#line 903 "hbf2gf.w" - -{int col,offset; - -if(rotation) -{int tmp; - - -tmp= input_size_x; -input_size_x= input_size_y; -input_size_y= tmp; -} - -if(mf_like) -{target_size_x= design_size*(x_resolution/dpi_x); -target_size_y= design_size*(x_resolution*y_scale/dpi_y); -} -else -target_size_x= target_size_y= design_size; -magstep_x= target_size_x/design_size; -magstep_y= target_size_y/design_size; - -pk_offset_x= offset_x*magstep_x+0.5; -pk_offset_y= offset_y*magstep_y+0.5; -tfm_offset_x= offset_x/(dpi_x/72.27)/design_size; -tfm_offset_y= offset_y/(dpi_y/72.27)/design_size; - -pk_width= input_size_x*mag_x*magstep_x+0.5; -pk_output_size_x= input_size_x*mag_x*magstep_x+ -input_size_y*mag_y*magstep_y*slant+0.5; -pk_output_size_y= input_size_y*mag_y*magstep_y+0.5; -tfm_output_size_x= input_size_x*mag_x/ -(dpi_x/72.27)/design_size; -tfm_output_size_y= input_size_y*mag_y/ -(dpi_y/72.27)/design_size; -if(pk_output_size_x> MAX_CHAR_SIZE) -{fprintf(stderr,"Output character box width too big\n"); -exit(1); -} -if(pk_output_size_y> MAX_CHAR_SIZE) -{fprintf(stderr,"Output character box height too big\n"); -exit(1); -} - -for(col= 0;col=0x100)) -{fprintf(stderr,"Invalid subfile number\n"); -exit(1); -} - -if(unicode) -{offset= 0; -code= file_number*0x100; -} -else -{offset= (file_number-1)*256%nmb_2_bytes; -code= (min_char&0xFF00)+min_2_byte+ -(file_number-1)*256/nmb_2_bytes*0x100; -} - -while(offset--) -while(!b2_codes[code++&0xFF]) - -; - -if(code> max_char) -{fprintf(stderr,"Invalid subfile number\n"); -exit(1); -} -} - -s_mag_x= mag_x*magstep_x*SCALE; -s_mag_y= mag_y*magstep_y*SCALE; -s_slant= slant*SCALE; -} - - -/*:28*/ -#line 231 "hbf2gf.w" - - -/*9:*/ -#line 387 "hbf2gf.w" - -{int j,max_numb; - -if(!mf_like) -{file_number= (unicode==TRUE?(min_char>>8):1); -if(nmb_files==-1) -max_numb= (unicode==TRUE?0x100:100); -else -max_numb= nmb_files; -} -else -max_numb= 1; - -for(j= 0;(j>24,f); -fputc(num>>16,f); -fputc(num>>8,f); -fputc(num,f); -} - - -/*:26*//*30:*/ -#line 999 "hbf2gf.w" - -void make_pixel_array(void) -{unsigned char*prP; -unsigned char*temp_prP; -unsigned char*new_prP; -long*grP; - -register unsigned char*xP; -register unsigned char*nxP; - -register int row,col; -int rows_read= 0; -register int need_to_read_row= 1; - -long frac_row_to_fill= SCALE; -long frac_row_left= s_mag_y; - -int no_code= FALSE; - - -prP= pixelrow; -temp_prP= temp_pixelrow; -new_prP= new_pixelrow; -grP= grayrow; -out_char_p= out_char; - -again: -if(b2_codes[code&0xFF]) -{if(pk_files) -{bitmap= hbfGetBitmap(hbf,code); -bP= bitmap; - - -if(!bitmap) -empty_char= TRUE; -else -/*31:*/ -#line 1058 "hbf2gf.w" - -{if(pk_output_size_y==input_size_y) -temp_prP= prP; - -curr_row= input_size_y-1; -for(row= 0;row PIXEL_MAXVAL) -g= PIXEL_MAXVAL; - -*nxP= g; -grP[col]= HALFSCALE; -} - -frac_row_left-= frac_row_to_fill; -if(frac_row_left==0) -{frac_row_left= s_mag_y; -need_to_read_row= 1; -} -frac_row_to_fill= SCALE; - - -/*:33*/ -#line 1092 "hbf2gf.w" - -} - - -/*:32*/ -#line 1064 "hbf2gf.w" - -/*34:*/ -#line 1140 "hbf2gf.w" - -if(pk_width==input_size_x&&s_slant==0) - -write_row(temp_prP); -else -{register long g= HALFSCALE; -register long frac_col_to_fill= SCALE; -register long frac_col_left; -register int need_col= 0; - - -nxP= new_prP; - -frac_col_left= (pk_output_size_y-row)*s_slant; -while(frac_col_left>=frac_col_to_fill) -{*(nxP++)= 0; -frac_col_left-= frac_col_to_fill; -} - -if(frac_col_left> 0) -frac_col_to_fill-= frac_col_left; - -for(col= 0,xP= temp_prP;col=frac_col_to_fill) -{if(need_col) -{++nxP; -g= HALFSCALE; -} - -g+= frac_col_to_fill*(*xP); -g/= SCALE; -if(g> PIXEL_MAXVAL) -g= PIXEL_MAXVAL; - -*nxP= g; -frac_col_left-= frac_col_to_fill; -frac_col_to_fill= SCALE; -need_col= 1; -} - -if(frac_col_left> 0) -{if(need_col) -{++nxP; -g= HALFSCALE; -need_col= 0; -} - -g+= frac_col_left*(*xP); -frac_col_to_fill-= frac_col_left; -} -} - -/*35:*/ -#line 1198 "hbf2gf.w" - -if(frac_col_to_fill> 0) -{--xP; -g+= frac_col_to_fill*(*xP); -} - -if(!need_col) -{g/= SCALE; -if(g> PIXEL_MAXVAL) -g= PIXEL_MAXVAL; -*nxP= g; -} - -*(++nxP)= 0; - -write_row(new_prP); - - -/*:35*/ -#line 1193 "hbf2gf.w" - -} - - -/*:34*/ -#line 1066 "hbf2gf.w" - -} -} - - -/*:31*/ -#line 1035 "hbf2gf.w" - -} -} -else -no_code= TRUE; - -if((code&0xFF)==max_2_byte) -code+= 0xFF-(max_2_byte-min_2_byte); -if(code>=max_char) -{end_of_file= TRUE; -return; -} - -code++; - -if(no_code) -{no_code= FALSE; -goto again; -} -} - - -/*:30*//*37:*/ -#line 1230 "hbf2gf.w" - -#ifdef __GNUC__ -__inline__ -#endif -void read_row(unsigned char*pixelrow) -{register int col,bitshift,offset; -register unsigned char*xP; -register unsigned char item= 0; - -if(rotation) -{bitshift= 7-(curr_row%8); -offset= (input_size_y+7)/8; -bP= bitmap+curr_row/8; -for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; -bP+= offset; -} -curr_row--; -} -else -{bitshift= -1; -for(col= 0,xP= pixelrow;col>bitshift)&1)==1?PIXEL_MAXVAL:0; ---bitshift; -} -} -} - - -/*:37*//*40:*/ -#line 1280 "hbf2gf.w" - -#ifdef __GNUC__ -__inline__ -#endif -void write_row(unsigned char*pixelrow) -{register int col; -register unsigned char*xP; - -for(col= 0,xP= pixelrow;col=threshold)?1:0; - -} - - -/*:40*//*42:*/ -#line 1333 "hbf2gf.w" - -void write_coding(void) -{register int count,skip; -register unsigned char paint; -register int x,y; -register unsigned char*cp; - -x= 0; -y= 0; -cp= out_char+y*pk_output_size_x+x; -count= skip= 0; -paint= WHITE; -goto start; - -while(y>8,out); -fputc(count&0xFF,out); -} -} -} -else -{if(skip==1) -fputc(SKIP0,out); -else -{if(skip<256) -{fputc(SKIP1,out); -fputc(skip,out); -} -else -{fputc(SKIP2,out); -fputc(skip>>8,out); -fputc(skip&0xFF,out); -} -} -skip= 0; -if(count<64) -fputc(PAINT_(count),out); -else if(count<256) -{fputc(PAINT1,out); -fputc(count,out); -} -else -{fputc(PAINT2,out); -fputc(count>>8,out); -fputc(count&0xFF,out); -} -} -count= 0; -paint= BLACK; -break; -} -x++; -cp++; -} -if(x>=pk_output_size_x) -{skip++; -y++; -continue; -} - - -/*:43*/ -#line 1348 "hbf2gf.w" - -start: -/*44:*/ -#line 1425 "hbf2gf.w" - -while(x>8,out); -fputc(count&0xFF,out); -} -count= 1; -paint= BLACK-paint; -} -x++; -cp++; -} -if(paint==BLACK) -{if(count<64) -fputc(PAINT_(count),out); -else if(count<256) -{fputc(PAINT1,out); -fputc(count,out); -} -else -{fputc(PAINT2,out); -fputc(count>>8,out); -fputc(count&0xFF,out); -} -paint= WHITE; -} - - - -/*:44*/ -#line 1350 "hbf2gf.w" - -y++; -} -} - - -/*:42*//*46:*/ -#line 1491 "hbf2gf.w" - -void write_pl(void) -{int i,pos; -char output_file[FILE_NAME_LENGTH+1]; -long t,sc; -char*s; -char tfm_header[]= "Created by hbf2gf"; - -file_number--; - -if(mf_like) -{if(unicode) -sprintf(output_file,"%s%02x.pl",output_name,file_number); -else -sprintf(output_file,"%s%02i.pl",output_name,file_number); -} -else -sprintf(output_file,"%s.pl",output_name); - -if(!(out= fopen(output_file,WRITE_TXT))) -{fprintf(stderr,"Couldn't open `%s'\n",output_file); -exit(1); -} -if(!quiet) -printf("\nWriting `%s'\n",output_file); - -fprintf(out, -"\n(FAMILY %s%d)" -"\n(CODINGSCHEME CJK-%s)", -output_name,file_number,font_encoding); - -fprintf(out, -"\n(DESIGNSIZE R %.6f)" -"\n(COMMENT DESIGNSIZE IS IN POINTS)" -"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" -"\n(CHECKSUM O %lo)" -"\n(FONTDIMEN" -"\n (SLANT R %.6f)" -"\n (SPACE R 0.0)" -"\n (STRETCH R 0.0)" -"\n (SHRINK R 0.0)" -"\n (XHEIGHT R 1.0)" -"\n (QUAD R 1.0)" -"\n (EXTRASPACE R 0.0)" -"\n )",design_size,checksum,slant); - -s= tfm_header; -i= strlen(s); -t= ((long)i)<<24; -sc= 16; -pos= 18; - -fprintf(out,"\n"); -while(i> 0) -{t|= ((long)(*(unsigned char*)s++))<=256) -nmb_subfonts++; - -sprintf(output_file,"%s.ovp",output_name); - -if(!(out= fopen(output_file,WRITE_TXT))) -{fprintf(stderr,"Couldn't open `%s'\n",output_file); -exit(1); -} -if(!quiet) -printf("\nWriting `%s'\n",output_file); - -fprintf(out, -"\n(VTITLE Omega virtual font created by hbf2gf)" -"\n(DESIGNSIZE R %.6f)" -"\n(COMMENT DESIGNSIZE IS IN POINTS)" -"\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)" -"\n(CHECKSUM O %lo)" -"\n(FONTDIMEN" -"\n (SLANT R %.6f)" -"\n (SPACE R 0.0)" -"\n (STRETCH R 0.0)" -"\n (SHRINK R 0.0)" -"\n (XHEIGHT R 1.0)" -"\n (QUAD R 1.0)" -"\n (EXTRASPACE R 0.0)" -"\n )",design_size,checksum,slant); - -s= ofm_header; -i= strlen(s); -t= ((long)i)<<24; -sc= 16; -pos= 18; - -fprintf(out,"\n"); -while(i> 0) -{t|= ((long)(*(unsigned char*)s++))<>8),j= 0;j>8),j= 0;jhbf_height; -input_size_y= boxp->hbf_width; -font_encoding= hbfProperty(hbf,"HBF_CODE_SCHEME"); - -if(!fsearch("output_name")) -config_error("output_name"); -else -strcpy(output_name,Buffer); -} - - -/*:57*/ -#line 2024 "hbf2gf.w" - -/*59:*/ -#line 2098 "hbf2gf.w" - -{if(fsearch("nmb_files")) -nmb_files= atoi(Buffer); -if(fsearch("unicode")) -if(Buffer[0]=='y'||Buffer[0]=='Y') -unicode= TRUE; -if(fsearch("min_char")) -{user_min_char= strtoul(Buffer,(char**)NULL,0); -have_min_char= TRUE; -} - -if(!mf_like) -{if(fsearch("pk_files")) -if(Buffer[0]=='n'||Buffer[0]=='N') -pk_files= FALSE; -if(fsearch("tfm_files")) -if(Buffer[0]=='n'||Buffer[0]=='N') -tfm_files= FALSE; -if(fsearch("ofm_file")) -if(Buffer[0]=='y'||Buffer[0]=='Y') -ofm_file= TRUE; -if(fsearch("long_extension")) -if(Buffer[0]=='n'||Buffer[0]=='N') -long_extension= FALSE; -} - -if(fsearch("slant")) -slant= atof(Buffer); -if(slant<0.0||slant> 1.0) -{fprintf(stderr,"Invalid slant\n"); -exit(1); -} -if(fsearch("rotation")) -if(Buffer[0]=='y'||Buffer[0]=='Y') -rotation= TRUE; - -if(fsearch("mag_x")) -mag_x= atof(Buffer); -if(fsearch("mag_y")) -mag_y= atof(Buffer); -if(!mag_x&&!mag_y) -{mag_x= 1.0; -mag_y= 1.0; -} -if(mag_x&&!mag_y) -mag_y= mag_x; -if(mag_y&&!mag_x) -mag_x= mag_y; -if(mag_x<=0.0) -{fprintf(stderr,"Invalid horizontal magnification\n"); -exit(1); -} -if(mag_y<=0.0) -{fprintf(stderr,"Invalid vertical magnification\n"); -exit(1); -} - -if(fsearch("dpi_x")) -dpi_x= atoi(Buffer); -if(fsearch("dpi_y")) -dpi_y= atoi(Buffer); -if(!dpi_x&&!dpi_y) -{dpi_x= 300; -dpi_y= 300; -} -if(dpi_x&&!dpi_y) -dpi_y= dpi_x; -if(dpi_y&&!dpi_x) -dpi_x= dpi_y; -if(dpi_x<=PRINTER_MIN_RES_X) -{fprintf(stderr,"Invalid horizontal printer resolution\n"); -exit(1); -} -if(dpi_y<=PRINTER_MIN_RES_Y) -{fprintf(stderr,"Invalid vertical printer resolution\n"); -exit(1); -} - -if(fsearch("design_size")) -design_size= atof(Buffer); - -if(fsearch("x_offset")) -offset_x= atoi(Buffer); -else -offset_x= rotation?0:(boxp->hbf_xDisplacement*mag_x+0.5); -if(fsearch("y_offset")) -offset_y= atoi(Buffer); -else -offset_y= rotation?0:(boxp->hbf_yDisplacement*mag_y+0.5); -if(!fsearch("comment")) -comment[0]= '\0'; -else -strcpy(comment,Buffer); - -if(fsearch("threshold")) -threshold= atoi(Buffer); -if(threshold<=0||threshold>=255) -{fprintf(stderr,"Invalid threshold\n"); -exit(1); -} - -if(!fsearch("checksum")) -checksum= 0; -else -checksum= strtoul(Buffer,(char**)NULL,0); - -if(!fsearch("coding")) -coding[0]= '\0'; -else -strcpy(coding,Buffer); - -if(!fsearch("pk_directory")) -pk_directory[0]= '\0'; -else -strcpy(pk_directory,Buffer); - -if(!fsearch("tfm_directory")) -tfm_directory[0]= '\0'; -else -strcpy(tfm_directory,Buffer); - -if(fsearch("rm_command")) -strcpy(rm_command,Buffer); -else -strcpy(rm_command,"rm"); - -if(fsearch("cp_command")) -strcpy(cp_command,Buffer); -else -strcpy(cp_command,"cp"); - -if(!fsearch("job_extension")) -job_extension[0]= '\0'; -else -{strncpy(job_extension,Buffer,EXTENSION_LENGTH); -job_extension[EXTENSION_LENGTH]= '\0'; -} -} - - -/*:59*/ -#line 2025 "hbf2gf.w" - - -/*61:*/ -#line 2252 "hbf2gf.w" - -{const void*cp; -HBF_CHAR dummy; - -cp= hbfGetCodeRange(hbf,NULL,&min_char,&max_char); -for(;cp!=NULL;cp= hbfGetCodeRange(hbf,cp,&dummy,&max_char)) -; - -if(have_min_char) -min_char= user_min_char; -} - - -/*:61*/ -#line 2027 "hbf2gf.w" - -/*63:*/ -#line 2281 "hbf2gf.w" - -{const void*b2r; -unsigned char dummy; -int i; - -for(i= 0;i<256;i++) -b2_codes[i]= 0; - -b2r= hbfGetByte2Range(hbf,NULL,&min_2_byte,&max_2_byte); -dummy= min_2_byte; -for(;b2r!=NULL;b2r= hbfGetByte2Range(hbf,b2r,&dummy,&max_2_byte)) -{for(i= dummy;i<=max_2_byte;i++) -b2_codes[i]= VALID_SUBCODE; -} - -for(i= 0;i<256;i++) -if(b2_codes[i]==VALID_SUBCODE) -nmb_2_bytes++; -} - - -/*:63*/ -#line 2028 "hbf2gf.w" - - -fclose(config); -} - - -/*:55*//*65:*/ -#line 2313 "hbf2gf.w" - -int fsearch(const char*search_string) -{char*P,p; -const char*Q; -char temp_buffer[STRING_LENGTH+1]; -char env_name[STRING_LENGTH+1]; -char*env_p; -char*env_value; -char*Buf_p; -int Ch,ch,old_ch= '\n'; -int count= STRING_LENGTH; - -rewind(config); - -do -{Q= search_string; -p= tolower(*Q); -Ch= fgetc(config); -ch= tolower(Ch); -while(!(ch==p&&old_ch=='\n')&&Ch!=EOF) - - -{old_ch= ch; -Ch= fgetc(config); -ch= tolower(Ch); -} - -for(;;) -{if(*(++Q)=='\0') -if((Ch= fgetc(config))==' '||Ch=='\t') - -goto success; -Ch= fgetc(config); -if(tolower(Ch)!=tolower(*Q)) -break; -} -} -while(Ch!=EOF); - -return 0; - -success: -P= temp_buffer; - -while((Ch= fgetc(config))==' '||Ch=='\t') - -; -while(Ch!='\n'&&--count> 0&&Ch!=EOF) -{*P++= Ch; -Ch= fgetc(config); -} -*P= '\0'; - -if(*temp_buffer) -/*66:*/ -#line 2392 "hbf2gf.w" - -{P= temp_buffer; -Buf_p= Buffer; -count= STRING_LENGTH-1; - -while(*P&&count> 0) -{env_p= env_name; - -if(*P=='$') -{P++; -if(*P=='$') -{*(Buf_p++)= *(P++); -count--; -continue; -} -while(*P=='{') -P++; -if(!(isalpha(*P)||*P=='_')) -{fprintf(stderr, -"Invalid environment variable name in configuration file\n"); -exit(1); -} -*(env_p++)= *(P++); -while(*P) -{if(isalnum(*P)||*P=='_') -*(env_p++)= *(P++); -else -{while(*P=='}') -P++; -*env_p= '\0'; -break; -} -} - -env_value= getenv(env_name); -if(env_value) -{while(*env_value&&count> 0) -{*(Buf_p++)= *(env_value++); -count--; -} -} -} -else -{*(Buf_p++)= *(P++); -count--; -} -} -*Buf_p= '\0'; -} - - -/*:66*/ -#line 2367 "hbf2gf.w" - -else -*Buffer= '\0'; - -return(*Buffer)?1:0; -} - - -/*:65*//*68:*/ -#line 2452 "hbf2gf.w" - -void config_error(const char*message) -{fprintf(stderr,"Couldn't find `%s' entry in configuration file\n", -message); -exit(1); -} - - - -/*:68*//*72:*/ -#line 2495 "hbf2gf.w" - -const char*TeX_search_version(void) -{ -#if defined(HAVE_LIBKPATHSEA) -return kpathsea_version_string; -#elif defined(HAVE_EMTEXDIR) -return emtex_version_string; -#elif defined(HAVE_MIKTEX) -char buf[200]; - -strcpy(buf,"MiKTeX "); -miktex_get_miktex_version_string_ex(buf+7,sizeof(buf)-7); - -return buf; -#else -return no_version_string; -#endif -} - - -/*:72*//*75:*/ -#line 2537 "hbf2gf.w" - -#ifdef HAVE_EMTEXDIR -int dir_setup(ed,env,dir,flags) -struct emtex_dir*ed; -const char*env; -const char*dir; -unsigned flags; - -{const char*val; -char path[260]; - -ed->alloc= 0; -ed->used= 0; -ed->list= NULL; - -if(env!=NULL&&(val= getenv(env))!=NULL) -return setup_list(ed,path,val,flags); -else -fprintf(stderr, -"Environment variable `%s' not set; use current directory\n", -env); - -return TRUE; -} - - -/*:75*//*77:*/ -#line 2569 "hbf2gf.w" - -char*file_find(name,list) -char*name; -struct emtex_dir*list; - -{if(emtex_dir_find(name_buffer,sizeof(name_buffer),list,name,EDF_CWD)) -return name_buffer; - -return NULL; -} -#endif - - -/*:77*//*80:*/ -#line 2619 "hbf2gf.w" - -#if defined(HAVE_LIBKPATHSEA) -char*TeX_search_cfg_file(char*name) -{ -return kpse_find_file(name,kpse_program_text_format,TRUE); -} - - -char*TeX_search_hbf_file(char*name) -{ -return kpse_find_file(name,kpse_miscfonts_format,TRUE); -} - - -#elif defined(HAVE_EMTEXDIR) -char*TeX_search_cfg_file(char*name) -{return file_find(name,&cfg_path); -} - - -char*TeX_search_hbf_file(char*name) -{return file_find(name,&hbf_path); -} - - -#elif defined(HAVE_MIKTEX) -char*TeX_search_cfg_file(char*name) -{char result[_MAX_PATH]; - -if(!miktex_find_input_file("hbf2gf",*name,result)) -return 0; -return strdup(result); -} - - -char*TeX_search_hbf_file(char*name) -{char result[_MAX_PATH]; - - -if(!miktex_find_miscfont_file(*name,result)) -return 0; -return strdup(result); -} - - -#else -char*TeX_search_cfg_file(char*name) -{return name; -} - - -char*TeX_search_hbf_file(char*name) -{return name; -} -#endif - - - -/*:80*/ diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.def b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.def deleted file mode 100644 index 25eeb107b7e..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.def +++ /dev/null @@ -1,3 +0,0 @@ -NAME HBF2GF WINDOWCOMPAT -DESCRIPTION 'hbf2gf (CJK Ver. 4.7.0)' -STACKSIZE 0x80000 diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.dvi b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.dvi deleted file mode 100644 index 8eb81e334d7..00000000000 Binary files a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.dvi and /dev/null differ diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.idx b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.idx deleted file mode 100644 index fdf1ac2a8d1..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.idx +++ /dev/null @@ -1,326 +0,0 @@ -\I\.{\_\_GNUC\_\_}, 36, 37, 39, 40. -\I\&{\_\_inline\_\_}, 36, 37, 39, 40. -\I\.{\_MAX\_PATH}, 80. -\I\.{\_2\_16}, \[19], 23. -\I\.{\_2\_20}, \[19], 21. -\I\\{again}, \[30]. -\I\\{alloc}, 75. -\I\\{argc}, \[4], 7, 8. -\I\\{argv}, \[4], 7, 8, 78. -\I\\{atof}, 8, 59. -\I\\{atoi}, 8, 59. -\I\\{banner}, \[1], 4, 5. -\I\\{bitmap}, \[27], 30, 36, 37. -\I\\{bitshift}, \[37]. -\I\.{BLACK}, \[27], 43, 44. -\I\.{BOC}, \[18]. -\I\.{BOC1}, \[18]. -\I\\{boxp}, \[55], 57, 59. -\I\\{bP}, \[27], 30, 37. -\I\\{buf}, \[72]. -\I\\{Buf\_p}, \[65], 66. -\I\\{buffer}, \[51]. -\I\\{Buffer}, \[53], 57, 59, 64, 65, 66. -\I\\{b2\_codes}, 28, 30, 48, \[62], 63. -\I\\{b2r}, \[63]. -\I\|{c}, \[48]. -\I\\{cfg\_path}, \[73], 78, 80. -\I\\{ch}, \[65]. -\I\\{Ch}, \[65]. -\I\\{char\_adr}, \[15], 17, 23. -\I\\{char\_adr\_p}, \[15], 17, 18, 23. -\I\.{CHAR\_LOC}, \[23]. -\I\.{CHAR\_LOC0}, \[23]. -\I\\{checksum}, \[19], 23, 46, 48, 59. -\I\\{code}, \[27], 28, 30. -\I\\{coding}, \[19], 22, 59. -\I\\{col}, \[28], \[30], 32, 33, 34, \[37], \[40]. -\I\\{comment}, \[19], 22, 59. -\I\\{config}, \[2], 55, 65. -\I\\{config\_error}, 57, \[67], \[68]. -\I\\{config\_file}, \[2], 4, 55, 56. -\I\\{count}, \[42], 43, 44, \[48], \[65], 66. -\I\\{cp}, \[42], 43, 44, \[61]. -\I\\{cp\_command}, \[49], 51, 59. -\I\\{curr\_row}, \[27], 31, 37. -\I\\{design\_size}, \[15], 21, 28, 46, 48, 59. -\I\\{designsize}, \[21], 23. -\I\\{dir}, \[75]. -\I\\{dir\_setup}, \[74], \[75], 78. -\I\\{dot\_count}, \[15], 17, 18. -\I\\{dpi\_x}, \[19], 21, 28, 51, 59. -\I\\{dpi\_y}, \[19], 21, 28, 59. -\I\\{dummy}, \[61], \[63]. -\I\\{ed}, \[75]. -\I\.{EDF\_CWD}, 77. -\I\.{EDS\_BANG}, 78. -\I\\{empty\_char}, \[15], 18, 30. -\I\&{emtex\_dir}, 73, 74, 75, 77. -\I\\{emtex\_dir\_find}, 77. -\I\\{emtex\_dir\_setup}, 75. -\I\\{emtex\_version\_string}, \[70], 72. -\I\\{end\_of\_file}, \[2], 9, 17, 18, 27, 30. -\I\\{env}, \[75]. -\I\\{env\_name}, \[65], 66. -\I\\{env\_p}, \[65], 66. -\I\\{env\_value}, \[65], 66. -\I\.{EOC}, \[18]. -\I\.{EOF}, 27, 65. -\I\\{exit}, 4, 5, 6, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 78. -\I\.{EXTENSION\_LENGTH}, \[49], 59. -\I\|{f}, \[26]. -\I\.{FALSE}, \[2], 7, 18, 30, 49, 58, 59. -\I\\{fclose}, 12, 46, 48, 51, 55. -\I\\{fflush}, 18. -\I\\{fgetc}, 65. -\I\\{file\_find}, \[74], \[77], 80. -\I\\{file\_name}, 4. -\I\.{FILE\_NAME\_LENGTH}, \[2], 4, 12, 46, 48, 51, 76. -\I\\{file\_number}, \[2], 8, 9, 12, 28, 46. -\I\\{flags}, \[75]. -\I\\{font\_encoding}, \[15], 46, 57. -\I\\{fopen}, 12, 46, 48, 51, 55, 69. -\I\\{fprintf}, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 75, 78. -\I\\{fputc}, 14, 18, 22, 23, 24, 26, 43, 44. -\I\\{fputl}, 18, 23, 24, \[25], \[26]. -\I\\{fputs}, 14, 22. -\I\\{frac\_col\_left}, \[34]. -\I\\{frac\_col\_to\_fill}, \[34], 35. -\I\\{frac\_row\_left}, \[30], 32, 33. -\I\\{frac\_row\_to\_fill}, \[30], 32, 33. -\I\\{fsearch}, 57, 59, \[64], \[65]. -\I\\{ftell}, 18, 22, 23, 24. -\I\|{g}, \[33], \[34]. -\I\\{getenv}, 66, 75. -\I\.{GF\_ID}, \[13], 14, 24. -\I\.{GFTOPK\_NAME}, \[49], 51. -\I\\{grayrow}, \[27], 28, 30. -\I\\{grP}, \[30], 32, 33. -\I\.{HALFSCALE}, \[27], 28, 33, 34. -\I\.{HAVE\_CONFIG\_H}, 10. -\I\.{HAVE\_EMTEXDIR}, 69, 70, 72, 73, 74, 75, 78, 80. -\I\.{HAVE\_LIBKPATHSEA}, 69, 72, 78, 80. -\I\.{HAVE\_MIKTEX}, 69, 70, 72, 80. -\I\\{have\_min\_char}, \[58], 59, 61. -\I\&{HBF}, 2. -\I\\{hbf}, \[2], 4, 30, 57, 61, 63. -\I\&{HBF\_BBOX}, 55. -\I\&{HBF\_CHAR}, 27, 58, 60, 61. -\I\\{hbf\_header}, \[57]. -\I\\{hbf\_height}, 57. -\I\\{hbf\_path}, \[73], 78, 80. -\I\\{hbf\_width}, 57. -\I\\{hbf\_xDisplacement}, 59. -\I\\{hbf\_yDisplacement}, 59. -\I\\{hbfBitmapBBox}, 57. -\I\\{hbfClose}, 4. -\I\\{hbfDebug}, 57. -\I\\{hbfGetBitmap}, 30. -\I\\{hbfGetByte2Range}, 62, 63. -\I\\{hbfGetCodeRange}, 60, 61. -\I\\{hbfOpen}, 57. -\I\\{hbfProperty}, 57. -\I\.{HBF2GF\_VERSION}, \[5]. -\I\\{header}, \[13], 14. -\I\|{i}, \[21], \[46], \[48], \[51], \[56], \[63]. -\I\\{input\_size\_x}, \[15], 28, 32, 33, 34, 36, 37, 57. -\I\\{input\_size\_y}, \[15], 28, 31, 32, 33, 37, 57. -\I\\{isalnum}, 66. -\I\\{isalpha}, 66. -\I\\{item}, \[37]. -\I\|{j}, \[9], \[51]. -\I\\{job\_extension}, \[49], 51, 59. -\I\\{kpathsea\_version\_string}, 72. -\I\\{kpse\_find\_file}, 80. -\I\\{kpse\_init\_prog}, 78. -\I\\{kpse\_miscfonts\_format}, 80. -\I\\{kpse\_program\_text\_format}, 80. -\I\\{kpse\_set\_program\_name}, 78. -\I\|{l}, \[4]. -\I\\{last\_char}, \[15], 17, 18, 23. -\I\\{lastext}, \[56]. -\I\\{list}, 75, \[77]. -\I\\{localtime}, 14. -\I\\{long\_extension}, \[2], 7, 12, 51, 59. -\I\\{mag\_x}, \[15], 28, 59. -\I\\{mag\_y}, \[15], 28, 59. -\I\\{magstep\_x}, \[15], 21, 28, 51. -\I\\{magstep\_y}, \[15], 21, 28. -\I\\{main}, \[4]. -\I\\{make\_pixel\_array}, 18, 27, \[29], \[30]. -\I\\{max\_char}, 28, 30, 48, \[60], 61. -\I\.{MAX\_CHAR\_SIZE}, 23, \[27], 28, 52, 81. -\I\\{max\_numb}, \[9]. -\I\\{max\_2\_byte}, 30, \[62], 63. -\I\\{message}, \[68]. -\I\\{mf\_like}, \[2], 4, 9, 12, 28, 46, 55, 59. -\I\\{miktex\_find\_input\_file}, 80. -\I\\{miktex\_find\_miscfont\_file}, 80. -\I\\{miktex\_get\_miktex\_version\_string\_ex}, 72. -\I\\{min\_char}, 9, 28, 48, 51, \[60], 61. -\I\\{min\_2\_byte}, 28, 30, \[62], 63. -\I$\msdos$, 2. -\I\\{name}, \[77], \[80]. -\I\\{name\_buffer}, \[76], 77. -\I\\{need\_col}, \[34], 35. -\I\\{need\_to\_read\_row}, \[30], 32, 33. -\I\\{new\_pixelrow}, \[27], 30. -\I\\{new\_prP}, \[30], 34, 35. -\I\.{NEW\_ROW\_}, \[41], 43. -\I\\{nmb\_files}, \[2], 3, 9, 49, 51, 59. -\I\\{nmb\_subfonts}, \[48]. -\I\\{nmb\_2\_bytes}, 28, 48, \[62], 63. -\I\\{no\_code}, \[30]. -\I\\{no\_version\_string}, \[70], 72. -\I\.{NOOP}, \[41]. -\I\\{num}, \[26]. -\I\\{nxP}, \[30], 33, 34, 35. -\I\\{offset}, \[28], \[37]. -\I\\{offset\_x}, 28, \[58], 59. -\I\\{offset\_y}, 28, \[58], 59. -\I\\{ofm\_file}, 4, \[49], 51, 59. -\I\\{ofm\_header}, \[48]. -\I\\{old\_ch}, \[65]. -\I\\{out}, \[2], 12, 14, 18, 22, 23, 24, 43, 44, 46, 48, \[51]. -\I\\{out\_char}, \[27], 30, 42, 43. -\I\\{out\_char\_p}, \[27], 30, 40. -\I\\{out\_s}, \[14]. -\I\\{output\_file}, \[12], \[46], \[48]. -\I\\{output\_name}, \[2], 12, 46, 48, 49, 51, 57. -\I\.{OVP2OVF\_NAME}, \[49], 51. -\I\|{P}, \[65]. -\I\|{p}, \[4], \[65]. -\I\\{paint}, \[42], 43, 44. -\I\.{PAINT\_}, \[41], 43, 44. -\I\.{PAINT1}, \[41], 43, 44. -\I\.{PAINT2}, \[41], 43, 44. -\I\.{PAINT3}, \[41]. -\I\\{path}, \[75]. -\I\.{PIXEL\_MAXVAL}, \[27], 33, 34, 35, 37. -\I\\{pixelrow}, \[27], 30, \[37], \[40]. -\I\\{pk\_directory}, \[49], 51, 59. -\I\\{pk\_dx}, 19, \[21], 23. -\I\\{pk\_files}, \[2], 7, 12, 18, 30, 51, 59. -\I\\{pk\_offset\_x}, \[15], 18, 21, 28. -\I\\{pk\_offset\_y}, \[15], 18, 21, 28. -\I\\{pk\_output\_size\_x}, \[15], 18, 21, 28, 40, 42, 43, 44, 52. -\I\\{pk\_output\_size\_y}, \[15], 18, 21, 28, 31, 32, 34, 42, 52. -\I\\{pk\_total\_max\_x}, \[19], 21, 23. -\I\\{pk\_total\_max\_y}, \[19], 21, 23. -\I\\{pk\_total\_min\_x}, \[19], 21, 23. -\I\\{pk\_total\_min\_y}, \[19], 21, 23. -\I\\{pk\_width}, \[15], 21, 28, 34. -\I\.{PLTOTF\_NAME}, \[49], 51. -\I\\{pos}, \[46], \[48]. -\I\.{POST}, \[23], 24. -\I\\{post\_adr}, \[21], 23, 24. -\I\.{POSTPOST}, \[24]. -\I\.{POSTPOST\_ID}, \[24]. -\I\\{ppp\_x}, \[19], 21, 23. -\I\\{ppp\_y}, \[19], 21, 23. -\I\.{PRE}, \[13], 14. -\I\.{PRINTER\_MIN\_RES\_X}, 8, \[53], 59. -\I\.{PRINTER\_MIN\_RES\_Y}, \[53], 59. -\I\\{printf}, 4, 5, 6, 12, 18, 46, 48, 51, 55. -\I\\{prP}, \[30], 31, 32, 33. -\I\|{Q}, \[65]. -\I\\{quiet}, \[2], 4, 7, 12, 18, 46, 48, 51, 55. -\I\.{READ\_BIN}, \[2]. -\I\\{read\_config}, 4, \[54], \[55]. -\I\\{read\_row}, 27, 30, 32, 33, \[36], \[37]. -\I\.{READ\_TXT}, \[2], 55. -\I\\{real\_config\_file}, \[55]. -\I\\{real\_hbf\_header}, \[57]. -\I\\{remainder}, \[48]. -\I\\{result}, \[80]. -\I\\{rewind}, 65. -\I\\{rm\_command}, \[49], 51, 59. -\I\\{rotation}, \[15], 28, 36, 37, 59. -\I\\{row}, \[30], 31, 34. -\I\\{rows\_read}, \[30], 32, 33. -\I\|{s}, \[14], \[46], \[48]. -\I\\{s\_mag\_x}, \[27], 28, 34. -\I\\{s\_mag\_y}, \[27], 28, 30, 32, 33. -\I\\{s\_slant}, \[27], 28, 34. -\I\\{sc}, \[46], \[48]. -\I\.{SCALE}, \[27], 28, 30, 33, 34, 35. -\I\\{search\_string}, \[65]. -\I\\{secs\_now}, \[14]. -\I\\{setup\_list}, \[74], 75. -\I\\{skip}, \[42], 43. -\I\.{SKIP0}, \[41], 43. -\I\.{SKIP1}, \[41], 43. -\I\.{SKIP2}, \[41], 43. -\I\.{SKIP3}, \[41]. -\I\\{slant}, \[15], 28, 46, 48, 52, 59. -\I\\{special\_adr}, \[21], 22, 23. -\I\\{sprintf}, 12, 46, 48. -\I\\{start}, \[42]. -\I\\{stderr}, 7, 8, 12, 28, 46, 48, 51, 55, 57, 59, 66, 68, 75, 78. -\I\\{stdout}, 18. -\I\\{strcat}, 14, 51, 56. -\I\\{strcmp}, 7. -\I\\{strcpy}, 14, 51, 57, 59, 72. -\I\\{strdup}, 80. -\I\\{strftime}, 14. -\I\.{STRING\_LENGTH}, \[2], 19, 49, 53, 57, 65, 66. -\I\\{strlen}, 4, 8, 14, 22, 46, 48. -\I\\{strncpy}, 4, 59. -\I\\{strtol}, 8. -\I\\{strtoul}, 59. -\I\\{success}, \[65]. -\I\|{t}, \[46], \[48]. -\I\\{target\_size\_x}, \[15], 28. -\I\\{target\_size\_y}, \[15], 28. -\I\\{temp}, \[21], 24. -\I\\{temp\_buffer}, \[65], 66. -\I\\{temp\_pixelrow}, \[27], 30. -\I\\{temp\_prP}, \[30], 31, 33, 34. -\I\\{testing}, \[2], 4, 7, 55. -\I\\{TeX\_search\_cfg\_file}, 55, \[79], \[80]. -\I\\{TeX\_search\_hbf\_file}, 57, \[79], \[80]. -\I\\{TeX\_search\_version}, 5, \[71], \[72]. -\I\\{tfm\_directory}, \[49], 51, 59. -\I\\{tfm\_files}, \[2], 4, 7, 51, 59. -\I\\{tfm\_header}, \[46]. -\I\\{tfm\_offset\_x}, \[15], 21, 28, 46, 48. -\I\\{tfm\_offset\_y}, \[15], 28, 46, 48. -\I\\{tfm\_output\_size\_x}, \[15], 21, 28, 46, 48. -\I\\{tfm\_output\_size\_y}, \[15], 28, 46, 48. -\I\\{tfm\_width}, 19, \[21], 23. -\I\\{threshold}, \[38], 40, 59. -\I\\{time}, 14. -\I\\{time\_now}, \[14]. -\I\&{tm}, 14. -\I\.{TM\_IN\_SYS\_TIME}, 10. -\I\\{tmp}, \[28]. -\I\\{tolower}, 65. -\I\.{TRUE}, \[2], 4, 7, 9, 30, 59, 75, 80. -\I\\{unicode}, \[2], 8, 9, 12, 28, 46, 51, 59. -\I\.{USAGE}, \[6]. -\I\\{used}, 75. -\I\\{user\_min\_char}, \[58], 59, 61. -\I\\{val}, \[75]. -\I\.{VALID\_SUBCODE}, 48, \[62], 63. -\I\.{WHITE}, \[27], 42, 44. -\I\.{WRITE\_BIN}, \[2], 12. -\I\\{write\_coding}, 18, \[41], \[42]. -\I\\{write\_data}, 11, 12, 15, \[16], \[17]. -\I\\{write\_file}, 4, 9, \[11], \[12]. -\I\\{write\_job}, 4, \[50], \[51]. -\I\\{write\_ovp}, 4, \[47], \[48]. -\I\\{write\_pl}, 4, \[45], \[46], 47. -\I\\{write\_post}, 11, 12, 19, \[20], \[21]. -\I\\{write\_pre}, 11, 12, \[13], \[14]. -\I\\{write\_row}, 30, 34, 35, 38, \[39], \[40]. -\I\.{WRITE\_TXT}, \[2], 46, 48, 51. -\I\|{x}, \[42]. -\I\\{x\_resolution}, \[2], 4, 8, 12, 28, 52. -\I\\{xP}, \[30], 32, 33, 34, 35, \[37], \[40]. -\I\.{XXX1}, \[22]. -\I\.{XXX2}, \[22]. -\I\.{XXX3}, \[22]. -\I\.{XXX4}, \[22]. -\I\|{y}, \[42]. -\I\\{y\_scale}, \[2], 4, 8, 28, 52. -\I\.{YYY}, \[22]. diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.scn b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.scn deleted file mode 100644 index 0d39715d758..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.scn +++ /dev/null @@ -1,56 +0,0 @@ -\I\X66:Check for environment variables\X -\U65. -\I\X8:Check other arguments\X -\U4. -\I\X61:Get code range\X -\U55. -\I\X63:Get sub code range\X -\U55. -\I\X2, 15, 19, 27, 38, 49, 53, 58, 60, 62, 70, 73, 76:Global variables\X -\U4. -\I\X56:Handle extension\X -\U55. -\I\X10, 69:Include files\X -\U4. -\I\X78:Initialize \TeX\ file searching\X -\U4. -\I\X28:Initialize variables\X -\U4. -\I\X57:Necessary parameters\X -\U55. -\I\X59:Optional parameters\X -\U55. -\I\X23:Post section\X -\U21. -\I\X24:Postpost section\X -\U21. -\I\X6:Print help information\X -\U7. -\I\X5:Print version\X -\U7. -\I\X44:Process rest of line\X -\U42. -\I\X33:Produce a temporary row\X -\U32. -\I\X11, 13, 16, 20, 25, 29, 36, 39, 41, 45, 47, 50, 54, 64, 67, 71, 74, -79:Prototypes\X -\U4. -\I\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[\,]} -and write it into \PB{\\{out\_char}[\,]}\X -\U31. -\I\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}\X -\U31. -\I\X31:Scale row by row\X -\U30. -\I\X7:Scan options\X -\U4. -\I\X43:Search blank lines\X -\U42. -\I\X22:Special section\X -\U21. -\I\X18:Write character\X -\U17. -\I\X9:Write files\X -\U4. -\I\X35:Write out a row\X -\U34. diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.tex b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.tex deleted file mode 100644 index c637786b20e..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.tex +++ /dev/null @@ -1,2928 +0,0 @@ -\input cwebmac -% This is the cweb file hbf2gf.w of the CJK package ver. 4.7.0 17-Oct-2006 - -% Copyright (C) 1994-2006 Werner Lemberg -% -% 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 in doc/COPYING; if not, write to the Free -% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -% MA 02110-1301 USA - -% To print this CWEB file you should (but not must) use the CWEAVE of the -% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say -% -% cweave +ai hbf2gf.w -% -% This (fully compatible) CWEAVE can transform CWEB-files with alternative -% output rules (look at the position of braces below!) the author (it's me -% too :-) prefer. Otherwise this file will be formatted traditionally. - -\font\meta=logo10 -\def\mf{{\meta META}\-{\meta FONT}} -\def\Om{\char "0A} % Omega symbol - -\def\title{hbf2gf (CJK Version 4.7.0)} - -\def\topofcontents{ - \null\vfill - \centerline{\titlefont The {\ttitlefont hbf2gf} program} - \vskip 20pt - \centerline{(CJK Version 4.7.0)} - \vfill} - -\def\botofcontents{ - \vfill - \noindent - Copyright \copyright~1996-1999 by Werner Lemberg - \bigskip\noindent - Permission is granted to make and distribute verbatim copies of this - document provided that the copyright notice and this permission notice are - preserved on all copies. - - \smallskip\noindent - Permission is granted to copy and distribute modified versions of this - document under the conditions for verbatim copying, provided that the - entire resulting derived work is distributed under the terms of a - permission notice identical to this one.} - -\pageno=\contentspagenumber \advance\pageno by 1 -\let\maybe=\iftrue -\fullpageheight=240mm -\pageheight=223mm -\pagewidth=158mm -\setpage -\frenchspacing - - -\def\msdos{\.{msdos}} - - - - - -\N{1}{1}Introduction. -This is the \.{hbf2gf} program by Werner Lemberg -(\.{wl@gnu.org}). - -The ``banner line'' defined here should be changed whenever \.{hbf2gf} is -modified. - -\Y\B\4\D$\\{banner}$ \5 -\.{"hbf2gf\ (CJK\ ver.\ 4.}\)\.{7.0)"}\par -\fi - -\M{2} -\.{hbf2gf} is intended to convert Hanzi Bitmap Fonts (HBF) into \TeX\ -generic font files (\.{GF} files) according to the \\{CJK} package, which -\.{hbf2gf} is part of. - -The outline of \.{hbf2gf} is simple: a CJK (Chinese/Japanese/Korean) bitmap -file will be scaled and written in at most \PB{\\{nmb\_files}} \.{GF} files, -each -file containing \PB{\T{256}}~characters (except the last and possibly the first -one). In the normal case it's not necessary to compute the right value of -\PB{\\{nmb\_files}} because \.{hbf2gf} will do this; you should use \PB{${-}% -\T{1}$} instead to -indicate this. See the last section for an example. - -Alternatively you can call \.{hbf2gf} similar to \mf, i.e., the program will -compute one font on demand. This mode will be used if two or three input -parameters instead of one are given: the font name, the horizontal -resolution, and optionally a vertical scaling factor or resolution to allow -modes for e.g.\ $300\times600\,\hbox{dpi}$ printers. \.{hbf2gf} will extract -the configuration file name from the font name; if this file isn't found, -the program exits with error code~\PB{\T{2}} (this is useful for scripts like -\.{mktexpk}). If the configuration file is found but an error occurs while -computing the font, error code~\PB{\T{1}} is returned. In case of success, the -exit -code is zero. - -The characters in the input font files are completely described by the HBF -header file. This program uses the HBF API implementation of Ross Paterson -(\.{ross@soi.city.ac.uk}; with small extensions). You will find a -description of the HBF standard at \.{ftp.ifcss.org}. - -A batch file created by \.{hbf2gf} too (if the program computes a whole set -of subfonts) will convert the \.{GF} files to \.{PK} files using -\.{GFtoPK}, a part of every \TeX\ package. - -\Y\B\4\D$\.{TRUE}$ \5 -\T{1}\par -\B\4\D$\.{FALSE}$ \5 -\T{0}\Y\par -\B\4\D$\.{STRING\_LENGTH}$ \5 -\T{255}\C{ the maximal length of an input string in the configuration file }\par -\B\4\D$\.{FILE\_NAME\_LENGTH}$ \5 -\T{1024}\C{ the maximal length (including the path) of a filename }\Y\par -\Y\B\4\X2:Global variables\X${}\E{}$\6 -\&{int} \\{nmb\_files}${}\K{-}\T{1}{}$;\C{ create all files by default }\6 -\&{int} \\{unicode}${}\K\.{FALSE}{}$;\C{ whether a Unicode font should be -processed }\7 -\&{int} \\{testing}${}\K\.{FALSE}{}$;\C{ whether we test only the font name }\7 -\&{int} \\{mf\_like}${}\K\.{FALSE}{}$;\C{ whether we are in the \mf-like mode }% -\6 -\&{int} \\{file\_number}${}\K\T{0}{}$;\C{ the subfont number }\7 -\&{double} \\{x\_resolution}${}\K\T{0.0}{}$;\C{ the second and third input -parameter }\6 -\&{double} \\{y\_scale}${}\K\T{1.0}{}$;\7 -\&{int} \\{pk\_files}${}\K\.{TRUE}{}$;\C{ command line options }\6 -\&{int} \\{tfm\_files}${}\K\.{TRUE};{}$\6 -\&{int} \\{long\_extension}${}\K\.{TRUE};{}$\6 -\&{int} \\{quiet}${}\K\.{FALSE}{}$;\7 -\&{char} ${}\\{config\_file}[\.{FILE\_NAME\_LENGTH}+\T{4}+\T{1}]{}$;\C{ we -probably must add `\.{.cfg}' }\6 -\&{char} ${}\\{output\_name}[\.{STRING\_LENGTH}+\T{1}]{}$;\7 -\&{FILE} ${}{*}\\{config},{}$ ${}{*}\\{out};{}$\6 -\&{HBF} ${}{*}\\{hbf}{}$;\7 -\8\#\&{ifdef} ${}\msdos{}$\C{ if we compile under DOS or OS/2 }\6 -\8\#\&{define} \.{WRITE\_BIN} \5\.{"wb"}\6 -\8\#\&{define} \.{WRITE\_TXT} \5\.{"wt"}\6 -\8\#\&{define} \.{READ\_BIN} \5\.{"rb"}\6 -\8\#\&{define} \.{READ\_TXT} \5\.{"rt"}\6 -\8\#\&{else}\6 -\8\#\&{define} \.{WRITE\_BIN} \5\.{"w"}\6 -\8\#\&{define} \.{WRITE\_TXT} \5\.{"w"}\6 -\8\#\&{define} \.{READ\_BIN} \5\.{"r"}\6 -\8\#\&{define} \.{READ\_TXT} \5\.{"r"}\6 -\8\#\&{endif}\7 -\&{int} \\{end\_of\_file}${}\K\.{FALSE}{}$;\par -\As15, 19, 27, 38, 49, 53, 58, 60, 62, 70, 73\ETs76. -\U4.\fi - -\M{3} -One \.{PL} file will be created additionally, which describes the font -metrics in a readable way. Because all CJK characters have identical -bounding boxes, one metrics file is enough---the batch job created by -\.{hbf2gf} calls \.{PLtoTF} to produce this \.{TFM} file and then copies -it into \PB{\\{nmb\_files}} metrics files. There usually will be a discrepancy -between the number of characters in the last \.{GF} file and the -\.{TFM} file, but this does not harm. - -If you specify the \.{ofm\_file} option in the configuration file, an -extended virtual property file (such files have the extension \.{.ovp}) for -the \Om\ system is written; this will be then converted with -\.{ovp2ovf} into an \.{OFM} and an \.{OVF} file to map all the subfonts -into one large virtual font. - - - -\fi - -\N{1}{4}The main routine. -The main routine takes \PB{\\{file\_name}}, \PB{\\{x\_resolution}}, and \PB{% -\\{y\_scale}} as command -line parameters if in \mf-like mode, otherwise \PB{\\{config\_file}} as the -only -argument. \PB{\\{read\_config}(\,)} scans the configuration file and fills the -global -variables, \PB{\\{write\_file}(\,)} writes the \.{GF} files, \PB{\\{write\_pl}(% -\,)} and -\PB{\\{write\_ovp}(\,)} write the \.{PL} and \.{OVP} files respectively, and -\PB{\\{write\_job}(\,)} the batch file. - -\Y\B\X10:Include files\X\6 -\X11:Prototypes\X\6 -\X2:Global variables\X\7 -\&{int} \\{main}(\&{int} \\{argc}${},\39{}$\&{char} ${}{*}\\{argv}[\,]){}$\1\1% -\2\2\6 -${}\{{}$\1\6 -\&{char} ${}{*}\|p;{}$\7 -\X78:Initialize \TeX\ file searching\X\7 -\X7:Scan options\X\7 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"\\n\%s\\n\\n"},\39\\{banner}){}$;\2\7 -${}\\{strncpy}(\\{config\_file},\39\\{argv}[\T{1}],\39\.{FILE\_NAME% -\_LENGTH});{}$\6 -${}\\{config\_file}[\.{FILE\_NAME\_LENGTH}]\K\.{'\\0'}{}$;\7 -\&{if} ${}(\\{argc}>\T{2}\V\\{testing}){}$\5 -${}\{{}$\1\6 -\&{int} \|l${}\K\\{strlen}(\\{config\_file});{}$\7 -\&{if} ${}(\|l>\T{2}){}$\1\5 -${}\\{config\_file}[\|l-\T{2}]\K\.{'\\0'}{}$;\C{ strip subfont number from file -name }\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"`\%s'\ can't\ be\ a\ sub}\)\.{font\ created\ by\ hbf2}\)\.{gf% -\\n"},\39\\{config\_file});{}$\2\6 -\\{exit}(\T{2});\6 -\4${}\}{}$\2\7 -${}\\{mf\_like}\K\.{TRUE};{}$\6 -\4${}\}{}$\2\7 -\\{read\_config}(\,);\C{ will call \PB{\\{exit}(\T{1})} on errors }\7 -\&{if} (\\{mf\_like})\1\5 -\X8:Check other arguments\X\2\7 -\X28:Initialize variables\X\7 -\X9:Write files\X\7 -\&{if} (\\{tfm\_files})\1\5 -\\{write\_pl}(\,);\2\6 -\&{if} (\\{ofm\_file})\1\5 -\\{write\_ovp}(\,);\2\6 -\&{if} ${}(\R\\{mf\_like}){}$\1\5 -\\{write\_job}(\,);\2\7 -\\{hbfClose}(\\{hbf});\7 -\\{exit}(\T{0});\6 -\&{return} \T{0};\C{ never reached }\6 -\4${}\}{}$\2\par -\fi - -\M{5} -\Y\B\4\D$\.{HBF2GF\_VERSION}$ \6 -\.{"\\n"}\6 -\.{"Copyright\ (C)\ 1996-}\)\.{1999\ Werner\ Lemberg.}\)\.{\\n"}\6 -\.{"There\ is\ NO\ warrant}\)\.{y.\ \ You\ may\ redistri}\)\.{bute\ this\ -software\\n}\)\.{"}\6 -\.{"under\ the\ terms\ of\ }\)\.{the\ GNU\ General\ Publ}\)\.{ic\ License\\n"}\6 -\.{"and\ the\ HBF\ library}\)\.{\ copyright.\\n"}\6 -\.{"\\n"}\6 -\.{"For\ more\ informatio}\)\.{n\ about\ these\ matter}\)\.{s,\ see\ the\ files% -\\n"}\6 -\.{"named\ COPYING\ and\ h}\)\.{bf.c.\\n"}\6 -\.{"\\n"}\par -\Y\B\4\X5:Print version\X${}\E{}$\6 -${}\{{}$\1\6 -\\{printf}(\.{"\\n"});\6 -\\{printf}(\\{banner});\6 -${}\\{printf}(\.{"\ (\%s)\\n"},\39\\{TeX\_search\_version}(\,));{}$\6 -\\{printf}(\.{HBF2GF\_VERSION});\6 -\\{exit}(\T{0});\6 -\4${}\}{}$\2\par -\U7.\fi - -\M{6} -\Y\B\4\D$\.{USAGE}$ \6 -\.{"\\n"}\6 -\.{"Usage:\ hbf2gf\ [-q]\ }\)\.{configuration\_file[.}\)\.{cfg]\\n"}\6 -\.{"\ \ \ \ \ \ \ hbf2gf\ [opti}\)\.{ons]\ font\_name\ x\_res}\)\.{olution\ [y% -\_scale\ |\ y}\)\.{\_resolution]\\n"}\6 -\.{"\ \ \ \ \ \ \ hbf2gf\ -t\ [-}\)\.{q]\ font\_name\\n"}\6 -\.{"\\n"}\6 -\.{"\ \ Convert\ a\ font\ in}\)\.{\ HBF\ format\ to\ TeX's}\)\.{\ GF\ resp.\ PK% -\ format.}\)\.{\\n"}\6 -\.{"\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ -q\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ be\ silent\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ -p\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ don't\ produce\ a}\)\.{% -\ PL\ file\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ -g\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ don't\ produce\ a}\)\.{% -\ GF\ file\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ -n\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ use\ no\ resoluti}\)% -\.{on\ in\ extension\ (onl}\)\.{y\ `.gf')\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ -t\ \ \ \ \ \ \ \ }\)\.{\ \ \ \ \ test\ for\ font\_n}\)% -\.{ame\ (returns\ 0\ on\ su}\)\.{ccess)\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ --help\ \ \ \ }\)\.{\ \ \ \ \ print\ this\ mess}\)\.{age\ -and\ exit\\n"}\6 -\.{"\ \ \ \ \ \ \ \ \ --version\ }\)\.{\ \ \ \ \ print\ version\ n}\)\.{umber\ -and\ exit\\n"}\6 -\.{"\\n"}\par -\Y\B\4\X6:Print help information\X${}\E{}$\6 -${}\{{}$\1\6 -\\{printf}(\.{USAGE});\6 -\\{exit}(\T{0});\6 -\4${}\}{}$\2\par -\U7.\fi - -\M{7} -Three options can be specified to the program (\.{-p}, \.{-g}, and \.{-n}) -if in \mf-like mode to suppress creation of a \.{PL} resp.\ a -\.{GF} file, and to force a `\.{.gf}' extension (instead of -e.g.\ `\.{.300gf}'). The corresponding setting of a particular switch in the -configuration file is ignored then. - -Additionally, the option \.{-t} tests whether the specified subfont name -leads to an \.{hbf2gf} configuration file. It returns 0 on success and prints -out the name of that configuration file (provided the \.{-q} switch isn't -set). This test isn't a thorough one; it only removes the last two characters -and checks whether a configuration file with that name exists. - -\Y\B\4\X7:Scan options\X${}\E{}$\6 -\&{if} ${}(\\{argc}\E\T{2}){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{strcmp}(\\{argv}[\T{1}],\39\.{"--help"})\E\T{0}){}$\1\5 -\X6:Print help information\X\2\6 -\&{else} \&{if} ${}(\\{strcmp}(\\{argv}[\T{1}],\39\.{"--version"})\E\T{0}){}$\1% -\5 -\X5:Print version\X\2\6 -\4${}\}{}$\2\7 -\&{while} ${}(\\{argc}>\T{1}){}$\5 -${}\{{}$\1\6 -${}\|p\K\\{argv}[\T{1}];{}$\6 -\&{if} ${}(\|p[\T{0}]\I\.{'-'}){}$\1\5 -\&{break};\2\6 -\&{if} ${}(\|p[\T{1}]\E\.{'p'}){}$\1\5 -${}\\{tfm\_files}\K\.{FALSE};{}$\2\6 -\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'g'}){}$\1\5 -${}\\{pk\_files}\K\.{FALSE};{}$\2\6 -\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'n'}){}$\1\5 -${}\\{long\_extension}\K\.{FALSE};{}$\2\6 -\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'q'}){}$\1\5 -${}\\{quiet}\K\.{TRUE};{}$\2\6 -\&{else} \&{if} ${}(\|p[\T{1}]\E\.{'t'}){}$\1\5 -${}\\{testing}\K\.{TRUE}{}$;\2\7 -${}\\{argv}\PP;{}$\6 -${}\\{argc}\MM;{}$\6 -\4${}\}{}$\2\7 -\&{if} (\\{testing})\5 -${}\{{}$\1\6 -\&{if} ${}(\\{argc}\I\T{2}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Need\ exactly\ one\ pa}\)\.{rameter\ for\ `-t'% -\ opt}\)\.{ion.\\n"});{}$\6 -${}\\{fprintf}(\\{stderr},\39\.{"Try\ `hbf2gf\ --help'}\)\.{\ for\ more\ -informatio}\)\.{n.\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else} \&{if} ${}(\\{argc}<\T{2}\V\\{argc}>\T{4}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ number\ of\ p}\)\.{arameters.% -\\n"});{}$\6 -${}\\{fprintf}(\\{stderr},\39\.{"Try\ `hbf2gf\ --help'}\)\.{\ for\ more\ -informatio}\)\.{n.\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\Y\par -\U4.\fi - -\M{8} -If the (optional) argument is larger than~\PB{\T{10}}, we treat it as a value -for -the vertical resolution (in dpi), otherwise as a vertical scaling factor. - -\Y\B\4\X8:Check other arguments\X${}\E{}$\6 -${}\{{}$\1\6 -\&{if} (\\{unicode})\1\5 -${}\\{file\_number}\K{}$(\&{int}) \\{strtol}${}({\AND}\\{argv}[\T{1}][% -\\{strlen}(\\{argv}[\T{1}])-\T{2}],\39{}$(\&{char} ${}{*}{*}){}$ ${}\NULL,\39% -\T{16});{}$\2\6 -\&{else}\1\5 -${}\\{file\_number}\K\\{atoi}({\AND}\\{argv}[\T{1}][\\{strlen}(\\{argv}[% -\T{1}])-\T{2}]){}$;\2\7 -${}\\{x\_resolution}\K\\{atof}(\\{argv}[\T{2}]);{}$\6 -\&{if} ${}(\\{x\_resolution}<\.{PRINTER\_MIN\_RES\_X}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{resolution% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{if} ${}(\\{argc}>\T{3}){}$\5 -${}\{{}$\1\6 -${}\\{y\_scale}\K\\{atof}(\\{argv}[\T{3}]);{}$\6 -\&{if} ${}(\\{y\_scale}<\T{0.01}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ sc}\)\.{aling\ factor\ or\ -reso}\)\.{lution\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{y\_scale}>\T{10.0}){}$\1\5 -${}\\{y\_scale}\K{}$(\&{double}) \\{x\_resolution}${}/\\{y\_scale};{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\U4.\fi - -\M{9} -If \PB{\\{unicode}} is \PB{\.{TRUE}}, the start value of the running number -appended to -the base name of the output font files is taken from the HBF header file, -otherwise it starts with~`\.{01}'. \PB{\\{min\_char}} represents the lower -bound of -the code range. - -If we are in \mf-like mode, \PB{\\{file\_number}} is taken from the command -line, -and \PB{\\{max\_numb}} will be set to~\PB{\T{1}}. - -\Y\B\4\X9:Write files\X${}\E{}$\6 -${}\{{}$\1\6 -\&{int} \|j${},{}$ \\{max\_numb};\7 -\&{if} ${}(\R\\{mf\_like}){}$\5 -${}\{{}$\1\6 -${}\\{file\_number}\K(\\{unicode}\E\.{TRUE}\?(\\{min\_char}\GG\T{8}):\T{1});{}$% -\6 -\&{if} ${}(\\{nmb\_files}\E{-}\T{1}){}$\1\5 -${}\\{max\_numb}\K(\\{unicode}\E\.{TRUE}\?\T{\^100}:\T{100});{}$\2\6 -\&{else}\1\5 -${}\\{max\_numb}\K\\{nmb\_files};{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -${}\\{max\_numb}\K\T{1}{}$;\2\7 -\&{for} ${}(\|j\K\T{0};{}$ ${}(\|j<\\{max\_numb})\W\R\\{end\_of\_file};{}$ ${}% -\\{file\_number}\PP,\39\|j\PP){}$\1\5 -\\{write\_file}(\,);\2\7 -${}\\{nmb\_files}\K\|j{}$;\C{ the real number of output font files }\6 -\4${}\}{}$\2\par -\U4.\fi - -\M{10} -\Y\B\4\X10:Include files\X${}\E{}$\6 -\8\#\&{ifdef} \.{HAVE\_CONFIG\_H}\6 -\8\#\&{include} \.{"c-auto.h"}\6 -\8\#\&{endif}\6 -\8\#\&{include} \.{}\6 -\8\#\&{include} \.{}\6 -\8\#\&{include} \.{}\6 -\8\#\&{include} \.{}\6 -\8\#\&{include} \.{}\6 -\8\#\&{ifdef} \.{TM\_IN\_SYS\_TIME}\6 -\8\#\&{include} \.{}\6 -\8\#\&{endif}\6 -\8\#\&{include} \.{"hbf.h"}\par -\A69. -\U4.\fi - -\N{1}{11}The functions. -The first function to be described is \PB{\\{write\_file}(\,)}. Each \.{GF} -file -consists of three sections: a preamble, a data section, and a postamble. The -functions \PB{\\{write\_pre}(\,)}, \PB{\\{write\_data}(\,)}, and \PB{\\{write% -\_post}(\,)} handle this. - -\Y\B\4\X11:Prototypes\X${}\E{}$\6 -\&{void} \\{write\_file}(\&{void});\par -\As13, 16, 20, 25, 29, 36, 39, 41, 45, 47, 50, 54, 64, 67, 71, 74\ETs79. -\U4.\fi - -\M{12} -In \mf-like mode we create font file name extensions similar to \mf\ if -the \.{-n} option isn't specified; otherwise only `\.{.gf}' will be appended. - -\Y\B\&{void} \\{write\_file}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\7 -\&{if} (\\{pk\_files})\5 -${}\{{}$\1\6 -\&{if} (\\{mf\_like})\5 -${}\{{}$\1\6 -\&{if} (\\{unicode})\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.\%.0igf"},{}$\6 -\\{output\_name}${},\39\\{file\_number},\39\\{long\_extension}\?(\&{int})(\\{x% -\_resolution}+\T{0.5}):\T{0});{}$\2\6 -\&{else}\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.\%.0igf"},{}$\6 -\\{output\_name}${},\39\\{file\_number},\39\\{long\_extension}\?(\&{int})(\\{x% -\_resolution}+\T{0.5}):\T{0});{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} (\\{unicode})\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.gf"},\39\\{output\_name},\39% -\\{file\_number});{}$\2\6 -\&{else}\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.gf"},\39\\{output\_name},\39% -\\{file\_number});{}$\2\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_BIN}))){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% -\_file});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"Writing\ `\%s'\ "},\39\\{output\_file}){}$;\2\7 -\\{write\_pre}(\,);\6 -\\{write\_data}(\,);\6 -\\{write\_post}(\,);\6 -\\{fclose}(\\{out});\7 -\&{if} ${}(\R\\{quiet}){}$\1\5 -\\{printf}(\.{"\\n"});\2\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -\\{write\_data}(\,);\2\6 -\4${}\}{}$\2\par -\fi - -\M{13} -The preamble has two bytes at the very beginning, \PB{\.{PRE}} and \PB{\.{GF% -\_ID}}. \PB{\.{PRE}} -starts the preamble, and \PB{\.{GF\_ID}} is the Generic Font Identity Byte. The -next -bytes are a string in Pascal format containing a header, the date, and the -time. Strings in Pascal format start with the length of the string and have -no terminating NULL byte. - -\Y\B\4\D$\.{GF\_ID}$ \5 -\T{131}\par -\B\4\D$\.{PRE}$ \5 -\T{247}\Y\par -\B\4\D$\\{header}$ \5 -\.{"\ hbf2gf\ output\ "}\par -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_pre}(\&{void});\par -\fi - -\M{14} -\Y\B\&{void} \\{write\_pre}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{char} \\{out\_s}[\T{40}]${},{}$ \|s[\T{20}];\6 -\&{time\_t} \\{secs\_now};\6 -\&{struct} \&{tm} ${}{*}\\{time\_now};{}$\7 -${}\\{strcpy}(\\{out\_s},\39\\{header}){}$;\7 -${}\\{secs\_now}\K\\{time}(\NULL){}$;\C{ system date and time }\6 -${}\\{time\_now}\K\\{localtime}({\AND}\\{secs\_now});{}$\6 -${}\\{strftime}(\|s,\39\T{20},\39\.{"\%Y.\%m.\%d:\%H.\%M"},\39\\{time% -\_now});{}$\6 -${}\\{strcat}(\\{out\_s},\39\|s){}$;\7 -${}\\{fputc}(\.{PRE},\39\\{out});{}$\6 -${}\\{fputc}(\.{GF\_ID},\39\\{out});{}$\6 -${}\\{fputc}(\\{strlen}(\\{out\_s}),\39\\{out});{}$\6 -${}\\{fputs}(\\{out\_s},\39\\{out});{}$\6 -\4${}\}{}$\2\par -\fi - -\M{15} -\PB{\\{write\_data}(\,)} produces the middle part of the \.{GF} file. It first -sets -\PB{\\{char\_adr\_p}} equal to the address of \PB{\\{char\_adr}[\,]} which will -contain file -offsets of the compressed characters. - -\PB{\\{input\_size\_x}} and \PB{\\{input\_size\_y}} reflect the original -dimensions of the -bitmap font, \PB{\\{pk\_output\_size\_x}} and \PB{\\{pk\_output\_size\_y}} -contain the width and -height of the output character box (in pixels), \PB{\\{pk\_offset\_x}} and -\PB{\\{pk\_offset\_y}} define the baseline of the font. The same names starting -with -`\\{tfm\_}' instead of `\\{pk\_}' are used for \.{TFM} files (values are -multiples of design size). \PB{\\{mag\_x}} and \PB{\\{mag\_y}} hold the scaling -factors -which are needed to reach \PB{\\{design\_size}}. \PB{\\{slant}} defines the -slant ($\Delta -x / \Delta y$), \PB{\\{target\_size\_x}} and \PB{\\{target\_size\_y}} will be -the final -dimensions; \PB{$\\{magstep\_x}\K\\{target\_size\_x}/\\{design\_size}$} is % -\TeX's -\.{\\magstep}. - -The \CEE/ standard specifies that all global values will be automatically -set to~\PB{\T{0}} if no initialization value is given. - -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{long} \\{char\_adr}[\T{256}];\6 -\&{long} ${}{*}\\{char\_adr\_p}{}$;\7 -\&{int} \\{pk\_offset\_x};\C{ horizontal offset (increase character width a -bit; will be applied on both the left and the right side) }\6 -\&{double} \\{tfm\_offset\_x};\6 -\&{int} \\{pk\_offset\_y};\C{ vertical offset (must be configured to desired -font size) }\6 -\&{double} \\{tfm\_offset\_y};\7 -\&{int} \\{input\_size\_x};\6 -\&{int} \\{input\_size\_y};\6 -\&{const} \&{char} ${}{*}\\{font\_encoding}{}$;\C{ taken from the HBF file }\6 -\&{int} \\{pk\_width};\C{ without slant }\6 -\&{int} \\{pk\_output\_size\_x};\C{ the output character box dimensions without -offsets }\6 -\&{double} \\{tfm\_output\_size\_x};\6 -\&{int} \\{pk\_output\_size\_y};\6 -\&{double} \\{tfm\_output\_size\_y};\7 -\&{double} \\{design\_size}${}\K\T{10.0}{}$;\C{ in points }\6 -\&{double} \\{target\_size\_x};\C{ in points }\6 -\&{double} \\{target\_size\_y};\6 -\&{double} \\{magstep\_x};\6 -\&{double} \\{magstep\_y};\6 -\&{double} \\{slant};\6 -\&{int} \\{rotation};\7 -\&{double} \\{mag\_x};\C{ horizontal and vertical magnification values }\6 -\&{double} \\{mag\_y};\7 -\&{int} \\{empty\_char};\C{ a flag whether the character does not exist or is -empty }\6 -\&{int} \\{last\_char};\C{ the last valid character in a \.{GF} file }\7 -\&{int} \\{dot\_count};\C{ this counts the processed characters; - every ten characters a dot is output to the screen }\par -\fi - -\M{16} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_data}(\&{void});\par -\fi - -\M{17} -\Y\B\&{void} \\{write\_data}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -${}\\{dot\_count}\K\T{0};{}$\6 -${}\\{char\_adr\_p}\K\\{char\_adr}{}$;\7 -\&{for} ${}(\\{last\_char}\K\T{0};{}$ ${}(\\{last\_char}<\T{256})\W\R\\{end\_of% -\_file};{}$ ${}\\{last\_char}\PP){}$\1\5 -\X18:Write character\X\2\6 -\4${}\}{}$\2\par -\fi - -\M{18} -The code in this section saves the current file position first and calls -\PB{\\{make\_pixel\_array}(\,)}, which expands and scales the character bitmap. - -\PB{\.{BOC}} (and \PB{\.{BOC1}}), the Begin Of Character command byte, must be -followed by -the character code and the dimensions of the character as explained in -``\mf---the program'' (corrected by vertical and horizontal offsets). - -\PB{\\{write\_coding}(\,)} compresses and outputs the bitmap; \PB{\.{EOC}} (End -Of Character) -finishes the current character. - -\Y\B\4\D$\.{BOC}$ \5 -\T{67}\par -\B\4\D$\.{BOC1}$ \5 -\T{68}\C{ simplified version of \PB{\.{BOC}} }\par -\B\4\D$\.{EOC}$ \5 -\T{69}\par -\Y\B\4\X18:Write character\X${}\E{}$\6 -${}\{{}$\1\6 -\&{if} ${}(\\{dot\_count}\PP\MOD\T{10}\E\T{0}{}$)\C{ a progress report for -impatient users }\1\6 -\&{if} ${}(\\{pk\_files}\W\R\\{quiet}){}$\5 -${}\{{}$\1\6 -\\{printf}(\.{"."});\6 -\\{fflush}(\\{stdout});\6 -\4${}\}{}$\2\2\7 -${}\\{empty\_char}\K\.{FALSE};{}$\6 -\\{make\_pixel\_array}(\,);\6 -\&{if} (\\{end\_of\_file})\1\5 -\&{return};\2\7 -\&{if} (\\{pk\_files})\5 -${}\{{}$\1\6 -${}{*}\\{char\_adr\_p}\K\\{ftell}(\\{out});{}$\6 -${}\\{char\_adr\_p}\PP{}$;\7 -\&{if} (\\{empty\_char})\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{BOC1},\39\\{out});{}$\6 -\\{fputc}((\&{unsigned} \&{char}) \\{last\_char}${},\39\\{out});{}$\6 -${}\\{fputc}(\T{0},\39\\{out});{}$\6 -${}\\{fputc}(\T{0},\39\\{out});{}$\6 -${}\\{fputc}(\T{0},\39\\{out});{}$\6 -${}\\{fputc}(\T{0},\39\\{out});{}$\6 -${}\\{fputc}(\.{EOC},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{BOC},\39\\{out});{}$\6 -${}\\{fputl}(\\{last\_char},\39\\{out});{}$\6 -${}\\{fputl}({-}\T{1\$L},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_offset\_x},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_output\_size\_x}+\\{pk\_offset\_x},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_offset\_y},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_output\_size\_y}+\\{pk\_offset\_y},\39\\{out}){}$;\7 -\\{write\_coding}(\,);\7 -${}\\{fputc}(\.{EOC},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\U17.\fi - -\M{19} -The current \.{GF} file will be completed with data written by -\PB{\\{write\_post}(\,)}. The end consists of three sections: ``special'', -``post'', -and ``postpost''. The first contains material not used by \TeX\ itself but -which can be used by other programs like \.{GFtoDVI} or for documentary -purposes (\PB{\\{coding}[\,]} and \PB{\\{comment}[\,]}). The second describes -the font as a -whole, and the last marks the end of the file. - -\PB{\\{pk\_total\_min\_x}} up to \PB{\\{pk\_total\_max\_y}} define the greatest -bounding box of -this file (including offsets); the horizontal character escapement after -drawing the character is \PB{\\{pk\_dx}}. \PB{\\{tfm\_width}} is the width in -multiples of -the design size ignoring the target size. - -\Y\B\4\D$\.{\_2\_16}$ \5 -\T{65536.0}\C{ $2^{16}$ }\par -\B\4\D$\.{\_2\_20}$ \5 -\T{1048576.0}\C{ $2^{20}$ }\par -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{char} ${}\\{coding}[\.{STRING\_LENGTH}+\T{1}]{}$;\C{ a comment describing -the font encoding }\6 -\&{char} ${}\\{comment}[\.{STRING\_LENGTH}+\T{1}]{}$;\C{ a comment describing -the font }\7 -\&{unsigned} \&{long} \\{checksum};\7 -\&{long} \\{pk\_total\_min\_x};\6 -\&{long} \\{pk\_total\_max\_x};\6 -\&{long} \\{pk\_total\_min\_y};\6 -\&{long} \\{pk\_total\_max\_y};\7 -\&{int} \\{dpi\_x};\C{ printer resolution }\6 -\&{int} \\{dpi\_y};\6 -\&{double} \\{ppp\_x};\C{ pixels per point }\6 -\&{double} \\{ppp\_y};\par -\fi - -\M{20} -To clarify the meaning of these values see the sections about the metrics -and configuration file also. - -\TeX\ defines that 72.27~points are exactly 1~inch. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_post}(\&{void});\par -\fi - -\M{21} -\Y\B\&{void} \\{write\_post}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{long} \\{special\_adr};\6 -\&{long} \\{post\_adr};\7 -\&{long} \\{designsize}${}\K\\{design\_size}*\.{\_2\_20}{}$;\C{ design size $* -2^{20}$ }\7 -\&{int} \\{pk\_dx};\6 -\&{long} \\{tfm\_width};\7 -\&{int} \|i;\6 -\&{long} \\{temp};\7 -${}\\{ppp\_x}\K\\{dpi\_x}/\T{72.27}*\\{magstep\_x};{}$\6 -${}\\{ppp\_y}\K\\{dpi\_y}/\T{72.27}*\\{magstep\_y}{}$;\7 -${}\\{pk\_total\_min\_x}\K\\{pk\_offset\_x};{}$\6 -${}\\{pk\_total\_max\_x}\K\\{pk\_output\_size\_x}+\T{2}*\\{pk\_offset\_x};{}$\6 -${}\\{pk\_total\_min\_y}\K\\{pk\_offset\_y};{}$\6 -${}\\{pk\_total\_max\_y}\K\\{pk\_output\_size\_y}+\\{pk\_offset\_y}{}$;\7 -${}\\{pk\_dx}\K\\{pk\_width}+\T{2}*\\{pk\_offset\_x}{}$;\C{ no slant }\6 -${}\\{tfm\_width}\K(\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x})*\.{\_2% -\_20}{}$;\C{ width in multiples of design size $* 2^{20}$ }\7 -\X22:Special section\X\6 -\X23:Post section\X\6 -\X24:Postpost section\X\6 -\4${}\}{}$\2\par -\fi - -\M{22} -\.{XXXn} will be followed by n~bytes representing the length of a string -which follows immediately. \PB{\.{YYY}} is a 32~bit integer which is normally -connected with the preceding string (but not used here). \PB{\\{special\_adr}} -contains the address of the ``special section''. All items here are -optional. - -\Y\B\4\D$\.{XXX1}$ \5 -\T{239}\C{ these are all special command bytes }\par -\B\4\D$\.{XXX2}$ \5 -\T{240}\C{ not used }\par -\B\4\D$\.{XXX3}$ \5 -\T{241}\C{ not used }\par -\B\4\D$\.{XXX4}$ \5 -\T{242}\C{ not used }\Y\par -\B\4\D$\.{YYY}$ \5 -\T{243}\C{ not used }\par -\Y\B\4\X22:Special section\X${}\E{}$\6 -$\\{special\_adr}\K\\{ftell}(\\{out}){}$;\7 -\&{if} ${}({*}\\{coding}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{XXX1},\39\\{out}){}$;\C{ \PB{\.{XXX1}} implies a string length % -\PB{$<$ \T{256}} }\6 -${}\\{fputc}(\\{strlen}(\\{coding}),\39\\{out});{}$\6 -${}\\{fputs}(\\{coding},\39\\{out});{}$\6 -\4${}\}{}$\2\7 -\&{if} ${}({*}\\{comment}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{XXX1},\39\\{out});{}$\6 -${}\\{fputc}(\\{strlen}(\\{comment}),\39\\{out});{}$\6 -${}\\{fputs}(\\{comment},\39\\{out});{}$\6 -\4${}\}{}$\2\par -\U21.\fi - -\M{23} -All character offsets collected in \PB{\\{char\_adr}} will be written to the -output -file. \PB{\\{fputl}(\,)} writes a 32~bit integer into a file. - -\PB{\.{CHAR\_LOC0}} (and \PB{\.{CHAR\_LOC}}) is the first byte of a character -locator -(i.e., offset, character code, and width information). \PB{\.{POST}} starts the -postamble, and \PB{\\{post\_adr}} points to the beginning byte of the -postamble. - -\Y\B\4\D$\.{POST}$ \5 -\T{248}\Y\par -\B\4\D$\.{CHAR\_LOC}$ \5 -\T{245}\par -\B\4\D$\.{CHAR\_LOC0}$ \5 -\T{246}\C{ simplified version of \PB{\.{CHAR\_LOC}} }\par -\Y\B\4\X23:Post section\X${}\E{}$\6 -$\\{post\_adr}\K\\{ftell}(\\{out});{}$\6 -${}\\{fputc}(\.{POST},\39\\{out});{}$\6 -${}\\{fputl}(\\{special\_adr},\39\\{out}){}$;\7 -${}\\{fputl}(\\{designsize},\39\\{out});{}$\6 -${}\\{fputl}(\\{checksum},\39\\{out});{}$\6 -${}\\{fputl}(\\{ppp\_x}*\.{\_2\_16},\39\\{out});{}$\6 -${}\\{fputl}(\\{ppp\_y}*\.{\_2\_16},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_total\_min\_x},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_total\_max\_x},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_total\_min\_y},\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_total\_max\_y},\39\\{out}){}$;\7 -${}\\{char\_adr\_p}\K\\{char\_adr}{}$;\7 -\&{if} ${}(\\{pk\_dx}<\T{256}){}$\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{last\_char};{}$ ${}\|i\PP{}$)\C{ the -character locators }\6 -${}\{{}$\1\6 -${}\\{fputc}(\.{CHAR\_LOC0},\39\\{out});{}$\6 -${}\\{fputc}(\|i,\39\\{out});{}$\6 -${}\\{fputc}(\\{pk\_dx},\39\\{out});{}$\6 -${}\\{fputl}(\\{tfm\_width},\39\\{out});{}$\6 -${}\\{fputl}({*}\\{char\_adr\_p}\PP,\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\C{ will only happen if \PB{$\.{MAX\_CHAR\_SIZE}\G\T{256}$} }\6 -${}\{{}$\1\6 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{last\_char};{}$ ${}\|i\PP){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{CHAR\_LOC},\39\\{out});{}$\6 -${}\\{fputc}(\|i,\39\\{out});{}$\6 -${}\\{fputl}(\\{pk\_dx}*\.{\_2\_16},\39\\{out});{}$\6 -${}\\{fputl}(\T{0},\39\\{out});{}$\6 -${}\\{fputl}(\\{tfm\_width},\39\\{out});{}$\6 -${}\\{fputl}({*}\\{char\_adr\_p}\PP,\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\U21.\fi - -\M{24} -\PB{\.{POSTPOST}} starts the section after the postamble. To get all -information in -a \.{GF} file, you must start here. The very last bytes of the file have -the value \PB{\.{POSTPOST\_ID}} (the file is filled with at least 4 of these -bytes -until a file length of a multiple of~4 is reached). Going backwards a -\PB{\.{GF\_ID}} will be next, then comes the address of the postamble section. - -Jumping to the postamble, a \PB{\.{POST}} byte comes first, then the address of -the special section, and afterwards all character offsets. These offsets and -addresses describe the whole file. - -\Y\B\4\D$\.{POSTPOST}$ \5 -\T{249}\par -\B\4\D$\.{POSTPOST\_ID}$ \5 -\T{223}\par -\Y\B\4\X24:Postpost section\X${}\E{}$\6 -$\\{fputc}(\.{POSTPOST},\39\\{out});{}$\6 -${}\\{fputl}(\\{post\_adr},\39\\{out});{}$\6 -${}\\{fputc}(\.{GF\_ID},\39\\{out});{}$\6 -${}\\{temp}\K\\{ftell}(\\{out});{}$\6 -${}\|i\K(\&{int})(\\{temp}\MOD\T{4})+\T{4};{}$\6 -\&{while} ${}(\|i\MM){}$\1\5 -${}\\{fputc}(\.{POSTPOST\_ID},\39\\{out}){}$;\2\par -\U21.\fi - -\M{25} -\TeX\ wants the most significant byte first. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} ${}\\{fputl}(\&{long},\39{}$\&{FILE} ${}{*}){}$;\par -\fi - -\M{26} -\Y\B\&{void} \\{fputl}(\&{long} \\{num}${},\39{}$\&{FILE} ${}{*}\|f){}$\1\1\2\2% -\6 -${}\{{}$\1\6 -${}\\{fputc}(\\{num}\GG\T{24},\39\|f);{}$\6 -${}\\{fputc}(\\{num}\GG\T{16},\39\|f);{}$\6 -${}\\{fputc}(\\{num}\GG\T{8},\39\|f);{}$\6 -${}\\{fputc}(\\{num},\39\|f);{}$\6 -\4${}\}{}$\2\par -\fi - -\M{27} -\PB{\\{make\_pixel\_array}(\,)} scales a character into the array \PB{\\{out% -\_char}[\,]} where -each \\{byte} represents one pixel, contrary to the input file where each -\\{bit} is used to store the character bitmap. \PB{\.{BLACK}} indicates a black -pixel. - -The scaling routine was modeled after the program \.{pnmscale} of the -\.{pbmplus} package. \.{pbmplus} was designed to handle arbitrary pictures, -and bitmaps are only a special case of a graymap with values from~0 for -white up to \PB{$\.{PIXEL\_MAXVAL}\K\T{255}$} for black. - -If \PB{\.{EOF}} is encountered, \PB{\\{end\_of\_file}} is set and the function -returns -immediately. - -\Y\B\4\D$\.{BLACK}$ \5 -\T{1}\par -\B\4\D$\.{WHITE}$ \5 -\T{0}\Y\par -\B\4\D$\.{PIXEL\_MAXVAL}$ \5 -\T{255}\par -\B\4\D$\.{SCALE}$ \5 -\T{4096}\par -\B\4\D$\.{HALFSCALE}$ \5 -\T{2048}\Y\par -\B\4\D$\.{MAX\_CHAR\_SIZE}$ \5 -\T{1023}\par -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{HBF\_CHAR} \\{code};\6 -\&{const} \&{unsigned} \&{char} ${}{*}\\{bitmap}{}$;\C{ a proper input bitmap -array will be allocated by the HBF API }\6 -\&{const} \&{unsigned} \&{char} ${}{*}\\{bP}{}$;\7 -\&{unsigned} \&{char} ${}\\{out\_char}[\.{MAX\_CHAR\_SIZE}*\.{MAX\_CHAR\_SIZE}+% -\T{1}]{}$;\C{ the output bitmap array }\6 -\&{unsigned} \&{char} ${}{*}\\{out\_char\_p}{}$;\7 -\&{unsigned} \&{char} \\{pixelrow}[\.{MAX\_CHAR\_SIZE}];\6 -\&{unsigned} \&{char} \\{temp\_pixelrow}[\.{MAX\_CHAR\_SIZE}];\6 -\&{unsigned} \&{char} ${}\\{new\_pixelrow}[\.{MAX\_CHAR\_SIZE}+\T{1}]{}$;\C{ we -need space to append a white pixel }\7 -\&{int} \\{curr\_row};\C{ for \PB{\\{read\_row}(\,)} if we access the glyph -rotated }\6 -\&{long} \\{grayrow}[\.{MAX\_CHAR\_SIZE}];\7 -\&{long} \\{s\_mag\_x}${},{}$ \\{s\_mag\_y}${},{}$ \\{s\_slant};\par -\fi - -\M{28} -We need to initialize the \PB{\\{grayrow}[\,]} array together with some other -variables. - -Two steps are necessary to compute the \PB{\\{code}} if we are in the \mf-like -mode. Assuming that we search the code \.{0xXXYY}, we first set \PB{\\{code}} -to -the value \.{0xXXAA}, where \.{0xAA} is equal to \PB{\\{min\_2\_byte}} (getting -\PB{\\{offset}} as the number of remaining characters to reach the first -character -in our given subfont), then we increment \PB{\\{code}} (and decrement \PB{% -\\{offset}}) -until \PB{\\{offset}} equals~0. - -\Y\B\4\X28:Initialize variables\X${}\E{}$\6 -${}\{{}$\1\6 -\&{int} \\{col}${},{}$ \\{offset};\7 -\&{if} (\\{rotation})\5 -${}\{{}$\1\6 -\&{int} \\{tmp};\7 -${}\\{tmp}\K\\{input\_size\_x};{}$\6 -${}\\{input\_size\_x}\K\\{input\_size\_y};{}$\6 -${}\\{input\_size\_y}\K\\{tmp};{}$\6 -\4${}\}{}$\2\7 -\&{if} (\\{mf\_like})\5 -${}\{{}$\1\6 -${}\\{target\_size\_x}\K\\{design\_size}*(\\{x\_resolution}/\\{dpi\_x});{}$\6 -${}\\{target\_size\_y}\K\\{design\_size}*(\\{x\_resolution}*\\{y\_scale}/\\{dpi% -\_y});{}$\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -${}\\{target\_size\_x}\K\\{target\_size\_y}\K\\{design\_size};{}$\2\6 -${}\\{magstep\_x}\K\\{target\_size\_x}/\\{design\_size};{}$\6 -${}\\{magstep\_y}\K\\{target\_size\_y}/\\{design\_size}{}$;\7 -${}\\{pk\_offset\_x}\K\\{offset\_x}*\\{magstep\_x}+\T{0.5};{}$\6 -${}\\{pk\_offset\_y}\K\\{offset\_y}*\\{magstep\_y}+\T{0.5};{}$\6 -${}\\{tfm\_offset\_x}\K\\{offset\_x}/(\\{dpi\_x}/\T{72.27})/\\{design% -\_size};{}$\6 -${}\\{tfm\_offset\_y}\K\\{offset\_y}/(\\{dpi\_y}/\T{72.27})/\\{design% -\_size}{}$;\7 -${}\\{pk\_width}\K\\{input\_size\_x}*\\{mag\_x}*\\{magstep\_x}+\T{0.5}{}$;\C{ -without slant }\6 -${}\\{pk\_output\_size\_x}\K\\{input\_size\_x}*\\{mag\_x}*\\{magstep\_x}+% -\\{input\_size\_y}*\\{mag\_y}*\\{magstep\_y}*\\{slant}+\T{0.5};{}$\6 -${}\\{pk\_output\_size\_y}\K\\{input\_size\_y}*\\{mag\_y}*\\{magstep\_y}+% -\T{0.5};{}$\6 -${}\\{tfm\_output\_size\_x}\K\\{input\_size\_x}*\\{mag\_x}/(\\{dpi\_x}/% -\T{72.27})/\\{design\_size};{}$\6 -${}\\{tfm\_output\_size\_y}\K\\{input\_size\_y}*\\{mag\_y}/(\\{dpi\_y}/% -\T{72.27})/\\{design\_size};{}$\6 -\&{if} ${}(\\{pk\_output\_size\_x}>\.{MAX\_CHAR\_SIZE}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Output\ character\ bo}\)\.{x\ width\ too\ big% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{pk\_output\_size\_y}>\.{MAX\_CHAR\_SIZE}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Output\ character\ bo}\)\.{x\ height\ too\ big% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{for} ${}(\\{col}\K\T{0};{}$ ${}\\{col}<\\{input\_size\_x};{}$ ${}\PP% -\\{col}){}$\1\5 -${}\\{grayrow}[\\{col}]\K\.{HALFSCALE}{}$;\2\7 -\&{if} ${}(\R\\{mf\_like}){}$\1\5 -${}\\{code}\K(\\{min\_char}\AND\T{\^FF00})+\\{min\_2\_byte};{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}((\\{file\_number}<(\\{unicode}\?\T{0}:\T{1}))\V(\\{file\_number}\G% -\T{\^100})){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ subfile\ num}\)\.{ber\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{if} (\\{unicode})\5 -${}\{{}$\1\6 -${}\\{offset}\K\T{0};{}$\6 -${}\\{code}\K\\{file\_number}*\T{\^100};{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{offset}\K(\\{file\_number}-\T{1})*\T{256}\MOD\\{nmb\_2\_bytes};{}$\6 -${}\\{code}\K(\\{min\_char}\AND\T{\^FF00})+\\{min\_2\_byte}+(\\{file\_number}-% -\T{1})*\T{256}/\\{nmb\_2\_bytes}*\T{\^100};{}$\6 -\4${}\}{}$\2\7 -\&{while} ${}(\\{offset}\MM){}$\1\6 -\&{while} ${}(\R\\{b2\_codes}[\\{code}\PP\AND\T{\^FF}]{}$)\C{ eliminate invalid -\PB{\\{b2\_codes}} }\1\6 -;\2\2\7 -\&{if} ${}(\\{code}>\\{max\_char}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ subfile\ num}\)\.{ber\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -${}\\{s\_mag\_x}\K\\{mag\_x}*\\{magstep\_x}*\.{SCALE};{}$\6 -${}\\{s\_mag\_y}\K\\{mag\_y}*\\{magstep\_y}*\.{SCALE};{}$\6 -${}\\{s\_slant}\K\\{slant}*\.{SCALE};{}$\6 -\4${}\}{}$\2\par -\U4.\fi - -\M{29} -All arrays of the \\{pixelrow} family contain gray values. While scaling -with non-integer values a pixel of the input bitmap will normally not align -with the pixel grid of the output bitmap (geometrically spoken). In this -case we first compute the fractions of input pixel rows scaled vertically -and add the corresponding gray values until a temporary row is produced. -Then we repeat this procedure horizontally pixel by pixel and write the -result into an output array. - - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{make\_pixel\_array}(\&{void});\par -\fi - -\M{30} -\Y\B\&{void} \\{make\_pixel\_array}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{unsigned} \&{char} ${}{*}\\{prP};{}$\6 -\&{unsigned} \&{char} ${}{*}\\{temp\_prP};{}$\6 -\&{unsigned} \&{char} ${}{*}\\{new\_prP};{}$\6 -\&{long} ${}{*}\\{grP}{}$;\7 -\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\6 -\&{register} \&{unsigned} \&{char} ${}{*}\\{nxP}{}$;\7 -\&{register} \&{int} \\{row}${},{}$ \\{col};\6 -\&{int} \\{rows\_read}${}\K\T{0};{}$\6 -\&{register} \&{int} \\{need\_to\_read\_row}${}\K\T{1}{}$;\7 -\&{long} \\{frac\_row\_to\_fill}${}\K\.{SCALE};{}$\6 -\&{long} \\{frac\_row\_left}${}\K\\{s\_mag\_y}{}$;\7 -\&{int} \\{no\_code}${}\K\.{FALSE};{}$\7 -${}\\{prP}\K\\{pixelrow};{}$\6 -${}\\{temp\_prP}\K\\{temp\_pixelrow};{}$\6 -${}\\{new\_prP}\K\\{new\_pixelrow};{}$\6 -${}\\{grP}\K\\{grayrow};{}$\6 -${}\\{out\_char\_p}\K\\{out\_char}{}$;\C{ will be increased by \PB{\\{write% -\_row}(\,)} }\7 -\4\\{again}:\6 -\&{if} ${}(\\{b2\_codes}[\\{code}\AND\T{\^FF}]{}$)\C{ a valid second byte? }\6 -${}\{{}$\1\6 -\&{if} (\\{pk\_files})\5 -${}\{{}$\1\6 -${}\\{bitmap}\K\\{hbfGetBitmap}(\\{hbf},\39\\{code});{}$\6 -${}\\{bP}\K\\{bitmap}{}$;\C{ will be increased by \PB{\\{read\_row}(\,)} }\7 -\&{if} ${}(\R\\{bitmap}){}$\1\5 -${}\\{empty\_char}\K\.{TRUE};{}$\2\6 -\&{else}\1\5 -\X31:Scale row by row\X\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -${}\\{no\_code}\K\.{TRUE}{}$;\2\7 -\&{if} ${}((\\{code}\AND\T{\^FF})\E\\{max\_2\_byte}){}$\1\5 -${}\\{code}\MRL{+{\K}}\T{\^FF}-(\\{max\_2\_byte}-\\{min\_2\_byte}){}$;\C{ go to -next plane }\2\6 -\&{if} ${}(\\{code}\G\\{max\_char}){}$\5 -${}\{{}$\1\6 -${}\\{end\_of\_file}\K\.{TRUE};{}$\6 -\&{return};\6 -\4${}\}{}$\2\7 -${}\\{code}\PP{}$;\7 -\&{if} (\\{no\_code})\5 -${}\{{}$\1\6 -${}\\{no\_code}\K\.{FALSE};{}$\6 -\&{goto} \\{again};\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\fi - -\M{31} -\Y\B\4\X31:Scale row by row\X${}\E{}$\6 -${}\{{}$\1\6 -\&{if} ${}(\\{pk\_output\_size\_y}\E\\{input\_size\_y}{}$)\C{ shortcut -Y~scaling if possible }\1\6 -${}\\{temp\_prP}\K\\{prP}{}$;\2\7 -${}\\{curr\_row}\K\\{input\_size\_y}-\T{1}{}$;\C{ only needed for rotated -glyphs }\6 -\&{for} ${}(\\{row}\K\T{0};{}$ ${}\\{row}<\\{pk\_output\_size\_y};{}$ ${}\PP% -\\{row}){}$\5 -${}\{{}$\1\6 -\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}\X\6 -\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[\,]} -and write it into \PB{\\{out\_char}[\,]}\X\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\U30.\fi - -\M{32} -\Y\B\4\X32:Scale Y from \PB{\\{pixelrow}[\,]} into \PB{\\{temp\_pixelrow}[\,]}% -\X${}\E{}$\6 -\&{if} ${}(\\{pk\_output\_size\_y}\E\\{input\_size\_y}{}$)\C{ shortcut -Y~scaling if possible }\1\6 -\\{read\_row}(\\{prP});\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{while} ${}(\\{frac\_row\_left}<\\{frac\_row\_to\_fill}){}$\5 -${}\{{}$\1\6 -\&{if} (\\{need\_to\_read\_row})\1\6 -\&{if} ${}(\\{rows\_read}<\\{input\_size\_y}){}$\5 -${}\{{}$\1\6 -\\{read\_row}(\\{prP});\6 -${}\PP\\{rows\_read};{}$\6 -\4${}\}{}$\2\2\7 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{prP};{}$ ${}\\{col}<\\{input\_size% -\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\1\5 -${}\\{grP}[\\{col}]\MRL{+{\K}}\\{frac\_row\_left}*({*}\\{xP}){}$;\2\7 -${}\\{frac\_row\_to\_fill}\MRL{-{\K}}\\{frac\_row\_left};{}$\6 -${}\\{frac\_row\_left}\K\\{s\_mag\_y};{}$\6 -${}\\{need\_to\_read\_row}\K\T{1};{}$\6 -\4${}\}{}$\2\7 -\X33:Produce a temporary row\X\6 -\4${}\}{}$\2\par -\U31.\fi - -\M{33} -Now \PB{$\\{frac\_row\_left}\G\\{frac\_row\_to\_fill}$}, so we can produce a -row. - -\Y\B\4\X33:Produce a temporary row\X${}\E{}$\6 -\&{if} (\\{need\_to\_read\_row})\1\6 -\&{if} ${}(\\{rows\_read}<\\{input\_size\_y}){}$\5 -${}\{{}$\1\6 -\\{read\_row}(\\{prP});\6 -${}\PP\\{rows\_read};{}$\6 -${}\\{need\_to\_read\_row}\K\T{0};{}$\6 -\4${}\}{}$\2\2\7 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{prP},\39\\{nxP}\K\\{temp\_prP};{}$ ${}% -\\{col}<\\{input\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP},\39\PP\\{nxP}){}$\5 -${}\{{}$\1\6 -\&{register} \&{long} \|g;\7 -${}\|g\K\\{grP}[\\{col}]+\\{frac\_row\_to\_fill}*({*}\\{xP});{}$\6 -${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 -\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 -${}\|g\K\.{PIXEL\_MAXVAL}{}$;\2\7 -${}{*}\\{nxP}\K\|g;{}$\6 -${}\\{grP}[\\{col}]\K\.{HALFSCALE};{}$\6 -\4${}\}{}$\2\7 -${}\\{frac\_row\_left}\MRL{-{\K}}\\{frac\_row\_to\_fill};{}$\6 -\&{if} ${}(\\{frac\_row\_left}\E\T{0}){}$\5 -${}\{{}$\1\6 -${}\\{frac\_row\_left}\K\\{s\_mag\_y};{}$\6 -${}\\{need\_to\_read\_row}\K\T{1};{}$\6 -\4${}\}{}$\2\6 -${}\\{frac\_row\_to\_fill}\K\.{SCALE}{}$;\par -\U32.\fi - -\M{34} -To implement the slant we move the starting point \PB{\\{nxP}} to the right -according to the corresponding \PB{\|y}~value. To simplify life only positive -shift values are allowed. - -We always append a white pixel to avoid artefacts at the end of the line -produced by the last line. This rule sets the second condition that the -slant must not be greater than~\PB{\T{1}}---such a large slant would be -unusable -anyway for typesetting purposes. - -\Y\B\4\X34:Scale X from \PB{\\{temp\_pixelrow}[\,]} into \PB{\\{new\_pixelrow}[% -\,]} and write it into \PB{\\{out\_char}[\,]}\X${}\E{}$\6 -\&{if} ${}(\\{pk\_width}\E\\{input\_size\_x}\W\\{s\_slant}\E\T{0}{}$)\C{ -shortcut X~scaling if possible }\1\6 -\\{write\_row}(\\{temp\_prP});\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{register} \&{long} \|g${}\K\.{HALFSCALE};{}$\6 -\&{register} \&{long} \\{frac\_col\_to\_fill}${}\K\.{SCALE};{}$\6 -\&{register} \&{long} \\{frac\_col\_left};\6 -\&{register} \&{int} \\{need\_col}${}\K\T{0};{}$\7 -${}\\{nxP}\K\\{new\_prP}{}$;\7 -${}\\{frac\_col\_left}\K(\\{pk\_output\_size\_y}-\\{row})*\\{s\_slant};{}$\6 -\&{while} ${}(\\{frac\_col\_left}\G\\{frac\_col\_to\_fill}){}$\5 -${}\{{}$\1\6 -${}{*}(\\{nxP}\PP)\K\T{0};{}$\6 -${}\\{frac\_col\_left}\MRL{-{\K}}\\{frac\_col\_to\_fill};{}$\6 -\4${}\}{}$\2\7 -\&{if} ${}(\\{frac\_col\_left}>\T{0}){}$\1\5 -${}\\{frac\_col\_to\_fill}\MRL{-{\K}}\\{frac\_col\_left}{}$;\2\7 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{temp\_prP};{}$ ${}\\{col}<\\{input% -\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 -${}\{{}$\1\6 -${}\\{frac\_col\_left}\K\\{s\_mag\_x};{}$\6 -\&{while} ${}(\\{frac\_col\_left}\G\\{frac\_col\_to\_fill}){}$\5 -${}\{{}$\1\6 -\&{if} (\\{need\_col})\5 -${}\{{}$\1\6 -${}\PP\\{nxP};{}$\6 -${}\|g\K\.{HALFSCALE};{}$\6 -\4${}\}{}$\2\7 -${}\|g\MRL{+{\K}}\\{frac\_col\_to\_fill}*({*}\\{xP});{}$\6 -${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 -\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 -${}\|g\K\.{PIXEL\_MAXVAL}{}$;\2\7 -${}{*}\\{nxP}\K\|g;{}$\6 -${}\\{frac\_col\_left}\MRL{-{\K}}\\{frac\_col\_to\_fill};{}$\6 -${}\\{frac\_col\_to\_fill}\K\.{SCALE};{}$\6 -${}\\{need\_col}\K\T{1};{}$\6 -\4${}\}{}$\2\7 -\&{if} ${}(\\{frac\_col\_left}>\T{0}){}$\5 -${}\{{}$\1\6 -\&{if} (\\{need\_col})\5 -${}\{{}$\1\6 -${}\PP\\{nxP};{}$\6 -${}\|g\K\.{HALFSCALE};{}$\6 -${}\\{need\_col}\K\T{0};{}$\6 -\4${}\}{}$\2\7 -${}\|g\MRL{+{\K}}\\{frac\_col\_left}*({*}\\{xP});{}$\6 -${}\\{frac\_col\_to\_fill}\MRL{-{\K}}\\{frac\_col\_left};{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\7 -\X35:Write out a row\X\6 -\4${}\}{}$\2\par -\U31.\fi - -\M{35} -\Y\B\4\X35:Write out a row\X${}\E{}$\6 -\&{if} ${}(\\{frac\_col\_to\_fill}>\T{0}){}$\5 -${}\{{}$\1\6 -${}\MM\\{xP};{}$\6 -${}\|g\MRL{+{\K}}\\{frac\_col\_to\_fill}*({*}\\{xP});{}$\6 -\4${}\}{}$\2\7 -\&{if} ${}(\R\\{need\_col}){}$\5 -${}\{{}$\1\6 -${}\|g\MRL{{/}{\K}}\.{SCALE};{}$\6 -\&{if} ${}(\|g>\.{PIXEL\_MAXVAL}){}$\1\5 -${}\|g\K\.{PIXEL\_MAXVAL};{}$\2\6 -${}{*}\\{nxP}\K\|g;{}$\6 -\4${}\}{}$\2\7 -${}{*}(\PP\\{nxP})\K\T{0}{}$;\C{ append a blank pixel }\7 -\\{write\_row}(\\{new\_prP});\par -\U34.\fi - -\M{36} -\PB{\\{read\_row}(\,)} reads a row from \PB{\\{bitmap}[\,]} and converts it -into a graymap row. -If the \PB{\\{rotation}} flag has been set, we get the proper column instead -(note -that in this case \PB{\\{input\_size\_x}} already reflects the width of the -rotated -glyph). - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 -\&{\_\_inline\_\_}\6 -\8\#\&{endif}\6 -\&{void} \\{read\_row}(\&{unsigned} \&{char} ${}{*}){}$;\par -\fi - -\M{37} -\Y\B\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 -\&{\_\_inline\_\_}\6 -\8\#\&{endif}\6 -\&{void} \\{read\_row}(\&{unsigned} \&{char} ${}{*}\\{pixelrow}){}$\1\1\2\2\6 -${}\{{}$\1\6 -\&{register} \&{int} \\{col}${},{}$ \\{bitshift}${},{}$ \\{offset};\6 -\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\6 -\&{register} \&{unsigned} \&{char} \\{item}${}\K\T{0};{}$\7 -\&{if} (\\{rotation})\5 -${}\{{}$\1\6 -${}\\{bitshift}\K\T{7}-(\\{curr\_row}\MOD\T{8});{}$\6 -${}\\{offset}\K(\\{input\_size\_y}+\T{7})/\T{8};{}$\6 -${}\\{bP}\K\\{bitmap}+\\{curr\_row}/\T{8};{}$\6 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{input% -\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 -${}\{{}$\1\6 -${}{*}\\{xP}\K(({*}\\{bP}\GG\\{bitshift})\AND\T{1})\E\T{1}\?\.{PIXEL\_MAXVAL}:% -\T{0};{}$\6 -${}\\{bP}\MRL{+{\K}}\\{offset};{}$\6 -\4${}\}{}$\2\6 -${}\\{curr\_row}\MM;{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{bitshift}\K{-}\T{1};{}$\6 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{input% -\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{bitshift}\E{-}\T{1}){}$\5 -${}\{{}$\1\6 -${}\\{item}\K{*}(\\{bP}\PP){}$;\C{ increase input bitmap pointer }\6 -${}\\{bitshift}\K\T{7};{}$\6 -\4${}\}{}$\2\6 -${}{*}\\{xP}\K((\\{item}\GG\\{bitshift})\AND\T{1})\E\T{1}\?\.{PIXEL\_MAXVAL}:% -\T{0};{}$\6 -${}\MM\\{bitshift};{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\fi - -\M{38} -\PB{\\{write\_row}(\,)} converts the graymap back into a bitmap using a simple -threshold. - -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{int} \\{threshold}${}\K\T{128}{}$;\par -\fi - -\M{39} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 -\&{\_\_inline\_\_}\6 -\8\#\&{endif}\6 -\&{void} \\{write\_row}(\&{unsigned} \&{char} ${}{*}){}$;\par -\fi - -\M{40} -\Y\B\8\#\&{ifdef} \.{\_\_GNUC\_\_}\6 -\&{\_\_inline\_\_}\6 -\8\#\&{endif}\6 -\&{void} \\{write\_row}(\&{unsigned} \&{char} ${}{*}\\{pixelrow}){}$\1\1\2\2\6 -${}\{{}$\1\6 -\&{register} \&{int} \\{col};\6 -\&{register} \&{unsigned} \&{char} ${}{*}\\{xP};{}$\7 -\&{for} ${}(\\{col}\K\T{0},\39\\{xP}\K\\{pixelrow};{}$ ${}\\{col}<\\{pk\_output% -\_size\_x};{}$ ${}\PP\\{col},\39\PP\\{xP}){}$\1\5 -${}{*}(\\{out\_char\_p}\PP)\K({*}\\{xP}\G\\{threshold})\?\T{1}:\T{0}{}$;\C{ -increase output bitmap pointer }\2\6 -\4${}\}{}$\2\par -\fi - -\M{41} -Now comes the most interesting routine. The pixel array will be compressed -in sequences of black and white pixels. - -\PB{\.{SKIP0}}, \PB{\.{SKIP1}}, and \PB{\.{SKIP2}} indicate how many blank -lines will be skipped. -\PB{\.{PAINT\_}(\|x)} means that the next x~pixels will have the same color, -then the -color changes. \PB{\.{NEW\_ROW\_}(\|x)} is the first black pixel in the next -row. - -An example: the pixel sequence 111100011001 [new row] 000111011110 will be -output as 4 3 2 2 1 77 3 1 4 1. - -Commands with an ending~`n' in its name indicate that the next n~bytes -should be read as the counter. Example: \PB{\.{SKIP1}}~26 means `skip the next -26~rows'. - -For further details please refer to ``\mf---the program''. - -\Y\B\4\D$\.{PAINT\_}(\|x)$ \5 -(\|x)\C{ $0 \le x \le 63$ }\par -\B\4\D$\.{PAINT1}$ \5 -\T{64}\par -\B\4\D$\.{PAINT2}$ \5 -\T{65}\par -\B\4\D$\.{PAINT3}$ \5 -\T{66}\C{ not used }\Y\par -\B\4\D$\.{SKIP0}$ \5 -\T{70}\par -\B\4\D$\.{SKIP1}$ \5 -\T{71}\par -\B\4\D$\.{SKIP2}$ \5 -\T{72}\par -\B\4\D$\.{SKIP3}$ \5 -\T{73}\C{ not used }\Y\par -\B\4\D$\.{NEW\_ROW\_}(\|x)$ \5 -$((\|x)+\T{74}{}$)\C{ $0 \le x \le 164$ }\Y\par -\B\4\D$\.{NOOP}$ \5 -\T{244}\C{ not used }\par -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_coding}(\&{void});\par -\fi - -\M{42} -The \PB{\&{goto} \\{start}} instruction causes some compilers to complain about -``Unreachable code $\ldots$'' or something similar. - -\Y\B\&{void} \\{write\_coding}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{register} \&{int} \\{count}${},{}$ \\{skip};\6 -\&{register} \&{unsigned} \&{char} \\{paint};\6 -\&{register} \&{int} \|x${},{}$ \|y;\6 -\&{register} \&{unsigned} \&{char} ${}{*}\\{cp};{}$\7 -${}\|x\K\T{0};{}$\6 -${}\|y\K\T{0};{}$\6 -${}\\{cp}\K\\{out\_char}+\|y*\\{pk\_output\_size\_x}+\|x;{}$\6 -${}\\{count}\K\\{skip}\K\T{0};{}$\6 -${}\\{paint}\K\.{WHITE};{}$\6 -\&{goto} \\{start};\7 -\&{while} ${}(\|y<\\{pk\_output\_size\_y}){}$\5 -${}\{{}$\1\6 -\X43:Search blank lines\X\6 -\4\\{start}:\5 -\X44:Process rest of line\X\6 -${}\|y\PP;{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\Y\par -\fi - -\M{43} -\Y\B\4\X43:Search blank lines\X${}\E{}$\6 -$\\{count}\K\T{0};{}$\6 -${}\|x\K\T{0};{}$\6 -${}\\{cp}\K\\{out\_char}+\|y*\\{pk\_output\_size\_x}+\|x{}$;\7 -\&{while} ${}(\|x<\\{pk\_output\_size\_x}){}$\5 -${}\{{}$\1\6 -\&{if} ${}({*}\\{cp}\E\\{paint}){}$\1\5 -${}\\{count}\PP;{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}(\\{skip}\E\T{0}){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{count}\Z\T{164}){}$\1\5 -${}\\{fputc}(\.{NEW\_ROW\_}(\\{count}),\39\\{out});{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{SKIP0},\39\\{out}){}$;\7 -\&{if} ${}(\\{count}<\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 -${}\\{fputc}(\\{count},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}(\\{skip}\E\T{1}){}$\1\5 -${}\\{fputc}(\.{SKIP0},\39\\{out});{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}(\\{skip}<\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{SKIP1},\39\\{out});{}$\6 -${}\\{fputc}(\\{skip},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{SKIP2},\39\\{out});{}$\6 -${}\\{fputc}(\\{skip}\GG\T{8},\39\\{out});{}$\6 -${}\\{fputc}(\\{skip}\AND\T{\^FF},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -${}\\{skip}\K\T{0};{}$\6 -\&{if} ${}(\\{count}<\T{64}){}$\1\5 -${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 -\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 -${}\\{fputc}(\\{count},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -${}\\{count}\K\T{0};{}$\6 -${}\\{paint}\K\.{BLACK};{}$\6 -\&{break};\6 -\4${}\}{}$\2\6 -${}\|x\PP;{}$\6 -${}\\{cp}\PP;{}$\6 -\4${}\}{}$\2\6 -\&{if} ${}(\|x\G\\{pk\_output\_size\_x}){}$\5 -${}\{{}$\1\6 -${}\\{skip}\PP;{}$\6 -${}\|y\PP;{}$\6 -\&{continue};\6 -\4${}\}{}$\2\par -\U42.\fi - -\M{44} -\Y\B\4\X44:Process rest of line\X${}\E{}$\6 -\&{while} ${}(\|x<\\{pk\_output\_size\_x}){}$\5 -${}\{{}$\1\6 -\&{if} ${}({*}\\{cp}\E\\{paint}){}$\1\5 -${}\\{count}\PP;{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{if} ${}(\\{count}<\T{64}){}$\1\5 -${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 -\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 -${}\\{fputc}(\\{count},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -${}\\{count}\K\T{1};{}$\6 -${}\\{paint}\K\.{BLACK}-\\{paint};{}$\6 -\4${}\}{}$\2\6 -${}\|x\PP;{}$\6 -${}\\{cp}\PP;{}$\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{paint}\E\.{BLACK}){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{count}<\T{64}){}$\1\5 -${}\\{fputc}(\.{PAINT\_}(\\{count}),\39\\{out});{}$\2\6 -\&{else} \&{if} ${}(\\{count}<\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT1},\39\\{out});{}$\6 -${}\\{fputc}(\\{count},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fputc}(\.{PAINT2},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\GG\T{8},\39\\{out});{}$\6 -${}\\{fputc}(\\{count}\AND\T{\^FF},\39\\{out});{}$\6 -\4${}\}{}$\2\6 -${}\\{paint}\K\.{WHITE};{}$\6 -\4${}\}{}$\2\par -\U42.\fi - -\N{1}{45}The font metrics file. -This routine creates one \.{PL} file with the font properties. None of the -\TeX\ font dimensions are needed because you never will use CJK fonts -directly, and intercharacter stretching is handled by the \\{CJK} macro -\.{\\CJKglue}. (Other packages may define similar commands.) - -The name of the \.{PL} file will contain the running two digits in -\mf-like mode only. - -It makes sense \\{not} to compute the check sum automatically for two -reasons. Firstly, since \TeX's checksum algorithm is based on the character -width, the number of valid characters, and the designsize, there is a much -higher chance that two subfonts from different HBF fonts have the same check -sum than it is for ordinary fonts, because all characters have the same -width, usually 256~characters in a subfont, and very often the same design -size. Secondly, and this is more important, we create just one -\.{TFM} file for all subfonts regardless of the real number of characters -in a particular subfont. - -To have an identification string in the \.{TFM} file, we split it into -single bytes and use the \.{HEADER} command repeatedly. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_pl}(\&{void});\par -\fi - -\M{46} -\Y\B\&{void} \\{write\_pl}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{int} \|i${},{}$ \\{pos};\6 -\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\6 -\&{long} \|t${},{}$ \\{sc};\6 -\&{char} ${}{*}\|s;{}$\6 -\&{char} \\{tfm\_header}[\,]${}\K\.{"Created\ by\ hbf2gf"};{}$\7 -${}\\{file\_number}\MM{}$;\C{ for \mf-like mode }\7 -\&{if} (\\{mf\_like})\5 -${}\{{}$\1\6 -\&{if} (\\{unicode})\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02x.pl"},\39\\{output\_name},\39% -\\{file\_number});{}$\2\6 -\&{else}\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s\%02i.pl"},\39\\{output\_name},\39% -\\{file\_number});{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s.pl"},\39\\{output\_name}){}$;\2\7 -\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_TXT}))){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% -\_file});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{output\_file}){}$;\2\7 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(FAMILY\ \%s\%d)"}\6 -\.{"\\n(CODINGSCHEME\ CJK}\)\.{-\%s)"}${},\39\\{output\_name},\39\\{file% -\_number},\39\\{font\_encoding}){}$;\7 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(DESIGNSIZE\ R\ \%.6}\)\.{f)"}\6 -\.{"\\n(COMMENT\ DESIGNSI}\)\.{ZE\ IS\ IN\ POINTS)"}\6 -\.{"\\n(COMMENT\ OTHER\ SI}\)\.{ZES\ ARE\ MULTIPLES\ OF}\)\.{\ DESIGNSIZE)"}\6 -\.{"\\n(CHECKSUM\ O\ \%lo)"}\6 -\.{"\\n(FONTDIMEN"}\6 -\.{"\\n\ \ \ (SLANT\ R\ \%.6f)}\)\.{"}\6 -\.{"\\n\ \ \ (SPACE\ R\ 0.0)"}\6 -\.{"\\n\ \ \ (STRETCH\ R\ 0.0}\)\.{)"}\6 -\.{"\\n\ \ \ (SHRINK\ R\ 0.0)}\)\.{"}\6 -\.{"\\n\ \ \ (XHEIGHT\ R\ 1.0}\)\.{)"}\6 -\.{"\\n\ \ \ (QUAD\ R\ 1.0)"}\6 -\.{"\\n\ \ \ (EXTRASPACE\ R\ }\)\.{0.0)"}\6 -\.{"\\n\ \ \ )"}${},\39\\{design\_size},\39\\{checksum},\39\\{slant}){}$;\7 -${}\|s\K\\{tfm\_header};{}$\6 -${}\|i\K\\{strlen}(\|s);{}$\6 -${}\|t\K{}$((\&{long}) \|i)${}\LL\T{24};{}$\6 -${}\\{sc}\K\T{16};{}$\6 -${}\\{pos}\K\T{18}{}$;\7 -${}\\{fprintf}(\\{out},\39\.{"\\n"});{}$\6 -\&{while} ${}(\|i>\T{0}){}$\5 -${}\{{}$\1\6 -${}\|t\MRL{{\OR}{\K}}((\&{long})({*}{}$(\&{unsigned} \&{char} ${}{*}){}$ \|s${}% -\PP))\LL\\{sc};{}$\6 -${}\\{sc}\MRL{-{\K}}\T{8};{}$\6 -\&{if} ${}(\\{sc}<\T{0}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% -\39\|t);{}$\6 -${}\|t\K\T{0};{}$\6 -${}\\{sc}\K\T{24};{}$\6 -${}\\{pos}\PP;{}$\6 -\4${}\}{}$\2\6 -${}\|i\MM;{}$\6 -\4${}\}{}$\2\6 -\&{if} (\|t)\1\5 -${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% -\39\|t);{}$\2\6 -${}\\{fprintf}(\\{out},\39\.{"\\n"}){}$;\7 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(CHARACTER\ O\ \%o"}\6 -\.{"\\n\ \ \ (CHARWD\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARHT\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARDP\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARIC\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ )"}${},{}$\6 -\|i${},\39\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x},\39\\{tfm\_output% -\_size\_y}+\\{tfm\_offset\_y},\39{-}\\{tfm\_offset\_y},\39\\{slant}*(\\{tfm% -\_output\_size\_y}+\\{tfm\_offset\_y}));{}$\6 -\4${}\}{}$\2\7 -\\{fclose}(\\{out});\6 -\4${}\}{}$\2\par -\fi - -\N{1}{47}The extended virtual font file for \Om. -The following is very similar to \PB{\\{write\_pl}(\,)}; we simply map the -glyphs -of the subfonts back to the original encoding positions. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_ovp}(\&{void});\par -\fi - -\M{48} -\Y\B\&{void} \\{write\_ovp}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{int} \|c${},{}$ \|i${},{}$ \\{nmb\_subfonts}${},{}$ \\{remainder}${},{}$ % -\\{count}${},{}$ \\{pos};\6 -\&{char} ${}\\{output\_file}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\6 -\&{long} \|t${},{}$ \\{sc};\6 -\&{char} ${}{*}\|s;{}$\6 -\&{char} \\{ofm\_header}[\,]${}\K\.{"Created\ by\ hbf2gf"};{}$\7 -${}\\{nmb\_subfonts}\K((\\{max\_char}-(\\{min\_char}\AND\T{\^FF00}))/\T{256}*% -\\{nmb\_2\_bytes})/\T{256}+\T{1};{}$\6 -${}\\{remainder}\K((\\{max\_char}-(\\{min\_char}\AND\T{\^FF00}))/\T{256}*\\{nmb% -\_2\_bytes})\MOD\T{256}{}$;\C{ correction for the last incomplete second byte -range }\6 -\&{for} ${}(\\{count}\K\T{0};{}$ ${}\\{count}<(\\{max\_char}\AND\T{\^FF});{}$ -${}\\{count}\PP){}$\1\6 -\&{if} (\\{b2\_codes}[\\{count}])\1\5 -${}\\{remainder}\PP;{}$\2\2\6 -\&{if} ${}(\\{remainder}\G\T{256}){}$\1\5 -${}\\{nmb\_subfonts}\PP{}$;\2\7 -${}\\{sprintf}(\\{output\_file},\39\.{"\%s.ovp"},\39\\{output\_name}){}$;\7 -\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{output\_file},\39\.{WRITE\_TXT}))){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{output% -\_file});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{output\_file}){}$;\2\7 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(VTITLE\ Omega\ vir}\)\.{tual\ font\ created\ by}\)\.{\ hbf2gf)"}\6 -\.{"\\n(DESIGNSIZE\ R\ \%.6}\)\.{f)"}\6 -\.{"\\n(COMMENT\ DESIGNSI}\)\.{ZE\ IS\ IN\ POINTS)"}\6 -\.{"\\n(COMMENT\ OTHER\ SI}\)\.{ZES\ ARE\ MULTIPLES\ OF}\)\.{\ DESIGNSIZE)"}\6 -\.{"\\n(CHECKSUM\ O\ \%lo)"}\6 -\.{"\\n(FONTDIMEN"}\6 -\.{"\\n\ \ \ (SLANT\ R\ \%.6f)}\)\.{"}\6 -\.{"\\n\ \ \ (SPACE\ R\ 0.0)"}\6 -\.{"\\n\ \ \ (STRETCH\ R\ 0.0}\)\.{)"}\6 -\.{"\\n\ \ \ (SHRINK\ R\ 0.0)}\)\.{"}\6 -\.{"\\n\ \ \ (XHEIGHT\ R\ 1.0}\)\.{)"}\6 -\.{"\\n\ \ \ (QUAD\ R\ 1.0)"}\6 -\.{"\\n\ \ \ (EXTRASPACE\ R\ }\)\.{0.0)"}\6 -\.{"\\n\ \ \ )"}${},\39\\{design\_size},\39\\{checksum},\39\\{slant}){}$;\7 -${}\|s\K\\{ofm\_header};{}$\6 -${}\|i\K\\{strlen}(\|s);{}$\6 -${}\|t\K{}$((\&{long}) \|i)${}\LL\T{24};{}$\6 -${}\\{sc}\K\T{16};{}$\6 -${}\\{pos}\K\T{18}{}$;\7 -${}\\{fprintf}(\\{out},\39\.{"\\n"});{}$\6 -\&{while} ${}(\|i>\T{0}){}$\5 -${}\{{}$\1\6 -${}\|t\MRL{{\OR}{\K}}((\&{long})({*}{}$(\&{unsigned} \&{char} ${}{*}){}$ \|s${}% -\PP))\LL\\{sc};{}$\6 -${}\\{sc}\MRL{-{\K}}\T{8};{}$\6 -\&{if} ${}(\\{sc}<\T{0}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% -\39\|t);{}$\6 -${}\|t\K\T{0};{}$\6 -${}\\{sc}\K\T{24};{}$\6 -${}\\{pos}\PP;{}$\6 -\4${}\}{}$\2\6 -${}\|i\MM;{}$\6 -\4${}\}{}$\2\6 -\&{if} (\|t)\1\5 -${}\\{fprintf}(\\{out},\39\.{"\\n(HEADER\ D\ \%d\ O\ \%l}\)\.{o)"},\39\\{pos},% -\39\|t);{}$\2\6 -${}\\{fprintf}(\\{out},\39\.{"\\n"}){}$;\7 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\\{nmb\_subfonts};{}$ ${}\|i\PP){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(MAPFONT\ D\ \%i"}\6 -\.{"\\n\ \ \ (FONTNAME\ \%s\%0}\)\.{2i)"}\6 -\.{"\\n\ \ \ (FONTCHECKSUM\ }\)\.{O\ \%lo)"}\6 -\.{"\\n\ \ \ (FONTAT\ R\ 1.0)}\)\.{"}\6 -\.{"\\n\ \ \ (FONTDSIZE\ R\ \%}\)\.{.6f)"}\6 -\.{"\\n\ \ \ )"}${},\39\|i,\39\\{output\_name},\39\|i+\T{1},\39\\{checksum},\39% -\\{design\_size});{}$\6 -\4${}\}{}$\2\7 -\&{for} ${}(\|c\K\\{min\_char},\39\|i\K\T{0},\39\\{count}\K\T{0};{}$ ${}\|c\Z% -\\{max\_char};{}$ ${}\|c\PP){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{b2\_codes}[\|c\AND\T{\^FF}]\E\.{VALID\_SUBCODE}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n(CHARACTER\ O\ \%o"}\6 -\.{"\\n\ \ \ (CHARWD\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARHT\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARDP\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (CHARIC\ R\ \%.6f}\)\.{)"}\6 -\.{"\\n\ \ \ (MAP"}\6 -\.{"\\n\ \ \ \ \ \ (SELECTFONT}\)\.{\ D\ \%i)"}\6 -\.{"\\n\ \ \ \ \ \ (SETCHAR\ O\ }\)\.{\%o)"}\6 -\.{"\\n\ \ \ \ \ \ )"}\6 -\.{"\\n\ \ \ )"}${},{}$\6 -\|c${},\39\\{tfm\_output\_size\_x}+\T{2}*\\{tfm\_offset\_x},\39\\{tfm\_output% -\_size\_y}+\\{tfm\_offset\_y},\39{-}\\{tfm\_offset\_y},\39\\{slant}*(\\{tfm% -\_output\_size\_y}+\\{tfm\_offset\_y}),\39\|i,\39\\{count}){}$;\7 -${}\\{count}\PP;{}$\6 -\&{if} ${}(\\{count}\E\T{256}){}$\5 -${}\{{}$\1\6 -${}\\{count}\K\T{0};{}$\6 -${}\|i\PP;{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\1\5 -\&{continue};\2\6 -\4${}\}{}$\2\7 -\\{fclose}(\\{out});\6 -\4${}\}{}$\2\par -\fi - -\N{1}{49}The job file. -This routine is the most system specific one. If your operating system needs -a different outline, make appropriate changes here. - -You have to call this batch file after \.{hbf2gf} has finished (if not in -\mf-like mode). It will transform the \.{GF} files into \.{PK} files and -delete the now unnecessary \.{GF} files, then transform the \.{PL} file into -a \.{TFM} file and copy it \PB{\\{nmb\_files}} times. The name of the job file -is -\PB{\\{output\_name}}. - -\Y\B\4\D$\.{EXTENSION\_LENGTH}$ \5 -\T{8}\C{ the maximal length of a file extension }\Y\par -\B\4\D$\.{GFTOPK\_NAME}$ \5 -\.{"gftopk"}\par -\B\4\D$\.{PLTOTF\_NAME}$ \5 -\.{"pltotf"}\par -\B\4\D$\.{OVP2OVF\_NAME}$ \5 -\.{"ovp2ovf"}\par -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{char} ${}\\{job\_extension}[\.{EXTENSION\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}\\{rm\_command}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}\\{cp\_command}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}\\{pk\_directory}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}\\{tfm\_directory}[\.{STRING\_LENGTH}+\T{1}]{}$;\7 -\&{int} \\{ofm\_file}${}\K\.{FALSE}{}$;\par -\fi - -\M{50} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{write\_job}(\&{void});\par -\fi - -\M{51} -\Y\B\&{void} \\{write\_job}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{FILE} ${}{*}\\{out};{}$\6 -\&{int} \|i${},{}$ \|j;\6 -\&{char} ${}\\{buffer}[\.{FILE\_NAME\_LENGTH}+\T{1}];{}$\7 -${}\\{strcpy}(\\{buffer},\39\\{output\_name});{}$\6 -${}\\{strcat}(\\{buffer},\39\\{job\_extension});{}$\6 -\&{if} ${}(\R(\\{out}\K\\{fopen}(\\{buffer},\39\.{WRITE\_TXT}))){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39% -\\{buffer});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"\\nWriting\ `\%s'\\n"},\39\\{buffer}){}$;\2\7 -\&{if} (\\{pk\_files})\5 -${}\{{}$\1\6 -\&{if} (\\{unicode})\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K(\\{min\_char}\GG\T{8}),\39\|j\K\T{0};{}$ ${}\|j<\\{nmb% -\_files};{}$ ${}\|i\PP,\39\|j\PP){}$\1\5 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\%s\ \%s\%02x.gf\ \%s\%s\%0}\)\.{2x.\%.0ipk\\n"}\6 -\.{"\%s\ \%s\%02x.gf\\n"}${},{}$\6 -\.{GFTOPK\_NAME}${},\39\\{output\_name},\39\|i,{}$\6 -\\{pk\_directory}${},\39\\{output\_name},\39\|i,\39\\{long\_extension}\?(% -\&{int})(\\{dpi\_x}*\\{magstep\_x}+\T{0.5}):\T{0},{}$\6 -\\{rm\_command}${},\39\\{output\_name},\39\|i);{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K\T{1};{}$ ${}\|i\Z\\{nmb\_files};{}$ ${}\|i\PP){}$\1\5 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\%s\ \%s\%02i.gf\ \%s\%s\%0}\)\.{2i.\%.0ipk\\n"}\6 -\.{"\%s\ \%s\%02i.gf\\n"}${},{}$\6 -\.{GFTOPK\_NAME}${},\39\\{output\_name},\39\|i,{}$\6 -\\{pk\_directory}${},\39\\{output\_name},\39\|i,\39\\{long\_extension}\?(% -\&{int})(\\{dpi\_x}*\\{magstep\_x}+\T{0.5}):\T{0},{}$\6 -\\{rm\_command}${},\39\\{output\_name},\39\|i);{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\7 -\&{if} (\\{tfm\_files})\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n"}\6 -\.{"\%s\ \%s.pl\ \%s.tfm\\n"}\6 -\.{"\%s\ \%s.pl\\n"}\6 -\.{"\\n"}${},{}$\6 -\.{PLTOTF\_NAME}${},\39\\{output\_name},\39\\{output\_name},{}$\6 -\\{rm\_command}${},\39\\{output\_name}){}$;\7 -\&{if} (\\{unicode})\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K(\\{min\_char}\GG\T{8}),\39\|j\K\T{0};{}$ ${}\|j<\\{nmb% -\_files};{}$ ${}\|i\PP,\39\|j\PP){}$\1\5 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\%s\ \%s.tfm\ \%s\%s\%02x.}\)\.{tfm\\n"}${},{}$\6 -\\{cp\_command}${},\39\\{output\_name},\39\\{tfm\_directory},\39\\{output% -\_name},\39\|i);{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K\T{1};{}$ ${}\|i\Z\\{nmb\_files};{}$ ${}\|i\PP){}$\1\5 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\%s\ \%s.tfm\ \%s\%s\%02i.}\)\.{tfm\\n"}${},{}$\6 -\\{cp\_command}${},\39\\{output\_name},\39\\{tfm\_directory},\39\\{output% -\_name},\39\|i);{}$\2\6 -\4${}\}{}$\2\7 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n"}\6 -\.{"\%s\ \%s.tfm"}${},{}$\6 -\\{rm\_command}${},\39\\{output\_name});{}$\6 -\4${}\}{}$\2\7 -\&{if} (\\{ofm\_file})\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{out},{}$\6 -\.{"\\n"}\6 -\.{"\%s\ \%s.ovp\ \%s.ovf\ \%s}\)\.{.ofm\\n"}\6 -\.{"\%s\ \%s.ovp\\n"}\6 -\.{"\\n"}${},{}$\6 -\.{OVP2OVF\_NAME}${},\39\\{output\_name},\39\\{output\_name},\39\\{output% -\_name},{}$\6 -\\{rm\_command}${},\39\\{output\_name});{}$\6 -\4${}\}{}$\2\7 -\\{fclose}(\\{out});\6 -\4${}\}{}$\2\par -\fi - -\N{1}{52}The configuration file. -Here is a list with all necessary keywords (and parameters): -\medskip -\halign{\quad\.{#}\hfil&\quad#\hfil\cr -hbf\_header & the HBF header file name of the input font(s). \cr -output\_name & the name stem of the output files. \cr -& Should be equal to the name of the configuration file -in most cases.\cr -& A running two digit decimal number starting with -\.{01} will be appended. \cr -& (For Unicode fonts see the keyword \.{unicode} -below.) \cr -} -\bigskip -And now all optional keywords: -\medskip -\halign{\quad\.{#}\hfil&\quad#\hfil\cr -x\_offset & increases the character width. \cr -& Will be applied on both sides; \cr -& default is the value given in the HBF header -(\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr -& scaled to \\{design\/}size (in pixels). \cr -y\_offset & shifts all characters up or down; \cr -& default is the value given in the HBF header -(\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr -& scaled to \\{design\/}size (in pixels). \cr -design\_size & the design size (in points) of the font. \cr -& \.{x\_offset} and \.{y\_offset} refer to this -size. \cr -& Default is \PB{\T{10.0}} \cr -target\_size & This command is obsolete now and will be -ignored.\cr -& \cr -slant & the slant of the font (given as $\Delta x / -\Delta y$). \cr -& Only values in the range \PB{$\T{0}\Z\\{slant}\Z\T{1}$} -are allowed. \cr -& Default is \PB{\T{0.0}} \cr -rotation & if set to `yes'. the glyphs are rotated -90~degrees counter-clockwise. \cr -& The default offsets as given in the HBF header -will be ignored (and set to~\PB{\T{0}}). \cr -& Default is `no'. \cr -& \cr -mag\_x & \cr -mag\_y & scaling values of the characters to reach -design size. \cr -& If only one magnification is given, x and y -values are assumed to be equal. \cr -& Default is \.{mag\_x} $=$ \.{mag\_y} $=$ \PB{\T{1.0}} -\cr -threshold & A value between \PB{\T{1}} and \PB{\T{254}} defining a -threshold for converting the internal \cr -& graymap into the output bitmap; lower values -cut more pixels. \cr -& Default value is \PB{\T{128}}. \cr -& \cr -comment & a comment describing the font; \cr -& default is none. \cr -& \cr -nmb\_fonts & the number of the fonts. \cr -& Default value is~\PB{${-}\T{1}$} for creating all -fonts. \cr -unicode & if `yes', a two digit hexadecimal number will -be used as a running number, \cr -& starting with the value of the first byte of -the first code range. \cr -& Default is `no'. \cr -min\_char & the minimum of the encoding range. \cr -& Specify this value if it is not identical to -the lowest code value \cr -& in the HBF file (to which it defaults). \cr -& \cr -dpi\_x & \cr -dpi\_y & the horizontal and vertical resolution (in -dpi) of the printer. \cr -& If only one resolution is given, x and y -values are assumed to be equal. \cr -& Default is \PB{\T{300}}. \cr -checksum & a checksum to identify the \.{GF} files -with the appropriate \.{TFM} files. \cr -& The default of this 32~bit unsigned integer -is \PB{\T{0}}. \cr -coding & a comment describing the coding scheme; \cr -& default is none. \cr -& \cr -pk\_directory & the destination directory of the -\.{PK} files; \cr -& default: none. \cr -& Attention! The batch file will not check -whether this directory exists. \cr -tfm\_directory & the destination directory of the -\.{TFM} files; \cr -& default: none. \cr -& Attention! The batch file will not check -whether this directory exists. \cr -pk\_files & whether to create \.{PK} files or not; \cr -& default is `yes'. \cr -tfm\_files & whether to create \.{TFM} files or not; \cr -& default is `yes'. \cr -ofm\_file & whether to create an \.{OFM} and an -\.{OVF} file or not; \cr -& default is `no'. \cr -long\_extension & if `yes', \.{PK} files will include the -resolution in the extension \cr -& (e.g. \.{gsso1201.300pk}). \cr -& This affects the batch file only (default is -`yes'). \cr -rm\_command & this shell command removes files; \cr -& default: `rm'. \cr -cp\_command & this shell command copies files; \cr -& default: `cp'. \cr -job\_extension & the extension of the batch file which calls -\.{GFtoPK} and \.{PLtoTF} \cr -& to convert the \.{GF} and the -\.{PL} files into \.{PK} and -\.{TFM} files; \cr -& default is none. \cr -} -\bigskip - -The searching algorithm (for the keywords) of \.{hbf2gf} is case -insensitive; it makes no difference whether you write for example \.{comment} -or \.{CommenT}. The keywords must start a line (be in the first column), and -the corresponding parameters must be on the same line with the keyword and -separated by at least one space or tabulator stop. Lines starting not with a -keyword are ignored. - -Key values \\{are} case sensitive (except \.{yes} and \.{no}). - -The default system dependent values are for \UNIX/-like operating systems; -if you use for example DOS, you must write -\medskip -\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr -long\_extension & no \cr -rm\_command & del \cr -cp\_command & copy \cr -job\_extension & .bat \cr -} -\medskip - -Both the values \PB{\\{pk\_output\_size\_x}} and \PB{\\{pk\_output\_size\_y}} -must not exceed -\PB{\.{MAX\_CHAR\_SIZE}}; \.{x\_offset} and \.{y\_offset} are related to the -design size (and not to the input size). - -In \mf-like mode, one \.{GF} file and one \.{PL} file will be computed -(depending on the command line options \.{-g} and \.{-p}), taking -\PB{\\{x\_resolution}} and \PB{\\{y\_scale}} from the command line. \.{nmb% -\_fonts} will -always be set to~\PB{\T{1}}; no job file will be created. - - -\fi - -\M{53} -\Y\B\4\D$\.{PRINTER\_MIN\_RES\_X}$ \5 -\T{50}\par -\B\4\D$\.{PRINTER\_MIN\_RES\_Y}$ \5 -\T{50}\par -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{char} ${}\\{Buffer}[\.{STRING\_LENGTH}+\T{1}]{}$;\par -\fi - -\M{54} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{read\_config}(\&{void});\par -\fi - -\M{55} -If \PB{\\{config\_file}} isn't found in \mf-like mode we assume that the font -isn't a HBF font at all. - -\Y\B\&{void} \\{read\_config}(\&{void})\1\1\2\2\6 -${}\{{}$\1\6 -\&{HBF\_BBOX} ${}{*}\\{boxp};{}$\6 -\&{char} ${}{*}\\{real\_config\_file};{}$\7 -\X56:Handle extension\X\7 -${}\\{real\_config\_file}\K\\{TeX\_search\_cfg\_file}(\\{config\_file});{}$\6 -\&{if} ${}(\R\\{real\_config\_file}){}$\5 -${}\{{}$\1\6 -\&{if} (\\{mf\_like})\5 -${}\{{}$\1\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{config\_file});{}$\2\6 -\\{exit}(\T{2});\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{config% -\_file});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\7 -\&{if} ${}(\R(\\{config}\K\\{fopen}(\\{real\_config\_file},\39\.{READ% -\_TXT}))){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\R\\{testing}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ open\ `\%s'\\}\)\.{n"},\39\\{config% -\_file});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{else}\C{ We reach this point only if no searching library is used }\6 -${}\{{}$\1\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ or\ op}\)\.{en\ `\%s'\\n"},\39% -\\{config\_file});{}$\2\6 -\\{exit}(\T{2});\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\7 -\&{if} (\\{testing})\5 -${}\{{}$\1\6 -\&{if} ${}(\R\\{quiet}){}$\1\5 -${}\\{printf}(\.{"\%s\\n"},\39\\{real\_config\_file});{}$\2\6 -\\{exit}(\T{0});\6 -\4${}\}{}$\2\6 -\X57:Necessary parameters\X\6 -\X59:Optional parameters\X\7 -\X61:Get code range\X\6 -\X63:Get sub code range\X\7 -\\{fclose}(\\{config});\6 -\4${}\}{}$\2\par -\fi - -\M{56} -Here we check whether we have to add an extension. - -\Y\B\4\X56:Handle extension\X${}\E{}$\6 -${}\{{}$\1\6 -\&{int} \|i${},{}$ \\{lastext}${}\K{-}\T{1};{}$\7 -\&{for} ${}(\|i\K\T{0};{}$ \\{config\_file}[\|i]; ${}\|i\PP){}$\1\6 -\&{if} ${}(\\{config\_file}[\|i]\E\.{'.'}){}$\1\5 -${}\\{lastext}\K\|i;{}$\2\6 -\&{else} \&{if} ${}(\\{config\_file}[\|i]\E\.{'/'}\V\\{config\_file}[\|i]\E% -\.{':'}\V\\{config\_file}[\|i]\E\.{'\\\\'}){}$\1\5 -${}\\{lastext}\K{-}\T{1}{}$;\2\2\7 -\&{if} ${}(\\{lastext}\E{-}\T{1}){}$\1\5 -${}\\{strcat}(\\{config\_file},\39\.{".cfg"});{}$\2\6 -\4${}\}{}$\2\par -\U55.\fi - -\M{57} -\Y\B\4\X57:Necessary parameters\X${}\E{}$\6 -${}\{{}$\1\6 -\&{char} ${}\\{hbf\_header}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}{*}\\{real\_hbf\_header};{}$\7 -\&{if} ${}(\R\\{fsearch}(\.{"hbf\_header"})){}$\1\5 -\\{config\_error}(\.{"hbf\_header"});\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{hbf\_header},\39\\{Buffer}){}$;\2\7 -${}\\{real\_hbf\_header}\K\\{TeX\_search\_hbf\_file}(\\{hbf\_header});{}$\6 -\&{if} ${}(\R\\{real\_hbf\_header}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\\}\)\.{n"},\39\\{hbf% -\_header});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -${}\\{hbfDebug}\K\T{1}{}$;\C{ we activate error messages of the HBF API - while scanning the HBF header file }\7 -\&{if} ${}(\R(\\{hbf}\K\\{hbfOpen}(\\{real\_hbf\_header}))){}$\1\5 -\\{exit}(\T{1});\2\7 -${}\\{hbfDebug}\K\T{0}{}$;\7 -${}\\{boxp}\K\\{hbfBitmapBBox}(\\{hbf});{}$\6 -${}\\{input\_size\_x}\K\\{boxp}\MG\\{hbf\_height}{}$;\C{ will be checked later -for rotation }\6 -${}\\{input\_size\_y}\K\\{boxp}\MG\\{hbf\_width};{}$\6 -${}\\{font\_encoding}\K\\{hbfProperty}(\\{hbf},\39\.{"HBF\_CODE\_SCHEME"}){}$;\7 -\&{if} ${}(\R\\{fsearch}(\.{"output\_name"})){}$\1\5 -\\{config\_error}(\.{"output\_name"});\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{output\_name},\39\\{Buffer});{}$\2\6 -\4${}\}{}$\2\par -\U55.\fi - -\M{58} -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{int} \\{offset\_x};\6 -\&{int} \\{offset\_y};\7 -\&{HBF\_CHAR} \\{user\_min\_char};\6 -\&{int} \\{have\_min\_char}${}\K\.{FALSE}{}$;\par -\fi - -\M{59} -\Y\B\4\X59:Optional parameters\X${}\E{}$\6 -${}\{{}$\1\6 -\&{if} (\\{fsearch}(\.{"nmb\_files"}))\1\5 -${}\\{nmb\_files}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{if} (\\{fsearch}(\.{"unicode"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 -${}\\{unicode}\K\.{TRUE};{}$\2\2\6 -\&{if} (\\{fsearch}(\.{"min\_char"}))\5 -${}\{{}$\1\6 -${}\\{user\_min\_char}\K\\{strtoul}(\\{Buffer},\39{}$(\&{char} ${}{*}{*}){}$ -${}\NULL,\39\T{0});{}$\6 -${}\\{have\_min\_char}\K\.{TRUE};{}$\6 -\4${}\}{}$\2\7 -\&{if} ${}(\R\\{mf\_like}){}$\5 -${}\{{}$\1\6 -\&{if} (\\{fsearch}(\.{"pk\_files"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 -${}\\{pk\_files}\K\.{FALSE};{}$\2\2\6 -\&{if} (\\{fsearch}(\.{"tfm\_files"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 -${}\\{tfm\_files}\K\.{FALSE};{}$\2\2\6 -\&{if} (\\{fsearch}(\.{"ofm\_file"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 -${}\\{ofm\_file}\K\.{TRUE};{}$\2\2\6 -\&{if} (\\{fsearch}(\.{"long\_extension"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'n'}\V\\{Buffer}[\T{0}]\E\.{'N'}){}$\1\5 -${}\\{long\_extension}\K\.{FALSE};{}$\2\2\6 -\4${}\}{}$\2\7 -\&{if} (\\{fsearch}(\.{"slant"}))\1\5 -${}\\{slant}\K\\{atof}(\\{Buffer});{}$\2\6 -\&{if} ${}(\\{slant}<\T{0.0}\V\\{slant}>\T{1.0}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ slant\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} (\\{fsearch}(\.{"rotation"}))\1\6 -\&{if} ${}(\\{Buffer}[\T{0}]\E\.{'y'}\V\\{Buffer}[\T{0}]\E\.{'Y'}){}$\1\5 -${}\\{rotation}\K\.{TRUE}{}$;\2\2\7 -\&{if} (\\{fsearch}(\.{"mag\_x"}))\1\5 -${}\\{mag\_x}\K\\{atof}(\\{Buffer});{}$\2\6 -\&{if} (\\{fsearch}(\.{"mag\_y"}))\1\5 -${}\\{mag\_y}\K\\{atof}(\\{Buffer});{}$\2\6 -\&{if} ${}(\R\\{mag\_x}\W\R\\{mag\_y}){}$\5 -${}\{{}$\1\6 -${}\\{mag\_x}\K\T{1.0};{}$\6 -${}\\{mag\_y}\K\T{1.0};{}$\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{mag\_x}\W\R\\{mag\_y}){}$\1\5 -${}\\{mag\_y}\K\\{mag\_x};{}$\2\6 -\&{if} ${}(\\{mag\_y}\W\R\\{mag\_x}){}$\1\5 -${}\\{mag\_x}\K\\{mag\_y};{}$\2\6 -\&{if} ${}(\\{mag\_x}\Z\T{0.0}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{magnification% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{mag\_y}\Z\T{0.0}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ ma}\)\.{gnification% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{if} (\\{fsearch}(\.{"dpi\_x"}))\1\5 -${}\\{dpi\_x}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{if} (\\{fsearch}(\.{"dpi\_y"}))\1\5 -${}\\{dpi\_y}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{if} ${}(\R\\{dpi\_x}\W\R\\{dpi\_y}){}$\5 -${}\{{}$\1\6 -${}\\{dpi\_x}\K\T{300};{}$\6 -${}\\{dpi\_y}\K\T{300};{}$\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{dpi\_x}\W\R\\{dpi\_y}){}$\1\5 -${}\\{dpi\_y}\K\\{dpi\_x};{}$\2\6 -\&{if} ${}(\\{dpi\_y}\W\R\\{dpi\_x}){}$\1\5 -${}\\{dpi\_x}\K\\{dpi\_y};{}$\2\6 -\&{if} ${}(\\{dpi\_x}\Z\.{PRINTER\_MIN\_RES\_X}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ horizontal\ }\)\.{printer\ resolution% -\\n}\)\.{"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\\{dpi\_y}\Z\.{PRINTER\_MIN\_RES\_Y}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ vertical\ pr}\)\.{inter\ resolution% -\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{if} (\\{fsearch}(\.{"design\_size"}))\1\5 -${}\\{design\_size}\K\\{atof}(\\{Buffer}){}$;\2\7 -\&{if} (\\{fsearch}(\.{"x\_offset"}))\1\5 -${}\\{offset\_x}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{else}\1\5 -${}\\{offset\_x}\K\\{rotation}\?\T{0}:(\\{boxp}\MG\\{hbf\_xDisplacement}*\\{mag% -\_x}+\T{0.5});{}$\2\6 -\&{if} (\\{fsearch}(\.{"y\_offset"}))\1\5 -${}\\{offset\_y}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{else}\1\5 -${}\\{offset\_y}\K\\{rotation}\?\T{0}:(\\{boxp}\MG\\{hbf\_yDisplacement}*\\{mag% -\_y}+\T{0.5});{}$\2\6 -\&{if} ${}(\R\\{fsearch}(\.{"comment"})){}$\1\5 -${}\\{comment}[\T{0}]\K\.{'\\0'};{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{comment},\39\\{Buffer}){}$;\2\7 -\&{if} (\\{fsearch}(\.{"threshold"}))\1\5 -${}\\{threshold}\K\\{atoi}(\\{Buffer});{}$\2\6 -\&{if} ${}(\\{threshold}\Z\T{0}\V\\{threshold}\G\T{255}){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Invalid\ threshold\\n}\)\.{"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\7 -\&{if} ${}(\R\\{fsearch}(\.{"checksum"})){}$\1\5 -${}\\{checksum}\K\T{0};{}$\2\6 -\&{else}\1\5 -${}\\{checksum}\K\\{strtoul}(\\{Buffer},\39{}$(\&{char} ${}{*}{*}){}$ ${}\NULL,% -\39\T{0}){}$;\2\7 -\&{if} ${}(\R\\{fsearch}(\.{"coding"})){}$\1\5 -${}\\{coding}[\T{0}]\K\.{'\\0'};{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{coding},\39\\{Buffer}){}$;\2\7 -\&{if} ${}(\R\\{fsearch}(\.{"pk\_directory"})){}$\1\5 -${}\\{pk\_directory}[\T{0}]\K\.{'\\0'};{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{pk\_directory},\39\\{Buffer}){}$;\2\7 -\&{if} ${}(\R\\{fsearch}(\.{"tfm\_directory"})){}$\1\5 -${}\\{tfm\_directory}[\T{0}]\K\.{'\\0'};{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{tfm\_directory},\39\\{Buffer}){}$;\2\7 -\&{if} (\\{fsearch}(\.{"rm\_command"}))\1\5 -${}\\{strcpy}(\\{rm\_command},\39\\{Buffer});{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{rm\_command},\39\.{"rm"}){}$;\2\7 -\&{if} (\\{fsearch}(\.{"cp\_command"}))\1\5 -${}\\{strcpy}(\\{cp\_command},\39\\{Buffer});{}$\2\6 -\&{else}\1\5 -${}\\{strcpy}(\\{cp\_command},\39\.{"cp"}){}$;\2\7 -\&{if} ${}(\R\\{fsearch}(\.{"job\_extension"})){}$\1\5 -${}\\{job\_extension}[\T{0}]\K\.{'\\0'};{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}\\{strncpy}(\\{job\_extension},\39\\{Buffer},\39\.{EXTENSION\_LENGTH});{}$\6 -${}\\{job\_extension}[\.{EXTENSION\_LENGTH}]\K\.{'\\0'};{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\par -\U55.\fi - -\M{60} -The function \PB{\\{hbfGetCodeRange}(\,)} is an extension to the HBF API. - -Successive calls return the code ranges in ascending order; we only need the -extrema of the whole code range. - -In case \PB{\\{min\_char}} has been supplied in the configuration file, we use -that -value instead. - -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{HBF\_CHAR} \\{min\_char}${},{}$ \\{max\_char};\par -\fi - -\M{61} -\Y\B\4\X61:Get code range\X${}\E{}$\6 -${}\{{}$\1\6 -\&{const} \&{void} ${}{*}\\{cp};{}$\6 -\&{HBF\_CHAR} \\{dummy};\7 -${}\\{cp}\K\\{hbfGetCodeRange}(\\{hbf},\39\NULL,\39{\AND}\\{min\_char},\39{% -\AND}\\{max\_char});{}$\6 -\&{for} ( ; ${}\\{cp}\I\NULL;{}$ ${}\\{cp}\K\\{hbfGetCodeRange}(\\{hbf},\39% -\\{cp},\39{\AND}\\{dummy},\39{\AND}\\{max\_char})){}$\1\5 -;\2\7 -\&{if} (\\{have\_min\_char})\1\5 -${}\\{min\_char}\K\\{user\_min\_char};{}$\2\6 -\4${}\}{}$\2\par -\U55.\fi - -\M{62} -The function \PB{\\{hbfGetByte2Range}(\,)} is an extension to the HBF API. - -Successive calls return the byte~2 ranges in ascending order. We raise -\PB{\.{VALID\_SUBCODE}} in the array \PB{\\{b2\_codes}[\,]} for all characters -in subcode -ranges. - -\Y\B\4\D$\.{VALID\_SUBCODE}$ \5 -\T{1}\par -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{char} \\{b2\_codes}[\T{256}];\6 -\&{unsigned} \&{char} \\{min\_2\_byte}${},{}$ \\{max\_2\_byte};\6 -\&{int} \\{nmb\_2\_bytes}${}\K\T{0}{}$;\par -\fi - -\M{63} -\Y\B\4\X63:Get sub code range\X${}\E{}$\6 -${}\{{}$\1\6 -\&{const} \&{void} ${}{*}\\{b2r};{}$\6 -\&{unsigned} \&{char} \\{dummy};\6 -\&{int} \|i;\7 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP){}$\1\5 -${}\\{b2\_codes}[\|i]\K\T{0}{}$;\2\7 -${}\\{b2r}\K\\{hbfGetByte2Range}(\\{hbf},\39\NULL,\39{\AND}\\{min\_2\_byte},% -\39{\AND}\\{max\_2\_byte});{}$\6 -${}\\{dummy}\K\\{min\_2\_byte};{}$\6 -\&{for} ( ; ${}\\{b2r}\I\NULL;{}$ ${}\\{b2r}\K\\{hbfGetByte2Range}(\\{hbf},\39% -\\{b2r},\39{\AND}\\{dummy},\39{\AND}\\{max\_2\_byte})){}$\5 -${}\{{}$\1\6 -\&{for} ${}(\|i\K\\{dummy};{}$ ${}\|i\Z\\{max\_2\_byte};{}$ ${}\|i\PP){}$\1\5 -${}\\{b2\_codes}[\|i]\K\.{VALID\_SUBCODE};{}$\2\6 -\4${}\}{}$\2\7 -\&{for} ${}(\|i\K\T{0};{}$ ${}\|i<\T{256};{}$ ${}\|i\PP{}$)\C{ compute the -number of valid \PB{\\{b2\_codes}} }\1\6 -\&{if} ${}(\\{b2\_codes}[\|i]\E\.{VALID\_SUBCODE}){}$\1\5 -${}\\{nmb\_2\_bytes}\PP;{}$\2\2\6 -\4${}\}{}$\2\par -\U55.\fi - -\M{64} -This search routine is case insignificant. Each keyword must start a line; -the function checks whether the character before the keyword is a newline -character (\PB{\.{'\\n'}}). It also checks the presence of a parameter and -fills -\PB{\\{Buffer}} if existent. \PB{\\{fsearch}(\,)} returns~1 on success. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{int} \\{fsearch}(\&{const} \&{char} ${}{*}){}$;\par -\fi - -\M{65} -\Y\B\&{int} \\{fsearch}(\&{const} \&{char} ${}{*}\\{search\_string}){}$\1\1\2\2% -\6 -${}\{{}$\1\6 -\&{char} ${}{*}\|P,{}$ \|p;\6 -\&{const} \&{char} ${}{*}\|Q;{}$\6 -\&{char} ${}\\{temp\_buffer}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}\\{env\_name}[\.{STRING\_LENGTH}+\T{1}];{}$\6 -\&{char} ${}{*}\\{env\_p};{}$\6 -\&{char} ${}{*}\\{env\_value};{}$\6 -\&{char} ${}{*}\\{Buf\_p};{}$\6 -\&{int} \\{Ch}${},{}$ \\{ch}${},{}$ \\{old\_ch}${}\K\.{'\\n'};{}$\6 -\&{int} \\{count}${}\K\.{STRING\_LENGTH};{}$\7 -\\{rewind}(\\{config});\C{ we start at offset~0 }\7 -\&{do}\5 -${}\{{}$\1\6 -${}\|Q\K\\{search\_string};{}$\6 -${}\|p\K\\{tolower}({*}\|Q);{}$\6 -${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 -${}\\{ch}\K\\{tolower}(\\{Ch});{}$\6 -\&{while} ${}(\R(\\{ch}\E\|p\W\\{old\_ch}\E\.{'\\n'})\W\\{Ch}\I\.{EOF}{}$)\C{ -search first character of \PB{\\{search\_string}}; - \PB{\.{'\\n'}} must be the character before }\6 -${}\{{}$\1\6 -${}\\{old\_ch}\K\\{ch};{}$\6 -${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 -${}\\{ch}\K\\{tolower}(\\{Ch});{}$\6 -\4${}\}{}$\2\7 -\&{for} ( ; ; \,)\5 -${}\{{}$\1\6 -\&{if} ${}({*}(\PP\|Q)\E\.{'\\0'}){}$\1\6 -\&{if} ${}((\\{Ch}\K\\{fgetc}(\\{config}))\E\.{'\ '}\V\\{Ch}\E\.{'\\t'}{}$)\C{ -there must be a space or a tab stop after the keyword }\1\6 -\&{goto} \\{success};\2\2\6 -${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 -\&{if} ${}(\\{tolower}(\\{Ch})\I\\{tolower}({*}\|Q)){}$\1\5 -\&{break};\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\5 -\&{while} ${}(\\{Ch}\I\.{EOF}){}$;\7 -\&{return} \T{0};\7 -\4\\{success}:\5 -${}\|P\K\\{temp\_buffer}{}$;\7 -\&{while} ${}((\\{Ch}\K\\{fgetc}(\\{config}))\E\.{'\ '}\V\\{Ch}\E\.{'\\t'}{}$)% -\C{ remove leading blanks and tabs }\1\6 -;\2\6 -\&{while} ${}(\\{Ch}\I\.{'\\n'}\W\MM\\{count}>\T{0}\W\\{Ch}\I\.{EOF}{}$)\C{ -fill \PB{\\{Buffer}} }\6 -${}\{{}$\1\6 -${}{*}\|P\PP\K\\{Ch};{}$\6 -${}\\{Ch}\K\\{fgetc}(\\{config});{}$\6 -\4${}\}{}$\2\6 -${}{*}\|P\K\.{'\\0'}{}$;\7 -\&{if} ${}({*}\\{temp\_buffer}){}$\1\5 -\X66:Check for environment variables\X\2\6 -\&{else}\1\5 -${}{*}\\{Buffer}\K\.{'\\0'}{}$;\2\7 -\&{return} ${}({*}\\{Buffer})\?\T{1}:\T{0}{}$;\C{ is there something in the -buffer? }\6 -\4${}\}{}$\2\par -\fi - -\M{66} -To make the configuration file more flexible we allow environment variables -in the arguments. We scan the parameter stored in \PB{\\{temp\_buffer}} whether -it -contains a `\.{\$}' character. If yes, the following code fragment tries to -get an environment variable name whose value will be then fetched with -\PB{\\{getenv}(\,)}. An environment variable name recognized by \.{hbf2gf} must -start -with a letter or underscore; the other characters may be alphanumeric or an -underscore. You can surround the environment variable name with braces to -indicate where the name ends, e.g. \.{\$\{FOO\}}. The interpolated -configuration parameter will be truncated to \PB{\.{STRING\_LENGTH}} -characters. If -you want to have `\.{\$}' you must write `\.{\$\$}'. - -Note that you should avoid to use such environment variables for specifying -the location of the configuration file in case you have support for a file -searching library like kpathsea. Its primary aim is to specify the target -directories for the \.{pk\_directory} and the \.{tfm\_directory} keywords. - -\Y\B\4\X66:Check for environment variables\X${}\E{}$\6 -${}\{{}$\1\6 -${}\|P\K\\{temp\_buffer};{}$\6 -${}\\{Buf\_p}\K\\{Buffer};{}$\6 -${}\\{count}\K\.{STRING\_LENGTH}-\T{1}{}$;\7 -\&{while} ${}({*}\|P\W\\{count}>\T{0}){}$\5 -${}\{{}$\1\6 -${}\\{env\_p}\K\\{env\_name}{}$;\7 -\&{if} ${}({*}\|P\E\.{'\$'}){}$\5 -${}\{{}$\1\6 -${}\|P\PP;{}$\6 -\&{if} ${}({*}\|P\E\.{'\$'}){}$\5 -${}\{{}$\1\6 -${}{*}(\\{Buf\_p}\PP)\K{*}(\|P\PP);{}$\6 -${}\\{count}\MM;{}$\6 -\&{continue};\6 -\4${}\}{}$\2\6 -\&{while} ${}({*}\|P\E\.{'\{'}){}$\1\5 -${}\|P\PP;{}$\2\6 -\&{if} ${}(\R(\\{isalpha}({*}\|P)\V{*}\|P\E\.{'\_'})){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},{}$\6 -\.{"Invalid\ environment}\)\.{\ variable\ name\ in\ co}\)\.{nfiguration\ file% -\\n"});\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -${}{*}(\\{env\_p}\PP)\K{*}(\|P\PP);{}$\6 -\&{while} ${}({*}\|P){}$\5 -${}\{{}$\1\6 -\&{if} ${}(\\{isalnum}({*}\|P)\V{*}\|P\E\.{'\_'}){}$\1\5 -${}{*}(\\{env\_p}\PP)\K{*}(\|P\PP);{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -\&{while} ${}({*}\|P\E\.{'\}'}){}$\1\5 -${}\|P\PP;{}$\2\6 -${}{*}\\{env\_p}\K\.{'\\0'};{}$\6 -\&{break};\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\7 -${}\\{env\_value}\K\\{getenv}(\\{env\_name});{}$\6 -\&{if} (\\{env\_value})\C{ append the environment value to \PB{\\{Buffer}} }\6 -${}\{{}$\1\6 -\&{while} ${}({*}\\{env\_value}\W\\{count}>\T{0}){}$\5 -${}\{{}$\1\6 -${}{*}(\\{Buf\_p}\PP)\K{*}(\\{env\_value}\PP);{}$\6 -${}\\{count}\MM;{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -\&{else}\5 -${}\{{}$\1\6 -${}{*}(\\{Buf\_p}\PP)\K{*}(\|P\PP);{}$\6 -${}\\{count}\MM;{}$\6 -\4${}\}{}$\2\6 -\4${}\}{}$\2\6 -${}{*}\\{Buf\_p}\K\.{'\\0'};{}$\6 -\4${}\}{}$\2\par -\U65.\fi - -\M{67} -If an error occurs, \PB{\\{config\_error}(\,)} will leave the program with an -error -message. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{void} \\{config\_error}(\&{const} \&{char} ${}{*}){}$;\par -\fi - -\M{68} -\Y\B\&{void} \\{config\_error}(\&{const} \&{char} ${}{*}\\{message}){}$\1\1\2\2% -\6 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ find\ `\%s'\ }\)\.{entry\ in\ -configurati}\)\.{on\ file\\n"},\39\\{message});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\par -\fi - -\N{1}{69}File searching. - -We support three searching engines: emtexdir, kpathsea, and MiKTeX (which is -a Win32 port of kpathsea). For emtexdir, define \PB{\.{HAVE\_EMTEXDIR}} while -compiling. For kpathsea, define \PB{\.{HAVE\_LIBKPATHSEA}}. For MikTeX, define -\PB{\.{HAVE\_MIKTEX}}. If none of these macros is defined, a simple \PB{% -\\{fopen}(\,)} will -be used instead. - -\Y\B\4\X10:Include files\X${}\mathrel+\E{}$\6 -\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 -\8\#\&{include} \.{"kpathsea/kpathsea.h}\)\.{"}\6 -\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 -\8\#\&{include} \.{"emtexdir.h"}\6 -\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\6 -\8\#\&{include} \.{"miktex.h"}\6 -\8\#\&{endif}\par -\fi - -\M{70} -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\8\#\&{if} \&{defined} (\.{HAVE\_EMTEXDIR})\6 -\&{char} \\{emtex\_version\_string}[\,]${}\K\.{"emTeXdir"};{}$\6 -\8\#\&{elif} ${}\R{}$\&{defined} (\.{HAVE\_MIKTEX})\6 -\&{char} \\{no\_version\_string}[\,]${}\K\.{"no\ search\ library"};{}$\6 -\8\#\&{endif}\par -\fi - -\M{71} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{const} \&{char} ${}{*}\\{TeX\_search\_version}(\&{void}){}$;\par -\fi - -\M{72} -\Y\B\&{const} \&{char} ${}{*}\\{TeX\_search\_version}(\&{void}){}$\1\1\2\2\6 -${}\{{}$\6 -\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\1\6 -\&{return} \\{kpathsea\_version\_string};\6 -\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 -\&{return} \\{emtex\_version\_string};\6 -\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\7 -\&{char} \\{buf}[\T{200}];\7 -${}\\{strcpy}(\\{buf},\39\.{"MiKTeX\ "});{}$\6 -${}\\{miktex\_get\_miktex\_version\_string\_ex}(\\{buf}+\T{7},\39{}$\&{sizeof} -(\\{buf})${}-\T{7});{}$\6 -\&{return} \\{buf};\6 -\8\#\&{else}\6 -\&{return} \\{no\_version\_string};\6 -\8\#\&{endif}\6 -\4${}\}{}$\2\par -\fi - -\M{73} -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 -\&{struct} \&{emtex\_dir} \\{cfg\_path}${},{}$ \\{hbf\_path};\6 -\8\#\&{endif}\par -\fi - -\M{74} -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 -\&{extern} \&{int} \\{setup\_list}(\&{struct} \&{emtex\_dir} ${}{*},\39{}$% -\&{char} ${}{*},\39{}$\&{const} \&{char} ${}{*},\39\&{unsigned});{}$\6 -\&{int} \\{dir\_setup}(\&{struct} \&{emtex\_dir} ${}{*},\39{}$\&{const} % -\&{char} ${}{*},\39{}$\&{const} \&{char} ${}{*},\39\&{unsigned});{}$\6 -\&{char} ${}{*}{}$\\{file\_find}(\&{char} ${}{*},\39{}$\&{struct} \&{emtex% -\_dir} ${}{*});{}$\6 -\8\#\&{endif}\par -\fi - -\M{75} -We slightly modify \PB{\\{emtex\_dir\_setup}(\,)} (from the file % -\.{emtexdir.c}) to -output a warning in case the environment variable \PB{\\{env}} isn't set -properly. - -\Y\B\8\#\&{ifdef} \.{HAVE\_EMTEXDIR}\6 -\&{int} ${}\\{dir\_setup}(\\{ed},\39\\{env},\39\\{dir},\39\\{flags}){}$\1\1\6 -\&{struct} \&{emtex\_dir} ${}{*}\\{ed};{}$\6 -\&{const} \&{char} ${}{*}\\{env};{}$\6 -\&{const} \&{char} ${}{*}\\{dir};{}$\6 -\&{unsigned} \\{flags};\2\2\6 -${}\{{}$\1\6 -\&{const} \&{char} ${}{*}\\{val};{}$\6 -\&{char} \\{path}[\T{260}];\7 -${}\\{ed}\MG\\{alloc}\K\T{0};{}$\6 -${}\\{ed}\MG\\{used}\K\T{0};{}$\6 -${}\\{ed}\MG\\{list}\K\NULL{}$;\7 -\&{if} ${}(\\{env}\I\NULL\W(\\{val}\K\\{getenv}(\\{env}))\I\NULL){}$\1\5 -\&{return} \\{setup\_list}${}(\\{ed},\39\\{path},\39\\{val},\39\\{flags});{}$\2% -\6 -\&{else}\1\5 -${}\\{fprintf}(\\{stderr},\39\.{"Environment\ variabl}\)\.{e\ `\%s'\ not\ set;\ -use\ }\)\.{current\ directory\\n"},\39\\{env}){}$;\2\7 -\&{return} \.{TRUE};\6 -\4${}\}{}$\2\par -\fi - -\M{76} -\Y\B\4\X2:Global variables\X${}\mathrel+\E{}$\6 -\&{char} ${}\\{name\_buffer}[\.{FILE\_NAME\_LENGTH}+\T{1}]{}$;\par -\fi - -\M{77} -\Y\B\&{char} ${}{*}\\{file\_find}(\\{name},\39\\{list}){}$\1\1\6 -\&{char} ${}{*}\\{name};{}$\6 -\&{struct} \&{emtex\_dir} ${}{*}\\{list};\2\2{}$\6 -${}\{{}$\1\6 -\&{if} ${}(\\{emtex\_dir\_find}(\\{name\_buffer},\39{}$\&{sizeof} (\\{name% -\_buffer})${},\39\\{list},\39\\{name},\39\.{EDF\_CWD})){}$\1\5 -\&{return} \\{name\_buffer};\2\7 -\&{return} ${}\NULL;{}$\6 -\4${}\}{}$\2\6 -\8\#\&{endif}\par -\fi - -\M{78} -For emtexdir we use the environment variables \.{HBFCFG} and \.{HBFONTS} for -configuration resp.\ HBF header files. - -\Y\B\4\X78:Initialize \TeX\ file searching\X${}\E{}$\6 -\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 -$\\{kpse\_set\_program\_name}(\\{argv}[\T{0}],\39\.{"hbf2gf"});{}$\6 -${}\\{kpse\_init\_prog}(\.{"HBF2GF"},\39\T{300},\39\.{"cx"},\39\.{"cmr10"}){}$;% -\7 -\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\6 -\&{if} ${}(\R\\{dir\_setup}({\AND}\\{cfg\_path},\39\.{"HBFCFG"},\39\NULL,\39% -\.{EDS\_BANG})){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ setup\ sear}\)\.{ch\ path\ for\ -configur}\)\.{ation\ files\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\&{if} ${}(\R\\{dir\_setup}({\AND}\\{hbf\_path},\39\.{"HBFONTS"},\39\NULL,\39% -\.{EDS\_BANG})){}$\5 -${}\{{}$\1\6 -${}\\{fprintf}(\\{stderr},\39\.{"Couldn't\ setup\ sear}\)\.{ch\ path\ for\ HBF\ -head}\)\.{er\ files\\n"});{}$\6 -\\{exit}(\T{1});\6 -\4${}\}{}$\2\6 -\8\#\&{endif}\par -\U4.\fi - -\M{79} -Finally, here are the searching routines. A special format in the kpathsea -library for fonts which are neither PostScript nor TrueType (\.{MISCFONTS}) -is available with version~3.3 and newer. For older versions we use the path -for PostScript fonts (\.{T1FONTS}) to find HBF files. Configuration files -are searched in the path specified within \.{TEXCONFIG} for old kpathsea -versions, and within \.{HBF2GFINPUTS} for new versions. - -\Y\B\4\X11:Prototypes\X${}\mathrel+\E{}$\6 -\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*});{}$\6 -\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}){}$;\par -\fi - -\M{80} -\Y\B\8\#\&{if} \&{defined} (\.{HAVE\_LIBKPATHSEA})\6 -\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{kpse\_find\_file}${}(\\{name},\39\\{kpse\_program\_text\_format},% -\39\.{TRUE});{}$\6 -\4${}\}{}$\2\7 -\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{kpse\_find\_file}${}(\\{name},\39\\{kpse\_miscfonts\_format},\39% -\.{TRUE});{}$\6 -\4${}\}{}$\2\7 -\8\#\&{elif} \&{defined} (\.{HAVE\_EMTEXDIR})\7 -\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{file\_find}${}(\\{name},\39{\AND}\\{cfg\_path});{}$\6 -\4${}\}{}$\2\7 -\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{file\_find}${}(\\{name},\39{\AND}\\{hbf\_path});{}$\6 -\4${}\}{}$\2\7 -\8\#\&{elif} \&{defined} (\.{HAVE\_MIKTEX})\7 -\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{char} \\{result}[\.{\_MAX\_PATH}];\7 -\&{if} ${}(\R\\{miktex\_find\_input\_file}(\.{"hbf2gf"},\39{*}\\{name},\39% -\\{result})){}$\1\5 -\&{return} \T{0};\2\6 -\&{return} \\{strdup}(\\{result});\6 -\4${}\}{}$\2\7 -\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{char} \\{result}[\.{\_MAX\_PATH}];\7 -\&{if} ${}(\R\\{miktex\_find\_miscfont\_file}({*}\\{name},\39\\{result})){}$\1\5 -\&{return} \T{0};\2\6 -\&{return} \\{strdup}(\\{result});\6 -\4${}\}{}$\2\7 -\8\#\&{else}\7 -\&{char} ${}{*}{}$\\{TeX\_search\_cfg\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{name};\6 -\4${}\}{}$\2\7 -\&{char} ${}{*}{}$\\{TeX\_search\_hbf\_file}(\&{char} ${}{*}\\{name}){}$\1\1\2% -\2\6 -${}\{{}$\1\6 -\&{return} \\{name};\6 -\4${}\}{}$\2\6 -\8\#\&{endif}\par -\fi - -\N{1}{81}An example. -This is the example configuration file \.{b5so12.cfg} (for use with DOS or -OS/2 and the emtexdir searching engine): -\bigskip -\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr -hbf\_header & et24.hbf \cr -mag\_x & 2.076 \cr -x\_offset & 3 \cr -y\_offset & -8 \cr -comment & fanti songti 24x24 pixel font scaled and -adapted to 12 pt \cr -& \cr -design\_size & 12.0 \cr -& \cr -nmb\_fonts & -1 \cr -& \cr -output\_name & b5so12 \cr -& \cr -dpi\_x & 300 \cr -checksum & 123456789 \cr -coding & codingscheme Big 5 encoded TeX text \cr -& \cr -long\_extension & no \cr -job\_extension & .cmd \cr -rm\_command & del \cr -cp\_command & copy \cr -pk\_directory & \$HBF\_TARGET\\pk\\360dpi\\ \cr -tfm\_directory & \$HBF\_TARGET\\tfm\\ \cr -} -\bigskip -If you say e.g. -\medskip -\quad \.{set HBF\_TARGET=c:\\emtex\\texfonts} -\medskip -on your DOS prompt (or in your \.{autoexec.bat} file), then the interpolated -value of the \.{tfm\_directory} keyword is \.{c:\\emtex\\texfonts\\tfm\\}. -The HBF header file \.{et24.hbf} will be searched in the path specified by -the \.{HBFCFG} environment variable. -\bigskip -The call -\medskip -\quad \.{hbf2gf b5so12.cfg} -\medskip -creates the files -\medskip -\quad \.{b5so1201.gf}, \.{b5so1202.gf}, $\ldots$ , \.{b5so1255.gf}, -\.{b5so12.pl}, and \.{b5so12.cmd} -\bigskip -After calling -\medskip -\quad \.{b5so12.cmd} -\medskip -you will find the \.{PK} files in the -\.{c:\\emtex\\texfonts\\pk\\360dpi} directory and the \.{TFM} files in -the \.{c:\\emtex\\texfonts\\tfm} directory; all \.{GF} files and -\.{b5so12.pl} will be deleted. -\bigskip -The call -\medskip -\quad \.{hbf2gf -n b5so1220 417} -\medskip -creates two files: -\medskip -\quad \.{b5so1220.gf} and \.{b5so1220.pl} -\medskip -using the configuration file \.{b5so12.cfg}. The \.{GF} file would be -named \.{b5so1220.417gf} if the flag \.{-n} had not been used. - -\medskip - -It is possible to convert bitmap fonts to \.{PK} files almost -automatically. The HBF header file already has the entry -\.{HBF\_BITMAP\_BOUNDING\_BOX} which defines vertical and horizontal offsets -(in pixels), but these values are not in all cases optimal. If you omit -\.{x\_offset} and \.{y\_offset} in the configuration file, the third and -fourth parameter of \.{HBF\_BITMAP\_BOUNDING\_BOX} is used, scaled to design -size (to say it with other words: \.{x\_offset} and \.{y\_offset} will always -apply to the design size to be synchronous with the \.{TFM} files). - -Don't confuse scaling and magnification: Scaling here means that you choose -a (arbitrary) design size and compute scaling values (\.{mag\_x} and -\.{mag\_y}) which scales the bitmap to this particular design size at a -certain (arbitrarily chosen) resolution (\.{dpi\_x} and \.{dpi\_y}). -Magnification means that the scaled bitmap will be then magnified to a -certain target size while still using the font parameters (i.e., the -\.{TFM} file) of the design size. - -In the sample, you have a $24 \times 24$ bitmap font which will be scaled to -$12\,\hbox{pt}$ having a resolution of $300\,\hbox{dpi}$: -\medskip -\quad $1\,\hbox{pt}$ are $300 / 72.27 = 4.1511$ pixel; - -\quad $12\,\hbox{pt}$ are $4.1511 * 12 = 49.813$ pixel; - -\quad thus the theoretical scaling value is $49.813 / 24 = 2.076$. - -\medskip - -But especially for small sizes, this may not be the best value if the font -should harmonize with, say, Knuth's Computer Modern fonts. I recommend to -compute, say, 5~\.{PK} fonts, then check the CJK font with different \TeX\ -fonts to see whether the offsets and/or the scaling value is good. The -greater the design size the finer you can control the offsets---as an -example you could use a design size of $30\,\hbox{pt}$ (nevertheless there -is a compile-time constant \PB{\.{MAX\_CHAR\_SIZE}} which limits the maximal -character size; default is 255~pixels). - -If you have found optimal offsets, you can produce many different -magnifications of the CJK font using the same set of \.{TFM} files -analogous to ordinary \TeX\ fonts; as a simplification, we assume that -\.{PK} files with a resolution of $300\,\hbox{dpi}$ and a design size of -$10\,\hbox{pt}$ have the extension `\.{.300pk}' (respectively come into a -`\.{300dpi}' subdirectory)---this is the reason why in the above example for -the $12\,\hbox{pt}$ design size a `\.{360dpi}' target directory has been -used. Now we can use the following formula: - -$$ \\{needed\_dpi} = \\{your\_horizontal\_resolution} * -{\\{your\_target\_size} \over 10.0} $$ - -Example: assuming that your printer has a resolution of -$300\times400\,\hbox{dpi}$, and you want $14.4\,\hbox{pt}$: - -$$ 300 * {14.4 \over 10.0} = 432 $$ - -The vertical scaling value is $400 / 300 = 1.3333$. Use these values now to -call \.{hbf2gf} in \mf-like mode: - -\quad \.{hbf2gf b5so1220 432 1.3333} - - - -\fi - -\N{1}{82}Index. -\fi - -\inx -\fin -\con diff --git a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.w b/Build/source/texk/cjkutils/hbf2gf/hbf2gf.w deleted file mode 100644 index 19a6cb6425b..00000000000 --- a/Build/source/texk/cjkutils/hbf2gf/hbf2gf.w +++ /dev/null @@ -1,2808 +0,0 @@ -% This is the cweb file hbf2gf.w of the CJK package ver. 4.7.0 17-Oct-2006 - -% Copyright (C) 1994-2006 Werner Lemberg -% -% 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 in doc/COPYING; if not, write to the Free -% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -% MA 02110-1301 USA - -% To print this CWEB file you should (but not must) use the CWEAVE of the -% c2cweb-package (found at the CTAN archives, e.g. ftp.dante.de) and then say -% -% cweave +ai hbf2gf.w -% -% This (fully compatible) CWEAVE can transform CWEB-files with alternative -% output rules (look at the position of braces below!) the author (it's me -% too :-) prefer. Otherwise this file will be formatted traditionally. - -\font\meta=logo10 -\def\mf{{\meta META}\-{\meta FONT}} -\def\Om{\char "0A} % Omega symbol - -\def\title{hbf2gf (CJK Version 4.7.0)} - -\def\topofcontents{ - \null\vfill - \centerline{\titlefont The {\ttitlefont hbf2gf} program} - \vskip 20pt - \centerline{(CJK Version 4.7.0)} - \vfill} - -\def\botofcontents{ - \vfill - \noindent - Copyright \copyright~1996-1999 by Werner Lemberg - \bigskip\noindent - Permission is granted to make and distribute verbatim copies of this - document provided that the copyright notice and this permission notice are - preserved on all copies. - - \smallskip\noindent - Permission is granted to copy and distribute modified versions of this - document under the conditions for verbatim copying, provided that the - entire resulting derived work is distributed under the terms of a - permission notice identical to this one.} - -\pageno=\contentspagenumber \advance\pageno by 1 -\let\maybe=\iftrue -\fullpageheight=240mm -\pageheight=223mm -\pagewidth=158mm -\setpage -\frenchspacing - - -\def\msdos{\.{msdos}} -@s msdos TeX - -@s HBF int -@s HBF_CHAR int -@s HBF_BBOX int - -@s __inline__ int - - -@* Introduction. -This is the \.{hbf2gf} program by Werner Lemberg -(\.{wl@@gnu.org}). - -The ``banner line'' defined here should be changed whenever \.{hbf2gf} is -modified. - -@d banner -"hbf2gf (CJK ver. 4.7.0)" - - -@ -\.{hbf2gf} is intended to convert Hanzi Bitmap Fonts (HBF) into \TeX\ -generic font files (\.{GF} files) according to the \\{CJK} package, which -\.{hbf2gf} is part of. - -The outline of \.{hbf2gf} is simple: a CJK (Chinese/Japanese/Korean) bitmap -file will be scaled and written in at most |nmb_files| \.{GF} files, each -file containing |256|~characters (except the last and possibly the first -one). In the normal case it's not necessary to compute the right value of -|nmb_files| because \.{hbf2gf} will do this; you should use |-1| instead to -indicate this. See the last section for an example. - -Alternatively you can call \.{hbf2gf} similar to \mf, i.e., the program will -compute one font on demand. This mode will be used if two or three input -parameters instead of one are given: the font name, the horizontal -resolution, and optionally a vertical scaling factor or resolution to allow -modes for e.g.\ $300\times600\,\hbox{dpi}$ printers. \.{hbf2gf} will extract -the configuration file name from the font name; if this file isn't found, -the program exits with error code~|2| (this is useful for scripts like -\.{mktexpk}). If the configuration file is found but an error occurs while -computing the font, error code~|1| is returned. In case of success, the exit -code is zero. - -The characters in the input font files are completely described by the HBF -header file. This program uses the HBF API implementation of Ross Paterson -(\.{ross@@soi.city.ac.uk}; with small extensions). You will find a -description of the HBF standard at \.{ftp.ifcss.org}. - -A batch file created by \.{hbf2gf} too (if the program computes a whole set -of subfonts) will convert the \.{GF} files to \.{PK} files using -\.{GFtoPK}, a part of every \TeX\ package. - -@d TRUE 1 -@d FALSE 0@# - -@d STRING_LENGTH 255 - /* the maximal length of an input string in the configuration file */ -@d FILE_NAME_LENGTH 1024 - /* the maximal length (including the path) of a filename */@# - -@= -int nmb_files = -1; /* create all files by default */ -int unicode = FALSE; /* whether a Unicode font should be processed */@# - -int testing = FALSE; /* whether we test only the font name */@# - -int mf_like = FALSE; /* whether we are in the \mf-like mode */ -int file_number = 0; /* the subfont number */@# - -double x_resolution = 0.0; /* the second and third input parameter */ -double y_scale = 1.0;@# - -int pk_files = TRUE; /* command line options */ -int tfm_files = TRUE; -int long_extension = TRUE; -int quiet = FALSE;@# - -char config_file[FILE_NAME_LENGTH + 4 + 1]; - /* we probably must add `\.{.cfg}' */ -char output_name[STRING_LENGTH + 1];@# - -FILE *config, *out; -HBF *hbf;@# - -#ifdef msdos /* if we compile under DOS or OS/2 */ -#define WRITE_BIN "wb" -#define WRITE_TXT "wt" -#define READ_BIN "rb" -#define READ_TXT "rt" -#else -#define WRITE_BIN "w" -#define WRITE_TXT "w" -#define READ_BIN "r" -#define READ_TXT "r" -#endif@# - -int end_of_file = FALSE; - - -@ -One \.{PL} file will be created additionally, which describes the font -metrics in a readable way. Because all CJK characters have identical -bounding boxes, one metrics file is enough---the batch job created by -\.{hbf2gf} calls \.{PLtoTF} to produce this \.{TFM} file and then copies -it into |nmb_files| metrics files. There usually will be a discrepancy -between the number of characters in the last \.{GF} file and the -\.{TFM} file, but this does not harm. - -If you specify the \.{ofm\_file} option in the configuration file, an -extended virtual property file (such files have the extension \.{.ovp}) for -the \Om\ system is written; this will be then converted with -\.{ovp2ovf} into an \.{OFM} and an \.{OVF} file to map all the subfonts -into one large virtual font. - - - -@* The main routine. -The main routine takes |file_name|, |x_resolution|, and |y_scale| as command -line parameters if in \mf-like mode, otherwise |config_file| as the only -argument. |read_config()| scans the configuration file and fills the global -variables, |write_file()| writes the \.{GF} files, |write_pl()| and -|write_ovp()| write the \.{PL} and \.{OVP} files respectively, and -|write_job()| the batch file. - -@c -@@; -@@; -@@;@# - - -int main(int argc, char *argv[]) - {char *p; - - @@;@# - - @@;@# - - if(!quiet) - printf("\n%s\n\n", banner);@# - - strncpy(config_file, argv[1], FILE_NAME_LENGTH); - config_file[FILE_NAME_LENGTH] = '\0';@# - - if(argc > 2 || testing) - {int l = strlen(config_file); - - if(l > 2) - config_file[l - 2] = '\0'; - /* strip subfont number from file name */ - else - {if(!quiet) - printf("`%s' can't be a subfont created by hbf2gf\n", - config_file); - exit(2); - }@# - - mf_like = TRUE; - }@# - - read_config(); /* will call |exit(1)| on errors */@# - - if(mf_like) - @@;@# - - @@;@# - - @@;@# - - if(tfm_files) - write_pl(); - if(ofm_file) - write_ovp(); - if(!mf_like) - write_job();@# - - hbfClose(hbf);@# - - exit(0); - return 0; /* never reached */ - } - - -@ -@d HBF2GF_VERSION @/ -"\n"@/ -"Copyright (C) 1996-1999 Werner Lemberg.\n"@/ -"There is NO warranty. You may redistribute this software\n"@/ -"under the terms of the GNU General Public License\n"@/ -"and the HBF library copyright.\n"@/ -"\n"@/ -"For more information about these matters, see the files\n"@/ -"named COPYING and hbf.c.\n"@/ -"\n" - -@= - {printf("\n"); - printf(banner); - printf(" (%s)\n", TeX_search_version()); - printf(HBF2GF_VERSION); - exit(0); - } - - -@ -@d USAGE @/ -"\n"@/ -"Usage: hbf2gf [-q] configuration_file[.cfg]\n"@/ -" hbf2gf [options] font_name x_resolution [y_scale | y_resolution]\n"@/ -" hbf2gf -t [-q] font_name\n"@/ -"\n"@/ -" Convert a font in HBF format to TeX's GF resp. PK format.\n"@/ -"\n"@/ -" -q be silent\n"@/ -" -p don't produce a PL file\n"@/ -" -g don't produce a GF file\n"@/ -" -n use no resolution in extension (only `.gf')\n"@/ -" -t test for font_name (returns 0 on success)\n"@/ -" --help print this message and exit\n"@/ -" --version print version number and exit\n"@/ -"\n" - -@= - {printf(USAGE); - exit(0); - } - - -@ -Three options can be specified to the program (\.{-p}, \.{-g}, and \.{-n}) -if in \mf-like mode to suppress creation of a \.{PL} resp.\ a -\.{GF} file, and to force a `\.{.gf}' extension (instead of -e.g.\ `\.{.300gf}'). The corresponding setting of a particular switch in the -configuration file is ignored then. - -Additionally, the option \.{-t} tests whether the specified subfont name -leads to an \.{hbf2gf} configuration file. It returns 0 on success and prints -out the name of that configuration file (provided the \.{-q} switch isn't -set). This test isn't a thorough one; it only removes the last two characters -and checks whether a configuration file with that name exists. - -@= - if(argc == 2) - {if(strcmp(argv[1], "--help") == 0) - @@; - else if(strcmp(argv[1], "--version") == 0) - @@; - }@# - - while(argc > 1) - {p = argv[1]; - if(p[0] != '-') - break; - if(p[1] == 'p') - tfm_files = FALSE; - else if(p[1] == 'g') - pk_files = FALSE; - else if(p[1] == 'n') - long_extension = FALSE; - else if(p[1] == 'q') - quiet = TRUE; - else if(p[1] == 't') - testing = TRUE;@# - - argv++; - argc--; - }@# - - if(testing) - {if(argc != 2) - {fprintf(stderr, "Need exactly one parameter for `-t' option.\n"); - fprintf(stderr, "Try `hbf2gf --help' for more information.\n"); - exit(1); - } - } - else if(argc < 2 || argc > 4) - {fprintf(stderr, "Invalid number of parameters.\n"); - fprintf(stderr, "Try `hbf2gf --help' for more information.\n"); - exit(1); - }@# - - -@ -If the (optional) argument is larger than~|10|, we treat it as a value for -the vertical resolution (in dpi), otherwise as a vertical scaling factor. - -@= - {if(unicode) - file_number = (int)strtol(&argv[1][strlen(argv[1]) - 2], - (char **)NULL, 16); - else - file_number = atoi(&argv[1][strlen(argv[1]) - 2]);@# - - x_resolution = atof(argv[2]); - if(x_resolution < PRINTER_MIN_RES_X) - {fprintf(stderr, "Invalid horizontal resolution\n"); - exit(1); - }@# - - if(argc > 3) - {y_scale = atof(argv[3]); - if(y_scale < 0.01) - {fprintf(stderr, - "Invalid vertical scaling factor or resolution\n"); - exit(1); - } - if(y_scale > 10.0) - y_scale = (double)x_resolution / y_scale; - } - } - - -@ -If |unicode| is |TRUE|, the start value of the running number appended to -the base name of the output font files is taken from the HBF header file, -otherwise it starts with~`\.{01}'. |min_char| represents the lower bound of -the code range. - -If we are in \mf-like mode, |file_number| is taken from the command line, -and |max_numb| will be set to~|1|. - -@= - {int j, max_numb; - - if(!mf_like) - {file_number = (unicode == TRUE ? (min_char >> 8) : 1); - if(nmb_files == -1) - max_numb = (unicode == TRUE ? 0x100 : 100); - else - max_numb = nmb_files; - } - else - max_numb = 1;@# - - for(j = 0; (j < max_numb) && !end_of_file; file_number++, j++) - write_file();@# - - nmb_files = j; /* the real number of output font files */ - } - - -@ -@= -#ifdef HAVE_CONFIG_H -#include "c-auto.h" -#endif -#include -#include -#include -#include -#include -#ifdef TM_IN_SYS_TIME -#include -#endif -#include "hbf.h" - - - -@* The functions. -The first function to be described is |write_file()|. Each \.{GF} file -consists of three sections: a preamble, a data section, and a postamble. The -functions |write_pre()|, |write_data()|, and |write_post()| handle this. - -@= -void write_file(void); - - -@ -In \mf-like mode we create font file name extensions similar to \mf\ if -the \.{-n} option isn't specified; otherwise only `\.{.gf}' will be appended. - -@c -void write_file(void) - {char output_file[FILE_NAME_LENGTH + 1]; - - - if(pk_files) - {if(mf_like) - {if(unicode) - sprintf(output_file, "%s%02x.%.0igf",@/ - output_name, file_number, - long_extension ? (int)(x_resolution + 0.5) : 0); - else - sprintf(output_file, "%s%02i.%.0igf",@/ - output_name, file_number, - long_extension ? (int)(x_resolution + 0.5) : 0); - } - else - {if(unicode) - sprintf(output_file, "%s%02x.gf", output_name, file_number); - else - sprintf(output_file, "%s%02i.gf", output_name, file_number); - } - if(!(out = fopen(output_file, WRITE_BIN))) - {fprintf(stderr, "Couldn't open `%s'\n", output_file); - exit(1); - } - if(!quiet) - printf("Writing `%s' ", output_file);@# - - write_pre(); - write_data(); - write_post(); - fclose(out);@# - - if(!quiet) - printf("\n"); - } - else - write_data(); - } - - -@ -The preamble has two bytes at the very beginning, |PRE| and |GF_ID|. |PRE| -starts the preamble, and |GF_ID| is the Generic Font Identity Byte. The next -bytes are a string in Pascal format containing a header, the date, and the -time. Strings in Pascal format start with the length of the string and have -no terminating NULL byte. - -@d GF_ID 131 -@d PRE 247@# - -@d header " hbf2gf output " - -@= -void write_pre(void); - - -@ -@s tm int - -@c -void write_pre(void) - {char out_s[40], s[20]; - time_t secs_now; - struct tm *time_now; - - - strcpy(out_s, header);@# - - secs_now = time(NULL); /* system date and time */ - time_now = localtime(&secs_now); - strftime(s, 20, "%Y.%m.%d:%H.%M", time_now); - strcat(out_s, s);@# - - fputc(PRE, out); - fputc(GF_ID, out); - fputc(strlen(out_s), out); - fputs(out_s, out); - } - - -@ -|write_data()| produces the middle part of the \.{GF} file. It first sets -|char_adr_p| equal to the address of |char_adr[]| which will contain file -offsets of the compressed characters. - -|input_size_x| and |input_size_y| reflect the original dimensions of the -bitmap font, |pk_output_size_x| and |pk_output_size_y| contain the width and -height of the output character box (in pixels), |pk_offset_x| and -|pk_offset_y| define the baseline of the font. The same names starting with -`\\{tfm\_}' instead of `\\{pk\_}' are used for \.{TFM} files (values are -multiples of design size). |mag_x| and |mag_y| hold the scaling factors -which are needed to reach |design_size|. |slant| defines the slant ($\Delta -x / \Delta y$), |target_size_x| and |target_size_y| will be the final -dimensions; |magstep_x = target_size_x / design_size| is \TeX's -\.{\\magstep}. - -The \CEE/ standard specifies that all global values will be automatically -set to~|0| if no initialization value is given. - -@= -long char_adr[256]; -long *char_adr_p;@# - -int pk_offset_x; - /* horizontal offset (increase character width a bit; will be applied on - both the left and the right side) */ -double tfm_offset_x; -int pk_offset_y; - /* vertical offset (must be configured to desired font size) */ -double tfm_offset_y;@# - -int input_size_x; -int input_size_y; -const char *font_encoding; /* taken from the HBF file */ -int pk_width; /* without slant */ -int pk_output_size_x; - /* the output character box dimensions without offsets */ -double tfm_output_size_x; -int pk_output_size_y; -double tfm_output_size_y;@# - -double design_size = 10.0; /* in points */ -double target_size_x; /* in points */ -double target_size_y; -double magstep_x; -double magstep_y; -double slant; -int rotation;@# - -double mag_x; /* horizontal and vertical magnification values */ -double mag_y;@# - -int empty_char; /* a flag whether the character does not exist or is empty */ -int last_char; /* the last valid character in a \.{GF} file */@# - -int dot_count; /* this counts the processed characters; - every ten characters a dot is output to the screen */ - - -@ -@= -void write_data(void); - - -@ -@c -void write_data(void) - {dot_count = 0; - char_adr_p = char_adr;@# - - for(last_char = 0; (last_char < 256) && !end_of_file; last_char++) - @@; - } - - -@ -The code in this section saves the current file position first and calls -|make_pixel_array()|, which expands and scales the character bitmap. - -|BOC| (and |BOC1|), the Begin Of Character command byte, must be followed by -the character code and the dimensions of the character as explained in -``\mf---the program'' (corrected by vertical and horizontal offsets). - -|write_coding()| compresses and outputs the bitmap; |EOC| (End Of Character) -finishes the current character. - -@d BOC 67 -@d BOC1 68 /* simplified version of |BOC| */ -@d EOC 69 - -@= - {if(dot_count++ % 10 == 0) /* a progress report for impatient users */ - if(pk_files && !quiet) - {printf("."); - fflush(stdout); - }@# - - empty_char = FALSE; - make_pixel_array(); - if(end_of_file) - return;@# - - if(pk_files) - {*char_adr_p = ftell(out); - char_adr_p++;@# - - if(empty_char) - {fputc(BOC1, out); - fputc((unsigned char)last_char, out); - fputc(0, out); - fputc(0, out); - fputc(0, out); - fputc(0, out); - fputc(EOC, out); - } - else - {fputc(BOC, out); - fputl(last_char, out); - fputl(-1L, out); - fputl(pk_offset_x, out); - fputl(pk_output_size_x + pk_offset_x, out); - fputl(pk_offset_y, out); - fputl(pk_output_size_y + pk_offset_y, out);@# - - write_coding();@# - - fputc(EOC, out); - } - } - } - - -@ -The current \.{GF} file will be completed with data written by -|write_post()|. The end consists of three sections: ``special'', ``post'', -and ``postpost''. The first contains material not used by \TeX\ itself but -which can be used by other programs like \.{GFtoDVI} or for documentary -purposes (|coding[]| and |comment[]|). The second describes the font as a -whole, and the last marks the end of the file. - -|pk_total_min_x| up to |pk_total_max_y| define the greatest bounding box of -this file (including offsets); the horizontal character escapement after -drawing the character is |pk_dx|. |tfm_width| is the width in multiples of -the design size ignoring the target size. - -@d _2_16 65536.0 /* $2^{16}$ */ -@d _2_20 1048576.0 /* $2^{20}$ */ - -@= -char coding[STRING_LENGTH + 1]; /* a comment describing the font encoding */ -char comment[STRING_LENGTH + 1]; /* a comment describing the font */@# - -unsigned long checksum;@# - -long pk_total_min_x; -long pk_total_max_x; -long pk_total_min_y; -long pk_total_max_y;@# - -int dpi_x; /* printer resolution */ -int dpi_y; -double ppp_x; /* pixels per point */ -double ppp_y; - - -@ -To clarify the meaning of these values see the sections about the metrics -and configuration file also. - -\TeX\ defines that 72.27~points are exactly 1~inch. - -@= -void write_post(void); - - -@ -@c -void write_post(void) - {long special_adr; - long post_adr;@# - - long designsize = design_size * _2_20; /* design size $* 2^{20}$ */@# - - int pk_dx; - long tfm_width;@# - - int i; - long temp; - - - ppp_x = dpi_x / 72.27 * magstep_x; - ppp_y = dpi_y / 72.27 * magstep_y;@# - - pk_total_min_x = pk_offset_x; - pk_total_max_x = pk_output_size_x + 2 * pk_offset_x; - pk_total_min_y = pk_offset_y; - pk_total_max_y = pk_output_size_y + pk_offset_y;@# - - pk_dx = pk_width + 2 * pk_offset_x; /* no slant */ - tfm_width = (tfm_output_size_x + 2 * tfm_offset_x) * _2_20; - /* width in multiples of design size $* 2^{20}$ */@# - - @@; - @@; - @@; - } - - -@ -\.{XXXn} will be followed by n~bytes representing the length of a string -which follows immediately. |YYY| is a 32~bit integer which is normally -connected with the preceding string (but not used here). |special_adr| -contains the address of the ``special section''. All items here are -optional. - -@d XXX1 239 /* these are all special command bytes */ -@d XXX2 240 /* not used */ -@d XXX3 241 /* not used */ -@d XXX4 242 /* not used */@# - -@d YYY 243 /* not used */ - -@= - special_adr = ftell(out);@# - - if(*coding) - {fputc(XXX1, out); /* |XXX1| implies a string length |< 256| */ - fputc(strlen(coding), out); - fputs(coding, out); - }@# - - if(*comment) - {fputc(XXX1, out); - fputc(strlen(comment), out); - fputs(comment, out); - } - - -@ -All character offsets collected in |char_adr| will be written to the output -file. |fputl()| writes a 32~bit integer into a file. - -|CHAR_LOC0| (and |CHAR_LOC|) is the first byte of a character locator -(i.e., offset, character code, and width information). |POST| starts the -postamble, and |post_adr| points to the beginning byte of the postamble. - -@d POST 248@# - -@d CHAR_LOC 245 -@d CHAR_LOC0 246 /* simplified version of |CHAR_LOC| */ - -@= - post_adr = ftell(out); - fputc(POST, out); - fputl(special_adr, out);@# - - fputl(designsize, out); - fputl(checksum, out); - fputl(ppp_x * _2_16, out); - fputl(ppp_y * _2_16, out); - fputl(pk_total_min_x, out); - fputl(pk_total_max_x, out); - fputl(pk_total_min_y, out); - fputl(pk_total_max_y, out);@# - - char_adr_p = char_adr;@# - - if(pk_dx < 256) - {for(i = 0; i < last_char; i++) /* the character locators */ - {fputc(CHAR_LOC0, out); - fputc(i, out); - fputc(pk_dx, out); - fputl(tfm_width, out); - fputl(*char_adr_p++, out); - } - } - else /* will only happen if |MAX_CHAR_SIZE >= 256| */ - {for(i = 0; i < last_char; i++) - {fputc(CHAR_LOC, out); - fputc(i, out); - fputl(pk_dx * _2_16, out); - fputl(0, out); - fputl(tfm_width, out); - fputl(*char_adr_p++, out); - } - } - - -@ -|POSTPOST| starts the section after the postamble. To get all information in -a \.{GF} file, you must start here. The very last bytes of the file have -the value |POSTPOST_ID| (the file is filled with at least 4 of these bytes -until a file length of a multiple of~4 is reached). Going backwards a -|GF_ID| will be next, then comes the address of the postamble section. - -Jumping to the postamble, a |POST| byte comes first, then the address of -the special section, and afterwards all character offsets. These offsets and -addresses describe the whole file. - -@d POSTPOST 249 -@d POSTPOST_ID 223 - -@= - fputc(POSTPOST, out); - fputl(post_adr, out); - fputc(GF_ID, out); - temp = ftell(out); - i = (int)(temp % 4) + 4; - while(i--) - fputc(POSTPOST_ID, out); - - -@ -\TeX\ wants the most significant byte first. - -@= -void fputl(long, FILE *); - - -@ -@c -void fputl(long num, FILE *f) - {fputc(num >> 24, f); - fputc(num >> 16, f); - fputc(num >> 8, f); - fputc(num, f); - } - - -@ -|make_pixel_array()| scales a character into the array |out_char[]| where -each \\{byte} represents one pixel, contrary to the input file where each -\\{bit} is used to store the character bitmap. |BLACK| indicates a black -pixel. - -The scaling routine was modeled after the program \.{pnmscale} of the -\.{pbmplus} package. \.{pbmplus} was designed to handle arbitrary pictures, -and bitmaps are only a special case of a graymap with values from~0 for -white up to |PIXEL_MAXVAL = 255| for black. - -If |EOF| is encountered, |end_of_file| is set and the function returns -immediately. - -@d BLACK 1 -@d WHITE 0@# - -@d PIXEL_MAXVAL 255 -@d SCALE 4096 -@d HALFSCALE 2048@# - -@d MAX_CHAR_SIZE 1023 - -@= -HBF_CHAR code; -const unsigned char *bitmap; - /* a proper input bitmap array will be allocated by the HBF API */ -const unsigned char *bP;@# - -unsigned char out_char[MAX_CHAR_SIZE * MAX_CHAR_SIZE + 1]; - /* the output bitmap array */ -unsigned char *out_char_p;@# - -unsigned char pixelrow[MAX_CHAR_SIZE]; -unsigned char temp_pixelrow[MAX_CHAR_SIZE]; -unsigned char new_pixelrow[MAX_CHAR_SIZE + 1]; - /* we need space to append a white pixel */@# -int curr_row; /* for |read_row()| if we access the glyph rotated */ - -long grayrow[MAX_CHAR_SIZE];@# - -long s_mag_x, s_mag_y, s_slant; - - -@ -We need to initialize the |grayrow[]| array together with some other -variables. - -Two steps are necessary to compute the |code| if we are in the \mf-like -mode. Assuming that we search the code \.{0xXXYY}, we first set |code| to -the value \.{0xXXAA}, where \.{0xAA} is equal to |min_2_byte| (getting -|offset| as the number of remaining characters to reach the first character -in our given subfont), then we increment |code| (and decrement |offset|) -until |offset| equals~0. - -@= - {int col, offset; - - if(rotation) - {int tmp; - - - tmp = input_size_x; - input_size_x = input_size_y; - input_size_y = tmp; - }@# - - if(mf_like) - {target_size_x = design_size * (x_resolution / dpi_x); - target_size_y = design_size * (x_resolution * y_scale / dpi_y); - } - else - target_size_x = target_size_y = design_size; - magstep_x = target_size_x / design_size; - magstep_y = target_size_y / design_size;@# - - pk_offset_x = offset_x * magstep_x + 0.5; - pk_offset_y = offset_y * magstep_y + 0.5; - tfm_offset_x = offset_x / (dpi_x / 72.27) / design_size; - tfm_offset_y = offset_y / (dpi_y / 72.27) / design_size;@# - - pk_width = input_size_x * mag_x * magstep_x + 0.5; /* without slant */ - pk_output_size_x = input_size_x * mag_x * magstep_x + - input_size_y * mag_y * magstep_y * slant + 0.5; - pk_output_size_y = input_size_y * mag_y * magstep_y + 0.5; - tfm_output_size_x = input_size_x * mag_x / - (dpi_x / 72.27) / design_size; - tfm_output_size_y = input_size_y * mag_y / - (dpi_y / 72.27) / design_size; - if(pk_output_size_x > MAX_CHAR_SIZE) - {fprintf(stderr, "Output character box width too big\n"); - exit(1); - } - if(pk_output_size_y > MAX_CHAR_SIZE) - {fprintf(stderr, "Output character box height too big\n"); - exit(1); - }@# - - for(col = 0; col < input_size_x; ++col) - grayrow[col] = HALFSCALE;@# - - if(!mf_like) - code = (min_char & 0xFF00) + min_2_byte; - else - {if((file_number < (unicode ? 0 : 1)) || (file_number >= 0x100)) - {fprintf(stderr, "Invalid subfile number\n"); - exit(1); - }@# - - if(unicode) - {offset = 0; - code = file_number * 0x100; - } - else - {offset = (file_number - 1) * 256 % nmb_2_bytes; - code = (min_char & 0xFF00) + min_2_byte + - (file_number - 1) * 256 / nmb_2_bytes * 0x100; - }@# - - while(offset--) - while(!b2_codes[code++ & 0xFF]) - /* eliminate invalid |b2_codes| */ - ;@# - - if(code > max_char) - {fprintf(stderr, "Invalid subfile number\n"); - exit(1); - } - } - - s_mag_x = mag_x * magstep_x * SCALE; - s_mag_y = mag_y * magstep_y * SCALE; - s_slant = slant * SCALE; - } - - -@ -All arrays of the \\{pixelrow} family contain gray values. While scaling -with non-integer values a pixel of the input bitmap will normally not align -with the pixel grid of the output bitmap (geometrically spoken). In this -case we first compute the fractions of input pixel rows scaled vertically -and add the corresponding gray values until a temporary row is produced. -Then we repeat this procedure horizontally pixel by pixel and write the -result into an output array. - - -@= -void make_pixel_array(void); - - -@ -@c -void make_pixel_array(void) - {unsigned char *prP; - unsigned char *temp_prP; - unsigned char *new_prP; - long *grP;@# - - register unsigned char *xP; - register unsigned char *nxP;@# - - register int row, col; - int rows_read = 0; - register int need_to_read_row = 1;@# - - long frac_row_to_fill = SCALE; - long frac_row_left = s_mag_y;@# - - int no_code = FALSE; - - - prP = pixelrow; - temp_prP = temp_pixelrow; - new_prP = new_pixelrow; - grP = grayrow; - out_char_p = out_char; /* will be increased by |write_row()| */@# - -again: - if(b2_codes[code & 0xFF]) /* a valid second byte? */ - {if(pk_files) - {bitmap = hbfGetBitmap(hbf, code); - bP = bitmap; - /* will be increased by |read_row()| */@# - - if(!bitmap) - empty_char = TRUE; - else - @@; - } - } - else - no_code = TRUE;@# - - if((code & 0xFF) == max_2_byte) - code += 0xFF - (max_2_byte - min_2_byte); /* go to next plane */ - if(code >= max_char) - {end_of_file = TRUE; - return; - }@# - - code++;@# - - if(no_code) - {no_code = FALSE; - goto again; - } - } - - -@ -@= - {if(pk_output_size_y == input_size_y) /* shortcut Y~scaling if possible */ - temp_prP = prP;@# - - curr_row = input_size_y - 1; /* only needed for rotated glyphs */ - for(row = 0; row < pk_output_size_y; ++row) - {@@; - @@; - } - } - - -@ -@= - if(pk_output_size_y == input_size_y) - /* shortcut Y~scaling if possible */ - read_row(prP); - else - {while(frac_row_left < frac_row_to_fill) - {if(need_to_read_row) - if(rows_read < input_size_y) - {read_row(prP); - ++rows_read; - }@# - - for(col = 0, xP = prP; col < input_size_x; ++col, ++xP) - grP[col] += frac_row_left * (*xP);@# - - frac_row_to_fill -= frac_row_left; - frac_row_left = s_mag_y; - need_to_read_row = 1; - }@# - - @@; - } - - -@ -Now |frac_row_left >= frac_row_to_fill|, so we can produce a row. - -@= - if(need_to_read_row) - if(rows_read < input_size_y) - {read_row(prP); - ++rows_read; - need_to_read_row = 0; - }@# - - for(col = 0, xP = prP, nxP = temp_prP; - col < input_size_x; ++col, ++xP, ++nxP) - {register long g; - - - g = grP[col] + frac_row_to_fill * (*xP); - g /= SCALE; - if(g > PIXEL_MAXVAL) - g = PIXEL_MAXVAL;@# - - *nxP = g; - grP[col] = HALFSCALE; - }@# - - frac_row_left -= frac_row_to_fill; - if(frac_row_left == 0) - {frac_row_left = s_mag_y; - need_to_read_row = 1; - } - frac_row_to_fill = SCALE; - - -@ -To implement the slant we move the starting point |nxP| to the right -according to the corresponding |y|~value. To simplify life only positive -shift values are allowed. - -We always append a white pixel to avoid artefacts at the end of the line -produced by the last line. This rule sets the second condition that the -slant must not be greater than~|1|---such a large slant would be unusable -anyway for typesetting purposes. - -@= - if(pk_width == input_size_x && s_slant == 0) - /* shortcut X~scaling if possible */ - write_row(temp_prP); - else - {register long g = HALFSCALE; - register long frac_col_to_fill = SCALE; - register long frac_col_left; - register int need_col = 0; - - - nxP = new_prP;@# - - frac_col_left = (pk_output_size_y - row) * s_slant; - while(frac_col_left >= frac_col_to_fill) - {*(nxP++) = 0; - frac_col_left -= frac_col_to_fill; - }@# - - if(frac_col_left > 0) - frac_col_to_fill -= frac_col_left;@# - - for(col = 0, xP = temp_prP; col < input_size_x; ++col, ++xP) - {frac_col_left = s_mag_x; - while(frac_col_left >= frac_col_to_fill) - {if(need_col) - {++nxP; - g = HALFSCALE; - }@# - - g += frac_col_to_fill * (*xP); - g /= SCALE; - if(g > PIXEL_MAXVAL) - g = PIXEL_MAXVAL;@# - - *nxP = g; - frac_col_left -= frac_col_to_fill; - frac_col_to_fill = SCALE; - need_col = 1; - }@# - - if(frac_col_left > 0) - {if(need_col) - {++nxP; - g = HALFSCALE; - need_col = 0; - }@# - - g += frac_col_left * (*xP); - frac_col_to_fill -= frac_col_left; - } - }@# - - @@; - } - - -@ -@= - if(frac_col_to_fill > 0) - {--xP; - g += frac_col_to_fill * (*xP); - }@# - - if(!need_col) - {g /= SCALE; - if(g > PIXEL_MAXVAL) - g = PIXEL_MAXVAL; - *nxP = g; - }@# - - *(++nxP) = 0; /* append a blank pixel */@# - - write_row(new_prP); - - -@ -|read_row()| reads a row from |bitmap[]| and converts it into a graymap row. -If the |rotation| flag has been set, we get the proper column instead (note -that in this case |input_size_x| already reflects the width of the rotated -glyph). - -@= -#ifdef __GNUC__ -__inline__ -#endif -void read_row(unsigned char *); - - -@ -@c -#ifdef __GNUC__ -__inline__ -#endif -void read_row(unsigned char *pixelrow) - {register int col, bitshift, offset; - register unsigned char *xP; - register unsigned char item = 0; - - if(rotation) - {bitshift = 7 - (curr_row % 8); - offset = (input_size_y + 7) / 8; - bP = bitmap + curr_row / 8; - for(col = 0, xP = pixelrow; col < input_size_x; ++col, ++xP) - {*xP = ((*bP >> bitshift) & 1) == 1 ? PIXEL_MAXVAL : 0; - bP += offset; - } - curr_row--; - } - else - {bitshift = -1; - for(col = 0, xP = pixelrow; col < input_size_x; ++col, ++xP) - {if(bitshift == -1) - {item = *(bP++); /* increase input bitmap pointer */ - bitshift = 7; - } - *xP = ((item >> bitshift) & 1) == 1 ? PIXEL_MAXVAL : 0; - --bitshift; - } - } - } - - -@ -|write_row()| converts the graymap back into a bitmap using a simple -threshold. - -@= -int threshold = 128; - - -@ -@= -#ifdef __GNUC__ -__inline__ -#endif -void write_row(unsigned char *); - - -@ -@c -#ifdef __GNUC__ -__inline__ -#endif -void write_row(unsigned char *pixelrow) - {register int col; - register unsigned char *xP; - - for(col = 0, xP = pixelrow; col < pk_output_size_x; ++col, ++xP) - *(out_char_p++) = (*xP >= threshold) ? 1 : 0; - /* increase output bitmap pointer */ - } - - -@ -Now comes the most interesting routine. The pixel array will be compressed -in sequences of black and white pixels. - -|SKIP0|, |SKIP1|, and |SKIP2| indicate how many blank lines will be skipped. -|PAINT_(x)| means that the next x~pixels will have the same color, then the -color changes. |NEW_ROW_(x)| is the first black pixel in the next row. - -An example: the pixel sequence 111100011001 [new row] 000111011110 will be -output as 4 3 2 2 1 77 3 1 4 1. - -Commands with an ending~`n' in its name indicate that the next n~bytes -should be read as the counter. Example: |SKIP1|~26 means `skip the next -26~rows'. - -For further details please refer to ``\mf---the program''. - -@d PAINT_(x) (x) /* $0 \le x \le 63$ */ -@d PAINT1 64 -@d PAINT2 65 -@d PAINT3 66 /* not used */@# - -@d SKIP0 70 -@d SKIP1 71 -@d SKIP2 72 -@d SKIP3 73 /* not used */@# - -@d NEW_ROW_(x) ((x) + 74) /* $0 \le x \le 164$ */@# - -@d NOOP 244 /* not used */ - -@= -void write_coding(void); - - -@ -The |goto start| instruction causes some compilers to complain about -``Unreachable code $\ldots$'' or something similar. - -@c -void write_coding(void) - {register int count, skip; - register unsigned char paint; - register int x, y; - register unsigned char *cp; - - x = 0; - y = 0; - cp = out_char + y * pk_output_size_x + x; - count = skip = 0; - paint = WHITE; - goto start;@# - - while (y < pk_output_size_y) - {@@; -start: - @@; - y++; - } - }@# - - -@ -@= - count = 0; - x = 0; - cp = out_char + y * pk_output_size_x + x;@# - - while(x < pk_output_size_x) - {if(*cp == paint) - count++; - else - {if(skip == 0) - {if(count <= 164) - fputc(NEW_ROW_(count), out); - else - {fputc(SKIP0, out);@# - - if(count < 256) - {fputc(PAINT1, out); - fputc(count, out); - } - else - {fputc(PAINT2, out); - fputc(count >> 8, out); - fputc(count & 0xFF, out); - } - } - } - else - {if(skip == 1) - fputc(SKIP0, out); - else - {if(skip < 256) - {fputc(SKIP1, out); - fputc(skip, out); - } - else - {fputc(SKIP2, out); - fputc(skip >> 8, out); - fputc(skip & 0xFF, out); - } - } - skip = 0; - if(count < 64) - fputc(PAINT_(count), out); - else if(count < 256) - {fputc(PAINT1, out); - fputc(count, out); - } - else - {fputc(PAINT2, out); - fputc(count >> 8, out); - fputc(count & 0xFF, out); - } - } - count = 0; - paint = BLACK; - break; - } - x++; - cp++; - } - if(x >= pk_output_size_x) - {skip++; - y++; - continue; - } - - -@ -@= - while(x < pk_output_size_x) - {if(*cp == paint) - count++; - else - {if(count < 64) - fputc(PAINT_(count), out); - else if(count < 256) - {fputc(PAINT1, out); - fputc(count, out); - } - else - {fputc(PAINT2, out); - fputc(count >> 8, out); - fputc(count & 0xFF, out); - } - count = 1; - paint = BLACK - paint; - } - x++; - cp++; - } - if(paint == BLACK) - {if(count < 64) - fputc(PAINT_(count), out); - else if(count < 256) - {fputc(PAINT1, out); - fputc(count, out); - } - else - {fputc(PAINT2, out); - fputc(count >> 8, out); - fputc(count & 0xFF, out); - } - paint = WHITE; - } - - - -@* The font metrics file. -This routine creates one \.{PL} file with the font properties. None of the -\TeX\ font dimensions are needed because you never will use CJK fonts -directly, and intercharacter stretching is handled by the \\{CJK} macro -\.{\\CJKglue}. (Other packages may define similar commands.) - -The name of the \.{PL} file will contain the running two digits in -\mf-like mode only. - -It makes sense \\{not} to compute the check sum automatically for two -reasons. Firstly, since \TeX's checksum algorithm is based on the character -width, the number of valid characters, and the designsize, there is a much -higher chance that two subfonts from different HBF fonts have the same check -sum than it is for ordinary fonts, because all characters have the same -width, usually 256~characters in a subfont, and very often the same design -size. Secondly, and this is more important, we create just one -\.{TFM} file for all subfonts regardless of the real number of characters -in a particular subfont. - -To have an identification string in the \.{TFM} file, we split it into -single bytes and use the \.{HEADER} command repeatedly. - -@= -void write_pl(void); - - -@ -@c -void write_pl(void) - {int i, pos; - char output_file[FILE_NAME_LENGTH + 1]; - long t, sc; - char *s; - char tfm_header[] = "Created by hbf2gf"; - - file_number--; /* for \mf-like mode */@# - - if(mf_like) - {if(unicode) - sprintf(output_file, "%s%02x.pl", output_name, file_number); - else - sprintf(output_file, "%s%02i.pl", output_name, file_number); - } - else - sprintf(output_file, "%s.pl", output_name);@# - - if(!(out = fopen(output_file, WRITE_TXT))) - {fprintf(stderr, "Couldn't open `%s'\n", output_file); - exit(1); - } - if(!quiet) - printf("\nWriting `%s'\n", output_file);@# - - fprintf(out,@/ - "\n(FAMILY %s%d)"@/ - "\n(CODINGSCHEME CJK-%s)", - output_name, file_number, font_encoding);@# - - fprintf(out,@/ - "\n(DESIGNSIZE R %.6f)"@/ - "\n(COMMENT DESIGNSIZE IS IN POINTS)"@/ - "\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"@/ - "\n(CHECKSUM O %lo)"@/ - "\n(FONTDIMEN"@/ - "\n (SLANT R %.6f)"@/ - "\n (SPACE R 0.0)"@/ - "\n (STRETCH R 0.0)"@/ - "\n (SHRINK R 0.0)"@/ - "\n (XHEIGHT R 1.0)"@/ - "\n (QUAD R 1.0)"@/ - "\n (EXTRASPACE R 0.0)"@/ - "\n )", design_size, checksum, slant);@# - - s = tfm_header; - i = strlen(s); - t = ((long)i) << 24; - sc = 16; - pos = 18;@# - - fprintf(out, "\n"); - while(i > 0) - {t |= ((long)(*(unsigned char *)s++)) << sc; - sc -= 8; - if(sc < 0) - {fprintf(out, "\n(HEADER D %d O %lo)", pos, t); - t = 0; - sc = 24; - pos++; - } - i--; - } - if(t) - fprintf(out, "\n(HEADER D %d O %lo)", pos, t); - fprintf(out, "\n");@# - - for(i = 0; i < 256; i++) - {fprintf(out,@/ - "\n(CHARACTER O %o"@/ - "\n (CHARWD R %.6f)"@/ - "\n (CHARHT R %.6f)"@/ - "\n (CHARDP R %.6f)"@/ - "\n (CHARIC R %.6f)"@/ - "\n )",@/ - i, - tfm_output_size_x + 2 * tfm_offset_x, - tfm_output_size_y + tfm_offset_y, - -tfm_offset_y, - slant * (tfm_output_size_y + tfm_offset_y)); - }@# - - fclose(out); - } - - - -@* The extended virtual font file for \Om. -The following is very similar to |write_pl()|; we simply map the glyphs -of the subfonts back to the original encoding positions. - -@= -void write_ovp(void); - - -@ -@c -void write_ovp(void) - {int c, i, nmb_subfonts, remainder, count, pos; - char output_file[FILE_NAME_LENGTH + 1]; - long t, sc; - char *s; - char ofm_header[] = "Created by hbf2gf"; - - nmb_subfonts = ((max_char - (min_char & 0xFF00)) / 256 * nmb_2_bytes) - / 256 + 1; - remainder = ((max_char - (min_char & 0xFF00)) / 256 * nmb_2_bytes) - % 256;@# - - /* correction for the last incomplete second byte range */ - for(count = 0; count < (max_char & 0xFF); count++) - if(b2_codes[count]) - remainder++; - if(remainder >= 256) - nmb_subfonts++;@# - - sprintf(output_file, "%s.ovp", output_name);@# - - if(!(out = fopen(output_file, WRITE_TXT))) - {fprintf(stderr, "Couldn't open `%s'\n", output_file); - exit(1); - } - if(!quiet) - printf("\nWriting `%s'\n", output_file);@# - - fprintf(out,@/ - "\n(VTITLE Omega virtual font created by hbf2gf)"@/ - "\n(DESIGNSIZE R %.6f)"@/ - "\n(COMMENT DESIGNSIZE IS IN POINTS)"@/ - "\n(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"@/ - "\n(CHECKSUM O %lo)"@/ - "\n(FONTDIMEN"@/ - "\n (SLANT R %.6f)"@/ - "\n (SPACE R 0.0)"@/ - "\n (STRETCH R 0.0)"@/ - "\n (SHRINK R 0.0)"@/ - "\n (XHEIGHT R 1.0)"@/ - "\n (QUAD R 1.0)"@/ - "\n (EXTRASPACE R 0.0)"@/ - "\n )", design_size, checksum, slant);@# - - s = ofm_header; - i = strlen(s); - t = ((long)i) << 24; - sc = 16; - pos = 18;@# - - fprintf(out, "\n"); - while(i > 0) - {t |= ((long)(*(unsigned char *)s++)) << sc; - sc -= 8; - if(sc < 0) - {fprintf(out, "\n(HEADER D %d O %lo)", pos, t); - t = 0; - sc = 24; - pos++; - } - i--; - } - if(t) - fprintf(out, "\n(HEADER D %d O %lo)", pos, t); - fprintf(out, "\n");@# - - for(i = 0; i < nmb_subfonts; i++) - {fprintf(out,@/ - "\n(MAPFONT D %i"@/ - "\n (FONTNAME %s%02i)"@/ - "\n (FONTCHECKSUM O %lo)"@/ - "\n (FONTAT R 1.0)"@/ - "\n (FONTDSIZE R %.6f)"@/ - "\n )", i, output_name, i + 1, checksum, design_size); - }@# - - for(c = min_char, i = 0, count = 0; c <= max_char; c++) - {if(b2_codes[c & 0xFF] == VALID_SUBCODE) - {fprintf(out,@/ - "\n(CHARACTER O %o"@/ - "\n (CHARWD R %.6f)"@/ - "\n (CHARHT R %.6f)"@/ - "\n (CHARDP R %.6f)"@/ - "\n (CHARIC R %.6f)"@/ - "\n (MAP"@/ - "\n (SELECTFONT D %i)"@/ - "\n (SETCHAR O %o)"@/ - "\n )"@/ - "\n )",@/ - c, - tfm_output_size_x + 2 * tfm_offset_x, - tfm_output_size_y + tfm_offset_y, - -tfm_offset_y, - slant * (tfm_output_size_y + tfm_offset_y), - i, - count);@# - - count++; - if(count == 256) - {count = 0; - i++; - } - } - else - continue; - }@# - - fclose(out); - } - - - -@* The job file. -This routine is the most system specific one. If your operating system needs -a different outline, make appropriate changes here. - -You have to call this batch file after \.{hbf2gf} has finished (if not in -\mf-like mode). It will transform the \.{GF} files into \.{PK} files and -delete the now unnecessary \.{GF} files, then transform the \.{PL} file into -a \.{TFM} file and copy it |nmb_files| times. The name of the job file is -|output_name|. - -@d EXTENSION_LENGTH 8 /* the maximal length of a file extension */@# - -@d GFTOPK_NAME "gftopk" -@d PLTOTF_NAME "pltotf" -@d OVP2OVF_NAME "ovp2ovf" - -@= -char job_extension[EXTENSION_LENGTH + 1]; -char rm_command[STRING_LENGTH + 1]; -char cp_command[STRING_LENGTH + 1]; -char pk_directory[STRING_LENGTH + 1]; -char tfm_directory[STRING_LENGTH + 1];@# - -int ofm_file = FALSE; - - -@ -@= -void write_job(void); - - -@ -@c -void write_job(void) - {FILE *out; - int i, j; - char buffer[FILE_NAME_LENGTH + 1]; - - - strcpy(buffer, output_name); - strcat(buffer, job_extension); - if(!(out = fopen(buffer, WRITE_TXT))) - {fprintf(stderr, "Couldn't open `%s'\n", buffer); - exit(1); - } - if(!quiet) - printf("\nWriting `%s'\n", buffer);@# - - if(pk_files) - {if(unicode) - {for(i = (min_char >> 8), j = 0; j < nmb_files; i++, j++) - fprintf(out,@/ - "%s %s%02x.gf %s%s%02x.%.0ipk\n"@/ - "%s %s%02x.gf\n",@/ - GFTOPK_NAME, output_name, i,@/ - pk_directory, output_name, i, - long_extension ? (int)(dpi_x * magstep_x + 0.5) : 0,@/ - rm_command, output_name, i); - } - else - {for(i = 1; i <= nmb_files; i++) - fprintf(out,@/ - "%s %s%02i.gf %s%s%02i.%.0ipk\n"@/ - "%s %s%02i.gf\n",@/ - GFTOPK_NAME, output_name, i,@/ - pk_directory, output_name, i, - long_extension ? (int)(dpi_x * magstep_x + 0.5) : 0,@/ - rm_command, output_name, i); - } - }@# - - if(tfm_files) - {fprintf(out,@/ - "\n"@/ - "%s %s.pl %s.tfm\n"@/ - "%s %s.pl\n"@/ - "\n",@/ - PLTOTF_NAME, output_name, output_name,@/ - rm_command, output_name);@# - - if(unicode) - {for(i = (min_char >> 8), j = 0; j < nmb_files; i++, j++) - fprintf(out,@/ - "%s %s.tfm %s%s%02x.tfm\n",@/ - cp_command, output_name, - tfm_directory, output_name, i); - } - else - {for(i = 1; i <= nmb_files; i++) - fprintf(out,@/ - "%s %s.tfm %s%s%02i.tfm\n",@/ - cp_command, output_name, - tfm_directory, output_name, i); - }@# - - fprintf(out,@/ - "\n"@/ - "%s %s.tfm",@/ - rm_command, output_name); - }@# - - if(ofm_file) - {fprintf(out,@/ - "\n"@/ - "%s %s.ovp %s.ovf %s.ofm\n"@/ - "%s %s.ovp\n"@/ - "\n",@/ - OVP2OVF_NAME, output_name, output_name, output_name,@/ - rm_command, output_name); - }@# - - fclose(out); - } - - - -@* The configuration file. -Here is a list with all necessary keywords (and parameters): -\medskip -\halign{\quad\.{#}\hfil&\quad#\hfil\cr - hbf\_header & the HBF header file name of the input font(s). \cr - output\_name & the name stem of the output files. \cr - & Should be equal to the name of the configuration file - in most cases.\cr - & A running two digit decimal number starting with - \.{01} will be appended. \cr - & (For Unicode fonts see the keyword \.{unicode} - below.) \cr - } -\bigskip -And now all optional keywords: -\medskip -\halign{\quad\.{#}\hfil&\quad#\hfil\cr - x\_offset & increases the character width. \cr - & Will be applied on both sides; \cr - & default is the value given in the HBF header - (\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr - & scaled to \\{design\/}size (in pixels). \cr - y\_offset & shifts all characters up or down; \cr - & default is the value given in the HBF header - (\.{HBF\_BITMAP\_BOUNDING\_BOX}) \cr - & scaled to \\{design\/}size (in pixels). \cr - design\_size & the design size (in points) of the font. \cr - & \.{x\_offset} and \.{y\_offset} refer to this - size. \cr - & Default is |10.0| \cr - target\_size & This command is obsolete now and will be - ignored.\cr - & \cr - slant & the slant of the font (given as $\Delta x / - \Delta y$). \cr - & Only values in the range |0 <= slant <= 1| - are allowed. \cr - & Default is |0.0| \cr - rotation & if set to `yes'. the glyphs are rotated - 90~degrees counter-clockwise. \cr - & The default offsets as given in the HBF header - will be ignored (and set to~|0|). \cr - & Default is `no'. \cr - & \cr - mag\_x & \cr - mag\_y & scaling values of the characters to reach - design size. \cr - & If only one magnification is given, x and y - values are assumed to be equal. \cr - & Default is \.{mag\_x} $=$ \.{mag\_y} $=$ |1.0| - \cr - threshold & A value between |1| and |254| defining a - threshold for converting the internal \cr - & graymap into the output bitmap; lower values - cut more pixels. \cr - & Default value is |128|. \cr - & \cr - comment & a comment describing the font; \cr - & default is none. \cr - & \cr - nmb\_fonts & the number of the fonts. \cr - & Default value is~|-1| for creating all - fonts. \cr - unicode & if `yes', a two digit hexadecimal number will - be used as a running number, \cr - & starting with the value of the first byte of - the first code range. \cr - & Default is `no'. \cr - min\_char & the minimum of the encoding range. \cr - & Specify this value if it is not identical to - the lowest code value \cr - & in the HBF file (to which it defaults). \cr - & \cr - dpi\_x & \cr - dpi\_y & the horizontal and vertical resolution (in - dpi) of the printer. \cr - & If only one resolution is given, x and y - values are assumed to be equal. \cr - & Default is |300|. \cr - checksum & a checksum to identify the \.{GF} files - with the appropriate \.{TFM} files. \cr - & The default of this 32~bit unsigned integer - is |0|. \cr - coding & a comment describing the coding scheme; \cr - & default is none. \cr - & \cr - pk\_directory & the destination directory of the - \.{PK} files; \cr - & default: none. \cr - & Attention! The batch file will not check - whether this directory exists. \cr - tfm\_directory & the destination directory of the - \.{TFM} files; \cr - & default: none. \cr - & Attention! The batch file will not check - whether this directory exists. \cr - pk\_files & whether to create \.{PK} files or not; \cr - & default is `yes'. \cr - tfm\_files & whether to create \.{TFM} files or not; \cr - & default is `yes'. \cr - ofm\_file & whether to create an \.{OFM} and an - \.{OVF} file or not; \cr - & default is `no'. \cr - long\_extension & if `yes', \.{PK} files will include the - resolution in the extension \cr - & (e.g. \.{gsso1201.300pk}). \cr - & This affects the batch file only (default is - `yes'). \cr - rm\_command & this shell command removes files; \cr - & default: `rm'. \cr - cp\_command & this shell command copies files; \cr - & default: `cp'. \cr - job\_extension & the extension of the batch file which calls - \.{GFtoPK} and \.{PLtoTF} \cr - & to convert the \.{GF} and the - \.{PL} files into \.{PK} and - \.{TFM} files; \cr - & default is none. \cr - } -\bigskip - -The searching algorithm (for the keywords) of \.{hbf2gf} is case -insensitive; it makes no difference whether you write for example \.{comment} -or \.{CommenT}. The keywords must start a line (be in the first column), and -the corresponding parameters must be on the same line with the keyword and -separated by at least one space or tabulator stop. Lines starting not with a -keyword are ignored. - -Key values \\{are} case sensitive (except \.{yes} and \.{no}). - -The default system dependent values are for \UNIX/-like operating systems; -if you use for example DOS, you must write -\medskip -\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr - long\_extension & no \cr - rm\_command & del \cr - cp\_command & copy \cr - job\_extension & .bat \cr - } -\medskip - -Both the values |pk_output_size_x| and |pk_output_size_y| must not exceed -|MAX_CHAR_SIZE|; \.{x\_offset} and \.{y\_offset} are related to the -design size (and not to the input size). - -In \mf-like mode, one \.{GF} file and one \.{PL} file will be computed -(depending on the command line options \.{-g} and \.{-p}), taking -|x_resolution| and |y_scale| from the command line. \.{nmb\_fonts} will -always be set to~|1|; no job file will be created. - - -@ -@d PRINTER_MIN_RES_X 50 -@d PRINTER_MIN_RES_Y 50 - -@= -char Buffer[STRING_LENGTH + 1]; - - -@ -@= -void read_config(void); - - -@ -If |config_file| isn't found in \mf-like mode we assume that the font -isn't a HBF font at all. - -@c -void read_config(void) - {HBF_BBOX *boxp; - char *real_config_file; - - - @@;@# - - real_config_file = TeX_search_cfg_file(config_file); - if(!real_config_file) - {if(mf_like) - {if(!quiet) - printf("Couldn't find `%s'\n", config_file); - exit(2); - } - else - {fprintf(stderr, "Couldn't find `%s'\n", config_file); - exit(1); - } - }@# - - if(!(config = fopen(real_config_file, READ_TXT))) - {if(!testing) - {fprintf(stderr, "Couldn't open `%s'\n", config_file); - exit(1); - } - else /* We reach this point only if no searching library is used */ - {if(!quiet) - fprintf(stderr, "Couldn't find or open `%s'\n", config_file); - exit(2); - } - }@# - - if(testing) - {if(!quiet) - printf("%s\n", real_config_file); - exit(0); - } - - @@; - @@;@# - - @@; - @@;@# - - fclose(config); - } - - -@ -Here we check whether we have to add an extension. - -@= - {int i, lastext = -1; - - for(i = 0; config_file[i]; i++) - if(config_file[i] == '.') - lastext = i; - else if (config_file[i] == '/' || - config_file[i] == ':' || - config_file[i] == '\\') - lastext = -1;@# - - if(lastext == -1) - strcat(config_file, ".cfg"); - } - - -@ -@= - {char hbf_header[STRING_LENGTH + 1]; - char *real_hbf_header; - - if(!fsearch("hbf_header")) - config_error("hbf_header"); - else - strcpy(hbf_header, Buffer);@# - - real_hbf_header = TeX_search_hbf_file(hbf_header); - if(!real_hbf_header) - {fprintf(stderr, "Couldn't find `%s'\n", hbf_header); - exit(1); - }@# - - hbfDebug = 1; /* we activate error messages of the HBF API - while scanning the HBF header file */@# - - if(!(hbf = hbfOpen(real_hbf_header))) - exit(1);@# - - hbfDebug = 0;@# - - boxp = hbfBitmapBBox(hbf); - input_size_x = boxp->hbf_height; /* will be checked later for rotation */ - input_size_y = boxp->hbf_width; - font_encoding = hbfProperty(hbf, "HBF_CODE_SCHEME");@# - - if(!fsearch("output_name")) - config_error("output_name"); - else - strcpy(output_name, Buffer); - } - - -@ -@= -int offset_x; -int offset_y;@# - -HBF_CHAR user_min_char; -int have_min_char = FALSE; - -@ -@= - {if(fsearch("nmb_files")) - nmb_files = atoi(Buffer); - if(fsearch("unicode")) - if(Buffer[0] == 'y' || Buffer[0] == 'Y') - unicode = TRUE; - if(fsearch("min_char")) - {user_min_char = strtoul(Buffer, (char **)NULL, 0); - have_min_char = TRUE; - }@# - - if(!mf_like) - {if(fsearch("pk_files")) - if(Buffer[0] == 'n' || Buffer[0] == 'N') - pk_files = FALSE; - if(fsearch("tfm_files")) - if(Buffer[0] == 'n' || Buffer[0] == 'N') - tfm_files = FALSE; - if(fsearch("ofm_file")) - if(Buffer[0] == 'y' || Buffer[0] == 'Y') - ofm_file = TRUE; - if(fsearch("long_extension")) - if(Buffer[0] == 'n' || Buffer[0] == 'N') - long_extension = FALSE; - }@# - - if(fsearch("slant")) - slant = atof(Buffer); - if(slant < 0.0 || slant > 1.0) - {fprintf(stderr, "Invalid slant\n"); - exit(1); - } - if(fsearch("rotation")) - if(Buffer[0] == 'y' || Buffer[0] == 'Y') - rotation = TRUE;@# - - if(fsearch("mag_x")) - mag_x = atof(Buffer); - if(fsearch("mag_y")) - mag_y = atof(Buffer); - if(!mag_x && !mag_y) - {mag_x = 1.0; - mag_y = 1.0; - } - if(mag_x && !mag_y) - mag_y = mag_x; - if(mag_y && !mag_x) - mag_x = mag_y; - if(mag_x <= 0.0) - {fprintf(stderr, "Invalid horizontal magnification\n"); - exit(1); - } - if(mag_y <= 0.0) - {fprintf(stderr, "Invalid vertical magnification\n"); - exit(1); - }@# - - if(fsearch("dpi_x")) - dpi_x = atoi(Buffer); - if(fsearch("dpi_y")) - dpi_y = atoi(Buffer); - if(!dpi_x && !dpi_y) - {dpi_x = 300; - dpi_y = 300; - } - if(dpi_x && !dpi_y) - dpi_y = dpi_x; - if(dpi_y && !dpi_x) - dpi_x = dpi_y; - if(dpi_x <= PRINTER_MIN_RES_X) - {fprintf(stderr, "Invalid horizontal printer resolution\n"); - exit(1); - } - if(dpi_y <= PRINTER_MIN_RES_Y) - {fprintf(stderr, "Invalid vertical printer resolution\n"); - exit(1); - }@# - - if(fsearch("design_size")) - design_size = atof(Buffer);@# - - if(fsearch("x_offset")) - offset_x = atoi(Buffer); - else - offset_x = rotation ? 0 : (boxp->hbf_xDisplacement * mag_x + 0.5); - if(fsearch("y_offset")) - offset_y = atoi(Buffer); - else - offset_y = rotation ? 0 : (boxp->hbf_yDisplacement * mag_y + 0.5); - if(!fsearch("comment")) - comment[0] = '\0'; - else - strcpy(comment, Buffer);@# - - if(fsearch("threshold")) - threshold = atoi(Buffer); - if(threshold <= 0 || threshold >= 255) - {fprintf(stderr, "Invalid threshold\n"); - exit(1); - }@# - - if(!fsearch("checksum")) - checksum = 0; - else - checksum = strtoul(Buffer, (char **)NULL, 0);@# - - if(!fsearch("coding")) - coding[0] = '\0'; - else - strcpy(coding, Buffer);@# - - if(!fsearch("pk_directory")) - pk_directory[0] = '\0'; - else - strcpy(pk_directory, Buffer);@# - - if(!fsearch("tfm_directory")) - tfm_directory[0] = '\0'; - else - strcpy(tfm_directory, Buffer);@# - - if(fsearch("rm_command")) - strcpy(rm_command, Buffer); - else - strcpy(rm_command, "rm");@# - - if(fsearch("cp_command")) - strcpy(cp_command, Buffer); - else - strcpy(cp_command, "cp");@# - - if(!fsearch("job_extension")) - job_extension[0] = '\0'; - else - {strncpy(job_extension, Buffer, EXTENSION_LENGTH); - job_extension[EXTENSION_LENGTH] = '\0'; - } - } - - -@ -The function |hbfGetCodeRange()| is an extension to the HBF API. - -Successive calls return the code ranges in ascending order; we only need the -extrema of the whole code range. - -In case |min_char| has been supplied in the configuration file, we use that -value instead. - -@= -HBF_CHAR min_char, max_char; - - -@ -@= - {const void *cp; - HBF_CHAR dummy; - - cp = hbfGetCodeRange(hbf, NULL, &min_char, &max_char); - for(; cp != NULL; cp = hbfGetCodeRange(hbf, cp, &dummy, &max_char)) - ;@# - - if(have_min_char) - min_char = user_min_char; - } - - -@ -The function |hbfGetByte2Range()| is an extension to the HBF API. - -Successive calls return the byte~2 ranges in ascending order. We raise -|VALID_SUBCODE| in the array |b2_codes[]| for all characters in subcode -ranges. - -@d VALID_SUBCODE 1 - -@= -char b2_codes[256]; -unsigned char min_2_byte, max_2_byte; -int nmb_2_bytes = 0; - - -@ -@= - {const void *b2r; - unsigned char dummy; - int i; - - for(i = 0; i < 256; i++) - b2_codes[i] = 0;@# - - b2r = hbfGetByte2Range(hbf, NULL, &min_2_byte, &max_2_byte); - dummy = min_2_byte; - for(; b2r != NULL; b2r = hbfGetByte2Range(hbf, b2r, &dummy, &max_2_byte)) - {for(i = dummy; i <= max_2_byte; i++) - b2_codes[i] = VALID_SUBCODE; - }@# - - for(i = 0; i < 256; i++) /* compute the number of valid |b2_codes| */ - if(b2_codes[i] == VALID_SUBCODE) - nmb_2_bytes++; - } - - -@ -This search routine is case insignificant. Each keyword must start a line; -the function checks whether the character before the keyword is a newline -character (|'\n'|). It also checks the presence of a parameter and fills -|Buffer| if existent. |fsearch()| returns~1 on success. - -@= -int fsearch(const char *); - - -@ -@c -int fsearch(const char *search_string) - {char *P, p; - const char *Q; - char temp_buffer[STRING_LENGTH + 1]; - char env_name[STRING_LENGTH + 1]; - char *env_p; - char *env_value; - char *Buf_p; - int Ch, ch, old_ch = '\n'; - int count = STRING_LENGTH; - - rewind(config); /* we start at offset~0 */@# - - do - {Q = search_string; - p = tolower(*Q); - Ch = fgetc(config); - ch = tolower(Ch); - while(!(ch == p && old_ch == '\n') && Ch != EOF) - /* search first character of |search_string|; - |'\n'| must be the character before */ - {old_ch = ch; - Ch = fgetc(config); - ch = tolower(Ch); - }@# - - for(;;) - {if(*(++Q) == '\0') - if((Ch = fgetc(config)) == ' ' || Ch == '\t') - /* there must be a space or a tab stop after the keyword */ - goto success; - Ch = fgetc(config); - if(tolower(Ch) != tolower(*Q)) - break; - } - } - while(Ch != EOF);@# - - return 0;@# - -success: - P = temp_buffer;@# - - while((Ch = fgetc(config)) == ' ' || Ch == '\t') - /* remove leading blanks and tabs */ - ; - while(Ch != '\n' && --count > 0 && Ch != EOF) /* fill |Buffer| */ - {*P++ = Ch; - Ch = fgetc(config); - } - *P = '\0';@# - - if (*temp_buffer) - @@; - else - *Buffer = '\0';@# - - return (*Buffer) ? 1 : 0; /* is there something in the buffer? */ - } - - -@ -To make the configuration file more flexible we allow environment variables -in the arguments. We scan the parameter stored in |temp_buffer| whether it -contains a `\.{\$}' character. If yes, the following code fragment tries to -get an environment variable name whose value will be then fetched with -|getenv()|. An environment variable name recognized by \.{hbf2gf} must start -with a letter or underscore; the other characters may be alphanumeric or an -underscore. You can surround the environment variable name with braces to -indicate where the name ends, e.g. \.{\$\{FOO\}}. The interpolated -configuration parameter will be truncated to |STRING_LENGTH| characters. If -you want to have `\.{\$}' you must write `\.{\$\$}'. - -Note that you should avoid to use such environment variables for specifying -the location of the configuration file in case you have support for a file -searching library like kpathsea. Its primary aim is to specify the target -directories for the \.{pk\_directory} and the \.{tfm\_directory} keywords. - -@= - {P = temp_buffer; - Buf_p = Buffer; - count = STRING_LENGTH - 1;@# - - while(*P && count > 0) - {env_p = env_name;@# - - if(*P == '$') - {P++; - if(*P == '$') - {*(Buf_p++) = *(P++); - count--; - continue; - } - while(*P == '{') @q } @> - P++; - if(!(isalpha(*P) || *P == '_')) - {fprintf(stderr,@/ - "Invalid environment variable name in configuration file\n"); - exit(1); - } - *(env_p++) = *(P++); - while(*P) - {if(isalnum(*P) || *P == '_') - *(env_p++) = *(P++); - else - {@q { @> while(*P == '}') - P++; - *env_p = '\0'; - break; - } - }@# - - env_value = getenv(env_name); - if(env_value) /* append the environment value to |Buffer| */ - {while(*env_value && count > 0) - {*(Buf_p++) = *(env_value++); - count--; - } - } - } - else - {*(Buf_p++) = *(P++); - count--; - } - } - *Buf_p = '\0'; - } - - -@ -If an error occurs, |config_error()| will leave the program with an error -message. - -@= -void config_error(const char *); - - -@ -@c -void config_error(const char *message) - {fprintf(stderr, "Couldn't find `%s' entry in configuration file\n", - message); - exit(1); - } - - - -@* File searching. - -We support three searching engines: emtexdir, kpathsea, and MiKTeX (which is -a Win32 port of kpathsea). For emtexdir, define |HAVE_EMTEXDIR| while -compiling. For kpathsea, define |HAVE_LIBKPATHSEA|. For MikTeX, define -|HAVE_MIKTEX|. If none of these macros is defined, a simple |fopen()| will -be used instead. - -@= -#if defined(HAVE_LIBKPATHSEA) -#include "kpathsea/kpathsea.h" - -#elif defined(HAVE_EMTEXDIR) -#include "emtexdir.h" - -#elif defined(HAVE_MIKTEX) -#include "miktex.h" -#endif - -@ -@= -#if defined(HAVE_EMTEXDIR) -char emtex_version_string[] = "emTeXdir"; -#elif !defined(HAVE_MIKTEX) -char no_version_string[] = "no search library"; -#endif - - -@ -@= -const char *TeX_search_version(void); - - -@ -@c -const char *TeX_search_version(void) - { -#if defined(HAVE_LIBKPATHSEA) - return kpathsea_version_string; -#elif defined(HAVE_EMTEXDIR) - return emtex_version_string; -#elif defined(HAVE_MIKTEX) - char buf[200]; - - strcpy(buf, "MiKTeX "); - miktex_get_miktex_version_string_ex(buf + 7, sizeof (buf) - 7); - - return buf; -#else - return no_version_string; -#endif - } - - -@ -@s emtex_dir int - -@= -#ifdef HAVE_EMTEXDIR -struct emtex_dir cfg_path, hbf_path; -#endif - - -@ -@= -#ifdef HAVE_EMTEXDIR -extern int setup_list(struct emtex_dir *, char *, const char *, unsigned); -int dir_setup(struct emtex_dir *, const char *, const char *, unsigned); -char *file_find(char *, struct emtex_dir *); -#endif - - -@ -We slightly modify |emtex_dir_setup()| (from the file \.{emtexdir.c}) to -output a warning in case the environment variable |env| isn't set properly. - -@c -#ifdef HAVE_EMTEXDIR -int dir_setup(ed, env, dir, flags) - struct emtex_dir *ed; - const char *env; - const char *dir; - unsigned flags; - - {const char *val; - char path[260]; - - ed->alloc = 0; - ed->used = 0; - ed->list = NULL;@# - - if(env != NULL && (val = getenv(env)) != NULL) - return setup_list(ed, path, val, flags); - else - fprintf(stderr, - "Environment variable `%s' not set; use current directory\n", - env);@# - - return TRUE; - } - - -@ -@= -char name_buffer[FILE_NAME_LENGTH + 1]; - - -@ -@c -char *file_find(name, list) - char *name; - struct emtex_dir *list; - - {if(emtex_dir_find(name_buffer, sizeof(name_buffer), list, name, EDF_CWD)) - return name_buffer;@# - - return NULL; - } -#endif - - -@ -For emtexdir we use the environment variables \.{HBFCFG} and \.{HBFONTS} for -configuration resp.\ HBF header files. - -@= -#if defined(HAVE_LIBKPATHSEA) - kpse_set_program_name(argv[0], "hbf2gf"); - kpse_init_prog("HBF2GF", 300, "cx", "cmr10");@# - -#elif defined(HAVE_EMTEXDIR) - if(!dir_setup(&cfg_path, "HBFCFG", NULL, EDS_BANG)) - {fprintf(stderr, - "Couldn't setup search path for configuration files\n"); - exit(1); - } - if(!dir_setup(&hbf_path, "HBFONTS", NULL, EDS_BANG)) - {fprintf(stderr, - "Couldn't setup search path for HBF header files\n"); - exit(1); - } -#endif - - -@ -Finally, here are the searching routines. A special format in the kpathsea -library for fonts which are neither PostScript nor TrueType (\.{MISCFONTS}) -is available with version~3.3 and newer. For older versions we use the path -for PostScript fonts (\.{T1FONTS}) to find HBF files. Configuration files -are searched in the path specified within \.{TEXCONFIG} for old kpathsea -versions, and within \.{HBF2GFINPUTS} for new versions. - -@= -char *TeX_search_cfg_file(char *); -char *TeX_search_hbf_file(char *); - - -@ -@c -#if defined(HAVE_LIBKPATHSEA) -char *TeX_search_cfg_file(char *name) - { - return kpse_find_file(name, kpse_program_text_format, TRUE); - }@# - - -char *TeX_search_hbf_file(char *name) - { - return kpse_find_file(name, kpse_miscfonts_format, TRUE); - }@# - - -#elif defined(HAVE_EMTEXDIR) -char *TeX_search_cfg_file(char *name) - {return file_find(name, &cfg_path); - }@# - - -char *TeX_search_hbf_file(char *name) - {return file_find(name, &hbf_path); - }@# - - -#elif defined(HAVE_MIKTEX) -char *TeX_search_cfg_file(char *name) - {char result[_MAX_PATH]; - - if (!miktex_find_input_file("hbf2gf", *name, result)) - return 0; - return strdup(result); - }@# - - -char *TeX_search_hbf_file(char *name) - {char result[_MAX_PATH]; - - - if (!miktex_find_miscfont_file(*name, result)) - return 0; - return strdup(result); - }@# - - -#else -char *TeX_search_cfg_file(char *name) - {return name; - }@# - - -char *TeX_search_hbf_file(char *name) - {return name; - } -#endif - - - -@* An example. -This is the example configuration file \.{b5so12.cfg} (for use with DOS or -OS/2 and the emtexdir searching engine): -\bigskip -\halign{\quad\.{#}\hfil&\quad\.{#}\hfil\cr - hbf\_header & et24.hbf \cr - mag\_x & 2.076 \cr - x\_offset & 3 \cr - y\_offset & -8 \cr - comment & fanti songti 24x24 pixel font scaled and - adapted to 12 pt \cr - & \cr - design\_size & 12.0 \cr - & \cr - nmb\_fonts & -1 \cr - & \cr - output\_name & b5so12 \cr - & \cr - dpi\_x & 300 \cr - checksum & 123456789 \cr - coding & codingscheme Big 5 encoded TeX text \cr - & \cr - long\_extension & no \cr - job\_extension & .cmd \cr - rm\_command & del \cr - cp\_command & copy \cr - pk\_directory & \$HBF\_TARGET\\pk\\360dpi\\ \cr - tfm\_directory & \$HBF\_TARGET\\tfm\\ \cr - } -\bigskip -If you say e.g. -\medskip -\quad \.{set HBF\_TARGET=c:\\emtex\\texfonts} -\medskip -on your DOS prompt (or in your \.{autoexec.bat} file), then the interpolated -value of the \.{tfm\_directory} keyword is \.{c:\\emtex\\texfonts\\tfm\\}. -The HBF header file \.{et24.hbf} will be searched in the path specified by -the \.{HBFCFG} environment variable. -\bigskip -The call -\medskip -\quad \.{hbf2gf b5so12.cfg} -\medskip -creates the files -\medskip -\quad \.{b5so1201.gf}, \.{b5so1202.gf}, $\ldots$ , \.{b5so1255.gf}, -\.{b5so12.pl}, and \.{b5so12.cmd} -\bigskip -After calling -\medskip -\quad \.{b5so12.cmd} -\medskip -you will find the \.{PK} files in the -\.{c:\\emtex\\texfonts\\pk\\360dpi} directory and the \.{TFM} files in -the \.{c:\\emtex\\texfonts\\tfm} directory; all \.{GF} files and -\.{b5so12.pl} will be deleted. -\bigskip -The call -\medskip -\quad \.{hbf2gf -n b5so1220 417} -\medskip -creates two files: -\medskip -\quad \.{b5so1220.gf} and \.{b5so1220.pl} -\medskip -using the configuration file \.{b5so12.cfg}. The \.{GF} file would be -named \.{b5so1220.417gf} if the flag \.{-n} had not been used. - -\medskip - -It is possible to convert bitmap fonts to \.{PK} files almost -automatically. The HBF header file already has the entry -\.{HBF\_BITMAP\_BOUNDING\_BOX} which defines vertical and horizontal offsets -(in pixels), but these values are not in all cases optimal. If you omit -\.{x\_offset} and \.{y\_offset} in the configuration file, the third and -fourth parameter of \.{HBF\_BITMAP\_BOUNDING\_BOX} is used, scaled to design -size (to say it with other words: \.{x\_offset} and \.{y\_offset} will always -apply to the design size to be synchronous with the \.{TFM} files). - -Don't confuse scaling and magnification: Scaling here means that you choose -a (arbitrary) design size and compute scaling values (\.{mag\_x} and -\.{mag\_y}) which scales the bitmap to this particular design size at a -certain (arbitrarily chosen) resolution (\.{dpi\_x} and \.{dpi\_y}). -Magnification means that the scaled bitmap will be then magnified to a -certain target size while still using the font parameters (i.e., the -\.{TFM} file) of the design size. - -In the sample, you have a $24 \times 24$ bitmap font which will be scaled to -$12\,\hbox{pt}$ having a resolution of $300\,\hbox{dpi}$: -\medskip -\quad $1\,\hbox{pt}$ are $300 / 72.27 = 4.1511$ pixel; - -\quad $12\,\hbox{pt}$ are $4.1511 * 12 = 49.813$ pixel; - -\quad thus the theoretical scaling value is $49.813 / 24 = 2.076$. - -\medskip - -But especially for small sizes, this may not be the best value if the font -should harmonize with, say, Knuth's Computer Modern fonts. I recommend to -compute, say, 5~\.{PK} fonts, then check the CJK font with different \TeX\ -fonts to see whether the offsets and/or the scaling value is good. The -greater the design size the finer you can control the offsets---as an -example you could use a design size of $30\,\hbox{pt}$ (nevertheless there -is a compile-time constant |MAX_CHAR_SIZE| which limits the maximal -character size; default is 255~pixels). - -If you have found optimal offsets, you can produce many different -magnifications of the CJK font using the same set of \.{TFM} files -analogous to ordinary \TeX\ fonts; as a simplification, we assume that -\.{PK} files with a resolution of $300\,\hbox{dpi}$ and a design size of -$10\,\hbox{pt}$ have the extension `\.{.300pk}' (respectively come into a -`\.{300dpi}' subdirectory)---this is the reason why in the above example for -the $12\,\hbox{pt}$ design size a `\.{360dpi}' target directory has been -used. Now we can use the following formula: - - $$ \\{needed\_dpi} = \\{your\_horizontal\_resolution} * - {\\{your\_target\_size} \over 10.0} $$ - -Example: assuming that your printer has a resolution of -$300\times400\,\hbox{dpi}$, and you want $14.4\,\hbox{pt}$: - - $$ 300 * {14.4 \over 10.0} = 432 $$ - -The vertical scaling value is $400 / 300 = 1.3333$. Use these values now to -call \.{hbf2gf} in \mf-like mode: - -\quad \.{hbf2gf b5so1220 432 1.3333} - - - -@* Index. diff --git a/Build/source/texk/cjkutils/scripts/Makefile.am b/Build/source/texk/cjkutils/scripts/Makefile.am deleted file mode 100644 index 74c8e1d1065..00000000000 --- a/Build/source/texk/cjkutils/scripts/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -## Makefile.am for the TeX Live subdirectory texk/cjkutils/scripts/ -## -## Copyright (C) 2009 Peter Breitenlohner -## You may freely use, modify and/or distribute this file. -# - -dist_bin_SCRIPTS = \ - bg5latex \ - bg5pdflatex \ - cef5latex \ - cef5pdflatex \ - ceflatex \ - cefpdflatex \ - cefslatex \ - cefspdflatex \ - gbklatex \ - gbkpdflatex \ - sjislatex \ - sjispdflatex - -install-exec-hook: - @cd $(DESTDIR)$(bindir) && \ - for p in latex pdflatex; do \ - echo "$(LN_S) gbk$$p bg5+$$p"; \ - rm -f bg5+$$p; $(LN_S) gbk$$p bg5+$$p; \ - done - -uninstall-hook: - rm -f $(DESTDIR)$(bindir)/bg5+latex $(DESTDIR)$(bindir)/bg5+pdflatex - diff --git a/Build/source/texk/cjkutils/scripts/Makefile.in b/Build/source/texk/cjkutils/scripts/Makefile.in deleted file mode 100644 index 624b21eeb9f..00000000000 --- a/Build/source/texk/cjkutils/scripts/Makefile.in +++ /dev/null @@ -1,460 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = scripts -DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ - $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ - $(top_srcdir)/../../m4/kpse-warnings.m4 \ - $(top_srcdir)/../../m4/libtool.m4 \ - $(top_srcdir)/../../m4/ltoptions.m4 \ - $(top_srcdir)/../../m4/ltsugar.m4 \ - $(top_srcdir)/../../m4/ltversion.m4 \ - $(top_srcdir)/../../m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/hbf2gf/c-auto.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(bindir)" -SCRIPTS = $(dist_bin_SCRIPTS) -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CTANGLE = @CTANGLE@ -CWEAVE = @CWEAVE@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KPATHSEA_DEPEND = @KPATHSEA_DEPEND@ -KPATHSEA_INCLUDES = @KPATHSEA_INCLUDES@ -KPATHSEA_LIBS = @KPATHSEA_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TEX = @TEX@ -VERSION = @VERSION@ -WARNING_CFLAGS = @WARNING_CFLAGS@ -XX_CFLAGS = @XX_CFLAGS@ -XX_CPPFLAGS = @XX_CPPFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -dist_bin_SCRIPTS = \ - bg5latex \ - bg5pdflatex \ - cef5latex \ - cef5pdflatex \ - ceflatex \ - cefpdflatex \ - cefslatex \ - cefspdflatex \ - gbklatex \ - gbkpdflatex \ - sjislatex \ - sjispdflatex - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign scripts/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(SCRIPTS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-dist_binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-dist_binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-exec-am install-strip uninstall-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dist_binSCRIPTS \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-exec-hook install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dist_binSCRIPTS uninstall-hook - - -install-exec-hook: - @cd $(DESTDIR)$(bindir) && \ - for p in latex pdflatex; do \ - echo "$(LN_S) gbk$$p bg5+$$p"; \ - rm -f bg5+$$p; $(LN_S) gbk$$p bg5+$$p; \ - done - -uninstall-hook: - rm -f $(DESTDIR)$(bindir)/bg5+latex $(DESTDIR)$(bindir)/bg5+pdflatex - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/Build/source/texk/cjkutils/scripts/bg5latex b/Build/source/texk/cjkutils/scripts/bg5latex deleted file mode 100755 index 257a8446e21..00000000000 --- a/Build/source/texk/cjkutils/scripts/bg5latex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -bg5conv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/bg5pdflatex b/Build/source/texk/cjkutils/scripts/bg5pdflatex deleted file mode 100755 index 80adc376a93..00000000000 --- a/Build/source/texk/cjkutils/scripts/bg5pdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] pdflatex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -bg5conv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/cef5latex b/Build/source/texk/cjkutils/scripts/cef5latex deleted file mode 100755 index 7eda1633766..00000000000 --- a/Build/source/texk/cjkutils/scripts/cef5latex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cef5conv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/cef5pdflatex b/Build/source/texk/cjkutils/scripts/cef5pdflatex deleted file mode 100755 index 25fe066a53f..00000000000 --- a/Build/source/texk/cjkutils/scripts/cef5pdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] pdflatex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cef5conv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/ceflatex b/Build/source/texk/cjkutils/scripts/ceflatex deleted file mode 100755 index d34244d9a5b..00000000000 --- a/Build/source/texk/cjkutils/scripts/ceflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cefconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/cefpdflatex b/Build/source/texk/cjkutils/scripts/cefpdflatex deleted file mode 100755 index 4c7309f2bf2..00000000000 --- a/Build/source/texk/cjkutils/scripts/cefpdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] pdflatex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cefconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/cefslatex b/Build/source/texk/cjkutils/scripts/cefslatex deleted file mode 100755 index 619d08c7577..00000000000 --- a/Build/source/texk/cjkutils/scripts/cefslatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cefsconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/cefspdflatex b/Build/source/texk/cjkutils/scripts/cefspdflatex deleted file mode 100755 index 02bf6598f71..00000000000 --- a/Build/source/texk/cjkutils/scripts/cefspdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -cefsconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/gbklatex b/Build/source/texk/cjkutils/scripts/gbklatex deleted file mode 100755 index f799f7b6e63..00000000000 --- a/Build/source/texk/cjkutils/scripts/gbklatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -extconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/gbkpdflatex b/Build/source/texk/cjkutils/scripts/gbkpdflatex deleted file mode 100755 index 6dd3ee3de9e..00000000000 --- a/Build/source/texk/cjkutils/scripts/gbkpdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] pdflatex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -extconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/sjislatex b/Build/source/texk/cjkutils/scripts/sjislatex deleted file mode 100755 index 68c554e6d71..00000000000 --- a/Build/source/texk/cjkutils/scripts/sjislatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -sjisconv < "$tex" > "$aux" && eval latex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/scripts/sjispdflatex b/Build/source/texk/cjkutils/scripts/sjispdflatex deleted file mode 100755 index e8d070e9dc6..00000000000 --- a/Build/source/texk/cjkutils/scripts/sjispdflatex +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh - -# Copyright (C) 1994-2006 Werner Lemberg -# -# 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 in doc/COPYING; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -# MA 02110-1301 USA - -n=1 -argv= - -# get last argument -while test 1 -lt $#; do - eval argv$n=\$1 - argv="$argv \"\$argv$n\"" - n=`expr $n + 1` - shift -done - -# replace extension with .cjk or append .cjk if there is no extension -tex=$1 -case $tex in -""|*.cjk) - echo >&2 "Usage: $0 [options] latex-file" - exit 1;; -*) - aux=`expr "X$tex" : 'X\(.*\)\.[^/]*$' \| "X$tex" : 'X\(.*\)'`.cjk;; -esac - -sjisconv < "$tex" > "$aux" && eval pdflatex "$argv" "\$aux" - -# EOF diff --git a/Build/source/texk/cjkutils/sjisconv.c b/Build/source/texk/cjkutils/sjisconv.c new file mode 100644 index 00000000000..3fcfbe1ae33 --- /dev/null +++ b/Build/source/texk/cjkutils/sjisconv.c @@ -0,0 +1,33 @@ +#define banner \ +"sjisconv (CJK ver. 4.8.2)" \ + +/*2:*/ +#line 93 "./cjkutils-4.8.2/SJISconv/sjisconv.w" + +#include +#include + + +int main(int argc,char*argv[]) +{int ch; + +fprintf(stdout,"\\def\\CJKpreproc{%s}",banner); + +ch= fgetc(stdin); + +while(!feof(stdin)) +{if((ch>=0x81&&ch<=0x9F)||(ch>=0xE0&&ch<=0xEF)) +{fprintf(stdout,"\177%c\177",ch); + +ch= fgetc(stdin); +if(!feof(stdin)) +fprintf(stdout,"%d\177",ch); +} +else +fputc(ch,stdout); + +ch= fgetc(stdin); +} +exit(EXIT_SUCCESS); +return 0; +}/*:2*/ -- cgit v1.2.3