summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/src')
-rw-r--r--contrib/groff/src/devices/grodvi/dvi.cpp59
-rw-r--r--contrib/groff/src/devices/grodvi/grodvi.man8
-rw-r--r--contrib/groff/src/devices/grohtml/grohtml.man169
-rw-r--r--contrib/groff/src/devices/grohtml/html-table.cpp117
-rw-r--r--contrib/groff/src/devices/grohtml/html-table.h10
-rw-r--r--contrib/groff/src/devices/grohtml/html-text.cpp242
-rw-r--r--contrib/groff/src/devices/grohtml/html-text.h20
-rw-r--r--contrib/groff/src/devices/grohtml/html.h5
-rw-r--r--contrib/groff/src/devices/grohtml/output.cpp27
-rw-r--r--contrib/groff/src/devices/grohtml/post-html.cpp1965
-rw-r--r--contrib/groff/src/devices/grolbp/lbp.cpp40
-rw-r--r--contrib/groff/src/devices/grolbp/lbp.h309
-rw-r--r--contrib/groff/src/devices/grolj4/Makefile.sub1
-rw-r--r--contrib/groff/src/devices/grolj4/grolj4.man3
-rw-r--r--contrib/groff/src/devices/grolj4/lj4.cpp24
-rw-r--r--contrib/groff/src/devices/grolj4/lj4_font.man167
-rw-r--r--contrib/groff/src/devices/grops/grops.man72
-rw-r--r--contrib/groff/src/devices/grops/ps.cpp30
-rw-r--r--contrib/groff/src/devices/grops/ps.h6
-rw-r--r--contrib/groff/src/devices/grops/psrm.cpp8
-rw-r--r--contrib/groff/src/devices/grotty/tty.cpp242
-rw-r--r--contrib/groff/src/devices/xditview/ChangeLog542
-rw-r--r--contrib/groff/src/devices/xditview/DESC.in9
-rw-r--r--contrib/groff/src/devices/xditview/Dvi.c611
-rw-r--r--contrib/groff/src/devices/xditview/Dvi.h46
-rw-r--r--contrib/groff/src/devices/xditview/DviP.h233
-rw-r--r--contrib/groff/src/devices/xditview/FontMap17
-rw-r--r--contrib/groff/src/devices/xditview/GXditview.ad57
-rw-r--r--contrib/groff/src/devices/xditview/Makefile.sub47
-rw-r--r--contrib/groff/src/devices/xditview/Menu.h46
-rw-r--r--contrib/groff/src/devices/xditview/README13
-rw-r--r--contrib/groff/src/devices/xditview/TODO17
-rw-r--r--contrib/groff/src/devices/xditview/ad2c64
-rw-r--r--contrib/groff/src/devices/xditview/device.c565
-rw-r--r--contrib/groff/src/devices/xditview/device.h21
-rw-r--r--contrib/groff/src/devices/xditview/draw.c699
-rw-r--r--contrib/groff/src/devices/xditview/font.c442
-rw-r--r--contrib/groff/src/devices/xditview/gray1.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray2.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray3.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray4.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray5.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray6.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray7.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gray8.bm4
-rw-r--r--contrib/groff/src/devices/xditview/gxditview.man410
-rw-r--r--contrib/groff/src/devices/xditview/lex.c96
-rw-r--r--contrib/groff/src/devices/xditview/page.c82
-rw-r--r--contrib/groff/src/devices/xditview/parse.c366
-rw-r--r--contrib/groff/src/devices/xditview/xdit.bm14
-rw-r--r--contrib/groff/src/devices/xditview/xdit_mask.bm14
-rw-r--r--contrib/groff/src/devices/xditview/xditview.c657
-rw-r--r--contrib/groff/src/include/DviChar.h37
-rw-r--r--contrib/groff/src/include/Makefile.sub11
-rw-r--r--contrib/groff/src/include/XFontName.h50
-rw-r--r--contrib/groff/src/include/assert.h2
-rw-r--r--contrib/groff/src/include/cmap.h2
-rw-r--r--contrib/groff/src/include/color.h6
-rw-r--r--contrib/groff/src/include/config.hin36
-rw-r--r--contrib/groff/src/include/cset.h2
-rw-r--r--contrib/groff/src/include/device.h2
-rw-r--r--contrib/groff/src/include/driver.h4
-rw-r--r--contrib/groff/src/include/errarg.h2
-rw-r--r--contrib/groff/src/include/error.h7
-rw-r--r--contrib/groff/src/include/font.h14
-rw-r--r--contrib/groff/src/include/geometry.h2
-rw-r--r--contrib/groff/src/include/getopt_int.h131
-rw-r--r--contrib/groff/src/include/gettext.h4
-rw-r--r--contrib/groff/src/include/html-strings.h2
-rw-r--r--contrib/groff/src/include/htmlhint.h2
-rw-r--r--contrib/groff/src/include/index.h2
-rw-r--r--contrib/groff/src/include/lib.h59
-rw-r--r--contrib/groff/src/include/macropath.h2
-rw-r--r--contrib/groff/src/include/nonposix.h171
-rw-r--r--contrib/groff/src/include/paper.h2
-rw-r--r--contrib/groff/src/include/posix.h8
-rw-r--r--contrib/groff/src/include/printer.h13
-rw-r--r--contrib/groff/src/include/ptable.h7
-rw-r--r--contrib/groff/src/include/refid.h2
-rw-r--r--contrib/groff/src/include/relocate.h27
-rw-r--r--contrib/groff/src/include/search.h10
-rw-r--r--contrib/groff/src/include/searchpath.h6
-rw-r--r--contrib/groff/src/include/stringclass.h2
-rw-r--r--contrib/groff/src/include/symbol.h83
-rw-r--r--contrib/groff/src/include/unicode.h26
-rw-r--r--contrib/groff/src/libs/libbib/common.cpp2
-rw-r--r--contrib/groff/src/libs/libbib/index.cpp10
-rw-r--r--contrib/groff/src/libs/libbib/linear.cpp2
-rw-r--r--contrib/groff/src/libs/libbib/map.c40
-rw-r--r--contrib/groff/src/libs/libbib/search.cpp2
-rw-r--r--contrib/groff/src/libs/libdriver/input.cpp38
-rw-r--r--contrib/groff/src/libs/libdriver/printer.cpp63
-rw-r--r--contrib/groff/src/libs/libgroff/Makefile.sub29
-rw-r--r--contrib/groff/src/libs/libgroff/assert.cpp6
-rw-r--r--contrib/groff/src/libs/libgroff/change_lf.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/color.cpp8
-rw-r--r--contrib/groff/src/libs/libgroff/device.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/errarg.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/error.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/fatal.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/fmod.c2
-rw-r--r--contrib/groff/src/libs/libgroff/font.cpp88
-rw-r--r--contrib/groff/src/libs/libgroff/fontfile.cpp12
-rw-r--r--contrib/groff/src/libs/libgroff/geometry.cpp227
-rw-r--r--contrib/groff/src/libs/libgroff/getcwd.c2
-rw-r--r--contrib/groff/src/libs/libgroff/glyphuni.cpp504
-rw-r--r--contrib/groff/src/libs/libgroff/htmlhint.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/hypot.cpp40
-rw-r--r--contrib/groff/src/libs/libgroff/iftoa.c16
-rw-r--r--contrib/groff/src/libs/libgroff/itoa.c18
-rw-r--r--contrib/groff/src/libs/libgroff/lf.cpp7
-rw-r--r--contrib/groff/src/libs/libgroff/macropath.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/matherr.c2
-rw-r--r--contrib/groff/src/libs/libgroff/maxfilename.cpp8
-rw-r--r--contrib/groff/src/libs/libgroff/maxpathname.cpp71
-rw-r--r--contrib/groff/src/libs/libgroff/mksdir.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/mkstemp.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/nametoindex.cpp10
-rw-r--r--contrib/groff/src/libs/libgroff/new.cpp6
-rw-r--r--contrib/groff/src/libs/libgroff/paper.cpp12
-rw-r--r--contrib/groff/src/libs/libgroff/progname.c1
-rw-r--r--contrib/groff/src/libs/libgroff/ptable.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/quotearg.c209
-rw-r--r--contrib/groff/src/libs/libgroff/relocate.cpp238
-rw-r--r--contrib/groff/src/libs/libgroff/searchpath.cpp94
-rw-r--r--contrib/groff/src/libs/libgroff/spawnvp.c122
-rw-r--r--contrib/groff/src/libs/libgroff/strcasecmp.c4
-rw-r--r--contrib/groff/src/libs/libgroff/strerror.c7
-rw-r--r--contrib/groff/src/libs/libgroff/string.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/strsave.cpp2
-rw-r--r--contrib/groff/src/libs/libgroff/strtol.c2
-rw-r--r--contrib/groff/src/libs/libgroff/symbol.cpp159
-rw-r--r--contrib/groff/src/libs/libgroff/tmpfile.cpp34
-rw-r--r--contrib/groff/src/libs/libgroff/tmpname.cpp8
-rw-r--r--contrib/groff/src/libs/libgroff/unicode.cpp67
-rw-r--r--contrib/groff/src/libs/libgroff/uniglyph.cpp504
-rw-r--r--contrib/groff/src/libs/libgroff/uniuni.cpp1994
-rw-r--r--contrib/groff/src/libs/libxutil/DviChar.c658
-rw-r--r--contrib/groff/src/libs/libxutil/Makefile.sub10
-rw-r--r--contrib/groff/src/libs/libxutil/XFontName.c241
-rw-r--r--contrib/groff/src/libs/libxutil/xmalloc.c7
-rw-r--r--contrib/groff/src/preproc/eqn/Makefile.sub6
-rw-r--r--contrib/groff/src/preproc/eqn/box.cpp7
-rw-r--r--contrib/groff/src/preproc/eqn/box.h15
-rw-r--r--contrib/groff/src/preproc/eqn/delim.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/eqn.h2
-rw-r--r--contrib/groff/src/preproc/eqn/eqn.man442
-rw-r--r--contrib/groff/src/preproc/eqn/eqn.y5
-rw-r--r--contrib/groff/src/preproc/eqn/lex.cpp10
-rw-r--r--contrib/groff/src/preproc/eqn/limit.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/list.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/main.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/mark.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/other.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/over.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/pbox.h2
-rw-r--r--contrib/groff/src/preproc/eqn/pile.cpp18
-rw-r--r--contrib/groff/src/preproc/eqn/script.cpp17
-rw-r--r--contrib/groff/src/preproc/eqn/special.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/sqrt.cpp2
-rw-r--r--contrib/groff/src/preproc/eqn/text.cpp2
-rw-r--r--contrib/groff/src/preproc/grn/gprint.h2
-rw-r--r--contrib/groff/src/preproc/grn/grn.man38
-rw-r--r--contrib/groff/src/preproc/grn/hdb.cpp33
-rw-r--r--contrib/groff/src/preproc/grn/hgraph.cpp144
-rw-r--r--contrib/groff/src/preproc/grn/hpoint.cpp26
-rw-r--r--contrib/groff/src/preproc/grn/main.cpp42
-rw-r--r--contrib/groff/src/preproc/html/Makefile.sub1
-rw-r--r--contrib/groff/src/preproc/html/pre-html.cpp1253
-rw-r--r--contrib/groff/src/preproc/html/pre-html.h2
-rw-r--r--contrib/groff/src/preproc/html/pushback.cpp30
-rw-r--r--contrib/groff/src/preproc/html/pushback.h24
-rw-r--r--contrib/groff/src/preproc/pic/TODO2
-rw-r--r--contrib/groff/src/preproc/pic/common.cpp155
-rw-r--r--contrib/groff/src/preproc/pic/common.h10
-rw-r--r--contrib/groff/src/preproc/pic/lex.cpp28
-rw-r--r--contrib/groff/src/preproc/pic/main.cpp2
-rw-r--r--contrib/groff/src/preproc/pic/object.cpp197
-rw-r--r--contrib/groff/src/preproc/pic/object.h11
-rw-r--r--contrib/groff/src/preproc/pic/output.h4
-rw-r--r--contrib/groff/src/preproc/pic/pic.h10
-rw-r--r--contrib/groff/src/preproc/pic/pic.man56
-rw-r--r--contrib/groff/src/preproc/pic/pic.y39
-rw-r--r--contrib/groff/src/preproc/pic/position.h2
-rw-r--r--contrib/groff/src/preproc/pic/tex.cpp27
-rw-r--r--contrib/groff/src/preproc/pic/troff.cpp36
-rw-r--r--contrib/groff/src/preproc/refer/command.cpp6
-rw-r--r--contrib/groff/src/preproc/refer/command.h2
-rw-r--r--contrib/groff/src/preproc/refer/label.y34
-rw-r--r--contrib/groff/src/preproc/refer/ref.cpp8
-rw-r--r--contrib/groff/src/preproc/refer/ref.h12
-rw-r--r--contrib/groff/src/preproc/refer/refer.cpp11
-rw-r--r--contrib/groff/src/preproc/refer/refer.h7
-rw-r--r--contrib/groff/src/preproc/refer/refer.man310
-rw-r--r--contrib/groff/src/preproc/refer/token.cpp2
-rw-r--r--contrib/groff/src/preproc/refer/token.h2
-rw-r--r--contrib/groff/src/preproc/soelim/Makefile.sub1
-rw-r--r--contrib/groff/src/preproc/soelim/soelim.cpp85
-rw-r--r--contrib/groff/src/preproc/soelim/soelim.man113
-rw-r--r--contrib/groff/src/preproc/tbl/Makefile.sub1
-rw-r--r--contrib/groff/src/preproc/tbl/main.cpp99
-rw-r--r--contrib/groff/src/preproc/tbl/table.cpp37
-rw-r--r--contrib/groff/src/preproc/tbl/table.h17
-rw-r--r--contrib/groff/src/preproc/tbl/tbl.man50
-rw-r--r--contrib/groff/src/roff/groff/groff.cpp46
-rw-r--r--contrib/groff/src/roff/groff/pipeline.c329
-rw-r--r--contrib/groff/src/roff/groff/pipeline.h2
-rw-r--r--contrib/groff/src/roff/grog/grog.pl2
-rw-r--r--contrib/groff/src/roff/grog/grog.sh2
-rw-r--r--contrib/groff/src/roff/nroff/Makefile.sub5
-rw-r--r--contrib/groff/src/roff/troff/Makefile.sub21
-rw-r--r--contrib/groff/src/roff/troff/charinfo.h2
-rw-r--r--contrib/groff/src/roff/troff/column.cpp4
-rw-r--r--contrib/groff/src/roff/troff/dictionary.cpp7
-rw-r--r--contrib/groff/src/roff/troff/dictionary.h2
-rw-r--r--contrib/groff/src/roff/troff/div.cpp66
-rw-r--r--contrib/groff/src/roff/troff/div.h21
-rw-r--r--contrib/groff/src/roff/troff/env.cpp449
-rw-r--r--contrib/groff/src/roff/troff/env.h111
-rw-r--r--contrib/groff/src/roff/troff/hvunits.h2
-rw-r--r--contrib/groff/src/roff/troff/input.cpp599
-rw-r--r--contrib/groff/src/roff/troff/input.h21
-rw-r--r--contrib/groff/src/roff/troff/mtsm.cpp632
-rw-r--r--contrib/groff/src/roff/troff/mtsm.h164
-rw-r--r--contrib/groff/src/roff/troff/node.cpp795
-rw-r--r--contrib/groff/src/roff/troff/node.h171
-rw-r--r--contrib/groff/src/roff/troff/number.cpp7
-rw-r--r--contrib/groff/src/roff/troff/reg.cpp5
-rw-r--r--contrib/groff/src/roff/troff/reg.h2
-rw-r--r--contrib/groff/src/roff/troff/request.h11
-rw-r--r--contrib/groff/src/roff/troff/token.h10
-rw-r--r--contrib/groff/src/roff/troff/troff.h8
-rw-r--r--contrib/groff/src/roff/troff/troff.man22
-rw-r--r--contrib/groff/src/utils/addftinfo/addftinfo.cpp2
-rw-r--r--contrib/groff/src/utils/addftinfo/guess.cpp2
-rw-r--r--contrib/groff/src/utils/addftinfo/guess.h2
-rw-r--r--contrib/groff/src/utils/afmtodit/Makefile.sub2
-rw-r--r--contrib/groff/src/utils/afmtodit/afmtodit.man44
-rw-r--r--contrib/groff/src/utils/afmtodit/afmtodit.pl12419
-rw-r--r--contrib/groff/src/utils/hpftodit/Makefile.sub6
-rw-r--r--contrib/groff/src/utils/hpftodit/hpftodit.cpp1131
-rw-r--r--contrib/groff/src/utils/hpftodit/hpftodit.man238
-rw-r--r--contrib/groff/src/utils/hpftodit/hpuni.cpp698
-rw-r--r--contrib/groff/src/utils/indxbib/Makefile.sub2
-rw-r--r--contrib/groff/src/utils/indxbib/indxbib.cpp34
-rw-r--r--contrib/groff/src/utils/indxbib/signal.c27
-rw-r--r--contrib/groff/src/utils/lkbib/lkbib.cpp2
-rw-r--r--contrib/groff/src/utils/lkbib/lkbib.man36
-rw-r--r--contrib/groff/src/utils/lookbib/lookbib.cpp6
-rw-r--r--contrib/groff/src/utils/lookbib/lookbib.man27
-rw-r--r--contrib/groff/src/utils/pfbtops/Makefile.sub1
-rw-r--r--contrib/groff/src/utils/pfbtops/pfbtops.c45
-rw-r--r--contrib/groff/src/utils/pfbtops/pfbtops.man21
-rw-r--r--contrib/groff/src/utils/tfmtodit/tfmtodit.cpp10
-rw-r--r--contrib/groff/src/utils/xtotroff/Makefile.in62
-rw-r--r--contrib/groff/src/utils/xtotroff/Makefile.sub8
-rw-r--r--contrib/groff/src/utils/xtotroff/xtotroff.c299
-rw-r--r--contrib/groff/src/utils/xtotroff/xtotroff.man109
258 files changed, 27517 insertions, 9717 deletions
diff --git a/contrib/groff/src/devices/grodvi/dvi.cpp b/contrib/groff/src/devices/grodvi/dvi.cpp
index df16939..201eb1c 100644
--- a/contrib/groff/src/devices/grodvi/dvi.cpp
+++ b/contrib/groff/src/devices/grodvi/dvi.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "nonposix.h"
@@ -340,12 +340,12 @@ void dvi_printer::set_color(color *col)
do_special(buf);
}
-void dvi_printer::set_char(int index, font *f, const environment *env,
+void dvi_printer::set_char(int idx, font *f, const environment *env,
int w, const char *)
{
if (*env->col != cur_color)
set_color(env->col);
- int code = f->get_code(index);
+ int code = f->get_code(idx);
if (env->size != cur_point_size || f != cur_font) {
cur_font = f;
cur_point_size = env->size;
@@ -384,7 +384,7 @@ void dvi_printer::set_char(int index, font *f, const environment *env,
}
possibly_begin_line();
end_h = env->hpos + w;
- cur_h += scale(f->get_width(index, UNITWIDTH)/MULTIPLIER,
+ cur_h += scale(f->get_width(idx, UNITWIDTH)/MULTIPLIER,
cur_point_size*RES_7227);
if (cur_h > max_h)
max_h = cur_h;
@@ -709,24 +709,26 @@ void draw_dvi_printer::draw(int code, int *p, int np, const environment *env)
fill_flag = 1;
// fall through
case 'c':
- // troff adds an extra argument to C
- if (np != 1 && !(code == 'C' && np == 2)) {
- error("1 argument required for circle");
+ {
+ // troff adds an extra argument to C
+ if (np != 1 && !(code == 'C' && np == 2)) {
+ error("1 argument required for circle");
+ break;
+ }
+ moveto(env->hpos+p[0]/2, env->vpos);
+ if (fill_flag)
+ fill_next(env);
+ else
+ set_line_thickness(env);
+ int rad;
+ rad = milliinches(p[0]/2);
+ sprintf(buf, "%s 0 0 %d %d 0 6.28319",
+ (fill_flag ? "ia" : "ar"),
+ rad,
+ rad);
+ do_special(buf);
break;
}
- moveto(env->hpos+p[0]/2, env->vpos);
- if (fill_flag)
- fill_next(env);
- else
- set_line_thickness(env);
- int rad;
- rad = milliinches(p[0]/2);
- sprintf(buf, "%s 0 0 %d %d 0 6.28319",
- (fill_flag ? "ia" : "ar"),
- rad,
- rad);
- do_special(buf);
- break;
case 'l':
if (np != 2) {
error("2 arguments required for line");
@@ -820,11 +822,11 @@ void draw_dvi_printer::draw(int code, int *p, int np, const environment *env)
if (adjust_arc_center(p, c)) {
int rad = milliinches(int(sqrt(c[0]*c[0] + c[1]*c[1]) + .5));
moveto(env->hpos + int(c[0]), env->vpos + int(c[1]));
- sprintf(buf, "ar 0 0 %d %d %f %f",
- rad,
- rad,
- atan2(p[1] + p[3] - c[1], p[0] + p[2] - c[0]),
- atan2(-c[1], -c[0]));
+ double start = atan2(p[1] + p[3] - c[1], p[0] + p[2] - c[0]);
+ double end = atan2(-c[1], -c[0]);
+ if (end - start < 0)
+ start -= 2 * 3.14159265358;
+ sprintf(buf, "ar 0 0 %d %d %f %f", rad, rad, start, end);
do_special(buf);
}
else {
@@ -915,7 +917,7 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "dF:lp:vw:", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "dF:I:lp:vw:", long_options, NULL))
!= EOF)
switch(c) {
case 'd':
@@ -927,6 +929,9 @@ int main(int argc, char **argv)
case 'F':
font::command_line_font_dir(optarg);
break;
+ case 'I':
+ // ignore include search path
+ break;
case 'p':
if (!font::scan_papersize(optarg, 0,
&user_paper_length, &user_paper_width))
diff --git a/contrib/groff/src/devices/grodvi/grodvi.man b/contrib/groff/src/devices/grodvi/grodvi.man
index 793bfe2..7c74c32 100644
--- a/contrib/groff/src/devices/grodvi/grodvi.man
+++ b/contrib/groff/src/devices/grodvi/grodvi.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -17,6 +17,8 @@ translations approved by the Free Software Foundation instead of in
the original English.
..
.
+.do nr grodvi_C \n[.C]
+.cp 0
.
.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
.el .ds tx TeX
@@ -117,7 +119,7 @@ may not contain a newline.
.
.LP
For inclusion of EPS image files,
-.B grodvi
+.B \-Tdvi
loads
.B pspic.tmac
automatically, providing the
@@ -425,6 +427,8 @@ and widths of rules be rounded.
.BR groff_char (@MAN7EXT@),
.BR groff_tmac (@MAN5EXT@)
.
+.cp \n[grodvi_C]
+.
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/contrib/groff/src/devices/grohtml/grohtml.man b/contrib/groff/src/devices/grohtml/grohtml.man
index 976990a..ec82beb 100644
--- a/contrib/groff/src/devices/grohtml/grohtml.man
+++ b/contrib/groff/src/devices/grohtml/grohtml.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1999-2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1999-2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -16,17 +16,23 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
..
+.
+.
.TH GROHTML @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
.
+.
.SH NAME
grohtml \- html driver for groff
.
+.
.SH SYNOPSIS
.nr a \n(.j
.ad l
@@ -34,22 +40,28 @@ grohtml \- html driver for groff
.in +\w'\fBgrohtml 'u
.ti \niu
.B grohtml
+.
.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
+. ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+. el .RB "[\ " "\\$1" "\ ]"
..
-.OP \-vhlrn
+.
+.OP \-bhlnprv
+.OP \-a \%aa-text-bits
.OP \-D dir
.OP \-F dir
-.OP \-i resolution
+.OP \-g \%aa-graphic-bits
+.OP \-i \%resolution
.OP \-I \%image-stem
+.OP \-j \%filename
.OP \-o \%image-vertical-offset
-.OP \-a \%aa-text-bits
-.OP \-a \%aa-graphic-bits
+.OP \-s size
+.OP \-S level
.RI "[\ " files\|.\|.\|. "\ ]"
.br
.ad \na
.
+.
.SH DESCRIPTION
The
.B grohtml
@@ -84,13 +96,15 @@ using
.BR groff 's
.B \-P
option.
+.
+.
.SH OPTIONS
.TP
.BI \-a aa-text-bits
Number of bits of antialiasing information to be used by
.I text
when generating png images.
-The default is\~4 but legal values are 0, 1, 2, and\~4.
+The default is\~4 but valid values are 0, 1, 2, and\~4.
Note your version of
.B gs
needs to support the
@@ -102,12 +116,33 @@ A value of\~0 stops
.B grohtml
from issuing antialiasing commands to
.BR gs .
+.
+.TP
+.B \-b
+Initialize the background color to white.
+.
+.TP
+.BI \-D dir
+Inform
+.B grohtml
+to place all image files into directory
+.IR dir .
+.
+.TP
+.BI \-F dir
+Prepend directory
+.IB dir /dev name
+to the search path for font and device description files;
+.I name
+is the name of the device, usually
+.BR html .
+.
.TP
.BI \-g aa-graphic-bits
Number of bits of antialiasing information to be used by
.I graphics
when generating png images.
-The default is\~4 but legal values are 0, 1, 2, and\~4.
+The default is\~4 but valid values are 0, 1, 2, and\~4.
Note your version of
.B gs
needs to support the
@@ -119,69 +154,93 @@ A value of\~0 stops
.B grohtml
from issuing antialiasing commands to
.BR gs .
+.
.TP
-.B -b
-Initialize the background color to white.
-.TP
-.B -h
-Generates section and number headings by using
+.B \-h
+Generate section and number headings by using
.BR <B> .\|.\|. </B>
and increasing the font size, rather than using the
.BI <H n >\c
\&.\|.\|.\c
.BI </H n >
tags.
-.TP
-.B -l
-Turns off the production of automatic section links at the top of the document.
-.TP
-.B -r
-Turns off the automatic header and footer line (html rule).
-.TP
-.B -n
-Generate simple heading anchors whenever a section/number heading is found.
-Without the option the anchor value is the textual heading.
-This can cause problems when a heading contains a `?' on some browsers
-(netscape).
-This flag is automatically turned on if a heading contains an image.
-.TP
-.B -p
-Display page rendering progress to stderr.
-.B grohtml
-only displays a page number when an image is required.
-.TP
-.BI \-F dir
-Prepend directory
-.IB dir /dev name
-to the search path for font and device description files;
-.I name
-is the name of the device, usually
-.BR html .
+.
.TP
.BI \-i resolution
Select the resolution for all images.
By default this is 100 pixels per inch.
-Example: -i200 indicates 200 pixels per inch.
+Example:
+.B \-i200
+indicates 200 pixels per inch.
+.
.TP
.BI \-I stem
Determine the image stem name.
If omitted grohtml uses
-.BI grohtml- XXX
+.BI \%grohtml- XXX
.RI ( XXX
is the process ID).
+.
+.TP
+.BI \-j filename
+Inform
+.B grohtml
+to split the html output into multiple files.
+The
+.I filename
+is the stem and specified section headings
+(default is level one) start a new file, named
+.IR filename-n.html .
+.
+.TP
+.B \-l
+Turn off the production of automatic section links at the top of the
+document.
+.
+.TP
+.B \-n
+Generate simple heading anchors whenever a section/number heading is found.
+Without the option the anchor value is the textual heading.
+This can cause problems when a heading contains a `?' on older versions of
+some browsers (Netscape).
+This flag is automatically turned on if a heading contains an image.
+.
.TP
.BI \-o vertical-offset
Specify the vertical offset of images in points.
+.
.TP
-.BI \-D dir
-Inform
+.B \-p
+Display page rendering progress to stderr.
.B grohtml
-to place all image files into directory
-.IR dir .
+only displays a page number when an image is required.
+.
+.TP
+.B \-r
+Turn off the automatic header and footer line (html rule).
+.
+.TP
+.B \-s size
+Set the base point size of the source file.
+Thereafter when this point size is used in the source it will correspond
+to the html base size.
+Every increase of two points in the source will yield a
+.B <big>
+tag, and conversely when a decrease of two points is seen a
+.B <small>
+tag is emitted.
+.
+.TP
+.BI \-S level
+When splitting html output,
+split at the heading level (or higher) defined by
+.IR level .
+.
.TP
.B \-v
Print the version number.
.
+.
.SH USAGE
There are styles called
.BR R ,
@@ -189,11 +248,15 @@ There are styles called
.BR B ,
and
.B BI
-mounted at font positions 1 to 4.
+mounted at font positions 1 to\~4.
+.
+.
.SH DEPENDENCIES
.B grohtml
is dependent upon the png utilities
-.RB ( \&\%pnmcut ,\ \%pnmcrop ,\ \%pnmtopng )
+.RB ( \%pnmcut ,
+.BR \%pnmcrop ,
+.BR \%pnmtopng )
and GhostScript
.RB ( gs ).
.B \%pnmtopng
@@ -208,10 +271,14 @@ from the
package.
Images are generated whenever a table, picture, equation or line is
encountered.
+.
+.
.SH BUGS
.B Grohtml
has been completely redesigned and rewritten.
-It is still alpha code.
+It is still beta code.
+.
+.
.SH "SEE ALSO"
.BR afmtodit (@MAN1EXT@),
.BR groff (@MAN1EXT@),
diff --git a/contrib/groff/src/devices/grohtml/html-table.cpp b/contrib/groff/src/devices/grohtml/html-table.cpp
index 3585cd3..7e5b2dc 100644
--- a/contrib/groff/src/devices/grohtml/html-table.cpp
+++ b/contrib/groff/src/devices/grohtml/html-table.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote html-table.cpp
*
@@ -24,7 +24,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "stringclass.h"
@@ -32,6 +32,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "html-table.h"
#include "ctype.h"
#include "html.h"
+#include "html-text.h"
#if !defined(TRUE)
# define TRUE (1==1)
@@ -62,7 +63,7 @@ void tabs::delete_list (void)
while (p != NULL) {
q = p;
p = p->next;
- free(q);
+ delete q;
}
tab = NULL;
}
@@ -104,7 +105,7 @@ int tabs::compatible (const char *s)
while ((*s != (char)0) && isspace(*s))
s++;
// collect tab position
- total += atoi(s);
+ total = atoi(s);
// move over tab position
while ((*s != (char)0) && !isspace(*s))
s++;
@@ -149,10 +150,10 @@ void tabs::init (const char *s)
while ((*s != (char)0) && !isspace(*s))
s++;
if (last == NULL) {
- tab = (tab_position *)malloc(sizeof(tab_position));
+ tab = new tab_position;
last = tab;
} else {
- last->next = (tab_position *)malloc(sizeof(tab_position));
+ last->next = new tab_position;
last = last->next;
}
last->alignment = align;
@@ -162,6 +163,16 @@ void tabs::init (const char *s)
}
/*
+ * check_init - define tab stops using, s, providing none already exist.
+ */
+
+void tabs::check_init (const char *s)
+{
+ if (tab == NULL)
+ init(s);
+}
+
+/*
* find_tab - returns the tab number corresponding to the position, pos.
*/
@@ -228,7 +239,7 @@ void tabs::dump_tabs (void)
*/
html_table::html_table (simple_output *op, int linelen)
- : columns(NULL), out(op), linelength(linelen), last_col(NULL), start_space(FALSE)
+ : out(op), columns(NULL), linelength(linelen), last_col(NULL), start_space(FALSE)
{
tab_stops = new tabs();
}
@@ -242,7 +253,7 @@ html_table::~html_table ()
c = columns;
while (columns != NULL) {
columns = columns->next;
- free(c);
+ delete c;
c = columns;
}
}
@@ -258,7 +269,7 @@ void html_table::remove_cols (cols *c)
while (c != NULL) {
p = c;
c = c->next;
- free(p);
+ delete p;
}
}
@@ -322,15 +333,21 @@ void html_table::emit_table_header (int space)
last_col = NULL;
if (linelength > 0) {
- int n = no_columns() + no_gaps();
-
out->nl();
out->nl();
- if (space)
- out->put_string("<p>");
- start_space = space;
- out->put_string("<table width=\"100%\" border=0 rules=\"none\" frame=\"void\"\n cols=\"").put_number(n).put_string("\" cellspacing=\"0\" cellpadding=\"0\">").nl();
- out->put_string("<tr valign=\"top\" align=\"left\">").nl();
+
+ out->put_string("<table width=\"100%\"")
+ .put_string(" border=0 rules=\"none\" frame=\"void\"\n")
+ .put_string(" cellspacing=\"0\" cellpadding=\"0\"");
+ out->put_string(">")
+ .nl();
+ out->put_string("<tr valign=\"top\" align=\"left\"");
+ if (space) {
+ out->put_string(" style=\"margin-top: ");
+ out->put_string(STYLE_VERTICAL_SPACE);
+ out->put_string("\"");
+ }
+ out->put_string(">").nl();
}
}
@@ -348,6 +365,16 @@ int html_table::get_right (cols *c)
}
/*
+ * set_space - assigns start_space. Used to determine the
+ * vertical alignment when generating the next table row.
+ */
+
+void html_table::set_space (int space)
+{
+ start_space = space;
+}
+
+/*
* emit_col - moves onto column, n.
*/
@@ -461,18 +488,22 @@ void html_table::finish_row (void)
void html_table::emit_new_row (void)
{
finish_row();
- out->put_string("<tr valign=\"top\" align=\"left\">").nl();
+
+ out->put_string("<tr valign=\"top\" align=\"left\"");
+ if (start_space) {
+ out->put_string(" style=\"margin-top: ");
+ out->put_string(STYLE_VERTICAL_SPACE);
+ out->put_string("\"");
+ }
+ out->put_string(">").nl();
+ start_space = FALSE;
last_col = NULL;
}
void html_table::emit_finish_table (void)
{
finish_row();
- // out->put_string("linelength = ").put_number(linelength).nl();
out->put_string("</table>");
- if (start_space)
- out->put_string("</p>");
- out->nl();
}
/*
@@ -516,13 +547,23 @@ cols *html_table::get_column (int coln)
int html_table::insert_column (int coln, int hstart, int hend, char align)
{
cols *c = columns;
- cols *l = NULL;
+ cols *l = columns;
cols *n = NULL;
while (c != NULL && c->no < coln) {
l = c;
c = c->next;
}
+ if (l != NULL && l->no>coln && hend > l->left)
+ return FALSE; // new column bumps into previous one
+
+ l = NULL;
+ c = columns;
+ while (c != NULL && c->no < coln) {
+ l = c;
+ c = c->next;
+ }
+
if ((l != NULL) && (hstart < l->right))
return FALSE; // new column bumps into previous one
@@ -530,7 +571,7 @@ int html_table::insert_column (int coln, int hstart, int hend, char align)
(l->next->left < hend))
return FALSE; // new column bumps into next one
- n = (cols *)malloc(sizeof(cols));
+ n = new cols;
if (l == NULL) {
n->next = columns;
columns = n;
@@ -691,7 +732,6 @@ html_indent::html_indent (simple_output *op, int ind, int pageoffset, int linele
in = ind;
pg = pageoffset;
ll = linelength;
- is_used = FALSE;
}
html_indent::~html_indent (void)
@@ -702,18 +742,33 @@ html_indent::~html_indent (void)
void html_indent::begin (int space)
{
- if (! is_used) {
- table->emit_table_header(space);
- table->emit_col(1);
- is_used = TRUE;
+ if (in + pg == 0) {
+ if (space) {
+ table->out->put_string(" style=\"margin-top: ");
+ table->out->put_string(STYLE_VERTICAL_SPACE);
+ table->out->put_string("\"");
+ }
+ }
+ else {
+ //
+ // we use exactly the same mechanism for calculating
+ // indentation as html_table::emit_col
+ //
+ table->out->put_string(" style=\"margin-left:")
+ .put_number(((in + pg) * 100 + ll/2) / ll -
+ (ll/2)/ll)
+ .put_string("%;");
+
+ if (space) {
+ table->out->put_string(" margin-top: ");
+ table->out->put_string(STYLE_VERTICAL_SPACE);
+ }
+ table->out->put_string("\"");
}
}
void html_indent::end (void)
{
- if (is_used)
- table->emit_finish_table();
- is_used = FALSE;
}
/*
diff --git a/contrib/groff/src/devices/grohtml/html-table.h b/contrib/groff/src/devices/grohtml/html-table.h
index c26eb6d..dc6cebe 100644
--- a/contrib/groff/src/devices/grohtml/html-table.h
+++ b/contrib/groff/src/devices/grohtml/html-table.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote html-table.h
*
@@ -24,7 +24,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "html.h"
@@ -45,6 +45,7 @@ public:
void clear (void);
int compatible (const char *s);
void init (const char *s);
+ void check_init (const char *s);
int find_tab (int pos);
int get_tab_pos (int n);
char get_tab_align (int n);
@@ -91,14 +92,15 @@ public:
void add_indent (int indent);
void finish_row (void);
int get_effective_linelength (void);
+ void set_space (int space);
tabs *tab_stops; /* tab stop positions */
+ simple_output *out;
private:
cols *columns; /* column entries */
- simple_output *out;
int linelength;
cols *last_col; /* last column started */
- int start_space; /* encapsulate with <p> </p> */
+ int start_space; /* have we seen a `.sp' tag? */
void remove_cols (cols *c);
};
diff --git a/contrib/groff/src/devices/grohtml/html-text.cpp b/contrib/groff/src/devices/grohtml/html-text.cpp
index 21a79eb..b58d5e4 100644
--- a/contrib/groff/src/devices/grohtml/html-text.cpp
+++ b/contrib/groff/src/devices/grohtml/html-text.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ * Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cpp
*
@@ -24,7 +25,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "stringclass.h"
@@ -40,6 +41,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "html-text.h"
+#undef DEBUGGING
// #define DEBUGGING
html_text::html_text (simple_output *op) :
@@ -145,18 +147,24 @@ void html_text::end_tag (tag_definition *t)
case I_TAG: out->put_string("</i>"); break;
case B_TAG: out->put_string("</b>"); break;
- case P_TAG: out->put_string("</p>");
- if (t->indent != NULL) {
+ case P_TAG: if (t->indent == NULL) {
+ out->put_string("</p>");
+ } else {
delete t->indent;
t->indent = NULL;
+ out->put_string("</p>");
}
- out->nl(); out->enable_newlines(FALSE);
+ out->enable_newlines(FALSE);
blank_para = TRUE; break;
case SUB_TAG: out->put_string("</sub>"); break;
case SUP_TAG: out->put_string("</sup>"); break;
case TT_TAG: out->put_string("</tt>"); break;
- case PRE_TAG: out->put_string("</pre>"); out->nl(); out->enable_newlines(TRUE);
- blank_para = TRUE; break;
+ case PRE_TAG: out->put_string("</pre>"); out->enable_newlines(TRUE);
+ blank_para = TRUE;
+ if (t->indent != NULL)
+ delete t->indent;
+ t->indent = NULL;
+ break;
case SMALL_TAG: out->put_string("</small>"); break;
case BIG_TAG: out->put_string("</big>"); break;
case COLOR_TAG: out->put_string("</font>"); break;
@@ -168,19 +176,29 @@ void html_text::end_tag (tag_definition *t)
/*
* issue_tag - writes out an html tag with argument.
+ * space == 0 if no space is requested
+ * space == 1 if a space is requested
+ * space == 2 if tag should not have a space style
*/
-void html_text::issue_tag (const char *tagname, const char *arg)
+void html_text::issue_tag (const char *tagname, const char *arg,
+ int space)
{
- if ((arg == 0) || (strlen(arg) == 0)) {
+ if ((arg == 0) || (strlen(arg) == 0))
out->put_string(tagname);
- out->put_string(">");
- } else {
+ else {
out->put_string(tagname);
out->put_string(" ");
out->put_string(arg);
- out->put_string(">");
}
+ if (space == TRUE) {
+ out->put_string(" style=\"margin-top: ");
+ out->put_string(STYLE_VERTICAL_SPACE);
+ out->put_string("\"");
+ }
+ if (space == TRUE || space == FALSE)
+ out->put_string(" valign=\"top\"");
+ out->put_string(">");
}
/*
@@ -214,29 +232,31 @@ void html_text::start_tag (tag_definition *t)
case I_TAG: issue_tag("<i", (char *)t->arg1); break;
case B_TAG: issue_tag("<b", (char *)t->arg1); break;
- case P_TAG: if (t->indent == NULL) {
+ case P_TAG: if (t->indent != NULL) {
out->nl();
- issue_tag("\n<p", (char *)t->arg1);
- } else {
- out->nl();
+#if defined(DEBUGGING)
out->simple_comment("INDENTATION");
- t->indent->begin(FALSE);
- start_space = FALSE;
- issue_tag("<p", (char *)t->arg1);
+#endif
+ out->put_string("\n<p");
+ t->indent->begin(start_space);
+ issue_tag("", (char *)t->arg1);
+ } else {
+ out->nl();
+ issue_tag("\n<p", (char *)t->arg1, start_space);
}
out->enable_newlines(TRUE); break;
case SUB_TAG: issue_tag("<sub", (char *)t->arg1); break;
case SUP_TAG: issue_tag("<sup", (char *)t->arg1); break;
case TT_TAG: issue_tag("<tt", (char *)t->arg1); break;
- case PRE_TAG: if (t->indent != NULL) {
- out->nl();
- out->simple_comment("INDENTATION");
- t->indent->begin(FALSE);
- start_space = FALSE;
- }
- out->enable_newlines(TRUE);
- out->nl(); issue_tag("<pre", (char *)t->arg1);
+ case PRE_TAG: out->enable_newlines(TRUE);
+ out->nl(); out->put_string("<pre");
+ if (t->indent == NULL)
+ issue_tag("", (char *)t->arg1, start_space);
+ else {
+ t->indent->begin(start_space);
+ issue_tag("", (char *)t->arg1);
+ }
out->enable_newlines(FALSE); break;
case SMALL_TAG: issue_tag("<small", (char *)t->arg1); break;
case BIG_TAG: issue_tag("<big", (char *)t->arg1); break;
@@ -264,7 +284,7 @@ void html_text::flush_text (void)
}
p = stackptr;
stackptr = stackptr->next;
- free(p);
+ delete p;
}
lastptr = NULL;
}
@@ -285,6 +305,23 @@ int html_text::is_present (HTML_TAG t)
return FALSE;
}
+/*
+ * uses_indent - returns TRUE if the current paragraph is using a
+ * html table to effect an indent.
+ */
+
+int html_text::uses_indent (void)
+{
+ tag_definition *p = stackptr;
+
+ while (p != NULL) {
+ if (p->indent != NULL)
+ return TRUE;
+ p = p->next;
+ }
+ return FALSE;
+}
+
extern void stop();
/*
@@ -337,7 +374,7 @@ void html_text::do_push (tag_definition *p)
void html_text::push_para (HTML_TAG t, void *arg, html_indent *in)
{
- tag_definition *p=(tag_definition *)malloc(sizeof(tag_definition));
+ tag_definition *p= new tag_definition;
p->type = t;
p->arg1 = arg;
@@ -357,7 +394,7 @@ void html_text::push_para (HTML_TAG t)
void html_text::push_para (color *c)
{
- tag_definition *p=(tag_definition *)malloc(sizeof(tag_definition));
+ tag_definition *p = new tag_definition;
p->type = COLOR_TAG;
p->arg1 = NULL;
@@ -407,9 +444,11 @@ void html_text::do_pre (void)
done_tt();
if (is_present(P_TAG)) {
html_indent *i = remove_indent(P_TAG);
+ int space = retrieve_para_space();
(void)done_para();
if (! is_present(PRE_TAG))
push_para(PRE_TAG, NULL, i);
+ start_space = space;
} else if (! is_present(PRE_TAG))
push_para(PRE_TAG, NULL, NULL);
dump_stack();
@@ -475,8 +514,8 @@ char *html_text::shutdown (HTML_TAG t)
/*
* push tag onto temp stack
*/
- p->next = temp;
- temp = p;
+ p->next = temp;
+ temp = p;
}
/*
@@ -495,7 +534,7 @@ char *html_text::shutdown (HTML_TAG t)
lastptr = NULL;
if (p->indent != NULL)
delete p->indent;
- free(p);
+ delete p;
}
/*
@@ -508,7 +547,7 @@ char *html_text::shutdown (HTML_TAG t)
push_para(temp->type, temp->arg1, temp->indent);
p = temp;
temp = temp->next;
- free(p);
+ delete p;
}
}
return arg;
@@ -607,7 +646,7 @@ void html_text::check_emit_text (tag_definition *t)
void html_text::do_emittext (const char *s, int length)
{
if ((! is_present(P_TAG)) && (! is_present(PRE_TAG)))
- do_para("");
+ do_para("", FALSE);
if (is_present(BREAK_TAG)) {
int text = remove_break();
@@ -615,13 +654,12 @@ void html_text::do_emittext (const char *s, int length)
if (text) {
if (is_present(PRE_TAG)) {
out->nl();
- } else {
+ } else
out->put_string("<br>").nl();
- }
}
- } else {
+ } else
check_emit_text(stackptr);
- }
+
out->put_string(s, length);
space_emitted = FALSE;
blank_para = FALSE;
@@ -631,38 +669,40 @@ void html_text::do_emittext (const char *s, int length)
* do_para - starts a new paragraph
*/
-void html_text::do_para (const char *arg, html_indent *in)
+void html_text::do_para (const char *arg, html_indent *in, int space)
{
if (! is_present(P_TAG)) {
if (is_present(PRE_TAG)) {
html_indent *i = remove_indent(PRE_TAG);
done_pre();
- if (i == in || in == NULL)
+ if ((arg == NULL || (strcmp(arg, "") == 0)) &&
+ (i == in || in == NULL))
in = i;
else
delete i;
}
remove_sub_sup();
push_para(P_TAG, (void *)arg, in);
- space_emitted = TRUE;
+ start_space = space;
}
}
-void html_text::do_para (const char *arg)
+void html_text::do_para (const char *arg, int space)
{
- do_para(arg, NULL);
+ do_para(arg, NULL, space);
}
void html_text::do_para (simple_output *op, const char *arg1,
- int indentation, int pageoffset, int linelength)
+ int indentation_value, int page_offset,
+ int line_length, int space)
{
- html_indent *indent;
+ html_indent *ind;
- if (indentation == 0)
- indent = NULL;
+ if (indentation_value == 0)
+ ind = NULL;
else
- indent = new html_indent(op, indentation, pageoffset, linelength);
- do_para(arg1, indent);
+ ind = new html_indent(op, indentation_value, page_offset, line_length);
+ do_para(arg1, ind, space);
}
/*
@@ -671,8 +711,11 @@ void html_text::do_para (simple_output *op, const char *arg1,
char *html_text::done_para (void)
{
+ char *result;
space_emitted = TRUE;
- return shutdown(P_TAG);
+ result = shutdown(P_TAG);
+ start_space = FALSE;
+ return result;
}
/*
@@ -696,25 +739,30 @@ html_indent *html_text::remove_indent (HTML_TAG tag)
}
/*
+ * remove_para_space - removes the leading space to a paragraph
+ * (effectively this trims off a leading `.sp' tag).
+ */
+
+void html_text::remove_para_space (void)
+{
+ start_space = FALSE;
+}
+
+/*
* do_space - issues an end of paragraph
*/
void html_text::do_space (void)
{
if (is_in_pre()) {
- if (blank_para)
- start_space = TRUE;
- else {
- do_emittext("", 0);
- out->nl();
- space_emitted = TRUE;
- }
+ do_emittext("", 0);
+ out->force_nl();
+ space_emitted = TRUE;
} else {
html_indent *i = remove_indent(P_TAG);
- do_para(done_para(), i);
+ do_para(done_para(), i, TRUE);
space_emitted = TRUE;
- start_space = TRUE;
}
}
@@ -724,13 +772,11 @@ void html_text::do_space (void)
void html_text::do_break (void)
{
- if (! is_present(PRE_TAG)) {
- if (emitted_text()) {
- if (! is_present(BREAK_TAG)) {
+ if (! is_present(PRE_TAG))
+ if (emitted_text())
+ if (! is_present(BREAK_TAG))
push_para(BREAK_TAG);
- }
- }
- }
+
space_emitted = TRUE;
}
@@ -756,7 +802,8 @@ int html_text::emitted_text (void)
}
/*
- * ever_emitted_text - returns TRUE if we have ever emitted text in this paragraph.
+ * ever_emitted_text - returns TRUE if we have ever emitted text in this
+ * paragraph.
*/
int html_text::ever_emitted_text (void)
@@ -765,7 +812,7 @@ int html_text::ever_emitted_text (void)
}
/*
- * starts_with_space - returns TRUE if we have start this paragraph with a .sp
+ * starts_with_space - returns TRUE if we started this paragraph with a .sp
*/
int html_text::starts_with_space (void)
@@ -774,19 +821,34 @@ int html_text::starts_with_space (void)
}
/*
+ * retrieve_para_space - returns TRUE, if the paragraph starts with
+ * a space and text has not yet been emitted.
+ * If TRUE is returned, then the, start_space,
+ * variable is set to FALSE.
+ */
+
+int html_text::retrieve_para_space (void)
+{
+ if (start_space && blank_para) {
+ start_space = FALSE;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/*
* emit_space - writes a space providing that text was written beforehand.
*/
void html_text::emit_space (void)
{
- if (space_emitted) {
- if (is_present(PRE_TAG)) {
- do_emittext(" ", 1);
- }
- } else {
+ if (is_present(PRE_TAG))
+ do_emittext(" ", 1);
+ else
out->space_or_newline();
- space_emitted = TRUE;
- }
+
+ space_emitted = TRUE;
}
/*
@@ -817,7 +879,7 @@ void html_text::remove_def (tag_definition *t)
if (l->next == NULL)
lastptr = l;
}
- free(p);
+ delete p;
}
}
@@ -837,7 +899,8 @@ void html_text::remove_tag (HTML_TAG tag)
}
/*
- * remove_sub_sup - removes a sub or sup tag, should either exist on the stack.
+ * remove_sub_sup - removes a sub or sup tag, should either exist
+ * on the stack.
*/
void html_text::remove_sub_sup (void)
@@ -882,7 +945,7 @@ int html_text::remove_break (void)
if (l->next == NULL)
lastptr = l;
}
- free(p);
+ delete p;
}
/*
* now determine whether text was issued before <br>
@@ -910,8 +973,9 @@ void html_text::remove_para_align (void)
while (p != NULL) {
if (p->type == P_TAG && p->arg1 != NULL) {
html_indent *i = remove_indent(P_TAG);
+ int space = retrieve_para_space();
done_para();
- do_para("", i);
+ do_para("", i, space);
return;
}
p = p->next;
@@ -920,6 +984,25 @@ void html_text::remove_para_align (void)
}
/*
+ * get_alignment - returns the alignment for the paragraph.
+ * If no alignment was given then we return "".
+ */
+
+char *html_text::get_alignment (void)
+{
+ if (is_present(P_TAG)) {
+ tag_definition *p=stackptr;
+
+ while (p != NULL) {
+ if (p->type == P_TAG && p->arg1 != NULL)
+ return (char *)p->arg1;
+ p = p->next;
+ }
+ }
+ return (char *)"";
+}
+
+/*
* do_small - potentially inserts a <small> tag into the html stream.
* However we check for a <big> tag, if present then we terminate it.
* Otherwise a <small> tag is inserted.
@@ -962,4 +1045,3 @@ void html_text::do_sub (void)
{
push_para(SUB_TAG);
}
-
diff --git a/contrib/groff/src/devices/grohtml/html-text.h b/contrib/groff/src/devices/grohtml/html-text.h
index aa4dd80..e0e3cc7 100644
--- a/contrib/groff/src/devices/grohtml/html-text.h
+++ b/contrib/groff/src/devices/grohtml/html-text.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ * Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote html-text.h
*
@@ -23,11 +24,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "html.h"
#include "html-table.h"
+#define STYLE_VERTICAL_SPACE "1em"
+
/*
* html tags
*/
@@ -64,9 +67,10 @@ public:
void do_pre (void);
void do_small (void);
void do_big (void);
- void do_para (const char *arg); // used for no indentation
+ void do_para (const char *arg, int space); // used for no indentation
void do_para (simple_output *op, const char *arg1,
- int indentation, int pageoffset, int linelength);
+ int indentation, int pageoffset, int linelength,
+ int space);
void do_sup (void);
void do_sub (void);
void do_space (void);
@@ -87,11 +91,15 @@ public:
int emitted_text (void);
int ever_emitted_text (void);
int starts_with_space (void);
+ int retrieve_para_space (void);
void emit_space (void);
int is_in_pre (void);
+ int uses_indent (void);
void remove_tag (HTML_TAG tag);
void remove_sub_sup (void);
void remove_para_align (void);
+ void remove_para_space (void);
+ char *get_alignment (void);
private:
tag_definition *stackptr; /* the current paragraph state */
@@ -108,7 +116,7 @@ private:
int is_present (HTML_TAG t);
void end_tag (tag_definition *t);
void start_tag (tag_definition *t);
- void do_para (const char *arg, html_indent *in);
+ void do_para (const char *arg, html_indent *in, int space);
void push_para (HTML_TAG t);
void push_para (HTML_TAG t, void *arg, html_indent *in);
void push_para (color *c);
@@ -116,7 +124,7 @@ private:
char *shutdown (HTML_TAG t);
void check_emit_text (tag_definition *t);
int remove_break (void);
- void issue_tag (const char *tagname, const char *arg);
+ void issue_tag (const char *tagname, const char *arg, int space=2);
void issue_color_begin (color *c);
void remove_def (tag_definition *t);
html_indent *remove_indent (HTML_TAG tag);
diff --git a/contrib/groff/src/devices/grohtml/html.h b/contrib/groff/src/devices/grohtml/html.h
index 431647c..b14fb2c 100644
--- a/contrib/groff/src/devices/grohtml/html.h
+++ b/contrib/groff/src/devices/grohtml/html.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#if !defined(HTML_H)
# define HTML_H
@@ -72,6 +72,7 @@ public:
simple_output &enable_newlines(int);
simple_output &check_newline(int n);
simple_output &nl(void);
+ simple_output &force_nl(void);
simple_output &space_or_newline (void);
simple_output &begin_tag (void);
FILE *get_file();
diff --git a/contrib/groff/src/devices/grohtml/output.cpp b/contrib/groff/src/devices/grohtml/output.cpp
index 2705b9e..f253127 100644
--- a/contrib/groff/src/devices/grohtml/output.cpp
+++ b/contrib/groff/src/devices/grohtml/output.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote output.cpp
* but it owes a huge amount of ideas and raw code from
@@ -25,7 +25,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "stringclass.h"
@@ -67,7 +67,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
word::word (const char *w, int n)
: next(0)
{
- s = (char *)malloc(n+1);
+ s = new char[n+1];
strncpy(s, w, n);
s[n] = (char)0;
}
@@ -78,7 +78,7 @@ word::word (const char *w, int n)
word::~word ()
{
- free(s);
+ a_delete s;
}
/*
@@ -253,6 +253,19 @@ simple_output &simple_output::space_or_newline (void)
}
/*
+ * force_nl - forces a newline.
+ */
+
+simple_output &simple_output::force_nl (void)
+{
+ space_or_newline();
+ col += last_word.flush(fp);
+ FPUTC('\n', fp);
+ col = 0;
+ return *this ;
+}
+
+/*
* nl - writes a newline providing that we
* are not in the first column.
*/
@@ -261,10 +274,8 @@ simple_output &simple_output::nl (void)
{
space_or_newline();
col += last_word.flush(fp);
- if (col != 0) {
- FPUTC('\n', fp);
- col = 0;
- }
+ FPUTC('\n', fp);
+ col = 0;
return *this ;
}
diff --git a/contrib/groff/src/devices/grohtml/post-html.cpp b/contrib/groff/src/devices/grohtml/post-html.cpp
index 7c96deb..1283e06 100644
--- a/contrib/groff/src/devices/grohtml/post-html.cpp
+++ b/contrib/groff/src/devices/grohtml/post-html.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ * Free Software Foundation, Inc.
*
* Gaius Mulley (gaius@glam.ac.uk) wrote post-html.cpp
* but it owes a huge amount of ideas and raw code from
@@ -21,7 +22,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "stringclass.h"
@@ -38,6 +39,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <fcntl.h>
+#include <string.h>
extern "C" const char *Version_string;
@@ -50,8 +52,7 @@ extern "C" const char *Version_string;
#define MAX_LINE_LENGTH 60 /* maximum characters we want in a line */
#define SIZE_INCREMENT 2 /* font size increment <big> = +2 */
-#define BASE_POINT_SIZE 10 /* 10 points is the base size ie html size 3 */
-#define CENTER_TOLERANCE 2 /* how many pixels off center will we still */
+#define CENTER_TOLERANCE 2 /* how many pixels off center do we allow */
#define ANCHOR_TEMPLATE "heading" /* if simple anchor is set we use this */
#define UNICODE_DESC_START 0x80 /* all character entities above this are */
/* either encoded by their glyph names or if */
@@ -60,7 +61,7 @@ typedef enum {CENTERED, LEFT, RIGHT, INLINE} TAG_ALIGNMENT;
typedef enum {col_tag, tab_tag, tab0_tag, none} colType;
#undef DEBUG_TABLES
-
+// #define DEBUG_TABLES
/*
* prototypes
@@ -78,6 +79,16 @@ static int simple_anchors = FALSE; /* default to anchors with
static int manufacture_headings = FALSE; /* default is to use the Hn html headings, */
/* rather than manufacture our own. */
static color *default_background = NULL; /* has user requested initial bg color? */
+static string job_name; /* if set then the output is split into */
+ /* multiple files with `job_name'-%d.html */
+static int multiple_files = FALSE; /* must we the output be divided into */
+ /* multiple html files, one for each */
+ /* heading? */
+static int base_point_size = 0; /* which troff font size maps onto html */
+ /* size 3? */
+static int split_level = 2; /* what heading level to split at? */
+static string head_info; /* user supplied information to be placed */
+ /* into <head> </head> */
/*
@@ -109,7 +120,7 @@ static int max (int a, int b)
static int is_intersection (int a1, int a2, int b1, int b2)
{
// easier to prove NOT outside limits
- return( ! ((a1 > b2) || (a2 < b1)) );
+ return ! ((a1 > b2) || (a2 < b1));
}
/*
@@ -118,7 +129,7 @@ static int is_intersection (int a1, int a2, int b1, int b2)
static int is_digit (char ch)
{
- return( (ch >= '0') && (ch <= '9') );
+ return (ch >= '0') && (ch <= '9');
}
/*
@@ -128,6 +139,9 @@ static int is_digit (char ch)
struct file {
FILE *fp;
file *next;
+ int new_output_file;
+ int require_links;
+ string output_file_name;
file (FILE *f);
};
@@ -137,21 +151,28 @@ struct file {
*/
file::file (FILE *f)
- : fp(f), next(0)
+ : fp(f), next(NULL), new_output_file(FALSE),
+ require_links(FALSE), output_file_name("")
{
}
class files {
public:
- files ();
- FILE *get_file (void);
- void start_of_list (void);
- void move_next (void);
- void add_new_file (FILE *f);
+ files ();
+ FILE *get_file (void);
+ void start_of_list (void);
+ void move_next (void);
+ void add_new_file (FILE *f);
+ void set_file_name (string name);
+ void set_links_required (void);
+ int are_links_required (void);
+ int is_new_output_file (void);
+ string file_name (void);
+ string next_file_name (void);
private:
- file *head;
- file *tail;
- file *ptr;
+ file *head;
+ file *tail;
+ file *ptr;
};
/*
@@ -159,7 +180,7 @@ private:
*/
files::files ()
- : head(0), tail(0), ptr(0)
+ : head(NULL), tail(NULL), ptr(NULL)
{
}
@@ -169,11 +190,10 @@ files::files ()
FILE *files::get_file (void)
{
- if (ptr) {
- return( ptr->fp );
- } else {
- return( 0 );
- }
+ if (ptr)
+ return ptr->fp;
+ else
+ return NULL;
}
/*
@@ -191,7 +211,7 @@ void files::start_of_list (void)
void files::move_next (void)
{
- if (ptr != 0)
+ if (ptr != NULL)
ptr = ptr->next;
}
@@ -201,7 +221,7 @@ void files::move_next (void)
void files::add_new_file (FILE *f)
{
- if (head == 0) {
+ if (head == NULL) {
head = new file(f);
tail = head;
} else {
@@ -212,6 +232,76 @@ void files::add_new_file (FILE *f)
}
/*
+ * set_file_name - sets the final file name to contain the html
+ * data to name.
+ */
+
+void files::set_file_name (string name)
+{
+ if (ptr != NULL) {
+ ptr->output_file_name = name;
+ ptr->new_output_file = TRUE;
+ }
+}
+
+/*
+ * set_links_required - issue links when processing this component
+ * of the file.
+ */
+
+void files::set_links_required (void)
+{
+ if (ptr != NULL)
+ ptr->require_links = TRUE;
+}
+
+/*
+ * are_links_required - returns TRUE if this section of the file
+ * requires that links should be issued.
+ */
+
+int files::are_links_required (void)
+{
+ if (ptr != NULL)
+ return ptr->require_links;
+ return FALSE;
+}
+
+/*
+ * is_new_output_file - returns TRUE if this component of the file
+ * is the start of a new output file.
+ */
+
+int files::is_new_output_file (void)
+{
+ if (ptr != NULL)
+ return ptr->new_output_file;
+ return FALSE;
+}
+
+/*
+ * file_name - returns the name of the file.
+ */
+
+string files::file_name (void)
+{
+ if (ptr != NULL)
+ return ptr->output_file_name;
+ return string("");
+}
+
+/*
+ * next_file_name - returns the name of the next file.
+ */
+
+string files::next_file_name (void)
+{
+ if (ptr != NULL && ptr->next != NULL)
+ return ptr->next->output_file_name;
+ return string("");
+}
+
+/*
* the class and methods for styles
*/
@@ -229,7 +319,7 @@ struct style {
};
style::style()
- : f(0)
+ : f(NULL)
{
}
@@ -265,14 +355,14 @@ struct char_block {
};
char_block::char_block()
-: buffer(NULL), used(0), next(0)
+: buffer(NULL), used(0), next(NULL)
{
}
char_block::char_block(int length)
-: used(0), next(0)
+: used(0), next(NULL)
{
- buffer = (char *)malloc(max(length, char_block::SIZE));
+ buffer = new char[max(length, char_block::SIZE)];
if (buffer == NULL)
fatal("out of memory error");
}
@@ -280,7 +370,7 @@ char_block::char_block(int length)
char_block::~char_block()
{
if (buffer != NULL)
- free(buffer);
+ a_delete buffer;
}
class char_buffer {
@@ -295,13 +385,13 @@ private:
};
char_buffer::char_buffer()
-: head(0), tail(0)
+: head(NULL), tail(NULL)
{
}
char_buffer::~char_buffer()
{
- while (head != 0) {
+ while (head != NULL) {
char_block *temp = head;
head = head->next;
delete temp;
@@ -316,7 +406,7 @@ char *char_buffer::add_string (const char *s, unsigned int length)
if (s == NULL || length == 0)
return NULL;
- if (tail == 0) {
+ if (tail == NULL) {
tail = new char_block(length+1);
head = tail;
} else {
@@ -341,7 +431,7 @@ char *char_buffer::add_string (const char *s, unsigned int length)
// and return start of new string
- return( &tail->buffer[old_used] );
+ return &tail->buffer[old_used];
}
char *char_buffer::add_string (const string &s)
@@ -382,7 +472,10 @@ public:
int is_in (void);
int is_po (void);
int is_ti (void);
+ int is_ll (void);
int is_ce (void);
+ int is_tl (void);
+ int is_eo_tl (void);
int is_eol_ce (void);
int is_col (void);
int is_tab (void);
@@ -392,6 +485,7 @@ public:
int is_tab_te (void);
int is_nf (void);
int is_fi (void);
+ int is_eo_h (void);
int get_arg (void);
int get_tab_args (char *align);
@@ -423,16 +517,16 @@ text_glob::text_glob (style *s, const char *str, int length,
int max_vertical, int max_horizontal,
bool is_troff_command,
bool is_auto_image, bool is_special_command,
- bool is_a_line, int line_thickness)
+ bool is_a_line_flag, int line_thickness)
: text_style(*s), text_string(str), text_length(length),
minv(min_vertical), minh(min_horizontal), maxv(max_vertical), maxh(max_horizontal),
is_tag(is_troff_command), is_img_auto(is_auto_image), is_special(is_special_command),
- is_line(is_a_line), thickness(line_thickness), tab(NULL)
+ is_line(is_a_line_flag), thickness(line_thickness), tab(NULL)
{
}
text_glob::text_glob ()
- : text_string(0), text_length(0), minv(-1), minh(-1), maxv(-1), maxh(-1),
+ : text_string(NULL), text_length(0), minv(-1), minh(-1), maxv(-1), maxh(-1),
is_tag(FALSE), is_special(FALSE), is_line(FALSE), thickness(0), tab(NULL)
{
}
@@ -483,11 +577,11 @@ void text_glob::text_glob_special (style *s, char *str, int length,
void text_glob::text_glob_line (style *s,
int min_vertical , int min_horizontal,
int max_vertical , int max_horizontal,
- int thickness)
+ int thickness_value)
{
text_glob *g = new text_glob(s, "", 0,
min_vertical, min_horizontal, max_vertical, max_horizontal,
- FALSE, FALSE, FALSE, TRUE, thickness);
+ FALSE, FALSE, FALSE, TRUE, thickness_value);
*this = *g;
delete g;
}
@@ -565,7 +659,7 @@ int text_glob::is_a_tag (void)
int text_glob::is_eol (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:eol") == 0) );
+ return is_tag && (strcmp(text_string, "devtag:.eol") == 0);
}
/*
@@ -574,26 +668,56 @@ int text_glob::is_eol (void)
int text_glob::is_eol_ce (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:eol.ce") == 0) );
+ return is_tag && (strcmp(text_string, "devtag:eol.ce") == 0);
}
+/*
+ * is_tl - returns TRUE if glob contains the tag .tl
+ */
+
+int text_glob::is_tl (void)
+{
+ return is_tag && (strcmp(text_string, "devtag:.tl") == 0);
+}
/*
- * is_nf - returns TRUE if glob contains the tag .nf
+ * is_eo_tl - returns TRUE if glob contains the tag eo.tl
+ */
+
+int text_glob::is_eo_tl (void)
+{
+ return is_tag && (strcmp(text_string, "devtag:.eo.tl") == 0);
+}
+
+/*
+ * is_nf - returns TRUE if glob contains the tag .fi 0
*/
int text_glob::is_nf (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:.nf") == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.fi",
+ strlen("devtag:.fi")) == 0) &&
+ (get_arg() == 0);
}
/*
- * is_fi - returns TRUE if glob contains the tag .fi
+ * is_fi - returns TRUE if glob contains the tag .fi 1
*/
int text_glob::is_fi (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:.fi") == 0) );
+ return( is_tag && (strncmp(text_string, "devtag:.fi",
+ strlen("devtag:.fi")) == 0) &&
+ (get_arg() == 1) );
+}
+
+/*
+ * is_eo_h - returns TRUE if glob contains the tag .eo.h
+ */
+
+int text_glob::is_eo_h (void)
+{
+ return is_tag && (strcmp(text_string, "devtag:.eo.h") == 0);
}
/*
@@ -602,7 +726,8 @@ int text_glob::is_fi (void)
int text_glob::is_ce (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:.ce") == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.ce",
+ strlen("devtag:.ce")) == 0);
}
/*
@@ -611,7 +736,8 @@ int text_glob::is_ce (void)
int text_glob::is_in (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.in ", strlen("html-tag:.in ")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.in ",
+ strlen("devtag:.in ")) == 0);
}
/*
@@ -620,7 +746,8 @@ int text_glob::is_in (void)
int text_glob::is_po (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.po ", strlen("html-tag:.po ")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.po ",
+ strlen("devtag:.po ")) == 0);
}
/*
@@ -629,7 +756,18 @@ int text_glob::is_po (void)
int text_glob::is_ti (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.ti ", strlen("html-tag:.ti ")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.ti ",
+ strlen("devtag:.ti ")) == 0);
+}
+
+/*
+ * is_ll - returns TRUE if glob contains the tag .ll
+ */
+
+int text_glob::is_ll (void)
+{
+ return is_tag && (strncmp(text_string, "devtag:.ll ",
+ strlen("devtag:.ll ")) == 0);
}
/*
@@ -638,7 +776,8 @@ int text_glob::is_ti (void)
int text_glob::is_col (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.col", strlen("html-tag:.col")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.col",
+ strlen("devtag:.col")) == 0);
}
/*
@@ -647,7 +786,7 @@ int text_glob::is_col (void)
int text_glob::is_tab_ts (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:.tab-ts") == 0) );
+ return is_tag && (strcmp(text_string, "devtag:.tab-ts") == 0);
}
/*
@@ -656,7 +795,7 @@ int text_glob::is_tab_ts (void)
int text_glob::is_tab_te (void)
{
- return( is_tag && (strcmp(text_string, "html-tag:.tab-te") == 0) );
+ return is_tag && (strcmp(text_string, "devtag:.tab-te") == 0);
}
/*
@@ -665,7 +804,8 @@ int text_glob::is_tab_te (void)
int text_glob::is_ta (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:.ta ", strlen("html-tag:.ta ")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:.ta ",
+ strlen("devtag:.ta ")) == 0);
}
/*
@@ -674,7 +814,8 @@ int text_glob::is_ta (void)
int text_glob::is_tab (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:tab ", strlen("html-tag:tab ")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:tab ",
+ strlen("devtag:tab ")) == 0);
}
/*
@@ -683,7 +824,8 @@ int text_glob::is_tab (void)
int text_glob::is_tab0 (void)
{
- return( is_tag && (strncmp(text_string, "html-tag:tab0", strlen("html-tag:tab0")) == 0) );
+ return is_tag && (strncmp(text_string, "devtag:tab0",
+ strlen("devtag:tab0")) == 0);
}
/*
@@ -705,14 +847,14 @@ int text_glob::is_auto_img (void)
int text_glob::is_br (void)
{
- return( is_a_tag() && ((strcmp ("html-tag:.br", text_string) == 0) ||
- (strncmp("html-tag:.sp", text_string, 11) == 0) ||
- (strcmp ("html-tag:.ce", text_string) == 0)) );
+ return is_a_tag() && ((strcmp ("devtag:.br", text_string) == 0) ||
+ (strncmp("devtag:.sp", text_string,
+ strlen("devtag:.sp")) == 0));
}
int text_glob::get_arg (void)
{
- if (strncmp("html-tag:", text_string, strlen("html-tag:")) == 0) {
+ if (strncmp("devtag:", text_string, strlen("devtag:")) == 0) {
const char *p = text_string;
while ((*p != (char)0) && (!isspace(*p)))
@@ -732,7 +874,7 @@ int text_glob::get_arg (void)
int text_glob::get_tab_args (char *align)
{
- if (strncmp("html-tag:", text_string, strlen("html-tag:")) == 0) {
+ if (strncmp("devtag:", text_string, strlen("devtag:")) == 0) {
const char *p = text_string;
// firstly the alignment C|R|L
@@ -774,10 +916,11 @@ html_table *text_glob::get_table (void)
}
/*
- * the class and methods used to construct ordered double linked lists.
- * In a previous implementation we used templates via #include "ordered-list.h",
- * but this does assume that all C++ compilers can handle this feature. Pragmatically
- * it is safer to assume this is not the case.
+ * the class and methods used to construct ordered double linked
+ * lists. In a previous implementation we used templates via
+ * #include "ordered-list.h", but this does assume that all C++
+ * compilers can handle this feature. Pragmatically it is safer to
+ * assume this is not the case.
*/
struct element_list {
@@ -893,7 +1036,8 @@ int list::is_less (element_list *a, element_list *b)
}
/*
- * add - adds a datum to the list in the order specified by the region position.
+ * add - adds a datum to the list in the order specified by the
+ * region position.
*/
void list::add (text_glob *in, int line_number, int min_vertical, int min_horizontal, int max_vertical, int max_horizontal)
@@ -902,7 +1046,13 @@ void list::add (text_glob *in, int line_number, int min_vertical, int min_horizo
element_list *t = new element_list(in, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
element_list *last;
- if (head == 0) {
+#if 0
+ fprintf(stderr, "[%s %d,%d,%d,%d] ",
+ in->text_string, min_vertical, min_horizontal, max_vertical, max_horizontal);
+ fflush(stderr);
+#endif
+
+ if (head == NULL) {
head = t;
tail = t;
ptr = t;
@@ -911,9 +1061,8 @@ void list::add (text_glob *in, int line_number, int min_vertical, int min_horizo
} else {
last = tail;
- while ((last != head) && (is_less(t, last))) {
+ while ((last != head) && (is_less(t, last)))
last = last->left;
- }
if (is_less(t, last)) {
t->right = last;
@@ -921,9 +1070,8 @@ void list::add (text_glob *in, int line_number, int min_vertical, int min_horizo
t->left = last->left;
last->left = t;
// now check for a new head
- if (last == head) {
+ if (last == head)
head = t;
- }
} else {
// add t beyond last
t->right = last->right;
@@ -931,9 +1079,8 @@ void list::add (text_glob *in, int line_number, int min_vertical, int min_horizo
last->right->left = t;
last->right = t;
// now check for a new tail
- if (last == tail) {
+ if (last == tail)
tail = t;
- }
}
}
}
@@ -948,22 +1095,20 @@ void list::sub_move_right (void)
element_list *t=ptr->right;
if (head == tail) {
- head = 0;
- if (tail != 0) {
+ head = NULL;
+ if (tail != NULL)
delete tail;
- }
- tail = 0;
- ptr = 0;
+
+ tail = NULL;
+ ptr = NULL;
} else {
- if (head == ptr) {
+ if (head == ptr)
head = head->right;
- }
- if (tail == ptr) {
+ if (tail == ptr)
tail = tail->left;
- }
ptr->left->right = ptr->right;
ptr->right->left = ptr->left;
- ptr=t;
+ ptr = t;
}
}
@@ -991,7 +1136,7 @@ void list::start_from_tail (void)
int list::is_empty (void)
{
- return( head == 0 );
+ return head == NULL;
}
/*
@@ -1000,7 +1145,7 @@ int list::is_empty (void)
int list::is_equal_to_tail (void)
{
- return( ptr == tail );
+ return ptr == tail;
}
/*
@@ -1009,7 +1154,7 @@ int list::is_equal_to_tail (void)
int list::is_equal_to_head (void)
{
- return( ptr == head );
+ return ptr == head;
}
/*
@@ -1036,7 +1181,7 @@ void list::move_right (void)
text_glob* list::get_data (void)
{
- return( ptr->datum );
+ return ptr->datum;
}
/*
@@ -1047,11 +1192,10 @@ text_glob* list::get_data (void)
text_glob* list::move_right_get_data (void)
{
ptr = ptr->right;
- if (ptr == head) {
- return( 0 );
- } else {
- return( ptr->datum );
- }
+ if (ptr == head)
+ return NULL;
+ else
+ return ptr->datum;
}
/*
@@ -1062,11 +1206,10 @@ text_glob* list::move_right_get_data (void)
text_glob* list::move_left_get_data (void)
{
ptr = ptr->left;
- if (ptr == tail) {
- return( 0 );
- } else {
- return( ptr->datum );
- }
+ if (ptr == tail)
+ return NULL;
+ else
+ return ptr->datum;
}
/*
@@ -1078,7 +1221,7 @@ void list::insert (text_glob *in)
if (is_empty())
fatal("list must not be empty if we are inserting data");
else {
- if (ptr == 0)
+ if (ptr == NULL)
ptr = head;
element_list *t = new element_list(in, ptr->lineno, ptr->minv, ptr->minh, ptr->maxv, ptr->maxh);
@@ -1121,7 +1264,8 @@ public:
void add_and_encode (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
- int max_vertical, int max_horizontal);
+ int max_vertical, int max_horizontal,
+ int is_tag);
void add_line (style *s,
int line_number,
int x1, int y1, int x2, int y2,
@@ -1183,7 +1327,8 @@ void page::add_tag (style *s, const string &str,
if (str.length() > 0) {
text_glob *g;
- if (strncmp((str+'\0').contents(), "html-tag:.auto-image", 20) == 0) {
+ if (strncmp((str+'\0').contents(), "devtag:.auto-image",
+ strlen("devtag:.auto-image")) == 0) {
g = new text_glob();
g->text_glob_auto_image(s, buffer.add_string(str), str.length(),
min_vertical, min_horizontal, max_vertical, max_horizontal);
@@ -1202,15 +1347,18 @@ void page::add_tag (style *s, const string &str,
void page::add_line (style *s,
int line_number,
- int x1, int y1, int x2, int y2,
+ int x_1, int y_1, int x_2, int y_2,
int thickness)
{
- if (y1 == y2) {
+ if (y_1 == y_2) {
text_glob *g = new text_glob();
g->text_glob_line(s,
- min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2),
+ min(y_1, y_2), min(x_1, x_2),
+ max(y_1, y_2), max(x_1, x_2),
thickness);
- glyphs.add(g, line_number, min(y1, y2), min(x1, y2), max(y1, y2), max(x1, x2));
+ glyphs.add(g, line_number,
+ min(y_1, y_2), min(x_1, x_2),
+ max(y_1, y_2), max(x_1, x_2));
}
}
@@ -1240,7 +1388,8 @@ static char *to_unicode (unsigned int ch)
void page::add_and_encode (style *s, const string &str,
int line_number,
int min_vertical, int min_horizontal,
- int max_vertical, int max_horizontal)
+ int max_vertical, int max_horizontal,
+ int is_tag)
{
string html_string;
char *html_glyph;
@@ -1267,10 +1416,10 @@ void page::add_and_encode (style *s, const string &str,
if (html_glyph)
html_string += html_glyph;
else {
- int index=s->f->name_to_index((troff_charname + '\0').contents());
+ int idx=s->f->name_to_index((troff_charname + '\0').contents());
- if (s->f->contains(index) && (index != 0))
- html_string += s->f->get_code(index);
+ if (s->f->contains(idx) && (idx != 0))
+ html_string += s->f->get_code(idx);
}
}
} else
@@ -1279,9 +1428,18 @@ void page::add_and_encode (style *s, const string &str,
}
if (html_string.length() > 0) {
text_glob *g=new text_glob();
- g->text_glob_special(s, buffer.add_string(html_string), html_string.length(),
- min_vertical, min_horizontal, max_vertical, max_horizontal);
- glyphs.add(g, line_number, min_vertical, min_horizontal, max_vertical, max_horizontal);
+ if (is_tag)
+ g->text_glob_tag(s, buffer.add_string(html_string),
+ html_string.length(),
+ min_vertical, min_horizontal,
+ max_vertical, max_horizontal);
+ else
+ g->text_glob_special(s, buffer.add_string(html_string),
+ html_string.length(),
+ min_vertical, min_horizontal,
+ max_vertical, max_horizontal);
+ glyphs.add(g, line_number, min_vertical,
+ min_horizontal, max_vertical, max_horizontal);
}
}
@@ -1380,18 +1538,21 @@ public:
header_desc ();
~header_desc ();
- int no_of_headings; // how many headings have we found?
- char_buffer headings; // all the headings used in the document
- list headers; // list of headers built from .NH and .SH
- int header_level; // current header level
- int written_header; // have we written the header yet?
- string header_buffer; // current header text
+ int no_of_level_one_headings; // how many .SH or .NH 1 have we found?
+ int no_of_headings; // how many headings have we found?
+ char_buffer headings; // all the headings used in the document
+ list headers; // list of headers built from .NH and .SH
+ list header_filename; // in which file is this header?
+ int header_level; // current header level
+ int written_header; // have we written the header yet?
+ string header_buffer; // current header text
void write_headings (FILE *f, int force);
};
header_desc::header_desc ()
- : no_of_headings(0), header_level(2), written_header(0)
+ : no_of_level_one_headings(0), no_of_headings(0),
+ header_level(2), written_header(0)
{
}
@@ -1412,9 +1573,15 @@ void header_desc::write_headings (FILE *f, int force)
int h=1;
headers.start_from_head();
+ header_filename.start_from_head();
do {
g = headers.get_data();
- fputs("<a href=\"#", f);
+ fputs("<a href=\"", f);
+ if (multiple_files && (! header_filename.is_empty())) {
+ text_glob *fn = header_filename.get_data();
+ fputs(fn->text_string, f);
+ }
+ fputs("#", f);
if (simple_anchors) {
string buffer(ANCHOR_TEMPLATE);
@@ -1428,12 +1595,345 @@ void header_desc::write_headings (FILE *f, int force)
fputs(g->text_string, f);
fputs("</a><br>\n", f);
headers.move_right();
+ if (multiple_files && (! header_filename.is_empty()))
+ header_filename.move_right();
} while (! headers.is_equal_to_head());
fputs("\n", f);
}
}
}
+struct assert_pos {
+ assert_pos *next;
+ const char *val;
+ const char *id;
+};
+
+class assert_state {
+public:
+ assert_state ();
+ ~assert_state ();
+
+ void addx (const char *c, const char *i, const char *v,
+ const char *f, const char *l);
+ void addy (const char *c, const char *i, const char *v,
+ const char *f, const char *l);
+ void build(const char *c, const char *v,
+ const char *f, const char *l);
+ void check_br (int br);
+ void check_ce (int ce);
+ void check_fi (int fi);
+ void check_sp (int sp);
+ void reset (void);
+
+private:
+ int check_br_flag;
+ int check_ce_flag;
+ int check_fi_flag;
+ int check_sp_flag;
+ const char *val_br;
+ const char *val_ce;
+ const char *val_fi;
+ const char *val_sp;
+ const char *file_br;
+ const char *file_ce;
+ const char *file_fi;
+ const char *file_sp;
+ const char *line_br;
+ const char *line_ce;
+ const char *line_fi;
+ const char *line_sp;
+
+ assert_pos *xhead;
+ assert_pos *yhead;
+
+ void add (assert_pos **h,
+ const char *c, const char *i, const char *v,
+ const char *f, const char *l);
+ void compare(assert_pos *t,
+ const char *v, const char *f, const char *l);
+ void close (const char *c);
+ void set (const char *c, const char *v,
+ const char *f, const char *l);
+ void check_value (const char *s, int v, const char *name,
+ const char *f, const char *l, int *flag);
+ int check_value_error (int c, int v, const char *s,
+ const char *name,
+ const char *f, const char *l, int flag);
+};
+
+assert_state::assert_state ()
+{
+ reset();
+ val_br = NULL;
+ val_ce = NULL;
+ val_fi = NULL;
+ val_sp = NULL;
+ file_br = NULL;
+ file_ce = NULL;
+ file_fi = NULL;
+ file_sp = NULL;
+ line_br = NULL;
+ line_ce = NULL;
+ line_fi = NULL;
+ line_sp = NULL;
+ xhead = NULL;
+ yhead = NULL;
+}
+
+assert_state::~assert_state ()
+{
+ assert_pos *t;
+
+ while (xhead != NULL) {
+ t = xhead;
+ xhead = xhead->next;
+ a_delete (char *)t->val;
+ a_delete (char *)t->id;
+ delete t;
+ }
+ while (yhead != NULL) {
+ t = yhead;
+ yhead = yhead->next;
+ a_delete (char *)t->val;
+ a_delete (char *)t->id;
+ delete t;
+ }
+}
+
+void assert_state::reset (void)
+{
+ check_br_flag = 0;
+ check_ce_flag = 0;
+ check_fi_flag = 0;
+ check_sp_flag = 0;
+}
+
+void assert_state::add (assert_pos **h,
+ const char *c, const char *i, const char *v,
+ const char *f, const char *l)
+{
+ assert_pos *t = *h;
+
+ while (t != NULL) {
+ if (strcmp(t->id, i) == 0)
+ break;
+ t = t->next;
+ }
+ if (t != NULL && v != NULL && (v[0] != '='))
+ compare(t, v, f, l);
+ else {
+ if (t == NULL) {
+ t = new assert_pos;
+ t->next = *h;
+ (*h) = t;
+ }
+ if (v == NULL || v[0] != '=') {
+ if (f == NULL)
+ f = "stdin";
+ if (l == NULL)
+ l = "<none>";
+ if (v == NULL)
+ v = "no value at all";
+ fprintf(stderr, "%s:%s:error in assert format of id=%s expecting value to be prefixed with an `=' got %s\n",
+ f, l, i, v);
+ }
+ t->id = i;
+ t->val = v;
+ a_delete (char *)c;
+ a_delete (char *)f;
+ a_delete (char *)l;
+ }
+}
+
+void assert_state::addx (const char *c, const char *i, const char *v,
+ const char *f, const char *l)
+{
+ add(&xhead, c, i, v, f, l);
+}
+
+void assert_state::addy (const char *c, const char *i, const char *v,
+ const char *f, const char *l)
+{
+ add(&yhead, c, i, v, f, l);
+}
+
+void assert_state::compare(assert_pos *t,
+ const char *v, const char *f, const char *l)
+{
+ const char *s=t->val;
+
+ while ((*v) == '=')
+ v++;
+ while ((*s) == '=')
+ s++;
+
+ if (strcmp(v, s) != 0) {
+ if (f == NULL)
+ f = "stdin";
+ if (l == NULL)
+ l = "<none>";
+ fprintf(stderr, "%s:%s: grohtml assertion failed at id%s expecting %s and was given %s\n",
+ f, l, t->id, s, v);
+ }
+}
+
+void assert_state::close (const char *c)
+{
+ if (strcmp(c, "sp") == 0)
+ check_sp_flag = 0;
+ else if (strcmp(c, "br") == 0)
+ check_br_flag = 0;
+ else if (strcmp(c, "fi") == 0)
+ check_fi_flag = 0;
+ else if (strcmp(c, "nf") == 0)
+ check_fi_flag = 0;
+ else if (strcmp(c, "ce") == 0)
+ check_ce_flag = 0;
+ else
+ fprintf(stderr, "internal error: unrecognised tag in grohtml (%s)\n", c);
+}
+
+const char *replace_negate_str (const char *before, char *after)
+{
+ if (before != NULL)
+ a_delete (char *)before;
+
+ if (strlen(after) > 0) {
+ int d = atoi(after);
+
+ if (d < 0 || d > 1) {
+ fprintf(stderr, "expecting nf/fi value to be 0 or 1 not %d\n", d);
+ d = 0;
+ }
+ if (d == 0)
+ after[0] = '1';
+ else
+ after[0] = '0';
+ after[1] = (char)0;
+ }
+ return after;
+}
+
+const char *replace_str (const char *before, const char *after)
+{
+ if (before != NULL)
+ a_delete (char *)before;
+ return after;
+}
+
+void assert_state::set (const char *c, const char *v,
+ const char *f, const char *l)
+{
+ if (l == NULL)
+ l = "<none>";
+ if (f == NULL)
+ f = "stdin";
+
+ // fprintf(stderr, "%s:%s:setting %s to %s\n", f, l, c, v);
+ if (strcmp(c, "sp") == 0) {
+ check_sp_flag = 1;
+ val_sp = replace_str(val_sp, strsave(v));
+ file_sp = replace_str(file_sp, strsave(f));
+ line_sp = replace_str(line_sp, strsave(l));
+ } else if (strcmp(c, "br") == 0) {
+ check_br_flag = 1;
+ val_br = replace_str(val_br, strsave(v));
+ file_br = replace_str(file_br, strsave(f));
+ line_br = replace_str(line_br, strsave(l));
+ } else if (strcmp(c, "fi") == 0) {
+ check_fi_flag = 1;
+ val_fi = replace_str(val_fi, strsave(v));
+ file_fi = replace_str(file_fi, strsave(f));
+ line_fi = replace_str(line_fi, strsave(l));
+ } else if (strcmp(c, "nf") == 0) {
+ check_fi_flag = 1;
+ val_fi = replace_negate_str(val_fi, strsave(v));
+ file_fi = replace_str(file_fi, strsave(f));
+ line_fi = replace_str(line_fi, strsave(l));
+ } else if (strcmp(c, "ce") == 0) {
+ check_ce_flag = 1;
+ val_ce = replace_str(val_ce, strsave(v));
+ file_ce = replace_str(file_ce, strsave(f));
+ line_ce = replace_str(line_ce, strsave(l));
+ }
+}
+
+/*
+ * build - builds the troff state assertion.
+ * see tmac/www.tmac for cmd examples.
+ */
+
+void assert_state::build (const char *c, const char *v,
+ const char *f, const char *l)
+{
+ if (c[0] == '{')
+ set(&c[1], v, f, l);
+ if (c[0] == '}')
+ close(&c[1]);
+}
+
+int assert_state::check_value_error (int c, int v, const char *s,
+ const char *name,
+ const char *f, const char *l, int flag)
+{
+ if (! c) {
+ if (f == NULL)
+ f = "stdin";
+ if (l == NULL)
+ l = "<none>";
+ fprintf(stderr, "%s:%s:grohtml (troff state) assertion failed, expected %s to be %s but found it to contain %d\n",
+ f, l, name, s, v);
+ return 0;
+ }
+ return flag;
+}
+
+void assert_state::check_value (const char *s, int v, const char *name,
+ const char *f, const char *l, int *flag)
+{
+ if (strncmp(s, "<=", 2) == 0)
+ *flag = check_value_error(v <= atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, ">=", 2) == 0)
+ *flag = check_value_error(v >= atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, "==", 2) == 0)
+ *flag = check_value_error(v == atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, "!=", 2) == 0)
+ *flag = check_value_error(v != atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, "<", 1) == 0)
+ *flag = check_value_error(v < atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, ">", 1) == 0)
+ *flag = check_value_error(v > atoi(&s[2]), v, s, name, f, l, *flag);
+ else if (strncmp(s, "=", 1) == 0)
+ *flag = check_value_error(v == atoi(&s[1]), v, s, name, f, l, *flag);
+ else
+ *flag = check_value_error(v == atoi(s), v, s, name, f, l, *flag);
+}
+
+void assert_state::check_sp (int sp)
+{
+ if (check_sp_flag)
+ check_value(val_sp, sp, "sp", file_sp, line_sp, &check_sp_flag);
+}
+
+void assert_state::check_fi (int fi)
+{
+ if (check_fi_flag)
+ check_value(val_fi, fi, "fi", file_fi, line_fi, &check_fi_flag);
+}
+
+void assert_state::check_br (int br)
+{
+ if (check_br_flag)
+ check_value(val_br, br, "br", file_br, line_br, &check_br_flag);
+}
+
+void assert_state::check_ce (int ce)
+{
+ if (check_ce_flag)
+ check_value(val_ce, ce, "ce", file_ce, line_ce, &check_ce_flag);
+}
+
class html_printer : public printer {
files file_list;
simple_output html;
@@ -1477,12 +1977,26 @@ class html_printer : public printer {
int max_linelength;
int linelength;
int pageoffset;
- int indentation;
- int prev_indent;
+ int troff_indent;
+ int device_indent;
+ int temp_indent;
int pointsize;
int vertical_spacing;
int line_number;
color *background;
+ int seen_indent;
+ int next_indent;
+ int seen_pageoffset;
+ int next_pageoffset;
+ int seen_linelength;
+ int next_linelength;
+ int seen_center;
+ int next_center;
+ int seen_space;
+ int seen_break;
+ int current_column;
+ int row_space;
+ assert_state as;
void flush_sbuf ();
void set_style (const style &);
@@ -1508,15 +2022,18 @@ class html_printer : public printer {
void start_font (const char *name);
void end_font (const char *name);
int is_font_courier (font *f);
+ int is_line_start (int nf);
int is_courier_until_eol (void);
void start_size (int from, int to);
void do_font (text_glob *g);
void do_center (char *arg);
+ void do_check_center (void);
void do_break (void);
+ void do_space (char *arg);
void do_eol (void);
void do_eol_ce (void);
void do_title (void);
- void do_fill (int on);
+ void do_fill (char *arg);
void do_heading (char *arg);
void write_header (void);
void determine_header_level (int level);
@@ -1533,6 +2050,9 @@ class html_printer : public printer {
void do_auto_image (text_glob *g, const char *filename);
void do_links (void);
void do_flush (void);
+ void do_job_name (char *name);
+ void do_head (char *name);
+ void insert_split_file (void);
int is_in_middle (int left, int right);
void do_sup_or_sub (text_glob *g);
int start_subscript (text_glob *g);
@@ -1563,6 +2083,18 @@ class html_printer : public printer {
void remove_courier_tabs (void);
void update_min_max (colType type_of_col, int *minimum, int *maximum, text_glob *g);
void add_table_end (const char *);
+ void do_file_components (void);
+ void write_navigation (const string &top, const string &prev,
+ const string &next, const string &current);
+ void emit_link (const string &to, const char *name);
+ int get_troff_indent (void);
+ void restore_troff_indent (void);
+ void handle_assertion (int minv, int minh, int maxv, int maxh, const char *s);
+ void handle_state_assertion (text_glob *g);
+ void do_end_para (text_glob *g);
+ int round_width (int x);
+ void handle_tag_within_title (text_glob *g);
+ void writeHeadMetaStyle (void);
// ADD HERE
public:
@@ -1570,10 +2102,13 @@ public:
~html_printer ();
void set_char (int i, font *f, const environment *env, int w, const char *name);
void set_numbered_char(int num, const environment *env, int *widthp);
+ int set_char_and_width(const char *nm, const environment *env,
+ int *widthp, font **f);
void draw (int code, int *p, int np, const environment *env);
void begin_page (int);
void end_page (int);
void special (char *arg, const environment *env, char type);
+ void devtag (char *arg, const environment *env, char type);
font *make_font (const char *);
void end_of_line ();
};
@@ -1640,6 +2175,24 @@ void html_printer::emit_line (text_glob *)
}
/*
+ * restore_troff_indent - is called when we have temporarily shutdown
+ * indentation (typically done when we have
+ * centered an image).
+ */
+
+void html_printer::restore_troff_indent (void)
+{
+ troff_indent = next_indent;
+ if (troff_indent > 0) {
+ /*
+ * force device indentation
+ */
+ device_indent = 0;
+ do_indent(get_troff_indent(), pageoffset, linelength);
+ }
+}
+
+/*
* emit_raw - writes the raw html information directly to the device.
*/
@@ -1650,17 +2203,20 @@ void html_printer::emit_raw (text_glob *g)
determine_space(g);
current_paragraph->do_emittext(g->text_string, g->text_length);
} else {
+ int space = current_paragraph->retrieve_para_space() || seen_space;
+
current_paragraph->done_para();
+ shutdown_table();
switch (next_tag) {
case CENTERED:
- current_paragraph->do_para("align=center");
+ current_paragraph->do_para("align=center", space);
break;
case LEFT:
- current_paragraph->do_para(&html, "align=left", indentation, pageoffset, linelength);
+ current_paragraph->do_para(&html, "align=left", get_troff_indent(), pageoffset, linelength, space);
break;
case RIGHT:
- current_paragraph->do_para(&html, "align=right", indentation, pageoffset, linelength);
+ current_paragraph->do_para(&html, "align=right", get_troff_indent(), pageoffset, linelength, space);
break;
default:
fatal("unknown enumeration");
@@ -1669,39 +2225,37 @@ void html_printer::emit_raw (text_glob *g)
current_paragraph->done_para();
next_tag = INLINE;
supress_sub_sup = TRUE;
- if (indentation > 0) {
- /*
- * restore indentation
- */
- int newin = indentation;
- indentation = 0;
- do_indent(newin, pageoffset, linelength);
- }
+ seen_space = FALSE;
+ restore_troff_indent();
}
}
/*
+ * handle_tag_within_title - handle a limited number of tags within
+ * the context of a table. Those tags which
+ * set values rather than generate spaces
+ * and paragraphs.
+ */
+
+void html_printer::handle_tag_within_title (text_glob *g)
+{
+ if (g->is_in() || g->is_ti() || g->is_po() || g->is_ce() || g->is_ll()
+ || g->is_fi() || g->is_nf())
+ troff_tag(g);
+}
+
+/*
* do_center - handle the .ce commands from troff.
*/
void html_printer::do_center (char *arg)
{
- int n = atoi(arg);
- current_paragraph->do_break();
-
- if (n > 0) {
- current_paragraph->done_para();
- supress_sub_sup = TRUE;
- current_paragraph->do_para("align=center");
- end_center += n;
- } else {
- end_center = 0;
- current_paragraph->remove_para_align();
- }
+ next_center = atoi(arg);
+ seen_center = TRUE;
}
/*
- * do_centered_image - set a flag such that the next html-tag is
+ * do_centered_image - set a flag such that the next devtag is
* placed inside a centered paragraph.
*/
@@ -1711,7 +2265,7 @@ void html_printer::do_centered_image (void)
}
/*
- * do_right_image - set a flag such that the next html-tag is
+ * do_right_image - set a flag such that the next devtag is
* placed inside a right aligned paragraph.
*/
@@ -1721,7 +2275,7 @@ void html_printer::do_right_image (void)
}
/*
- * do_left_image - set a flag such that the next html-tag is
+ * do_left_image - set a flag such that the next devtag is
* placed inside a left aligned paragraph.
*/
@@ -1759,7 +2313,8 @@ static string &generate_img_src (const char *filename)
filename++;
}
if (exists(filename))
- *s += string("<img src=\"") + filename + "\">";
+ *s += string("<img src=\"") + filename + "\" "
+ + "alt=\"Image " + filename + "\">";
return *s;
}
@@ -1808,7 +2363,6 @@ void html_printer::do_title (void)
{
text_glob *t;
int removed_from_head;
- int eol_ce = 0;
if (page_number == 1) {
int found_title_start = FALSE;
@@ -1830,24 +2384,16 @@ void html_printer::do_title (void)
page_contents->glyphs.sub_move_right(); /* move onto next word */
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
- } else if (t->is_eol_ce()) {
- /* process the eol associated with .ce
- */
- eol_ce++;
- page_contents->glyphs.sub_move_right(); /* move onto next word */
- } else if (t->is_eol()) {
+ } else if (t->is_eo_tl()) {
/* end of title found
*/
title.has_been_found = TRUE;
- outstanding_eol(eol_ce);
return;
} else if (t->is_a_tag()) {
- /* end of title found, but move back so that we read this tag and process it
- */
- page_contents->glyphs.move_left(); /* move backwards to last word */
- title.has_been_found = TRUE;
- outstanding_eol(eol_ce);
- return;
+ handle_tag_within_title(t);
+ page_contents->glyphs.sub_move_right(); /* move onto next word */
+ removed_from_head = ((!page_contents->glyphs.is_empty()) &&
+ (page_contents->glyphs.is_equal_to_head()));
} else if (found_title_start) {
title.text += " " + string(t->text_string, t->text_length);
page_contents->glyphs.sub_move_right(); /* move onto next word */
@@ -1861,15 +2407,17 @@ void html_printer::do_title (void)
removed_from_head = ((!page_contents->glyphs.is_empty()) &&
(page_contents->glyphs.is_equal_to_head()));
}
- } while ((! page_contents->glyphs.is_equal_to_head()) || (removed_from_head));
+ } while ((! page_contents->glyphs.is_equal_to_head()) ||
+ (removed_from_head));
}
- outstanding_eol(eol_ce);
}
}
void html_printer::write_header (void)
{
if (! header.header_buffer.empty()) {
+ int space = current_paragraph->retrieve_para_space() || seen_space;
+
if (header.header_level > 7) {
header.header_level = 7;
}
@@ -1897,7 +2445,7 @@ void html_printer::write_header (void)
// lastly we generate a tag
- html.nl().put_string("<a name=\"");
+ html.nl().nl().put_string("<a name=\"");
if (simple_anchors) {
string buffer(ANCHOR_TEMPLATE);
@@ -1937,7 +2485,23 @@ void html_printer::write_header (void)
html.put_string(">").nl();
}
- current_paragraph->do_para(&html, "", indentation, pageoffset, linelength);
+ /* and now we save the file name in which this header will occur */
+
+ style st; // fake style to enable us to use the list data structure
+
+ text_glob *h=new text_glob();
+ h->text_glob_html(&st,
+ header.headings.add_string(file_list.file_name()),
+ file_list.file_name().length(),
+ header.no_of_headings, header.header_level,
+ header.no_of_headings, header.header_level);
+
+ header.header_filename.add(h,
+ header.no_of_headings,
+ header.no_of_headings, header.no_of_headings,
+ header.no_of_headings, header.no_of_headings);
+
+ current_paragraph->do_para(&html, "", get_troff_indent(), pageoffset, linelength, space);
}
}
@@ -1955,6 +2519,10 @@ void html_printer::determine_header_level (int level)
}
}
header.header_level = level+1;
+ if (header.header_level >= 2 && header.header_level <= split_level) {
+ header.no_of_level_one_headings++;
+ insert_split_file();
+ }
}
/*
@@ -1964,39 +2532,46 @@ void html_printer::determine_header_level (int level)
void html_printer::do_heading (char *arg)
{
text_glob *g;
- text_glob *l = 0;
int level=atoi(arg);
+ int horiz;
header.header_buffer.clear();
page_contents->glyphs.move_right();
if (! page_contents->glyphs.is_equal_to_head()) {
g = page_contents->glyphs.get_data();
+ horiz = g->minh;
do {
if (g->is_auto_img()) {
string img=generate_img_src((char *)(g->text_string + 20));
if (! img.empty()) {
simple_anchors = TRUE; // we cannot use full heading anchors with images
- if (l != 0)
+ if (horiz < g->minh)
header.header_buffer += " ";
- l = g;
header.header_buffer += img;
}
- } else if (! (g->is_a_line() || g->is_a_tag())) {
+ }
+ else if (g->is_in() || g->is_ti() || g->is_po() || g->is_ce() || g->is_ll())
+ troff_tag(g);
+ else if (g->is_fi())
+ fill_on = 1;
+ else if (g->is_nf())
+ fill_on = 0;
+ else if (! (g->is_a_line() || g->is_a_tag())) {
/*
- * we ignore tags commands when constructing a heading
+ * we ignore the other tag commands when constructing a heading
*/
- if (l != 0)
+ if (horiz < g->minh)
header.header_buffer += " ";
- l = g;
+ horiz = g->maxh;
header.header_buffer += string(g->text_string, g->text_length);
}
page_contents->glyphs.move_right();
g = page_contents->glyphs.get_data();
} while ((! page_contents->glyphs.is_equal_to_head()) &&
- (! g->is_br()));
+ (! g->is_eo_h()));
}
determine_header_level(level);
@@ -2046,8 +2621,8 @@ void html_printer::do_linelength (char *arg)
if (max_linelength == -1)
max_linelength = atoi(arg);
- if (fill_on)
- do_indent(indentation, pageoffset, atoi(arg));
+ next_linelength = atoi(arg);
+ seen_linelength = TRUE;
}
/*
@@ -2056,8 +2631,20 @@ void html_printer::do_linelength (char *arg)
void html_printer::do_pageoffset (char *arg)
{
- if (fill_on)
- do_indent(indentation, atoi(arg), linelength);
+ next_pageoffset = atoi(arg);
+ seen_pageoffset = TRUE;
+}
+
+/*
+ * get_troff_indent - returns the indent value.
+ */
+
+int html_printer::get_troff_indent (void)
+{
+ if (end_tempindent > 0)
+ return temp_indent;
+ else
+ return troff_indent;
}
/*
@@ -2066,8 +2653,8 @@ void html_printer::do_pageoffset (char *arg)
void html_printer::do_indentation (char *arg)
{
- if (fill_on)
- do_indent(atoi(arg), pageoffset, linelength);
+ next_indent = atoi(arg);
+ seen_indent = TRUE;
}
/*
@@ -2077,9 +2664,12 @@ void html_printer::do_indentation (char *arg)
void html_printer::do_tempindent (char *arg)
{
if (fill_on) {
- end_tempindent = 1;
- prev_indent = indentation;
- do_indent(atoi(arg), pageoffset, linelength);
+ /*
+ * we set the end_tempindent to 2 as the first .br
+ * activates the .ti and the second terminates it.
+ */
+ end_tempindent = 2;
+ temp_indent = atoi(arg);
}
}
@@ -2105,17 +2695,19 @@ void html_printer::shutdown_table (void)
void html_printer::do_indent (int in, int pageoff, int linelen)
{
- if ((indentation != -1) &&
- (pageoffset+indentation != in+pageoff)) {
-
+ if ((device_indent != -1) &&
+ (pageoffset+device_indent != in+pageoff)) {
+
+ int space = current_paragraph->retrieve_para_space() || seen_space;
current_paragraph->done_para();
- indentation = in;
+ device_indent = in;
pageoffset = pageoff;
if (linelen <= max_linelength)
linelength = linelen;
- current_paragraph->do_para(&html, "", indentation, pageoffset, max_linelength);
+ current_paragraph->do_para(&html, "", device_indent,
+ pageoffset, max_linelength, space);
}
}
@@ -2134,24 +2726,56 @@ void html_printer::do_verticalspacing (char *arg)
void html_printer::do_pointsize (char *arg)
{
- pointsize = atoi(arg);
+ /*
+ * firstly check to see whether this point size is really associated with a .tl tag
+ */
+
+ if (! page_contents->glyphs.is_empty()) {
+ text_glob *g = page_contents->glyphs.get_data();
+ text_glob *t = page_contents->glyphs.get_data();
+
+ while (t->is_a_tag() && (! page_contents->glyphs.is_equal_to_head())) {
+ if (t->is_tl()) {
+ /*
+ * found title therefore ignore this .ps tag
+ */
+ while (t != g) {
+ page_contents->glyphs.move_left();
+ t = page_contents->glyphs.get_data();
+ }
+ return;
+ }
+ page_contents->glyphs.move_right();
+ t = page_contents->glyphs.get_data();
+ }
+ /*
+ * move back to original position
+ */
+ while (t != g) {
+ page_contents->glyphs.move_left();
+ t = page_contents->glyphs.get_data();
+ }
+ /*
+ * collect legal pointsize
+ */
+ pointsize = atoi(arg);
+ }
}
/*
* do_fill - records whether troff has requested that text be filled.
*/
-void html_printer::do_fill (int on)
+void html_printer::do_fill (char *arg)
{
- current_paragraph->do_break();
- output_hpos = indentation+pageoffset;
+ int on = atoi(arg);
+
+ output_hpos = get_troff_indent()+pageoffset;
supress_sub_sup = TRUE;
if (fill_on != on) {
if (on)
- current_paragraph->do_para("");
- else
- current_paragraph->do_pre();
+ current_paragraph->do_para("", seen_space);
fill_on = on;
}
}
@@ -2168,7 +2792,53 @@ void html_printer::do_eol (void)
current_paragraph->do_break();
}
}
- output_hpos = indentation+pageoffset;
+ output_hpos = get_troff_indent()+pageoffset;
+}
+
+/*
+ * do_check_center - checks to see whether we have seen a `.ce' tag
+ * during the previous line.
+ */
+
+void html_printer::do_check_center(void)
+{
+ if (seen_center) {
+ seen_center = FALSE;
+ if (next_center > 0) {
+ if (end_center == 0) {
+ int space = current_paragraph->retrieve_para_space() || seen_space;
+ current_paragraph->done_para();
+ supress_sub_sup = TRUE;
+ current_paragraph->do_para("align=center", space);
+ } else
+ if (strcmp("align=center",
+ current_paragraph->get_alignment()) != 0) {
+ /*
+ * different alignment, so shutdown paragraph and open
+ * a new one.
+ */
+ int space = current_paragraph->retrieve_para_space() || seen_space;
+ current_paragraph->done_para();
+ supress_sub_sup = TRUE;
+ current_paragraph->do_para("align=center", space);
+ } else
+ /*
+ * same alignment, if we have emitted text then issue a break.
+ */
+ if (current_paragraph->emitted_text())
+ current_paragraph->do_break();
+ } else
+ /*
+ * next_center == 0
+ */
+ if (end_center > 0) {
+ seen_space = seen_space || current_paragraph->retrieve_para_space();
+ current_paragraph->done_para();
+ supress_sub_sup = TRUE;
+ current_paragraph->do_para("", seen_space);
+ }
+ end_center = next_center;
+ }
}
/*
@@ -2205,26 +2875,110 @@ void html_printer::do_flush (void)
void html_printer::do_links (void)
{
- current_paragraph->done_para();
+ html.end_line(); // flush line
auto_links = FALSE; /* from now on only emit under user request */
file_list.add_new_file(xtmpfile());
+ file_list.set_links_required();
html.set_file(file_list.get_file());
}
/*
+ * insert_split_file -
+ */
+
+void html_printer::insert_split_file (void)
+{
+ if (multiple_files) {
+ current_paragraph->done_para(); // flush paragraph
+ html.end_line(); // flush line
+ html.set_file(file_list.get_file()); // flush current file
+ file_list.add_new_file(xtmpfile());
+ string split_file = job_name;
+
+ split_file += string("-");
+ split_file += as_string(header.no_of_level_one_headings);
+ split_file += string(".html");
+ split_file += '\0';
+
+ file_list.set_file_name(split_file);
+ html.set_file(file_list.get_file());
+ }
+}
+
+/*
+ * do_job_name - assigns the job_name to name.
+ */
+
+void html_printer::do_job_name (char *name)
+{
+ if (! multiple_files) {
+ multiple_files = TRUE;
+ while (name != NULL && (*name != (char)0) && (*name == ' '))
+ name++;
+ job_name = name;
+ }
+}
+
+/*
+ * do_head - adds a string to head_info which is to be included into
+ * the <head> </head> section of the html document.
+ */
+
+void html_printer::do_head (char *name)
+{
+ head_info += string(name);
+ head_info += '\n';
+}
+
+/*
* do_break - handles the ".br" request and also
- * undoes an outstanding ".ti" command.
+ * undoes an outstanding ".ti" command
+ * and calls indent if the indentation
+ * related registers have changed.
*/
void html_printer::do_break (void)
{
+ int seen_temp_indent = FALSE;
+
current_paragraph->do_break();
if (end_tempindent > 0) {
end_tempindent--;
- if (end_tempindent == 0)
- do_indent(prev_indent, pageoffset, linelength);
+ if (end_tempindent > 0)
+ seen_temp_indent = TRUE;
+ }
+ if (seen_indent || seen_pageoffset || seen_linelength || seen_temp_indent) {
+ if (seen_indent && (! seen_temp_indent))
+ troff_indent = next_indent;
+ if (! seen_pageoffset)
+ next_pageoffset = pageoffset;
+ if (! seen_linelength)
+ next_linelength = linelength;
+ do_indent(get_troff_indent(), next_pageoffset, next_linelength);
+ }
+ seen_indent = seen_temp_indent;
+ seen_linelength = FALSE;
+ seen_pageoffset = FALSE;
+ do_check_center();
+ output_hpos = get_troff_indent()+pageoffset;
+ supress_sub_sup = TRUE;
+}
+
+void html_printer::do_space (char *arg)
+{
+ int n = atoi(arg);
+
+ seen_space = atoi(arg);
+ as.check_sp(seen_space);
+#if 0
+ if (n>0 && table)
+ table->set_space(TRUE);
+#endif
+
+ while (n>0) {
+ current_paragraph->do_space();
+ n--;
}
- output_hpos = indentation+pageoffset;
supress_sub_sup = TRUE;
}
@@ -2237,14 +2991,24 @@ void html_printer::do_tab_ts (text_glob *g)
html_table *t = g->get_table();
if (t != NULL) {
+ current_column = 0;
current_paragraph->done_pre();
current_paragraph->done_para();
+ current_paragraph->remove_para_space();
+#if defined(DEBUG_TABLES)
html.simple_comment("TABS");
+#endif
t->set_linelength(max_linelength);
t->add_indent(pageoffset);
+#if 0
+ t->emit_table_header(seen_space);
+#else
t->emit_table_header(FALSE);
+ row_space = current_paragraph->retrieve_para_space() || seen_space;
+ seen_space = FALSE;
+#endif
}
table = t;
@@ -2258,23 +3022,16 @@ void html_printer::do_tab_te (void)
{
if (table) {
current_paragraph->done_para();
+ current_paragraph->remove_para_space();
table->emit_finish_table();
}
table = NULL;
-
- if (indentation > 0) {
- /*
- * restore indentation
- */
- int newin = indentation;
- indentation = 0;
- do_indent(newin, pageoffset, linelength);
- }
+ restore_troff_indent();
}
/*
- * do_tab - handle the "html-tag:tab" tag
+ * do_tab - handle the "devtag:tab" tag
*/
void html_printer::do_tab (char *s)
@@ -2283,7 +3040,7 @@ void html_printer::do_tab (char *s)
while (isspace(*s))
s++;
s++;
- int col = table->find_column(atoi(s) + pageoffset + indentation);
+ int col = table->find_column(atoi(s) + pageoffset + get_troff_indent());
if (col > 0) {
current_paragraph->done_para();
table->emit_col(col);
@@ -2292,13 +3049,13 @@ void html_printer::do_tab (char *s)
}
/*
- * do_tab0 - handle the "html-tag:tab0" tag
+ * do_tab0 - handle the "devtag:tab0" tag
*/
void html_printer::do_tab0 (void)
{
if (table) {
- int col = table->find_column(pageoffset+indentation);
+ int col = table->find_column(pageoffset+get_troff_indent());
if (col > 0) {
current_paragraph->done_para();
table->emit_col(col);
@@ -2313,33 +3070,40 @@ void html_printer::do_tab0 (void)
void html_printer::do_col (char *s)
{
if (table) {
+ if (atoi(s) < current_column)
+ row_space = seen_space;
+
+ current_column = atoi(s);
current_paragraph->done_para();
- table->emit_col(atoi(s));
+ table->emit_col(current_column);
+ current_paragraph->do_para("", row_space);
}
}
/*
- * troff_tag - processes the troff tag and manipulates the troff state machine.
+ * troff_tag - processes the troff tag and manipulates the troff
+ * state machine.
*/
void html_printer::troff_tag (text_glob *g)
{
/*
- * firstly skip over html-tag:
+ * firstly skip over devtag:
*/
- char *t=(char *)g->text_string+9;
+ char *t=(char *)g->text_string+strlen("devtag:");
- if (g->is_eol()) {
+ if (strncmp(g->text_string, "html</p>:", strlen("html</p>:")) == 0) {
+ do_end_para(g);
+ } else if (g->is_eol()) {
do_eol();
} else if (g->is_eol_ce()) {
do_eol_ce();
} else if (strncmp(t, ".sp", 3) == 0) {
- if (g->get_arg() > 0)
- current_paragraph->do_space();
- else
- current_paragraph->do_break();
- supress_sub_sup = TRUE;
+ char *a = (char *)t+3;
+ do_space(a);
} else if (strncmp(t, ".br", 3) == 0) {
+ seen_break = 1;
+ as.check_br(1);
do_break();
} else if (strcmp(t, ".centered-image") == 0) {
do_centered_image();
@@ -2354,7 +3118,7 @@ void html_printer::troff_tag (text_glob *g)
char *a = (char *)t+3;
supress_sub_sup = TRUE;
do_center(a);
- } else if (strncmp(t, ".tl", 3) == 0) {
+ } else if (g->is_tl()) {
supress_sub_sup = TRUE;
title.with_h1 = TRUE;
do_title();
@@ -2363,9 +3127,8 @@ void html_printer::troff_tag (text_glob *g)
title.with_h1 = FALSE;
do_title();
} else if (strncmp(t, ".fi", 3) == 0) {
- do_fill(TRUE);
- } else if (strncmp(t, ".nf", 3) == 0) {
- do_fill(FALSE);
+ char *a = (char *)t+3;
+ do_fill(a);
} else if ((strncmp(t, ".SH", 3) == 0) || (strncmp(t, ".NH", 3) == 0)) {
char *a = (char *)t+3;
do_heading(a);
@@ -2389,6 +3152,12 @@ void html_printer::troff_tag (text_glob *g)
do_pointsize(a);
} else if (strcmp(t, ".links") == 0) {
do_links();
+ } else if (strncmp(t, ".job-name", 9) == 0) {
+ char *a = (char *)t+9;
+ do_job_name(a);
+ } else if (strncmp(t, ".head", 5) == 0) {
+ char *a = (char *)t+5;
+ do_head(a);
} else if (strcmp(t, ".no-auto-rule") == 0) {
auto_rule = FALSE;
} else if (strcmp(t, ".tab-ts") == 0) {
@@ -2412,7 +3181,8 @@ void html_printer::troff_tag (text_glob *g)
int html_printer::is_in_middle (int left, int right)
{
- return( abs(abs(left-pageoffset) - abs(pageoffset+linelength-right)) <= CENTER_TOLERANCE );
+ return( abs(abs(left-pageoffset) - abs(pageoffset+linelength-right))
+ <= CENTER_TOLERANCE );
}
/*
@@ -2427,17 +3197,31 @@ void html_printer::flush_globs (void)
page_contents->glyphs.start_from_head();
do {
g = page_contents->glyphs.get_data();
+#if 0
+ fprintf(stderr, "[%s:%d:%d:%d:%d]",
+ g->text_string, g->minv, g->minh, g->maxv, g->maxh) ;
+ fflush(stderr);
+#endif
+
+ handle_state_assertion(g);
if (strcmp(g->text_string, "XXXXXXX") == 0)
stop();
- if (g->is_a_tag()) {
+ if (g->is_a_tag())
troff_tag(g);
- } else if (g->is_a_line()) {
+ else if (g->is_a_line())
emit_line(g);
- } else {
+ else {
+ as.check_sp(seen_space);
+ as.check_br(seen_break);
+ seen_break = 0;
+ seen_space = 0;
emit_html(g);
}
+
+ as.check_fi(fill_on);
+ as.check_ce(end_center);
/*
* after processing the title (and removing it) the glyph list might be empty
*/
@@ -2456,11 +3240,16 @@ void html_printer::flush_globs (void)
int html_printer::calc_nf (text_glob *g, int nf)
{
if (g != NULL) {
- if (g->is_fi())
+ if (g->is_fi()) {
+ as.check_fi(TRUE);
return FALSE;
- if (g->is_nf())
+ }
+ if (g->is_nf()) {
+ as.check_fi(FALSE);
return TRUE;
+ }
}
+ as.check_fi(! nf);
return nf;
}
@@ -2471,16 +3260,15 @@ int html_printer::calc_nf (text_glob *g, int nf)
void html_printer::calc_po_in (text_glob *g, int nf)
{
if (g->is_in())
- indentation = g->get_arg();
+ troff_indent = g->get_arg();
else if (g->is_po())
pageoffset = g->get_arg();
else if (g->is_ti()) {
- prev_indent = indentation;
- indentation = g->get_arg();
- end_tempindent = 1;
- } else if (g->is_br() && ((end_tempindent > 0) || (nf && g->is_eol()))) {
- end_tempindent = 0;
- indentation = prev_indent;
+ temp_indent = g->get_arg();
+ end_tempindent = 2;
+ } else if (g->is_br() || (nf && g->is_eol())) {
+ if (end_tempindent > 0)
+ end_tempindent--;
}
}
@@ -2491,13 +3279,15 @@ void html_printer::calc_po_in (text_glob *g, int nf)
int html_printer::next_horiz_pos (text_glob *g, int nf)
{
- int next = -1;
+ int next = -1;
if ((g != NULL) && (g->is_br() || (nf && g->is_eol())))
if (! page_contents->glyphs.is_empty()) {
page_contents->glyphs.move_right_get_data();
- if (g == NULL)
+ if (g == NULL) {
page_contents->glyphs.start_from_head();
+ as.reset();
+ }
else {
next = g->minh;
page_contents->glyphs.move_left();
@@ -2517,7 +3307,7 @@ text_glob *html_printer::insert_tab_ts (text_glob *where)
page_contents->glyphs.move_to(where);
page_contents->glyphs.move_left();
- page_contents->insert_tag(string("html-tag:.tab-ts")); // tab table start
+ page_contents->insert_tag(string("devtag:.tab-ts")); // tab table start
page_contents->glyphs.move_right();
start_of_table = page_contents->glyphs.get_data();
page_contents->glyphs.move_to(old_pos);
@@ -2537,7 +3327,7 @@ void html_printer::insert_tab_te (void)
while (page_contents->glyphs.get_data()->is_a_tag())
page_contents->glyphs.move_left();
- page_contents->insert_tag(string("html-tag:.tab-te")); // tab table end
+ page_contents->insert_tag(string("devtag:.tab-te")); // tab table end
while (g != page_contents->glyphs.get_data())
page_contents->glyphs.move_right();
page_contents->dump_page();
@@ -2553,7 +3343,7 @@ void html_printer::insert_tab_0 (text_glob *where)
page_contents->glyphs.move_to(where);
page_contents->glyphs.move_left();
- page_contents->insert_tag(string("html-tag:tab0")); // tab0 start of line
+ page_contents->insert_tag(string("devtag:tab0")); // tab0 start of line
page_contents->glyphs.move_right();
page_contents->glyphs.move_to(old_pos);
}
@@ -2595,10 +3385,11 @@ void html_printer::remove_courier_tabs (void)
if (! page_contents->glyphs.is_empty()) {
page_contents->glyphs.start_from_head();
+ as.reset();
line_start = TRUE;
do {
g = page_contents->glyphs.get_data();
-
+ handle_state_assertion(g);
nf = calc_nf(g, nf);
if (line_start) {
@@ -2608,7 +3399,8 @@ void html_printer::remove_courier_tabs (void)
}
}
- line_start = g->is_br() || g->is_nf() || g->is_fi() || (nf && g->is_eol());
+ // line_start = g->is_br() || g->is_nf() || g->is_fi() || (nf && g->is_eol());
+ line_start = g->is_br() || (nf && g->is_eol());
page_contents->glyphs.move_right();
} while (! page_contents->glyphs.is_equal_to_head());
}
@@ -2624,10 +3416,11 @@ void html_printer::insert_tab0_foreach_tab (void)
if (! page_contents->glyphs.is_empty()) {
page_contents->glyphs.start_from_head();
+ as.reset();
start_of_line = page_contents->glyphs.get_data();
do {
g = page_contents->glyphs.get_data();
-
+ handle_state_assertion(g);
nf = calc_nf(g, nf);
if (g->is_tab())
@@ -2640,6 +3433,7 @@ void html_printer::insert_tab0_foreach_tab (void)
do {
page_contents->glyphs.move_right();
g = page_contents->glyphs.get_data();
+ handle_state_assertion(g);
nf = calc_nf(g, nf);
if (page_contents->glyphs.is_equal_to_head()) {
if (seen_tab && !seen_col)
@@ -2707,7 +3501,8 @@ void html_printer::add_table_end (const char *
}
/*
- * lookahead_for_tables - checks for .col tags and inserts table start/end tags
+ * lookahead_for_tables - checks for .col tags and inserts table
+ * start/end tags
*/
void html_printer::lookahead_for_tables (void)
@@ -2721,9 +3516,9 @@ void html_printer::lookahead_for_tables (void)
int found_col = FALSE;
int seen_text = FALSE;
int ncol = 0;
- int colmin;
- int colmax;
- html_table *table = new html_table(&html, -1);
+ int colmin = 0; // pacify compiler
+ int colmax = 0; // pacify compiler
+ html_table *tbl = new html_table(&html, -1);
const char *tab_defs = NULL;
char align = 'L';
int nf = FALSE;
@@ -2735,7 +3530,28 @@ void html_printer::lookahead_for_tables (void)
page_contents->dump_page();
if (! page_contents->glyphs.is_empty()) {
page_contents->glyphs.start_from_head();
+ as.reset();
g = page_contents->glyphs.get_data();
+ if (g->is_br()) {
+ g = page_contents->glyphs.move_right_get_data();
+ handle_state_assertion(g);
+ if (page_contents->glyphs.is_equal_to_head()) {
+ if (tbl != NULL) {
+ delete tbl;
+ tbl = NULL;
+ }
+ return;
+ }
+
+ start_of_line = g;
+ seen_text = FALSE;
+ ncol = 0;
+ left = next_horiz_pos(g, nf);
+ if (found_col)
+ last = g;
+ found_col = FALSE;
+ }
+
do {
#if defined(DEBUG_TABLES)
fprintf(stderr, " [") ;
@@ -2752,11 +3568,11 @@ void html_printer::lookahead_for_tables (void)
if (type_of_col == tab_tag && start_of_table != NULL) {
page_contents->glyphs.move_left();
insert_tab_te();
- start_of_table->remember_table(table);
- table = new html_table(&html, -1);
+ start_of_table->remember_table(tbl);
+ tbl = new html_table(&html, -1);
page_contents->insert_tag(string("*** TAB -> COL ***"));
if (tab_defs != NULL)
- table->tab_stops->init(tab_defs);
+ tbl->tab_stops->init(tab_defs);
start_of_table = NULL;
last = NULL;
}
@@ -2770,28 +3586,28 @@ void html_printer::lookahead_for_tables (void)
type_of_col = tab_tag;
colmin = g->get_tab_args(&align);
align = 'L'; // for now as 'C' and 'R' are broken
- ncol = table->find_tab_column(colmin);
- colmin += pageoffset + indentation;
- colmax = table->get_tab_pos(ncol+1);
+ ncol = tbl->find_tab_column(colmin);
+ colmin += pageoffset + get_troff_indent();
+ colmax = tbl->get_tab_pos(ncol+1);
if (colmax > 0)
- colmax += pageoffset + indentation;
+ colmax += pageoffset + get_troff_indent();
} else if (g->is_tab0()) {
if (type_of_col == col_tag && start_of_table != NULL) {
page_contents->glyphs.move_left();
insert_tab_te();
- start_of_table->remember_table(table);
- table = new html_table(&html, -1);
+ start_of_table->remember_table(tbl);
+ tbl = new html_table(&html, -1);
page_contents->insert_tag(string("*** COL -> TAB ***"));
start_of_table = NULL;
last = NULL;
}
if (tab_defs != NULL)
- table->tab_stops->init(tab_defs);
+ tbl->tab_stops->init(tab_defs);
type_of_col = tab0_tag;
ncol = 1;
colmin = 0;
- colmax = table->get_tab_pos(2) + pageoffset + indentation;
+ colmax = tbl->get_tab_pos(2) + pageoffset + get_troff_indent();
} else if (! g->is_a_tag())
update_min_max(type_of_col, &colmin, &colmax, g);
@@ -2805,34 +3621,39 @@ void html_printer::lookahead_for_tables (void)
seen_text = FALSE;
} else if (g->is_ce() && (start_of_table != NULL)) {
add_table_end("*** CE ***");
- start_of_table->remember_table(table);
+ start_of_table->remember_table(tbl);
+ tbl = new html_table(&html, -1);
start_of_table = NULL;
last = NULL;
} else if (g->is_ta()) {
tab_defs = g->text_string;
- if (!table->tab_stops->compatible(tab_defs)) {
+
+ if (type_of_col == col_tag)
+ tbl->tab_stops->check_init(tab_defs);
+
+ if (!tbl->tab_stops->compatible(tab_defs)) {
if (start_of_table != NULL) {
add_table_end("*** TABS ***");
- start_of_table->remember_table(table);
- table = new html_table(&html, -1);
+ start_of_table->remember_table(tbl);
+ tbl = new html_table(&html, -1);
start_of_table = NULL;
type_of_col = none;
last = NULL;
}
- table->tab_stops->init(tab_defs);
+ tbl->tab_stops->init(tab_defs);
}
}
if (((! g->is_a_tag()) || g->is_tab()) && (start_of_table != NULL)) {
// we are in a table and have a glyph
- if ((ncol == 0) || (! table->add_column(ncol, colmin, colmax, align))) {
+ if ((ncol == 0) || (! tbl->add_column(ncol, colmin, colmax, align))) {
if (ncol == 0)
add_table_end("*** NCOL == 0 ***");
else
add_table_end("*** CROSSED COLS ***");
- start_of_table->remember_table(table);
- table = new html_table(&html, -1);
+ start_of_table->remember_table(tbl);
+ tbl = new html_table(&html, -1);
start_of_table = NULL;
type_of_col = none;
last = NULL;
@@ -2843,16 +3664,19 @@ void html_printer::lookahead_for_tables (void)
* move onto next glob, check whether we are starting a new line
*/
g = page_contents->glyphs.move_right_get_data();
+ handle_state_assertion(g);
if (g == NULL) {
if (found_col) {
page_contents->glyphs.start_from_head();
+ as.reset();
last = g;
found_col = FALSE;
}
} else if (g->is_br() || (nf && g->is_eol())) {
do {
g = page_contents->glyphs.move_right_get_data();
+ handle_state_assertion(g);
nf = calc_nf(g, nf);
} while ((g != NULL) && (g->is_br() || (nf && g->is_eol())));
start_of_line = g;
@@ -2876,18 +3700,20 @@ void html_printer::lookahead_for_tables (void)
page_contents->glyphs.move_left();
insert_tab_te();
- start_of_table->remember_table(table);
- table = NULL;
+ start_of_table->remember_table(tbl);
+ tbl = NULL;
page_contents->insert_tag(string("*** LAST ***"));
}
}
- if (table != NULL)
- delete table;
+ if (tbl != NULL) {
+ delete tbl;
+ tbl = NULL;
+ }
// and reset the registers
pageoffset = old_pageoffset;
- indentation = 0;
- prev_indent = 0;
+ troff_indent = 0;
+ temp_indent = 0;
end_tempindent = 0;
}
@@ -2935,6 +3761,37 @@ void html_printer::determine_space (text_glob *g)
}
/*
+ * is_line_start - returns TRUE if we are at the start of a line.
+ */
+
+int html_printer::is_line_start (int nf)
+{
+ int line_start = FALSE;
+ int result = TRUE;
+ text_glob *orig = page_contents->glyphs.get_data();
+ text_glob *g;
+
+ if (! page_contents->glyphs.is_equal_to_head()) {
+ do {
+ page_contents->glyphs.move_left();
+ g = page_contents->glyphs.get_data();
+ result = g->is_a_tag();
+ if (g->is_fi())
+ nf = FALSE;
+ else if (g->is_nf())
+ nf = TRUE;
+ line_start = g->is_col() || g->is_br() || (nf && g->is_eol());
+ } while ((!line_start) && (result));
+ /*
+ * now restore our previous position.
+ */
+ while (page_contents->glyphs.get_data() != orig)
+ page_contents->glyphs.move_right();
+ }
+ return result;
+}
+
+/*
* is_font_courier - returns TRUE if the font, f, is courier.
*/
@@ -2945,7 +3802,7 @@ int html_printer::is_font_courier (font *f)
return( (fontname != 0) && (fontname[0] == 'C') );
}
- return( FALSE );
+ return FALSE;
}
/*
@@ -2994,24 +3851,28 @@ void html_printer::start_font (const char *fontname)
current_paragraph->do_bold();
current_paragraph->do_italic();
} else if (strcmp(fontname, "CR") == 0) {
- if ((! fill_on) && (is_courier_until_eol())) {
+ if ((! fill_on) && (is_courier_until_eol()) &&
+ is_line_start(! fill_on)) {
current_paragraph->do_pre();
}
current_paragraph->do_tt();
} else if (strcmp(fontname, "CI") == 0) {
- if ((! fill_on) && (is_courier_until_eol())) {
+ if ((! fill_on) && (is_courier_until_eol()) &&
+ is_line_start(! fill_on)) {
current_paragraph->do_pre();
}
current_paragraph->do_tt();
current_paragraph->do_italic();
} else if (strcmp(fontname, "CB") == 0) {
- if ((! fill_on) && (is_courier_until_eol())) {
+ if ((! fill_on) && (is_courier_until_eol()) &&
+ is_line_start(! fill_on)) {
current_paragraph->do_pre();
}
current_paragraph->do_tt();
current_paragraph->do_bold();
} else if (strcmp(fontname, "CBI") == 0) {
- if ((! fill_on) && (is_courier_until_eol())) {
+ if ((! fill_on) && (is_courier_until_eol()) &&
+ is_line_start(! fill_on)) {
current_paragraph->do_pre();
}
current_paragraph->do_tt();
@@ -3164,6 +4025,23 @@ void html_printer::do_sup_or_sub (text_glob *g)
}
/*
+ * do_end_para - writes out the html text after shutting down the
+ * current paragraph.
+ */
+
+void html_printer::do_end_para (text_glob *g)
+{
+ do_font(g);
+ current_paragraph->done_para();
+ current_paragraph->remove_para_space();
+ html.put_string(g->text_string+9);
+ output_vpos = g->minv;
+ output_hpos = g->maxh;
+ output_vpos_max = g->maxv;
+ supress_sub_sup = FALSE;
+}
+
+/*
* emit_html - write out the html text
*/
@@ -3187,6 +4065,7 @@ void html_printer::flush_sbuf()
if (sbuf.length() > 0) {
int r=font::res; // resolution of the device
set_style(sbuf_style);
+
if (overstrike_detected && (! is_bold(sbuf_style.f))) {
font *bold_font = make_bold(sbuf_style.f);
if (bold_font != NULL)
@@ -3297,11 +4176,24 @@ html_printer::html_printer()
max_linelength(-1),
linelength(0),
pageoffset(0),
- indentation(0),
- prev_indent(0),
- pointsize(0),
+ troff_indent(0),
+ device_indent(0),
+ temp_indent(0),
+ pointsize(base_point_size),
line_number(0),
- background(default_background)
+ background(default_background),
+ seen_indent(FALSE),
+ next_indent(0),
+ seen_pageoffset(FALSE),
+ next_pageoffset(0),
+ seen_linelength(FALSE),
+ next_linelength(0),
+ seen_center(FALSE),
+ next_center(0),
+ seen_space(0),
+ seen_break(0),
+ current_column(0),
+ row_space(FALSE)
{
file_list.add_new_file(xtmpfile());
html.set_file(file_list.get_file());
@@ -3336,17 +4228,17 @@ html_printer::html_printer()
* add_to_sbuf - adds character code or name to the sbuf.
*/
-void html_printer::add_to_sbuf (int index, const string &s)
+void html_printer::add_to_sbuf (int idx, const string &s)
{
if (sbuf_style.f == NULL)
return;
char *html_glyph = NULL;
- unsigned int code = sbuf_style.f->get_code(index);
+ unsigned int code = sbuf_style.f->get_code(idx);
if (s.empty()) {
- if (sbuf_style.f->contains(index))
- html_glyph = (char *)sbuf_style.f->get_special_device_encoding(index);
+ if (sbuf_style.f->contains(idx))
+ html_glyph = (char *)sbuf_style.f->get_special_device_encoding(idx);
else
html_glyph = NULL;
@@ -3362,7 +4254,7 @@ void html_printer::add_to_sbuf (int index, const string &s)
sbuf += html_glyph;
}
-int html_printer::sbuf_continuation (int index, const char *name,
+int html_printer::sbuf_continuation (int idx, const char *name,
const environment *env, int w)
{
/*
@@ -3372,7 +4264,7 @@ int html_printer::sbuf_continuation (int index, const char *name,
|| ((sbuf_prev_hpos < sbuf_end_hpos)
&& (env->hpos < sbuf_end_hpos)
&& ((sbuf_end_hpos-env->hpos < env->hpos-sbuf_prev_hpos)))) {
- add_to_sbuf(index, name);
+ add_to_sbuf(idx, name);
sbuf_prev_hpos = sbuf_end_hpos;
sbuf_end_hpos += w + sbuf_kern;
return TRUE;
@@ -3384,7 +4276,7 @@ int html_printer::sbuf_continuation (int index, const char *name,
*/
if (env->hpos-sbuf_end_hpos < space_width) {
- add_to_sbuf(index, name);
+ add_to_sbuf(idx, name);
sbuf_prev_hpos = sbuf_end_hpos;
sbuf_end_hpos = env->hpos + w;
return TRUE;
@@ -3401,18 +4293,18 @@ int html_printer::sbuf_continuation (int index, const char *name,
char *get_html_translation (font *f, const string &name)
{
- int index;
+ int idx;
if ((f == 0) || name.empty())
return NULL;
else {
- index = f->name_to_index((char *)(name + '\0').contents());
- if (index == 0) {
+ idx = f->name_to_index((char *)(name + '\0').contents());
+ if (idx == 0) {
error("character `%s' not found", (name + '\0').contents());
return NULL;
} else
- if (f->contains(index))
- return (char *)f->get_special_device_encoding(index);
+ if (f->contains(idx))
+ return (char *)f->get_special_device_encoding(idx);
else
return NULL;
}
@@ -3425,7 +4317,7 @@ char *get_html_translation (font *f, const string &name)
* is flushed.
*/
-int html_printer::overstrike(int index, const char *name, const environment *env, int w)
+int html_printer::overstrike(int idx, const char *name, const environment *env, int w)
{
if ((env->hpos < sbuf_end_hpos)
|| ((sbuf_kern != 0) && (sbuf_end_hpos - sbuf_kern < env->hpos))) {
@@ -3435,7 +4327,7 @@ int html_printer::overstrike(int index, const char *name, const environment *env
if (overstrike_detected) {
/* already detected, remove previous glyph and use this glyph */
sbuf.set_length(last_sbuf_length);
- add_to_sbuf(index, name);
+ add_to_sbuf(idx, name);
sbuf_end_hpos = env->hpos + w;
return TRUE;
} else {
@@ -3444,7 +4336,7 @@ int html_printer::overstrike(int index, const char *name, const environment *env
if (! is_bold(sbuf_style.f))
flush_sbuf();
overstrike_detected = TRUE;
- add_to_sbuf(index, name);
+ add_to_sbuf(idx, name);
sbuf_end_hpos = env->hpos + w;
return TRUE;
}
@@ -3453,11 +4345,13 @@ int html_printer::overstrike(int index, const char *name, const environment *env
}
/*
- * set_char - adds a character into the sbuf if it is a continuation with the previous
- * word otherwise flush the current sbuf and add character anew.
+ * set_char - adds a character into the sbuf if it is a continuation
+ * with the previous word otherwise flush the current sbuf
+ * and add character anew.
*/
-void html_printer::set_char(int i, font *f, const environment *env, int w, const char *name)
+void html_printer::set_char(int i, font *f, const environment *env,
+ int w, const char *name)
{
style sty(f, env->size, env->height, env->slant, env->fontno, *env->col);
if (sty.slant != 0) {
@@ -3471,6 +4365,8 @@ void html_printer::set_char(int i, font *f, const environment *env, int w, const
return;
flush_sbuf();
+ if (sbuf_style.f == NULL)
+ sbuf_style = sty;
add_to_sbuf(i, name);
sbuf_end_hpos = env->hpos + w;
sbuf_start_hpos = env->hpos;
@@ -3516,11 +4412,44 @@ void html_printer::set_numbered_char(int num, const environment *env,
w = nbsp_width;
else
w = f->get_width(i, env->size);
+ w = round_width(w);
if (widthp)
*widthp = w;
set_char(i, f, env, w, 0);
}
+int html_printer::set_char_and_width(const char *nm, const environment *env,
+ int *widthp, font **f)
+{
+ int i = font::name_to_index(nm);
+ int fn = env->fontno;
+ if (fn < 0 || fn >= nfonts) {
+ error("bad font position `%1'", fn);
+ return -1;
+ }
+ *f = font_table[fn];
+ if (*f == 0) {
+ error("no font mounted at `%1'", fn);
+ return -1;
+ }
+ if (!(*f)->contains(i)) {
+ if (nm[0] != '\0' && nm[1] == '\0')
+ error("font `%1' does not contain ascii character `%2'",
+ (*f)->get_name(),
+ nm[0]);
+ else
+ error("font `%1' does not contain special character `%2'",
+ (*f)->get_name(),
+ nm);
+ return -1;
+ }
+ int w = (*f)->get_width(i, env->size);
+ w = round_width(w);
+ if (widthp)
+ *widthp = w;
+ return i;
+}
+
/*
* write_title - writes the title to this document
*/
@@ -3573,8 +4502,8 @@ void html_printer::begin_page(int n)
output_vpos = -1;
output_vpos_max = -1;
current_paragraph = new html_text(&html);
- do_indent(indentation, pageoffset, linelength);
- current_paragraph->do_para("");
+ do_indent(get_troff_indent(), pageoffset, linelength);
+ current_paragraph->do_para("", FALSE);
}
void html_printer::end_page(int)
@@ -3606,6 +4535,133 @@ void html_printer::do_body (void)
}
}
+/*
+ * emit_link - generates: <a href="to">name</a>
+ */
+
+void html_printer::emit_link (const string &to, const char *name)
+{
+ fputs("<a href=\"", stdout);
+ fputs(to.contents(), stdout);
+ fputs("\">", stdout);
+ fputs(name, stdout);
+ fputs("</a>", stdout);
+}
+
+/*
+ * write_navigation - writes out the links which navigate between
+ * file fragments.
+ */
+
+void html_printer::write_navigation (const string &top, const string &prev,
+ const string &next, const string &current)
+{
+ int need_bar = FALSE;
+
+ if (multiple_files) {
+ write_rule();
+ fputs("[ ", stdout);
+ if ((strcmp(prev.contents(), "") != 0) && prev != top && prev != current) {
+ emit_link(prev, "prev");
+ need_bar = TRUE;
+ }
+ if ((strcmp(next.contents(), "") != 0) && next != top && next != current) {
+ if (need_bar)
+ fputs(" | ", stdout);
+ emit_link(next, "next");
+ need_bar = TRUE;
+ }
+ if (top != "<standard input>" && (strcmp(top.contents(), "") != 0) && top != current) {
+ if (need_bar)
+ fputs(" | ", stdout);
+ emit_link(top, "top");
+ }
+ fputs(" ]\n", stdout);
+ write_rule();
+ }
+}
+
+/*
+ * do_file_components - scan the file list copying each temporary
+ * file in turn. This is used twofold:
+ *
+ * firstly to emit section heading links,
+ * between file fragments if required and
+ * secondly to generate jobname file fragments
+ * if required.
+ */
+
+void html_printer::do_file_components (void)
+{
+ int fragment_no = 1;
+ string top;
+ string prev;
+ string next;
+ string current;
+
+ file_list.start_of_list();
+ top = string(job_name);
+ top += string(".html");
+ top += '\0';
+ next = file_list.next_file_name();
+ next += '\0';
+ current = next;
+ while (file_list.get_file() != 0) {
+ if (fseek(file_list.get_file(), 0L, 0) < 0)
+ fatal("fseek on temporary file failed");
+ html.copy_file(file_list.get_file());
+ fclose(file_list.get_file());
+
+ file_list.move_next();
+ if (file_list.is_new_output_file()) {
+ if (fragment_no > 1)
+ write_navigation(top, prev, next, current);
+ prev = current;
+ current = next;
+ next = file_list.next_file_name();
+ next += '\0';
+ string split_file = file_list.file_name();
+ split_file += '\0';
+ fflush(stdout);
+ freopen(split_file.contents(), "w", stdout);
+ fragment_no++;
+ writeHeadMetaStyle();
+ write_navigation(top, prev, next, current);
+ }
+ if (file_list.are_links_required())
+ header.write_headings(stdout, TRUE);
+ }
+ if (fragment_no > 1)
+ write_navigation(top, prev, next, current);
+ else
+ write_rule();
+}
+
+/*
+ * writeHeadMetaStyle - emits the <head> <meta> and <style> tags and
+ * related information.
+ */
+
+void html_printer::writeHeadMetaStyle (void)
+{
+ fputs("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n", stdout);
+ fputs("\"http://www.w3.org/TR/html4/loose.dtd\">\n", stdout);
+
+ fputs("<html>\n", stdout);
+ fputs("<head>\n", stdout);
+ fputs("<meta name=\"generator\" "
+ "content=\"groff -Thtml, see www.gnu.org\">\n", stdout);
+ fputs("<meta http-equiv=\"Content-Type\" "
+ "content=\"text/html; charset=US-ASCII\">\n", stdout);
+ fputs("<meta name=\"Content-Style\" content=\"text/css\">\n", stdout);
+
+ fputs("<style type=\"text/css\">\n", stdout);
+ fputs(" p { margin-top: 0; margin-bottom: 0; }\n", stdout);
+ fputs(" pre { margin-top: 0; margin-bottom: 0; }\n", stdout);
+ fputs(" table { margin-top: 0; margin-bottom: 0; }\n", stdout);
+ fputs("</style>\n", stdout);
+}
+
html_printer::~html_printer()
{
#ifdef LONG_FOR_TIME_T
@@ -3628,17 +4684,11 @@ html_printer::~html_printer()
.put_string(ctime(&t), strlen(ctime(&t))-1)
.end_comment();
- fputs("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n", stdout);
- fputs("\"http://www.w3.org/TR/html4/loose.dtd\">\n", stdout);
+ writeHeadMetaStyle();
- fputs("<html>\n", stdout);
- fputs("<head>\n", stdout);
- fputs("<meta name=\"generator\" "
- "content=\"groff -Thtml, see www.gnu.org\">\n", stdout);
- fputs("<meta http-equiv=\"Content-Type\" "
- "content=\"text/html; charset=US-ASCII\">\n", stdout);
- fputs("<meta name=\"Content-Style\" content=\"text/css\">\n", stdout);
write_title(TRUE);
+ head_info += '\0';
+ fputs(head_info.contents(), stdout);
fputs("</head>\n", stdout);
do_body();
@@ -3650,28 +4700,131 @@ html_printer::~html_printer()
#endif
html.end_line();
html.end_line();
- /*
- * now run through the file list copying each temporary file in turn and emitting the links.
- */
- file_list.start_of_list();
- while (file_list.get_file() != 0) {
- if (fseek(file_list.get_file(), 0L, 0) < 0)
- fatal("fseek on temporary file failed");
- html.copy_file(file_list.get_file());
- fclose(file_list.get_file());
- file_list.move_next();
- if (file_list.get_file() != 0)
- header.write_headings(stdout, TRUE);
+
+ if (multiple_files) {
+ fputs("</body>\n", stdout);
+ fputs("</html>\n", stdout);
+ do_file_components();
+ } else {
+ do_file_components();
+ fputs("</body>\n", stdout);
+ fputs("</html>\n", stdout);
}
- write_rule();
- fputs("</body>\n", stdout);
- fputs("</html>\n", stdout);
}
/*
- * special - handle all x X requests from troff. For post-html they allow users
- * to pass raw html commands, turn auto linked headings off/on and
- * also allow troff to emit tags to indicate when a: .br, .sp etc occurs.
+ * get_str - returns a dupicate of string, s. The duplicate
+ * string is terminated at the next ',' or ']'.
+ */
+
+static char *get_str (const char *s, char **n)
+{
+ int i=0;
+ char *v;
+
+ while ((s[i] != (char)0) && (s[i] != ',') && (s[i] != ']'))
+ i++;
+ if (i>0) {
+ v = new char[i+1];
+ memcpy(v, s, i+1);
+ v[i] = (char)0;
+ if (s[i] == ',')
+ (*n) = (char *)&s[i+1];
+ else
+ (*n) = (char *)&s[i];
+ return v;
+ }
+ if (s[i] == ',')
+ (*n) = (char *)&s[1];
+ else
+ (*n) = (char *)s;
+ return NULL;
+}
+
+/*
+ * make_val - creates a string from if s is NULL.
+ */
+
+char *make_val (char *s, int v, char *id, char *f, char *l)
+{
+ if (s == NULL) {
+ char buf[30];
+
+ sprintf(buf, "%d", v);
+ return strsave(buf);
+ }
+ else {
+ /*
+ * check that value, s, is the same as, v.
+ */
+ char *t = s;
+
+ while (*t == '=')
+ t++;
+ if (atoi(t) != v) {
+ if (f == NULL)
+ f = (char *)"stdin";
+ if (l == NULL)
+ l = (char *)"<none>";
+ fprintf(stderr, "%s:%s: grohtml assertion failed at id%s expecting %d and was given %s\n",
+ f, l, id, v, s);
+ }
+ return s;
+ }
+}
+
+/*
+ * handle_assertion - handles the assertions created via .www:ASSERT
+ * in www.tmac. See www.tmac for examples.
+ * This method should be called as we are
+ * parsing the ditroff input. It checks the x, y
+ * position assertions. It does _not_ check the
+ * troff state assertions as these are unknown at this
+ * point.
+ */
+
+void html_printer::handle_assertion (int minv, int minh, int maxv, int maxh, const char *s)
+{
+ char *n;
+ char *cmd = get_str(s, &n);
+ char *id = get_str(n, &n);
+ char *val = get_str(n, &n);
+ char *file= get_str(n, &n);
+ char *line= get_str(n, &n);
+
+ if (strcmp(cmd, "assertion:[x") == 0)
+ as.addx(cmd, id, make_val(val, minh, id, file, line), file, line);
+ else if (strcmp(cmd, "assertion:[y") == 0)
+ as.addy(cmd, id, make_val(val, minv, id, file, line), file, line);
+ else
+ if (strncmp(cmd, "assertion:[", strlen("assertion:[")) == 0)
+ page_contents->add_tag(&sbuf_style, string(s),
+ line_number, minv, minh, maxv, maxh);
+}
+
+/*
+ * build_state_assertion - builds the troff state assertions.
+ */
+
+void html_printer::handle_state_assertion (text_glob *g)
+{
+ if (g != NULL && g->is_a_tag() &&
+ (strncmp(g->text_string, "assertion:[", 11) == 0)) {
+ char *n = (char *)&g->text_string[11];
+ char *cmd = get_str(n, &n);
+ char *val = get_str(n, &n);
+ (void)get_str(n, &n); // unused
+ char *file= get_str(n, &n);
+ char *line= get_str(n, &n);
+
+ as.build(cmd, val, file, line);
+ }
+}
+
+/*
+ * special - handle all x X requests from troff. For post-html they
+ * allow users to pass raw html commands, turn auto linked
+ * headings off/on etc.
*/
void html_printer::special(char *s, const environment *env, char type)
@@ -3702,16 +4855,73 @@ void html_printer::special(char *s, const environment *env, char type)
page_contents->add_and_encode(&sbuf_style, string(&s[5]),
line_number,
env->vpos-env->size*r/72, env->hpos,
- env->vpos , env->hpos);
+ env->vpos , env->hpos,
+ FALSE);
/*
- * assume that the html command has no width, if it does then hopefully troff
- * will have fudged this in a macro by requesting that the formatting move right by
- * the appropriate amount.
+ * assume that the html command has no width, if it does then
+ * hopefully troff will have fudged this in a macro by
+ * requesting that the formatting move right by the appropriate
+ * amount.
+ */
+ } else if (strncmp(s, "html</p>:", 9) == 0) {
+ int r=font::res; /* resolution of the device */
+ font *f=sbuf_style.f;
+
+ if (f == NULL) {
+ int found=FALSE;
+
+ f = font::load_font("TR", &found);
+ }
+
+ /*
+ * need to pass all of string through to html output during flush
+ */
+ page_contents->add_and_encode(&sbuf_style, string(s),
+ line_number,
+ env->vpos-env->size*r/72, env->hpos,
+ env->vpos , env->hpos,
+ TRUE);
+
+ /*
+ * assume that the html command has no width, if it does then
+ * hopefully troff will have fudged this in a macro by
+ * requesting that the formatting move right by the appropriate
+ * amount.
*/
} else if (strncmp(s, "index:", 6) == 0) {
cutoff_heading = atoi(&s[6]);
- } else if (strncmp(s, "html-tag:", 9) == 0) {
+ } else if (strncmp(s, "assertion:[", 11) == 0) {
+ int r=font::res; /* resolution of the device */
+
+ handle_assertion(env->vpos-env->size*r/72, env->hpos,
+ env->vpos, env->hpos, s);
+ }
+ }
+}
+
+/*
+ * devtag - handles device troff tags sent from the `troff'.
+ * These include the troff state machine tags:
+ * .br, .sp, .in, .tl, .ll etc
+ *
+ * (see man 5 grohtml_tags).
+ */
+
+void html_printer::devtag (char *s, const environment *env, char type)
+{
+ if (type != 'p')
+ return;
+
+ if (s != 0) {
+ flush_sbuf();
+ if (env->fontno >= 0) {
+ style sty(get_font_from_index(env->fontno), env->size, env->height,
+ env->slant, env->fontno, *env->col);
+ sbuf_style = sty;
+ }
+
+ if (strncmp(s, "devtag:", strlen("devtag:")) == 0) {
int r=font::res; /* resolution of the device */
page_contents->add_tag(&sbuf_style, string(s),
@@ -3722,6 +4932,26 @@ void html_printer::special(char *s, const environment *env, char type)
}
}
+
+/*
+ * taken from number.cpp in src/roff/troff, [hunits::hunits(units x)]
+ */
+
+int html_printer::round_width(int x)
+{
+ int r = font::hor;
+ int n;
+
+ // don't depend on the rounding direction for division of negative integers
+ if (r == 1)
+ n = x;
+ else
+ n = (x < 0
+ ? -((-x + r/2 - 1)/r)
+ : (x + r/2 - 1)/r);
+ return n * r;
+}
+
int main(int argc, char **argv)
{
program_name = argv[0];
@@ -3733,58 +4963,69 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "a:g:o:i:I:D:F:vbdhlrnp", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "a:bdD:F:g:hi:I:j:lno:prs:S:v",
+ long_options, NULL))
!= EOF)
switch(c) {
- case 'v':
- printf("GNU post-grohtml (groff) version %s\n", Version_string);
- exit(0);
- break;
case 'a':
/* text antialiasing bits - handled by pre-html */
break;
- case 'g':
- /* graphic antialiasing bits - handled by pre-html */
- break;
case 'b':
// set background color to white
default_background = new color;
default_background->set_gray(color::MAX_COLOR_VAL);
break;
- case 'F':
- font::command_line_font_dir(optarg);
+ case 'd':
+ /* handled by pre-html */
break;
- case 'l':
- auto_links = FALSE;
+ case 'D':
+ /* handled by pre-html */
break;
- case 'r':
- auto_rule = FALSE;
+ case 'F':
+ font::command_line_font_dir(optarg);
break;
- case 'd':
- /* handled by pre-html */
+ case 'g':
+ /* graphic antialiasing bits - handled by pre-html */
break;
case 'h':
/* do not use the Hn headings of html, but manufacture our own */
manufacture_headings = TRUE;
break;
- case 'o':
- /* handled by pre-html */
- break;
- case 'p':
- /* handled by pre-html */
- break;
case 'i':
/* handled by pre-html */
break;
case 'I':
/* handled by pre-html */
break;
- case 'D':
- /* handled by pre-html */
+ case 'j':
+ multiple_files = TRUE;
+ job_name = optarg;
+ break;
+ case 'l':
+ auto_links = FALSE;
break;
case 'n':
simple_anchors = TRUE;
break;
+ case 'o':
+ /* handled by pre-html */
+ break;
+ case 'p':
+ /* handled by pre-html */
+ break;
+ case 'r':
+ auto_rule = FALSE;
+ break;
+ case 's':
+ base_point_size = atoi(optarg);
+ break;
+ case 'S':
+ split_level = atoi(optarg) + 1;
+ break;
+ case 'v':
+ printf("GNU post-grohtml (groff) version %s\n", Version_string);
+ exit(0);
+ break;
case CHAR_MAX + 1: // --help
usage(stdout);
exit(0);
diff --git a/contrib/groff/src/devices/grolbp/lbp.cpp b/contrib/groff/src/devices/grolbp/lbp.cpp
index b34a1e0..081ab99 100644
--- a/contrib/groff/src/devices/grolbp/lbp.cpp
+++ b/contrib/groff/src/devices/grolbp/lbp.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1994, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Francisco Andrés Verdú <pandres@dragonet.es> with many ideas
taken from the other groff drivers.
@@ -18,16 +19,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
TODO
- Add X command to include bitmaps
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include "driver.h"
#include "lbp.h"
@@ -93,21 +91,6 @@ private:
int paperwidth;
};
-// Compatibility section.
-//
-// Here we define some functions not present in some of the targets
-// platforms
-#ifndef HAVE_STRSEP
-// Solaris 8 doesn't have the strsep function
-static char *strsep(char **pcadena, const char *delim)
-{
- char *p;
- p = strtok(*pcadena, delim);
- *pcadena = strtok(NULL, delim);
- return p;
-}
-#endif
-
lbp_font::lbp_font(const char *nm)
: font(nm)
{
@@ -231,7 +214,7 @@ inline void lbp_printer::set_line_thickness(int size,const environment *env)
/* fprintf(stderr, "thickness: %d == %d, size %d, %d \n",
size, line_thickness, env->size,req_linethickness); */
return;
-}; // lbp_printer::set_line_thickness
+} // lbp_printer::set_line_thickness
void lbp_printer::begin_page(int)
{
@@ -294,10 +277,10 @@ char *lbp_printer::font_name(const lbp_font *f, const int siz)
return bfont_name;
}
-void lbp_printer::set_char(int index, font *f, const environment *env,
+void lbp_printer::set_char(int idx, font *f, const environment *env,
int w, const char *)
{
- int code = f->get_code(index);
+ int code = f->get_code(idx);
unsigned char ch = code & 0xff;
unsigned short symbol_set = code >> 8;
if (f != cur_font) {
@@ -441,9 +424,9 @@ void lbp_printer::draw(int code, int *p, int np, const environment *env)
if (np != 1 && np != 2) {
error("0 or 1 argument required for thickness");
break;
- };
+ }
set_line_thickness(p[0],env);
- };
+ }
break;
case 'l': // Line
if (np != 2) {
@@ -663,12 +646,15 @@ int main(int argc, char **argv)
int c = 0;
int option_index = 0;
while (c >= 0) {
- c = getopt_long (argc, argv, "F:p:lvo:c:hw:",
+ c = getopt_long (argc, argv, "c:F:hI:lo:p:vw:",
long_options, &option_index);
switch (c) {
case 'F':
font::command_line_font_dir(optarg);
break;
+ case 'I':
+ // ignore include path arguments
+ break;
case 'p':
{
const char *s;
@@ -694,7 +680,7 @@ int main(int argc, char **argv)
orientation = 1;
else
error("unknown orientation '%1'", optarg);
- };
+ }
break;
case 'c':
{
diff --git a/contrib/groff/src/devices/grolbp/lbp.h b/contrib/groff/src/devices/grolbp/lbp.h
index e669ff2..b3171cf 100644
--- a/contrib/groff/src/devices/grolbp/lbp.h
+++ b/contrib/groff/src/devices/grolbp/lbp.h
@@ -1,5 +1,6 @@
// -*- C -*-
-/* Copyright (C) 1994, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Francisco Andrés Verdú <pandres@dragonet.es>
groff is free software; you can redistribute it and/or modify it under
@@ -14,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file contains a set of utility functions to use canon CAPSL printers
* (lbp-4 and lbp-8 series printers) */
@@ -28,14 +29,15 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static FILE *lbpoutput = NULL;
static FILE *vdmoutput = NULL;
+
static inline void
lbpinit(FILE *outfile)
{
lbpoutput = outfile;
-};
+}
-static inline void
+static void
lbpprintf(const char *format, ... )
{ /* Taken from cjet */
va_list stuff;
@@ -43,68 +45,78 @@ lbpprintf(const char *format, ... )
va_start(stuff, format);
vfprintf(lbpoutput, format, stuff);
va_end(stuff);
-};
+}
+
static inline void
lbpputs(const char *data)
{
fputs(data,lbpoutput);
-};
+}
+
static inline void
lbpputc(unsigned char c)
{
fputc(c,lbpoutput);
-};
+}
static inline void
-lbpsavestatus(int index )
+lbpsavestatus(int idx )
{
- fprintf(lbpoutput,"\033[%d%%y",index);
-};
+ fprintf(lbpoutput,"\033[%d%%y",idx);
+}
+
static inline void
-lbprestorestatus(int index )
+lbprestorestatus(int idx )
{
- fprintf(lbpoutput,"\033[%d%cz",index ,'%');
-};
+ fprintf(lbpoutput,"\033[%d%cz",idx ,'%');
+}
+
static inline void
-lbpsavepos(int index)
+lbpsavepos(int idx)
{
- fprintf(lbpoutput,"\033[1;%d;0x",index);
-};
+ fprintf(lbpoutput,"\033[1;%d;0x",idx);
+}
+
static inline void
-lbprestorepos(int index)
+lbprestorepos(int idx)
{
- fprintf(lbpoutput,"\033[0;%d;0x",index);
-};
+ fprintf(lbpoutput,"\033[0;%d;0x",idx);
+}
+
static inline void
-lbprestoreposx(int index)
+lbprestoreposx(int idx)
{
- fprintf(lbpoutput,"\033[0;%d;1x",index);
-};
+ fprintf(lbpoutput,"\033[0;%d;1x",idx);
+}
+
static inline void
lbpmoverel(int despl, char direction)
{
fprintf(lbpoutput,"\033[%d%c",despl,direction);
-};
+}
+
static inline void
lbplinerel(int width,int despl,char direction )
{
fprintf(lbpoutput,"\033[%d;0;9{\033[%d%c\033[9}",width,despl,direction);
-};
+}
+
static inline void
lbpmoveabs(int x, int y)
{
fprintf(lbpoutput,"\033[%d;%df",y,x);
-};
+}
+
static inline void
lbplineto(int x,int y, int width )
@@ -112,7 +124,8 @@ lbplineto(int x,int y, int width )
fprintf(lbpoutput,"\033[%d;0;9{",width);
lbpmoveabs(x,y);
fprintf(lbpoutput,"\033[9}\n");
-};
+}
+
static inline void
lbpruleabs(int x, int y, int hsize, int vsize)
@@ -121,9 +134,11 @@ lbpruleabs(int x, int y, int hsize, int vsize)
fprintf(lbpoutput,"\033[0;9;000s");
lbpmoveabs(x+hsize,y+vsize);
fprintf(lbpoutput,"\033[9r");
-};
+}
+
+
+static void vdmprintf(const char *format, ... );
-static inline void vdmprintf(const char *format, ... );
static inline char *
vdmnum(int num,char *result)
@@ -147,7 +162,8 @@ vdmnum(int num,char *result)
*p++ = b3;
*p = 0x00; /* End of the resulting string */
return result;
-};
+}
+
static inline void
vdmorigin(int newx, int newy)
@@ -155,7 +171,7 @@ vdmorigin(int newx, int newy)
char nx[4],ny[4];
vdmprintf("}\"%s%s\x1e",vdmnum(newx,nx),vdmnum(newy,ny));
-}; /* vdmorigin */
+}
static inline FILE *
@@ -170,15 +186,17 @@ vdminit(FILE *vdmfile)
vdmnum(-3,scale),vdmnum(1,size),vdmnum(1,lineend));
return vdmoutput;
-};
+}
+
static inline void
vdmend()
{
vdmprintf("}p\x1e");
-};
+}
-static inline void
+
+static void
vdmprintf(const char *format, ... )
{ /* Taken from cjet */
va_list stuff;
@@ -187,7 +205,8 @@ vdmprintf(const char *format, ... )
va_start(stuff, format);
vfprintf(vdmoutput, format, stuff);
va_end(stuff);
-};
+}
+
static inline void
vdmsetfillmode(int pattern,int perimeter, int inverted)
@@ -200,7 +219,8 @@ vdmsetfillmode(int pattern,int perimeter, int inverted)
vdmprintf("I%s%s%s%s%s\x1e",vdmnum(pattern,patt),\
vdmnum(perimeter,perim),vdmnum(0,rot),
vdmnum(0,espejo),vdmnum(inverted,inv));
-};
+}
+
static inline void
vdmcircle(int centerx, int centery, int radius)
@@ -209,7 +229,8 @@ vdmcircle(int centerx, int centery, int radius)
vdmprintf("5%s%s%s\x1e",vdmnum(centerx,x),vdmnum(centery,y),\
vdmnum(radius,rad));
-};
+}
+
static inline void
vdmaarc(int centerx, int centery, int radius,int startangle,int angle,int style,int arcopen)
@@ -220,7 +241,8 @@ vdmaarc(int centerx, int centery, int radius,int startangle,int angle,int style,
vdmnum(centerx,x),vdmnum(centery,y),\
vdmnum(radius,rad),vdmnum(startangle,stx),vdmnum(angle,sty),\
vdmnum(style,styl));
-};
+}
+
static inline void
vdmvarc(int centerx, int centery,int radius, int startx, int starty, int endx, int endy,\
@@ -228,11 +250,12 @@ vdmvarc(int centerx, int centery,int radius, int startx, int starty, int endx, i
{
char x[4],y[4],rad[4],stx[4],sty[4],enx[4],eny[4],styl[4],op[4];
- vdmprintf("}6%s%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
+ vdmprintf("}6%s%s%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
vdmnum(centerx,x),vdmnum(centery,y),\
vdmnum(radius,rad),vdmnum(startx,stx),vdmnum(starty,sty),\
vdmnum(endx,enx),vdmnum(endy,eny),vdmnum(style,styl));
-};
+}
+
static inline void
vdmellipse(int centerx, int centery, int radiusx, int radiusy,int rotation)
@@ -242,7 +265,8 @@ vdmellipse(int centerx, int centery, int radiusx, int radiusy,int rotation)
vdmprintf("}7%s%s%s%s%s\x1e\n",vdmnum(centerx,x),vdmnum(centery,y),\
vdmnum(radiusx,radx),vdmnum(radiusy,rady),\
vdmnum(rotation,rotat));
-};
+}
+
static inline void
vdmsetlinetype(int lintype)
@@ -251,7 +275,8 @@ vdmsetlinetype(int lintype)
vdmprintf("E1%s%s\x1e",vdmnum(lintype,ltyp),vdmnum(1,expfact));
-};
+}
+
static inline void
vdmsetlinestyle(int lintype, int pattern,int unionstyle)
@@ -265,7 +290,8 @@ vdmsetlinestyle(int lintype, int pattern,int unionstyle)
vdmnum(pattern,patt),vdmnum(0,rot),
vdmnum(0,espejo),vdmnum(0,in));
vdmprintf("}F%s",vdmnum(unionstyle,rot));
-};
+}
+
static inline void
vdmlinewidth(int width)
@@ -273,7 +299,8 @@ vdmlinewidth(int width)
char wh[4];
vdmprintf("F1%s\x1e",vdmnum(width,wh));
-};
+}
+
static inline void
vdmrectangle(int origx, int origy,int dstx, int dsty)
@@ -282,7 +309,8 @@ vdmrectangle(int origx, int origy,int dstx, int dsty)
vdmprintf("}:%s%s%s%s\x1e\n",vdmnum(origx,xcoord),vdmnum(dstx,sdstx),\
vdmnum(origy,ycoord),vdmnum(dsty,sdsty));
-}; /* polyline */
+}
+
static inline void
vdmpolyline(int numpoints, int *points)
@@ -296,10 +324,11 @@ vdmpolyline(int numpoints, int *points)
for (i = 1; i < numpoints ; i++) {
vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
p += 2;
- }; /* for */
+ } /* for */
vdmprintf("\x1e\n");
-}; /* polyline */
+}
+
static inline void
vdmpolygon(int numpoints, int *points)
{
@@ -312,10 +341,10 @@ vdmpolygon(int numpoints, int *points)
for (i = 1; i < numpoints ; i++) {
vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
p += 2;
- }; /* for */
+ } /* for */
vdmprintf("\x1e\n");
-}; /* vdmpolygon */
+}
/************************************************************************
@@ -325,7 +354,7 @@ static inline int
vdminited()
{
return (vdmoutput != NULL);
-}; /* vdminited */
+}
static inline void
@@ -340,7 +369,8 @@ vdmline(int startx, int starty, int sizex, int sizey)
vdmpolyline(2,points);
-};
+}
+
/*#define THRESHOLD .05 */ /* inch */
#define THRESHOLD 1 /* points (1/300 inch) */
@@ -348,13 +378,13 @@ static inline void
splinerel(double px,double py,int flush)
{
static int lx = 0 ,ly = 0;
- static float pend = 0.0;
+ static double pend = 0.0;
static int dy = 0, despx = 0, despy = 0, sigpend = 0;
- int dxnew ,dynew, sg;
+ int dxnew = 0, dynew = 0, sg;
char xcoord[4],ycoord[4];
- float npend ;
+ double npend ;
- if (flush == -1) {lx = (int)px; ly = (int)py; return;};
+ if (flush == -1) {lx = (int)px; ly = (int)py; return;}
if (flush == 0) {
dxnew = (int)px -lx;
@@ -366,7 +396,7 @@ splinerel(double px,double py,int flush)
despx = dxnew;
if ((sg == sigpend) && (dy == 0)){
return;
- };
+ }
dy = 0;
}
else {
@@ -377,9 +407,9 @@ splinerel(double px,double py,int flush)
else
{ sigpend = sg;
pend = npend;
- }; /* else (( npend == pend) && ... */
- }; /* else (if (dynew == 0)) */
- }; /* if (!flush ) */
+ } /* else (( npend == pend) && ... */
+ } /* else (if (dynew == 0)) */
+ } /* if (!flush ) */
/* if we've changed direction we must draw the line */
/* fprintf(stderr," (%d) %.2f,%.2f\n",flush,(float)px,(float)py);*/
@@ -390,7 +420,7 @@ splinerel(double px,double py,int flush)
if (flush) {
dxnew = dy = despx = despy = 0;
return;
- }; /* if (flush) */
+ } /* if (flush) */
dxnew -= despx;
dynew -= despy;
if ((dxnew != 0) || (dynew != 0)) vdmprintf("%s%s",vdmnum(dxnew,xcoord),\
@@ -401,111 +431,116 @@ splinerel(double px,double py,int flush)
lx = (int)px; ly = (int)py;
dxnew = dy = despx = despy = 0;
-}; /* splinerel */
+}
+
/**********************************************************************
* The following code to draw splines is adapted from the transfig package
*/
static void
-quadratic_spline(double a1,double b1, double a2, double b2, \
- double a3, double b3, double a4, double b4)
-{
- double x1, y1, x4, y4;
- double xmid, ymid;
-
- x1 = a1; y1 = b1;
- x4 = a4; y4 = b4;
- xmid = (a2 + a3)/2.0;
- ymid = (b2 + b3)/2.0;
- if ((fabs(x1 - xmid) < THRESHOLD) && (fabs(y1 - ymid) < THRESHOLD)) {
- splinerel(xmid,ymid,0);
-/* fprintf(tfp, "PA%.4f,%.4f;\n", xmid, ymid);*/
+quadratic_spline(double a_1, double b_1, double a_2, double b_2, \
+ double a_3, double b_3, double a_4, double b_4)
+{
+ double x_1, y_1, x_4, y_4;
+ double x_mid, y_mid;
+
+ x_1 = a_1; y_1 = b_1;
+ x_4 = a_4; y_4 = b_4;
+ x_mid = (a_2 + a_3)/2.0;
+ y_mid = (b_2 + b_3)/2.0;
+ if ((fabs(x_1 - x_mid) < THRESHOLD)
+ && (fabs(y_1 - y_mid) < THRESHOLD)) {
+ splinerel(x_mid, y_mid, 0);
+/* fprintf(tfp, "PA%.4f,%.4f;\n", x_mid, y_mid);*/
}
else {
- quadratic_spline(x1, y1, ((x1+a2)/2.0), ((y1+b2)/2.0),
- ((3.0*a2+a3)/4.0), ((3.0*b2+b3)/4.0), xmid, ymid);
- }
+ quadratic_spline(x_1, y_1, ((x_1+a_2)/2.0), ((y_1+b_2)/2.0),
+ ((3.0*a_2+a_3)/4.0), ((3.0*b_2+b_3)/4.0), x_mid, y_mid);
+ }
- if ((fabs(xmid - x4) < THRESHOLD) && (fabs(ymid - y4) < THRESHOLD)) {
- splinerel(x4,y4,0);
-/* fprintf(tfp, "PA%.4f,%.4f;\n", x4, y4);*/
+ if ((fabs(x_mid - x_4) < THRESHOLD)
+ && (fabs(y_mid - y_4) < THRESHOLD)) {
+ splinerel(x_4, y_4, 0);
+/* fprintf(tfp, "PA%.4f,%.4f;\n", x_4, y_4);*/
}
else {
- quadratic_spline(xmid, ymid, ((a2+3.0*a3)/4.0), ((b2+3.0*b3)/4.0),
- ((a3+x4)/2.0), ((b3+y4)/2.0), x4, y4);
- };
-}; /* quadratic_spline */
+ quadratic_spline(x_mid, y_mid,
+ ((a_2+3.0*a_3)/4.0), ((b_2+3.0*b_3)/4.0),
+ ((a_3+x_4)/2.0), ((b_3+y_4)/2.0), x_4, y_4);
+ }
+}
+
#define XCOORD(i) numbers[(2*i)]
#define YCOORD(i) numbers[(2*i)+1]
static void
-vdmspline(int numpoints, int ox,int oy, int *numbers)
+vdmspline(int numpoints, int o_x, int o_y, int *numbers)
{
- double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
- double x1, y1, x2, y2;
+ double cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4;
+ double x_1, y_1, x_2, y_2;
char xcoord[4],ycoord[4];
int i;
/*p = s->points;
- x1 = p->x/ppi;*/
- x1 = ox;
- y1 = oy;
+ x_1 = p->x/ppi;*/
+ x_1 = o_x;
+ y_1 = o_y;
/* p = p->next;
- x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = ox + XCOORD(0);
- y2 = oy + YCOORD(0);
- cx1 = (x1 + x2)/2.0;
- cy1 = (y1 + y2)/2.0;
- cx2 = (x1 + 3.0*x2)/4.0;
- cy2 = (y1 + 3.0*y2)/4.0;
-
-/* fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x1,(int)y1);*/
- vdmprintf("1%s%s",vdmnum((int)x1,xcoord),vdmnum((int)y1,ycoord));
- splinerel(x1,y1,-1);
- splinerel(cx1,cy1,0);
+ x_2 = p->x/ppi;
+ y_2 = p->y/ppi;*/
+ x_2 = o_x + XCOORD(0);
+ y_2 = o_y + YCOORD(0);
+ cx_1 = (x_1 + x_2)/2.0;
+ cy_1 = (y_1 + y_2)/2.0;
+ cx_2 = (x_1 + 3.0*x_2)/4.0;
+ cy_2 = (y_1 + 3.0*y_2)/4.0;
+
+/* fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x_1,(int)y_1);*/
+ vdmprintf("1%s%s",vdmnum((int)x_1,xcoord),vdmnum((int)y_1,ycoord));
+ splinerel(x_1,y_1,-1);
+ splinerel(cx_1,cy_1,0);
/* fprintf(tfp, "PA%.4f,%.4f;PD%.4f,%.4f;\n",
- x1, y1, cx1, cy1);*/
+ x_1, y_1, cx_1, cy_1);*/
/*for (p = p->next; p != NULL; p = p->next) {*/
for (i = 1; i < (numpoints); i++) {
- x1 = x2;
- y1 = y2;
-/* x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = x1 + XCOORD(i);
- y2 = y1 + YCOORD(i);
- cx3 = (3.0*x1 + x2)/4.0;
- cy3 = (3.0*y1 + y2)/4.0;
- cx4 = (x1 + x2)/2.0;
- cy4 = (y1 + y2)/2.0;
- /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x1,(int)(y1),(int)x2,(int)y2);*/
- quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
- cx1 = cx4;
- cy1 = cy4;
- cx2 = (x1 + 3.0*x2)/4.0;
- cy2 = (y1 + 3.0*y2)/4.0;
- }
- x1 = x2;
- y1 = y2;
-/* p = s->points->next;
- x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = ox + XCOORD(0);
- y2 = oy + YCOORD(0);
- cx3 = (3.0*x1 + x2)/4.0;
- cy3 = (3.0*y1 + y2)/4.0;
- cx4 = (x1 + x2)/2.0;
- cy4 = (y1 + y2)/2.0;
- splinerel(x1,y1,0);
- splinerel(x1,y1,1);
- /*vdmprintf("%s%s",vdmnum((int)(x1-lx),xcoord),\
- vdmnum((int)(y1-ly),ycoord));*/
+ x_1 = x_2;
+ y_1 = y_2;
+/* x_2 = p->x/ppi;
+ y_2 = p->y/ppi;*/
+ x_2 = x_1 + XCOORD(i);
+ y_2 = y_1 + YCOORD(i);
+ cx_3 = (3.0*x_1 + x_2)/4.0;
+ cy_3 = (3.0*y_1 + y_2)/4.0;
+ cx_4 = (x_1 + x_2)/2.0;
+ cy_4 = (y_1 + y_2)/2.0;
+ /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x_1,(int)(y_1),(int)x_2,(int)y_2);*/
+ quadratic_spline(cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4);
+ cx_1 = cx_4;
+ cy_1 = cy_4;
+ cx_2 = (x_1 + 3.0*x_2)/4.0;
+ cy_2 = (y_1 + 3.0*y_2)/4.0;
+ }
+ x_1 = x_2;
+ y_1 = y_2;
+/* p = s->points->next;
+ x_2 = p->x/ppi;
+ y_2 = p->y/ppi;*/
+ x_2 = o_x + XCOORD(0);
+ y_2 = o_y + YCOORD(0);
+ cx_3 = (3.0*x_1 + x_2)/4.0;
+ cy_3 = (3.0*y_1 + y_2)/4.0;
+ cx_4 = (x_1 + x_2)/2.0;
+ cy_4 = (y_1 + y_2)/2.0;
+ splinerel(x_1, y_1, 0);
+ splinerel(x_1, y_1, 1);
+ /*vdmprintf("%s%s",vdmnum((int)(x_1-lx),xcoord),\
+ vdmnum((int)(y_1-ly),ycoord));*/
vdmprintf("\x1e\n");
-/* fprintf(tfp, "PA%.4f,%.4f;PU;\n", x1, y1);*/
+/* fprintf(tfp, "PA%.4f,%.4f;PU;\n", x_1, y_1);*/
-}; /* vdmspline */
+}
#endif
diff --git a/contrib/groff/src/devices/grolj4/Makefile.sub b/contrib/groff/src/devices/grolj4/Makefile.sub
index 9899b7a..1216a49 100644
--- a/contrib/groff/src/devices/grolj4/Makefile.sub
+++ b/contrib/groff/src/devices/grolj4/Makefile.sub
@@ -1,5 +1,6 @@
PROG=grolj4$(EXEEXT)
MAN1=grolj4.n
+MAN5=lj4_font.n
XLIBS=$(LIBDRIVER) $(LIBGROFF)
MLIB=$(LIBM)
OBJS=lj4.$(OBJEXT)
diff --git a/contrib/groff/src/devices/grolj4/grolj4.man b/contrib/groff/src/devices/grolj4/grolj4.man
index 267c621..260a619 100644
--- a/contrib/groff/src/devices/grolj4/grolj4.man
+++ b/contrib/groff/src/devices/grolj4/grolj4.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1994-2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1994-2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -140,6 +140,7 @@ Macros for use with
.SH BUGS
Small dots.
.SH "SEE ALSO"
+.BR lj4_font (@MAN5EXT@),
.BR groff (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
.BR groff_out (@MAN5EXT@),
diff --git a/contrib/groff/src/devices/grolj4/lj4.cpp b/contrib/groff/src/devices/grolj4/lj4.cpp
index 1332e19..1284954 100644
--- a/contrib/groff/src/devices/grolj4/lj4.cpp
+++ b/contrib/groff/src/devices/grolj4/lj4.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1994, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
TODO
@@ -277,10 +278,10 @@ int is_unprintable(unsigned char c)
return c < 32 && (c == 0 || (7 <= c && c <= 15) || c == 27);
}
-void lj4_printer::set_char(int index, font *f, const environment *env,
+void lj4_printer::set_char(int idx, font *f, const environment *env,
int w, const char *)
{
- int code = f->get_code(index);
+ int code = f->get_code(idx);
unsigned char ch = code & 0xff;
unsigned short symbol_set = code >> 8;
@@ -611,18 +612,21 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, ":F:p:d:lvw:c:", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "c:d:F:I:lp:vw:", long_options, NULL))
!= EOF)
switch(c) {
case 'l':
landscape_flag = 1;
break;
+ case 'I':
+ // ignore include search path
+ break;
case ':':
if (optopt == 'd') {
fprintf(stderr, "duplex assumed to be long-side\n");
duplex_flag = 1;
} else
- fprintf(stderr, "option -%c requires an operand\n", optopt);
+ fprintf(stderr, "option -%c requires an argument\n", optopt);
fflush(stderr);
break;
case 'd':
@@ -644,11 +648,9 @@ int main(int argc, char **argv)
break;
}
case 'v':
- {
- printf("GNU grolj4 (groff) version %s\n", Version_string);
- exit(0);
- break;
- }
+ printf("GNU grolj4 (groff) version %s\n", Version_string);
+ exit(0);
+ break;
case 'F':
font::command_line_font_dir(optarg);
break;
diff --git a/contrib/groff/src/devices/grolj4/lj4_font.man b/contrib/groff/src/devices/grolj4/lj4_font.man
new file mode 100644
index 0000000..e82edff
--- /dev/null
+++ b/contrib/groff/src/devices/grolj4/lj4_font.man
@@ -0,0 +1,167 @@
+.tr ~
+.ig
+Copyright (C) 2004 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual 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.
+
+Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be included in
+translations approved by the Free Software Foundation instead of in
+the original English.
+..
+.\" Like TP, but if specified indent is more than half
+.\" the current line-length - indent, use the default indent.
+.de Tp
+.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+.el .TP "\\$1"
+..
+.tr ~
+.TH LJ4_FONT @MAN5EXT@ "@MDATE@" "Groff Version @VERSION@"
+.\" --------------------------------------------------------------------------
+.SH NAME
+.\" --------------------------------------------------------------------------
+lj4_font \- groff fonts for use with devlj4
+.\" --------------------------------------------------------------------------
+.SH DESCRIPTION
+.\" --------------------------------------------------------------------------
+Nominally, all Hewlett-Packard LaserJet~4\(enseries and newer printers
+have the same internal fonts: 45 scalable fonts and one bitmapped
+Lineprinter font.
+The scalable fonts are available in sizes between 0.25 point and 999.75
+points, in 0.25-point increments; the Lineprinter font is available only
+in 8.5-point size.
+.LP
+The LaserJet font files included with
+.B groff
+assume that all printers since the LaserJet~4 are identical.
+There are some differences between fonts in the earlier and more recent
+printers, however.
+The LaserJet~4 printer used Agfa Intellifont technology for 35 of the
+internal scalable fonts; the remaining 10 scalable fonts were TrueType.
+Beginning with the LaserJet~4000\(enseries printers introduced in 1997,
+all scalable internal fonts have been TrueType.
+The number of printable glyphs differs slightly between Intellifont and
+TrueType fonts (generally, the TrueType fonts include more glyphs), and
+there are some minor differences in glyph metrics.
+Differences among printer models are described in the
+.I "PCL~5 Comparison Guide"
+and the
+.I "PCL~5 Comparison Guide Addendum"
+(for printers introduced since approximately 2001).
+.LP
+LaserJet printers reference a glyph by a combination of a 256-glyph
+symbol set and an index within that symbol set.
+Many glyphs appear in more than one symbol set; all combinations of
+symbol set and index that reference the same glyph are equivalent.
+For each glyph,
+.BR hpftodit (@MAN1EXT@)
+searches a list of symbol sets, and selects the first set that contains
+the glyph.
+The printing code generated by
+.BR hpftodit (@MAN1EXT@)
+is an integer that encodes a numerical value for the symbol set in the
+high byte(s), and the index in the low byte.
+See
+.BR groff_font (@MAN5EXT@)
+for a complete description of the font file format; symbol sets are
+described in greater detail in the
+.IR "PCL~5 Printer Language Technical Reference Manual" .
+.LP
+Two of the scalable fonts, Symbol and Wingdings, are bound to
+256-glyph symbol sets; the remaining scalable fonts, as well as the
+Lineprinter font, support numerous symbol sets, sufficient to enable
+printing of more than 600 glyphs.
+.LP
+The metrics generated by
+.BR hpftodit (@MAN1EXT@)
+assume that the DESC file contains values of 1200 for res and 6350 for
+unitwidth (or any combination (e.g., 2400 and 3175) for which
+res~\(mu~unitwidth~=~7\|620\|000).
+Although HP PCL~5 LaserJet printers support an internal resolution of
+7200 units per inch, they use a 16-bit signed integer for cursor
+positioning; if
+.B devlj4
+is to support U.S. ledger paper (11\(sd~\(mu~17\(sd), the maximum usable
+resolution is 32\|767~/~17, or 1927, units per inch, which rounds down to
+1200 units per inch.
+If the largest required paper size is less (e.g., 8.5\(sd~\(mu~11\(sd or
+A5), a greater resolution (and lesser unitwidth) can be specified.
+.\" --------------------------------------------------------------------------
+.SH LIMITATIONS
+.\" --------------------------------------------------------------------------
+Font metrics for Intellifont fonts were provided by Tagged Font Metric
+(TFM) files originally developed by Agfa/Compugraphic.
+The TFM files provided for these fonts supported 600+ glyphs and
+contained extensive lists of kern pairs.
+.LP
+To accommodate developers who had become accustomed to TFM files, HP also
+provided TFM files for the 10 TrueType fonts included in the LaserJet~4.
+The TFM files for TrueType fonts generally included less information
+than the Intellifont TFMs, supporting fewer glyphs, and in most cases,
+providing no kerning information.
+By the time the LaserJet~4000 printer was introduced, most
+developers had migrated to other means of obtaining font metrics,
+and support for new TFM files was very limited.
+The TFM files provided for the TrueType fonts in the LaserJet~4000
+support only the Latin 2 (ISO 8859-2) symbol set, and include no kerning
+information; consequently, they are of little value for any but the most
+rudimentary documents.
+.LP
+Because the Intellifont TFM files contain considerably more information,
+they generally are preferable to the TrueType TFM files even for use
+with the TrueType fonts in the newer printers.
+The metrics for the TrueType fonts are very close, though not identical,
+to those for the earlier Intellifont fonts of the same names.
+Although most output using the Intellifont metrics with the newer
+printers is quite acceptable, a few glyphs may fail to print as
+expected.
+The differences in glyph metrics may be particularly noticeable with
+composite parentheses, brackets, and braces used by
+.BR eqn (@MAN1EXT@) .
+A script, located in
+.BR @FONTDIR@/devlj4/generate ,
+can be used to adjust the metrics for these glyphs in the special font S
+for use with printers that have all TrueType fonts.
+.LP
+At the time HP last supported TFM files, only Version 1 of the Unicode
+standard was available.
+Consequently, many glyphs lacking assigned code points were assigned by
+HP to the Private Use Area (PUA).
+Later versions of the Unicode standard included code points outside the
+PUA for many of these glyphs.
+The HP-supplied TrueType TFM files use the PUA assignments;
+TFM files generated from more recent TrueType font files require the
+later Unicode values to access the same glyphs.
+Consequently, two different mapping files may be required: one for the
+HP-supplied TFM files, and one for more recent TFM files.
+.\" --------------------------------------------------------------------------
+.SH FILES
+.\" --------------------------------------------------------------------------
+.Tp \w'\fB@FONTDIR@/devlj4/DESC'u+2n
+.B @FONTDIR@/devlj4/DESC
+Device description file.
+.TP
+.BI @FONTDIR@/devlj4/ F
+Font description file for font
+.IR F .
+.\" --------------------------------------------------------------------------
+.SH "SEE ALSO"
+.\" --------------------------------------------------------------------------
+.ad 0
+.BR groff (@MAN1EXT@),
+.BR groff_diff (@MAN1EXT@),
+.BR hpftodit (@MAN1EXT@),
+.BR grolj4 (@MAN1EXT@),
+.BR groff_font (@MAN5EXT@)
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/groff/src/devices/grops/grops.man b/contrib/groff/src/devices/grops/grops.man
index e9f8f02..0ff2579 100644
--- a/contrib/groff/src/devices/grops/grops.man
+++ b/contrib/groff/src/devices/grops/grops.man
@@ -1,5 +1,6 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -17,6 +18,9 @@ translations approved by the Free Software Foundation instead of in
the original English.
..
.
+.do nr grops_C \n[.C]
+.cp 0
+.
.mso www.tmac
.
.
@@ -62,6 +66,7 @@ grops \- PostScript driver for groff
.OP \-b n
.OP \-c n
.OP \-F dir
+.OP \-I dir
.OP \-p papersize
.OP \-P prologue
.OP \-w n
@@ -112,6 +117,15 @@ using the
.B \-P
option.
.
+.PP
+Note that
+.B grops
+doesn't produce a valid document structure (conforming to the Document
+Structuring Convention) if called with multiple file arguments.
+.
+To print such concatenated output it is necessary to deactivate DSC
+handling in the printing program or previewer.
+.
.
.SH OPTIONS
.TP
@@ -184,6 +198,9 @@ PostScript command).
This was the behaviour of groff version 1.18.1 and earlier; it is needed
for older printers which don't understand PostScript LanguageLevel\~2.
.
+It is also necessary if the output is further processed to get an
+encapsulated PS (EPS) file -- see below.
+.
.IP
The default value can be specified by a
.
@@ -225,6 +242,19 @@ This option allows you to generate documents that can be printed
both on letter (8.5\(mu11) paper and on A4 paper without change.
.
.TP
+.BI \-I dir
+This option may be used to specify a directory to search for
+files on the command line and files named in
+.B \eX'ps: import'
+and
+.B \eX'ps: file'
+escapes.
+The current directory is always searched first.
+This option may be specified more than once;
+the directories will be searched in the order specified.
+No directory search is performed for files specified using an absolute path.
+.
+.TP
.B \-l
Print the document in landscape format.
.
@@ -754,7 +784,7 @@ commands.
.RS
.LP
For example,
-.B gxditview
+.B \%gxditview
is not able to display a proper
.B \[rs](em
character because the standard X11 fonts do not provide it;
@@ -772,7 +802,7 @@ request
.
.LP
In this case,
-.B gxditview
+.B \%gxditview
will be unable to display the
.B \[rs](em
character and will draw the line,
@@ -783,10 +813,10 @@ will print the
character
and ignore the line (this code is already in file
.B Xps.tmac
-which will be loaded if a documented intended for
+which will be loaded if a document intended for
.B grops
is previewed with
-.BR gxditview ).
+.BR \%gxditview ).
.RE
.
.LP
@@ -1002,6 +1032,32 @@ comments)
should be used.
.
.
+.SS Encapsulated PostScript
+.B grops
+itself doesn't emit bounding box information.
+.
+With the help of GhostScript the following commands will produce an
+encapsulated PS file
+.B foo.eps
+from input file
+.BR foo :
+.
+.IP
+.B
+groff -P-b16 foo > foo.ps
+.br
+.B
+gs -dNOPAUSE -sDEVICE=bbox -- foo.ps 2> foo.bbox
+.br
+.B
+cat foo.ps | sed \-e '/%%Orientation/rfoo.bbx' > foo.eps
+.br
+.B
+rm foo.bbx
+.br
+.
+.
+.
.SS TrueType fonts
TrueType fonts can be used with
.B grops
@@ -1103,6 +1159,12 @@ Temporary file.
.BR groff_char (@MAN7EXT@),
.BR groff_tmac (@MAN5EXT@)
.
+.PP
+.URL "http://\:partners.adobe.com/\:public/\:developer/\:en/\:ps/\:5001.DSC_Spec.pdf" \
+ "PostScript Language Document Structuring Conventions Specification"
+.
+.cp \n[grops_C]
+.
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/contrib/groff/src/devices/grops/ps.cpp b/contrib/groff/src/devices/grops/ps.cpp
index f1c094b..b6a5403 100644
--- a/contrib/groff/src/devices/grops/ps.cpp
+++ b/contrib/groff/src/devices/grops/ps.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* PostScript documentation:
@@ -42,6 +42,9 @@ extern "C" {
extern "C" const char *Version_string;
+// search path defaults to the current directory
+search_path include_search_path(0, 0, 0, 1);
+
static int landscape_flag = 0;
static int manual_feed_flag = 0;
static int ncopies = 1;
@@ -326,9 +329,14 @@ ps_output &ps_output::put_fix_number(int i)
ps_output &ps_output::put_float(double d)
{
char buf[128];
- sprintf(buf, "%.3g", d);
- int len = strlen(buf);
- if (col > 0 && col + len + need_space > max_line_length) {
+ sprintf(buf, "%.4f", d);
+ int last = strlen(buf) - 1;
+ while (buf[last] == '0')
+ last--;
+ if (buf[last] == '.')
+ last--;
+ buf[++last] = '\0';
+ if (col > 0 && col + last + need_space > max_line_length) {
putc('\n', fp);
col = 0;
need_space = 0;
@@ -338,7 +346,7 @@ ps_output &ps_output::put_float(double d)
col++;
}
fputs(buf, fp);
- col += len;
+ col += last;
need_space = 1;
return *this;
}
@@ -789,7 +797,7 @@ void ps_printer::define_encoding(const char *encoding, int encoding_index)
p++;
if (*p != '#' && *p != '\0' && (p = strtok(buf, WS)) != 0) {
char *q = strtok(0, WS);
- int n;
+ int n = 0; // pacify compiler
if (q == 0 || sscanf(q, "%d", &n) != 1 || n < 0 || n >= 256)
fatal_with_file_and_line(path, lineno, "bad second field");
vec[n] = new char[strlen(p) + 1];
@@ -1790,7 +1798,7 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "b:c:F:glmp:P:vw:", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "b:c:F:gI:lmp:P:vw:", long_options, NULL))
!= EOF)
switch(c) {
case 'b':
@@ -1810,6 +1818,9 @@ int main(int argc, char **argv)
case 'g':
guess_flag = 1;
break;
+ case 'I':
+ include_search_path.command_line_dir(optarg);
+ break;
case 'l':
landscape_flag = 1;
break;
@@ -1864,6 +1875,7 @@ int main(int argc, char **argv)
static void usage(FILE *stream)
{
fprintf(stream,
- "usage: %s [-glmv] [-b n] [-c n] [-w n] [-P prologue] [-F dir] [files ...]\n",
+"usage: %s [-glmv] [-b n] [-c n] [-w n] [-I dir] [-P prologue]\n"
+" [-F dir] [files ...]\n",
program_name);
}
diff --git a/contrib/groff/src/devices/grops/ps.h b/contrib/groff/src/devices/grops/ps.h
index a4b4169..fabf47d 100644
--- a/contrib/groff/src/devices/grops/ps.h
+++ b/contrib/groff/src/devices/grops/ps.h
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class ps_output {
public:
@@ -123,3 +123,7 @@ enum {
USE_PS_ADOBE_2_0 = 010,
NO_PAPERSIZE = 020
};
+
+#include "searchpath.h"
+
+extern search_path include_search_path;
diff --git a/contrib/groff/src/devices/grops/psrm.cpp b/contrib/groff/src/devices/grops/psrm.cpp
index ab94ffe..f1894f5 100644
--- a/contrib/groff/src/devices/grops/psrm.cpp
+++ b/contrib/groff/src/devices/grops/psrm.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "stringclass.h"
@@ -347,7 +347,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
r->flags |= resource::BUSY;
if (rank > r->rank)
r->rank = rank;
- char *path;
+ char *path = 0; // pacify compiler
FILE *fp = 0;
if (r->filename != 0) {
if (r->type == RESOURCE_FONT) {
@@ -360,7 +360,7 @@ void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
}
else {
errno = 0;
- fp = fopen(r->filename, "r");
+ fp = include_search_path.open_file_cautious(r->filename);
if (!fp) {
error("can't open `%1': %2", r->filename, strerror(errno));
a_delete r->filename;
diff --git a/contrib/groff/src/devices/grotty/tty.cpp b/contrib/groff/src/devices/grotty/tty.cpp
index 812ebf8..a959461 100644
--- a/contrib/groff/src/devices/grotty/tty.cpp
+++ b/contrib/groff/src/devices/grotty/tty.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,14 +17,16 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "driver.h"
#include "device.h"
#include "ptable.h"
-declare_ptable(char)
-implement_ptable(char)
+typedef signed char schar;
+
+declare_ptable(schar)
+implement_ptable(schar)
extern "C" const char *Version_string;
@@ -41,25 +44,38 @@ extern "C" const char *Version_string;
static int horizontal_tab_flag = 0;
static int form_feed_flag = 0;
-static int bold_flag = 1;
-static int underline_flag = 1;
+static int bold_flag_option = 1;
+static int bold_flag;
+static int underline_flag_option = 1;
+static int underline_flag;
static int overstrike_flag = 1;
static int draw_flag = 1;
-static int italic_flag = 0;
-static int reverse_flag = 0;
+static int italic_flag_option = 0;
+static int italic_flag;
+static int reverse_flag_option = 0;
+static int reverse_flag;
static int old_drawing_scheme = 0;
+static void update_options();
+static void usage(FILE *stream);
+
+static int hline_char = '-';
+static int vline_char = '|';
+
enum {
UNDERLINE_MODE = 0x01,
BOLD_MODE = 0x02,
VDRAW_MODE = 0x04,
HDRAW_MODE = 0x08,
CU_MODE = 0x10,
- COLOR_CHANGE = 0x20
+ COLOR_CHANGE = 0x20,
+ START_LINE = 0x40,
+ END_LINE = 0x80
};
// Mode to use for bold-underlining.
-static unsigned char bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
+static unsigned char bold_underline_mode_option = BOLD_MODE|UNDERLINE_MODE;
+static unsigned char bold_underline_mode;
#ifndef IS_EBCDIC_HOST
#define CSI "\033["
@@ -77,7 +93,7 @@ static unsigned char bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
#define SGR_REVERSE CSI "7m"
#define SGR_NO_REVERSE CSI "27m"
// many terminals can't handle `CSI 39 m' and `CSI 49 m' to reset
-// the foreground and bachground color, respectively; thus we use
+// the foreground and background color, respectively; we thus use
// `CSI 0 m' exclusively
#define SGR_DEFAULT CSI "0m"
@@ -105,13 +121,14 @@ tty_font *tty_font::load_tty_font(const char *s)
const char *num = f->get_internal_name();
long n;
if (num != 0 && (n = strtol(num, 0, 0)) != 0)
- f->mode = int(n & (BOLD_MODE|UNDERLINE_MODE));
+ f->mode = (unsigned char)(n & (BOLD_MODE|UNDERLINE_MODE));
if (!underline_flag)
f->mode &= ~UNDERLINE_MODE;
if (!bold_flag)
f->mode &= ~BOLD_MODE;
if ((f->mode & (BOLD_MODE|UNDERLINE_MODE)) == (BOLD_MODE|UNDERLINE_MODE))
- f->mode = (f->mode & ~(BOLD_MODE|UNDERLINE_MODE)) | bold_underline_mode;
+ f->mode = (unsigned char)((f->mode & ~(BOLD_MODE|UNDERLINE_MODE))
+ | bold_underline_mode);
return f;
}
@@ -138,11 +155,12 @@ class glyph {
static glyph *free_list;
public:
glyph *next;
- short hpos;
+ int w;
+ int hpos;
unsigned int code;
unsigned char mode;
- char back_color_idx;
- char fore_color_idx;
+ schar back_color_idx;
+ schar fore_color_idx;
void *operator new(size_t);
void operator delete(void *);
inline int draw_mode() { return mode & (VDRAW_MODE|HDRAW_MODE); }
@@ -181,19 +199,19 @@ class tty_printer : public printer {
int nlines;
int cached_v;
int cached_vpos;
- char curr_fore_idx;
- char curr_back_idx;
+ schar curr_fore_idx;
+ schar curr_back_idx;
int is_underline;
int is_bold;
int cu_flag;
- PTABLE(char) tty_colors;
- void make_underline();
- void make_bold(unsigned int);
- char color_to_idx(color *col);
- void add_char(unsigned int, int, int, color *, color *, unsigned char);
+ PTABLE(schar) tty_colors;
+ void make_underline(int);
+ void make_bold(unsigned int, int);
+ schar color_to_idx(color *col);
+ void add_char(unsigned int, int, int, int, color *, color *, unsigned char);
char *make_rgb_string(unsigned int, unsigned int, unsigned int);
- int tty_color(unsigned int, unsigned int, unsigned int, char *,
- char = DEFAULT_COLOR_IDX);
+ int tty_color(unsigned int, unsigned int, unsigned int, schar *,
+ schar = DEFAULT_COLOR_IDX);
public:
tty_printer(const char *device);
~tty_printer();
@@ -203,7 +221,7 @@ public:
void change_color(const environment * const env);
void change_fill_color(const environment * const env);
void put_char(unsigned int);
- void put_color(char, int);
+ void put_color(schar, int);
void begin_page(int) { }
void end_page(int page_length);
font *make_font(const char *);
@@ -233,14 +251,14 @@ char *tty_printer::make_rgb_string(unsigned int r,
int tty_printer::tty_color(unsigned int r,
unsigned int g,
- unsigned int b, char *idx, char value)
+ unsigned int b, schar *idx, schar value)
{
int unknown_color = 0;
char *s = make_rgb_string(r, g, b);
- char *i = tty_colors.lookup(s);
+ schar *i = tty_colors.lookup(s);
if (!i) {
unknown_color = 1;
- i = new char[1];
+ i = new schar[1];
*i = value;
tty_colors.define(s, i);
}
@@ -249,10 +267,14 @@ int tty_printer::tty_color(unsigned int r,
return unknown_color;
}
-tty_printer::tty_printer(const char *device) : cached_v(0)
+tty_printer::tty_printer(const char *dev) : cached_v(0)
{
- is_utf8 = !strcmp(device, "utf8");
- char dummy;
+ is_utf8 = !strcmp(dev, "utf8");
+ if (is_utf8) {
+ hline_char = 0x2500;
+ vline_char = 0x2502;
+ }
+ schar dummy;
// black, white
(void)tty_color(0, 0, 0, &dummy, 0);
(void)tty_color(color::MAX_COLOR_VAL,
@@ -278,11 +300,18 @@ tty_printer::~tty_printer()
a_delete lines;
}
-void tty_printer::make_underline()
+void tty_printer::make_underline(int w)
{
if (old_drawing_scheme) {
- putchar('_');
- putchar('\b');
+ if (!w)
+ warning("can't underline zero-width character");
+ else {
+ int n = w / font::hor;
+ for (int i = 0; i < n; i++)
+ putchar('_');
+ for (int j = 0; j < n; j++)
+ putchar('\b');
+ }
}
else {
if (!is_underline) {
@@ -297,11 +326,17 @@ void tty_printer::make_underline()
}
}
-void tty_printer::make_bold(unsigned int c)
+void tty_printer::make_bold(unsigned int c, int w)
{
if (old_drawing_scheme) {
- put_char(c);
- putchar('\b');
+ if (!w)
+ warning("can't print zero-width character in bold");
+ else {
+ int n = w / font::hor;
+ put_char(c);
+ for (int i = 0; i < n; i++)
+ putchar('\b');
+ }
}
else {
if (!is_bold)
@@ -310,13 +345,13 @@ void tty_printer::make_bold(unsigned int c)
}
}
-char tty_printer::color_to_idx(color *col)
+schar tty_printer::color_to_idx(color *col)
{
if (col->is_default())
return DEFAULT_COLOR_IDX;
unsigned int r, g, b;
col->get_rgb(&r, &g, &b);
- char idx;
+ schar idx;
if (tty_color(r, g, b, &idx)) {
char *s = col->print_color();
error("Unknown color (%1) mapped to default", s);
@@ -328,15 +363,15 @@ char tty_printer::color_to_idx(color *col)
void tty_printer::set_char(int i, font *f, const environment *env,
int w, const char *)
{
- if (w != font::hor)
- fatal("width of character not equal to horizontal resolution");
- add_char(f->get_code(i),
+ if (w % font::hor != 0)
+ fatal("width of character not a multiple of horizontal resolution");
+ add_char(f->get_code(i), w,
env->hpos, env->vpos,
env->col, env->fill,
((tty_font *)f)->get_mode());
}
-void tty_printer::add_char(unsigned int c,
+void tty_printer::add_char(unsigned int c, int w,
int h, int v,
color *fore, color *back,
unsigned char mode)
@@ -377,6 +412,7 @@ void tty_printer::add_char(unsigned int c,
cached_vpos = vpos;
}
glyph *g = new glyph;
+ g->w = w;
g->hpos = hpos;
g->code = c;
g->fore_color_idx = color_to_idx(fore);
@@ -400,7 +436,8 @@ void tty_printer::add_char(unsigned int c,
void tty_printer::special(char *arg, const environment *env, char type)
{
if (type == 'u') {
- add_char(*arg - '0', env->hpos, env->vpos, env->col, env->fill, CU_MODE);
+ add_char(*arg - '0', 0, env->hpos, env->vpos, env->col, env->fill,
+ CU_MODE);
return;
}
if (type != 'p')
@@ -433,17 +470,18 @@ void tty_printer::special(char *arg, const environment *env, char type)
old_drawing_scheme = 1;
else
old_drawing_scheme = 0;
+ update_options();
}
}
void tty_printer::change_color(const environment * const env)
{
- add_char(0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE);
+ add_char(0, 0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE);
}
void tty_printer::change_fill_color(const environment * const env)
{
- add_char(0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE);
+ add_char(0, 0, env->hpos, env->vpos, env->col, env->fill, COLOR_CHANGE);
}
void tty_printer::draw(int code, int *p, int np, const environment *env)
@@ -462,10 +500,22 @@ void tty_printer::draw(int code, int *p, int np, const environment *env)
v += len;
len = -len;
}
- while (len >= 0) {
- add_char('|', env->hpos, v, env->col, env->fill, VDRAW_MODE);
+ if (len >= 0 && len <= font::vert)
+ add_char(vline_char, font::hor, env->hpos, v, env->col, env->fill,
+ VDRAW_MODE|START_LINE|END_LINE);
+ else {
+ add_char(vline_char, font::hor, env->hpos, v, env->col, env->fill,
+ VDRAW_MODE|START_LINE);
len -= font::vert;
v += font::vert;
+ while (len > 0) {
+ add_char(vline_char, font::hor, env->hpos, v, env->col, env->fill,
+ VDRAW_MODE|START_LINE|END_LINE);
+ len -= font::vert;
+ v += font::vert;
+ }
+ add_char(vline_char, font::hor, env->hpos, v, env->col, env->fill,
+ VDRAW_MODE|END_LINE);
}
}
if (p[1] == 0) {
@@ -476,10 +526,22 @@ void tty_printer::draw(int code, int *p, int np, const environment *env)
h += len;
len = -len;
}
- while (len >= 0) {
- add_char('-', h, env->vpos, env->col, env->fill, HDRAW_MODE);
+ if (len >= 0 && len <= font::hor)
+ add_char(hline_char, font::hor, h, env->vpos, env->col, env->fill,
+ HDRAW_MODE|START_LINE|END_LINE);
+ else {
+ add_char(hline_char, font::hor, h, env->vpos, env->col, env->fill,
+ HDRAW_MODE|START_LINE);
len -= font::hor;
h += font::hor;
+ while (len > 0) {
+ add_char(hline_char, font::hor, h, env->vpos, env->col, env->fill,
+ HDRAW_MODE|START_LINE|END_LINE);
+ len -= font::hor;
+ h += font::hor;
+ }
+ add_char(hline_char, font::hor, h, env->vpos, env->col, env->fill,
+ HDRAW_MODE|END_LINE);
}
}
}
@@ -511,7 +573,7 @@ void tty_printer::put_char(unsigned int wc)
putchar(wc);
}
-void tty_printer::put_color(char color_index, int back)
+void tty_printer::put_color(schar color_index, int back)
{
if (color_index == DEFAULT_COLOR_IDX) {
putstring(SGR_DEFAULT);
@@ -541,6 +603,20 @@ void tty_printer::put_color(char color_index, int back)
}
}
+// The possible Unicode combinations for crossing characters.
+//
+// ` ' = 0, ` -' = 4, `- ' = 8, `--' = 12,
+//
+// ` ' = 0, ` ' = 1, `|' = 2, `|' = 3
+// | |
+
+static int crossings[4*4] = {
+ 0x0000, 0x2577, 0x2575, 0x2502,
+ 0x2576, 0x250C, 0x2514, 0x251C,
+ 0x2574, 0x2510, 0x2518, 0x2524,
+ 0x2500, 0x252C, 0x2534, 0x253C
+};
+
void tty_printer::end_page(int page_length)
{
if (page_length % font::vert != 0)
@@ -588,7 +664,12 @@ void tty_printer::end_page(int page_length)
if (nextp && p->hpos == nextp->hpos) {
if (p->draw_mode() == HDRAW_MODE &&
nextp->draw_mode() == VDRAW_MODE) {
- nextp->code = '+';
+ if (is_utf8)
+ nextp->code =
+ crossings[((p->mode & (START_LINE|END_LINE)) >> 4)
+ + ((nextp->mode & (START_LINE|END_LINE)) >> 6)];
+ else
+ nextp->code = '+';
continue;
}
if (p->draw_mode() != 0 && p->draw_mode() == nextp->draw_mode()) {
@@ -611,7 +692,7 @@ void tty_printer::end_page(int page_length)
if (next_tab_pos > p->hpos)
break;
if (cu_flag)
- make_underline();
+ make_underline(p->w);
else if (!old_drawing_scheme && is_underline) {
if (italic_flag)
putstring(SGR_NO_ITALIC);
@@ -627,7 +708,7 @@ void tty_printer::end_page(int page_length)
}
for (; hpos < p->hpos; hpos++) {
if (cu_flag)
- make_underline();
+ make_underline(p->w);
else if (!old_drawing_scheme && is_underline) {
if (italic_flag)
putstring(SGR_NO_ITALIC);
@@ -655,7 +736,7 @@ void tty_printer::end_page(int page_length)
continue;
}
if (p->mode & UNDERLINE_MODE)
- make_underline();
+ make_underline(p->w);
else if (!old_drawing_scheme && is_underline) {
if (italic_flag)
putstring(SGR_NO_ITALIC);
@@ -666,7 +747,7 @@ void tty_printer::end_page(int page_length)
is_underline = 0;
}
if (p->mode & BOLD_MODE)
- make_bold(p->code);
+ make_bold(p->code, p->w);
else if (!old_drawing_scheme && is_bold) {
putstring(SGR_NO_BOLD);
is_bold = 0;
@@ -682,7 +763,7 @@ void tty_printer::end_page(int page_length)
}
}
put_char(p->code);
- hpos++;
+ hpos += p->w / font::hor;
}
if (!old_drawing_scheme
&& (is_bold || is_underline
@@ -711,7 +792,23 @@ printer *make_printer()
return new tty_printer(device);
}
-static void usage(FILE *stream);
+static void update_options()
+{
+ if (old_drawing_scheme) {
+ italic_flag = 0;
+ reverse_flag = 0;
+ bold_underline_mode = bold_underline_mode_option;
+ bold_flag = bold_flag_option;
+ underline_flag = underline_flag_option;
+ }
+ else {
+ italic_flag = italic_flag_option;
+ reverse_flag = reverse_flag_option;
+ bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
+ bold_flag = 1;
+ underline_flag = 1;
+ }
+}
int main(int argc, char **argv)
{
@@ -726,7 +823,7 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "bBcdfF:hioruUv", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "bBcdfF:hiI:oruUv", long_options, NULL))
!= EOF)
switch(c) {
case 'v':
@@ -735,11 +832,14 @@ int main(int argc, char **argv)
break;
case 'i':
// Use italic font instead of underlining.
- italic_flag = 1;
+ italic_flag_option = 1;
+ break;
+ case 'I':
+ // ignore include search path
break;
case 'b':
// Do not embolden by overstriking.
- bold_flag = 0;
+ bold_flag_option = 0;
break;
case 'c':
// Use old scheme for emboldening and underline.
@@ -747,7 +847,7 @@ int main(int argc, char **argv)
break;
case 'u':
// Do not underline.
- underline_flag = 0;
+ underline_flag_option = 0;
break;
case 'o':
// Do not overstrike (other than emboldening and underlining).
@@ -755,15 +855,15 @@ int main(int argc, char **argv)
break;
case 'r':
// Use reverse mode instead of underlining.
- reverse_flag = 1;
+ reverse_flag_option = 1;
break;
case 'B':
// Do bold-underlining as bold.
- bold_underline_mode = BOLD_MODE;
+ bold_underline_mode_option = BOLD_MODE;
break;
case 'U':
// Do bold-underlining as underlining.
- bold_underline_mode = UNDERLINE_MODE;
+ bold_underline_mode_option = UNDERLINE_MODE;
break;
case 'h':
// Use horizontal tabs.
@@ -790,15 +890,7 @@ int main(int argc, char **argv)
default:
assert(0);
}
- if (old_drawing_scheme) {
- italic_flag = 0;
- reverse_flag = 0;
- }
- else {
- bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
- bold_flag = 1;
- underline_flag = 1;
- }
+ update_options();
if (optind >= argc)
do_file("-");
else {
diff --git a/contrib/groff/src/devices/xditview/ChangeLog b/contrib/groff/src/devices/xditview/ChangeLog
new file mode 100644
index 0000000..41ea31c
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/ChangeLog
@@ -0,0 +1,542 @@
+2004-05-29 Werner LEMBERG <wl@gnu.org>
+
+ gxditview and xtotroff have been integrated into the normal groff
+ directory structure; future changes are logged in the main
+ ChangeLog file.
+
+2004-05-13 Werner LEMBERG <wl@gnu.org>
+
+Version 1.19.1 released
+=======================
+
+2004-04-17 Werner LEMBERG <wl@gnu.org>
+
+ * device.c (scale_round): Round correctly for negative values
+ (this is the same function as in src/libs/libgroff/font.c).
+ Found by Paul Eggert.
+
+2003-11-10 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in: s/@top_srcdir@/@abs_top_srcdir@/,
+ s/@groff_top_builddir@/@abs_top_builddir@/.
+
+Version 1.19 released
+=====================
+
+2003-03-03 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in (extraclean): Added gxditview._man.
+
+2003-01-28 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in (SEP): New variable; set to @PATH_SEPARATOR@.
+ (GROFF_FONTPATH): Use it.
+
+2003-01-07 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (Adobe_Symbol_map): Add `sqrt'.
+
+2003-01-06 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (Adobe_Symbol_map): Add `integral'.
+
+2002-12-29 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map): Remove `ap' and `eq'.
+
+2002-12-20 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (Adobe_Symbol_map): Don't include `or'.
+ * draw.c (AdjustCharDeltas): Apply correction only if nadj > 1.
+ (DoCharacter): Call FlushCharCache if font size and font number
+ differ.
+ Reset `dw->dvi.cache.adjustable' properly.
+
+2002-12-09 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map): Use `tno' symbol instead of `no'.
+
+2002-12-01 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in: Use `InstallAppDefaultsLong' instead of
+ `InstallAppDefaults' to make it work if build directory isn't
+ $srcdir.
+
+2002-11-24 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (Adobe_Symbol_map): Add glyph `braceex'.
+
+2002-11-14 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map): Don't include `or'.
+
+Version 1.18.1 released
+=======================
+
+2002-09-16 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in (GROFF_LOCALFONTDIR): New variable.
+ (GROFF_FONTPATH): Use it.
+ Remove /usr/local/lib/font.
+
+Version 1.18.0 released
+=======================
+
+2002-06-22 Werner LEMBERG <wl@gnu.org>
+
+ * gxditview.c (main): Handle `-help' and `--help' correctly.
+
+2002-06-17 Colin Watson <cjwatson@debian.org>
+
+ * Imakefile.in: s/@top_builddir@/@groff_top_builddir@/.
+
+2002-04-06 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map, Adobe_Symbol_map): Remove all
+ characters > 0x80.
+ * parse.c (ParseInput): Ignore `m' command.
+ (ParseDrawFunction): Don't move for unknown drawing functions.
+ Don't move for `f' drawing function.
+
+2002-03-25 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map): Use `t+-', `tmu', and `tdi' symbols
+ instead of `+-', `mu', and `di', respectively.
+
+2002-02-23 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c (ISO_8859_1_map): Add `mc' symbol.
+
+2001-09-22 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile.in: Redefine `ProgramTargetHelper' as
+ `ProgramTargetHelperNoMan' and add a call to `InstallManPageLong'
+ to make the `install.man' target work if the build directory isn't
+ $srcdir.
+
+Version 1.17.2 released
+=======================
+
+Version 1.17.1 released
+=======================
+
+2001-04-21 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * Imakefile.in: Add support for recent HP architectures.
+
+Version 1.17 released
+=====================
+
+2001-01-04 Rob Daasch <daasch@ece.pdx.edu>
+
+ * parse.c (ParseInput): Added 'F' to command switch to swallow
+ filename strings as ignored comments.
+
+2000-12-02 Werner LEMBERG <wl@gnu.org>
+
+ * device.c (find_file): Remove home directory in search path.
+
+2000-11-14 Werner LEMBERG <wl@gnu.org>
+
+ * device.c (open_device_file): Remove `path' parameter.
+ (find_file): Construct font path similar to groff: First the contents
+ of GROFF_FONT_PATH, then the home directory, and finally the default
+ font path.
+ * Imakefile.in: Fix GROFF_DATAPROGRAMDIR and GROFF_FONTPATH.
+
+2000-10-23 Werner LEMBERG <wl@gnu.org>
+
+ Change installation structure for data files from .../groff/... to
+ .../groff/<version><revision>/... to be conform with other GNU
+ programs.
+
+ * Imakefile.in: Implement it.
+
+Version 1.16.1 released
+=======================
+
+Version 1.16 released
+=====================
+
+2000-05-18 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Adding `cq' as an alias for "'" in latin-1 map.
+
+2000-05-03 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Adding `dq' as an alias for `"' in latin-1 map.
+
+2000-04-28 Werner LEMBERG <wl@gnu.org>
+
+ * DviChar.c: Replacing `md' glyph name with `pc' in latin-1 map to
+ make it distinct from the `md' glyph in the symbol font.
+
+2000-03-03 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile replaced with Imakefile.in which will be configured by
+ the main configure script of groff. This will set the correct font
+ path, and it will make it possible to build xditview in a directory
+ different from $srcdir.
+
+2000-03-01 Colin Phipps <crp22@cam.ac.uk>
+
+ * Dvi.c (OpenFile): Use tmpdir() for security reasons.
+ * xtotroff.c (MapFont): Avoid race while opening file.
+
+2000-02-06 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile: Adapted to new directory structure.
+
+ * README: Updated.
+
+Version 1.15 released
+=====================
+
+1999-12-21 Werner LEMBERG <wl@gnu.org>
+
+ * README: Fixed ftp GNU address.
+
+1999-12-13 Werner LEMBERG <wl@gnu.org>
+
+ * device.c: Use extern declarations of strtok(), strchr(), and
+ getenv() only if not defined as macros.
+
+1999-11-18 Larry Jones <larry.jones@sdrc.com>
+
+ * xditview.c: Add fallback_resources to allow running without
+ access to the app-defaults file.
+
+ * Imakefile: Added rule to create app-defaults to a C header file.
+
+ * GXditview-ad.h: New file containing fallback default resources.
+
+ * ad2c: New file to do the app-defaults -> C header file
+ conversion.
+
+1999-10-27 Larry Jones <larry.jones@sdrc.com>
+
+ * font.c (DisposeFontSizes): If there's a problem loading a font,
+ xditview will fall-back and use the default font, but it hasn't
+ checked before unloading fonts which could result in unloading the
+ default font (possibly multiple times) and then X errors.
+
+1999-09-13 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile (extraclean): Added Makefile.
+
+ * xditview.c (main, MakePrompt): Fixing compilation warnings.
+
+ * TODO: Imakefile should be replaced with a configure script.
+
+1999-09-13 Werner LEMBERG <wl@gnu.org>
+
+ * Makefile: Removed.
+
+1999-09-12 Werner LEMBERG <wl@gnu.org>
+
+ * Imakefile (GROFF_FONTPATH): Another addition.
+
+ * device.c (FONTPATH): Update to match current groff version.
+
+1999-09-11 Larry Jones <larry.jones@sdrc.com>
+
+ * Imakefile (GROFF_LIBDIR, GROFF_FONTPATH): Update to match
+ current groff version.
+
+ * Dvi.c (Realize, Destroy), DviP.h, draw.c (setFillGC), gray*.bm:
+ Allow 8 levels of gray rather than just 1.
+
+ * draw.c (DrawFilledCircle, DrawFilledEllipse, DrawFilledPolygon):
+ Draw outlines to prevent gaps between abutting figures.
+
+1999-05-27 Werner LEMBERG <wl@gnu.org>
+
+ * xtotroff.c (usage): Fixed typo.
+
+Mon Sep 11 10:40:33 1995 James Clark <jjc@jclark.com>
+
+ * device.c (INT_MIN, INT_MAX): Don't define if already defined.
+
+Mon Aug 8 11:14:11 1994 James Clark (jjc@jclark.com)
+
+ * DviChar.c (Adobe_Symbol_map): Use \(nb for notsubset.
+
+Tue Apr 19 04:41:16 1994 James Clark (jjc@jclark.com)
+
+ * Dvi.c (resources): Change default for background and foreground
+ to "XtDefaultBackground" and "XtDefaultForeground".
+
+Sat Feb 12 10:38:47 1994 James Clark (jjc@jclark.com)
+
+ * DviChar.c (Adobe_Symbol_map): Rename radicalex to rn.
+
+Thu May 27 20:30:12 1993 James Clark (jjc@jclark.com)
+
+ * device.c (isascii): Define if necessary.
+ (canonicalize_name): Cast argument to isdigit() to unsigned char.
+
+Thu Apr 29 18:36:57 1993 James Clark (jjc at jclark.com)
+
+ * xditview.c: Include <X11/Xos.h>.
+ (NewFile): Don't declare rindex(). Use strrchr() rather than
+ rindex().
+
+Tue Mar 30 15:12:09 1993 James Clark (jjc at jclark)
+
+ * draw.c (charExists): Check that fi->per_char is not NULL.
+
+Sat Dec 12 17:42:40 1992 James Clark (jjc at jclark)
+
+ * Dvi.c (SetGeometry): Cast XtMakeGeometryRequest arguments.
+
+ * draw.c (DrawPolygon, DrawFilledPolygon): Cast Xtfree argument.
+
+ * font.c (DisposeFontSizes): Add declaration.
+
+ * draw.c (FakeCharacter): Add declaration.
+
+Wed Oct 28 13:24:00 1992 James Clark (jjc at jclark)
+
+ * Imakefile (install.dev): Deleted.
+ (fonts): New target.
+
+Mon Oct 12 10:50:44 1992 James Clark (jjc at jclark)
+
+ * Imakefile (install.dev): Say when we're installing devX*-12.
+
+ * Imakefile (install.dev): Depends on DESC and FontMap.
+
+Thu Oct 1 20:03:45 1992 James Clark (jjc at jclark)
+
+ * xditview.c (Syntax): Mention -filename option.
+
+Sat Aug 15 12:56:39 1992 James Clark (jjc at jclark)
+
+ * GXditview.ad: Bind space and return to NextPage. Bind backspace
+ and delete to previous page.
+
+ * DviChar.c (Adobe_Symbol_map): Add `an'.
+
+ * DviChar.c (Adobe_Symbol_map): Add arrowvertex, arrowverttp, and
+ arrowvertbt.
+
+Mon Aug 10 11:54:27 1992 James Clark (jjc at jclark)
+
+ * FontMap: Add m/p fields to the fonts names.
+
+Sat Aug 8 12:00:28 1992 James Clark (jjc at jclark)
+
+ * DESC: Leave font positions 5-9 blank.
+
+Tue Jul 28 11:37:05 1992 James Clark (jjc at jclark)
+
+ * Imakefile: Don't use gendef. Pass definition of FONTPATH using
+ DEFINES.
+ (path.h): Deleted.
+ (device.c): Don't include path.h. Provide default definition of
+ FONTPATH.
+
+Mon Jul 6 14:06:53 1992 James Clark (jjc at jclark)
+
+ * Imakefile: Don't install tmac.X and tmac.Xps.
+ * tmac.X, tmac.Xps: Moved to ../macros.
+
+ * Imakefile: Don't install eqnchar.
+ * eqnchar: Deleted.
+
+Sun Jun 14 12:55:02 1992 James Clark (jjc@jclark)
+
+ * tmac.Xps: Handle OE, oe, lq, rq.
+ * draw.c (FakeCharacter): Don't handle these.
+
+ * draw.c (FakeCharacter): Don't handle f/.
+
+Mon Jun 8 11:46:37 1992 James Clark (jjc@jclark)
+
+ * tmac.X: Translate char160 to space.
+
+Sun Jun 7 14:39:53 1992 James Clark (jjc@jclark)
+
+ * tmac.X: Do `mso tmac.psic' before restoring compatibility mode.
+
+ * tmac.X: Add \(OE, \(oe, \(ah, \(ao, \(ho.
+
+ * tmac.Xps: Make it work in compatibility mode.
+ Redo existing character definitions with .Xps-char.
+ Add more character definitions.
+ (Xps-char): New macro.
+
+Sat Jun 6 21:46:03 1992 James Clark (jjc@jclark)
+
+ * DviChar.c (Adobe_Symbol_map): Add +h, +f, +p, Fn, lz.
+ * tmac.X: Add \(bq, \(Bq, \(aq.
+ * tmac.Xps: Handle \(aq, \(bq, \(Bq, \(Fn.
+
+Wed Jun 3 11:11:15 1992 James Clark (jjc@jclark)
+
+ * DviChar.c (Adobe_Symbol_map): Add wp.
+
+Tue Apr 21 09:21:59 1992 James Clark (jjc at jclark)
+
+ * GXditview.ad: Bind n, p, q keys to NextPage, PreviousPage and
+ Quit actions.
+
+ * xditview.c (RerasterizeAction): New function.
+ (xditview_actions): Add RerasterizeAction.
+ * GXditview.ad: Bind r key to Rerasterize action.
+
+Fri Apr 17 08:25:36 1992 James Clark (jjc at jclark)
+
+ * xditview.c: Add -filename option.
+ (main): Copy any -filename argument into current_file_name.
+
+Mon Mar 16 10:21:58 1992 James Clark (jjc at jclark)
+
+ * tmac.X: Load tmac.pspic.
+
+Sun Mar 8 11:27:19 1992 James Clark (jjc at jclark)
+
+ * Lex.c (GetLine, GetWord, GetNumber): Rewrite.
+
+Sat Oct 12 22:58:52 1991 James Clark (jjc at jclark)
+
+ * Dvi.c (SetDevice): If the size change request is refused but a
+ larger geometry is offered, request that.
+
+Wed Oct 9 12:27:48 1991 James Clark (jjc at jclark)
+
+ * font.c (InstallFontSizes): Ignore FontNameAverageWidth component.
+
+ * Dvi.c (default_font_map): Add `adobe' to font names to avoid
+ ambiguity.
+
+ * FontMap: New file.
+ * FontMap.X100, FontMap.X75: Deleted.
+ * xtotroff.c (main, usage): Add -s and -r options.
+ (MapFont): Change the font pattern to have the selected resolution and
+ size.
+ * Imakefile (install.dev): Use FontMap and supply appropriate -s
+ and -r options.
+
+ * xtotroff.c (MapFont): Check for ambiguity by comparing canonicalized
+ font names.
+
+ * DviP.h (DviFontList): Add initialized and scalable members.
+ (font.c): Add support for scalable fonts based on R5 xditview.
+
+ * DviChar.c: Use xmalloc rather than malloc.
+ * xditview.c (xmalloc): New function.
+ * xtotroff.c (xmalloc): New function.
+ * other files: Use XtMalloc and XtFree instead of malloc and free.
+
+Thu Aug 29 20:15:31 1991 James Clark (jjc at jclark)
+
+ * draw.c (setGC): Do multiplication in floating point to avoid
+ overflow.
+
+Tue Aug 13 12:04:41 1991 James Clark (jjc at jclark)
+
+ * draw.c (FakeCharacter): Remove casts in defintion of pack2.
+
+Tue Jul 30 11:42:39 1991 James Clark (jjc at jclark)
+
+ * tmac.Xps: New file.
+ * Imakefile (install): Install tmac.Xps.
+
+Tue Jul 2 09:31:37 1991 James Clark (jjc at jclark)
+
+ * xtotroff.c (main): Pass argv[0] to usage().
+
+Sun Jun 30 12:34:06 1991 James Clark (jjc at jclark)
+
+ * xtotroff.c (MapFont): Handle the case where XLoadQueryFont
+ returns NULL.
+
+Sat Jun 29 12:32:52 1991 James Clark (jjc at jclark)
+
+ * Imakefile: Use ../gendef to generate path.h.
+
+Sun Jun 16 13:26:34 1991 James Clark (jjc at jclark)
+
+ * Imakefile (depend.o): Change to device.o.
+
+Sun Jun 2 12:17:56 1991 James Clark (jjc at jclark)
+
+ * Imakefile: Remove spaces from the beginning of variable
+ assignment lines.
+
+Sun May 26 14:14:01 1991 James Clark (jjc at jclark)
+
+ * xditview.c (Syntax): Update.
+
+ * Dvi.c (DviSaveToFile, SaveToFile): New functions.
+ (FindPage): Check that we're not readingTmp before checking for
+ end of file of normal input file.
+ (ClassPartInitialize): New function.
+ * Dvi.h: Add declaration of DviSaveToFile.
+ * DviP.h: Add save method to DviClassPart. Declare
+ InheritSaveToFile.
+ * xditview.c (DoPrint, Print, PrintAction): New functions.
+ * xditview.c: Add print menu entry.
+ * xditview.c: Provide printCommand application resource.
+ * lex.c: Don't output EOF to temporary file.
+
+ * Dvi.c (QueryGeometry): Check request->request_mode.
+
+ * Dvi.c (SetDevice): New function.
+ (SetDeviceResolution): Deleted.
+
+ * Dvi.c: Add resolution resource.
+ * DviP.h: Add definitions of XtNResolution and XtCResolution.
+ * xditview.c: Add -resolution argument.
+ * GXditview.ad: Add default for GXditview.height.
+ * Dvi.c (Initialize, SetDevice): Use default_resolution.
+
+ * Dvi.c: Make MY_HEIGHT and MY_WIDTH use the paperlength and
+ paperwidth commands in the DESC file.
+
+ * Dvi.c: Add SS font to default font map.
+
+ * draw.c: Rewritten so as not to assume device and display
+ resolution is the same.
+ * DviP.h: Include device.h. Add device_font member to DviFontList.
+ Add adjustable array to DviCharCache. Add text_x_width,
+ text_device_width, word_flag, device_font, device_font_number,
+ device, native, device_resolution, display_resolution,
+ paperlength, paperwidth, scale_factor, sizescale members.
+ * Dvi.c (Initialize): Initialize new variable used by draw.c.
+ (Destroy): Call device_destroy.
+ * font.c (MaxFontPosition): New function.
+ (LookupFontSizeBySize): Handle sizescale.
+ (InstallFont): Load the device font.
+ (ForgetFonts): New function.
+ (QueryDeviceFont): New function.
+ * parse.c (ParseInput): Handle t and u commands. Split off
+ character output into draw.c.
+ (ParseDeviceControl): Ignore res command. Use the device argument
+ to the T command.
+
+ * font.c (MapXNameToDviName): Ifdefed out.
+
+ * path.h: New file.
+ * device.c, device.h: New files.
+
+ * DviChar.c: Add entries for lB, rB, oq, lC, rC, md.
+
+ * INSTALL: New file.
+
+ * libxdvi: Merged into main directory.
+ * xtotroff.c, xditview.c: Change includes accordingly.
+
+ * devX75, devX100: Merged into main directory.
+ * xditview.man: Renamed to gxditview.man.
+
+ * Xditview.ad: Renamed to GXditview.ad.
+ * xditview.c (main): Use class of GXditview rather than xditview.
+
+ * Imakefile: New file.
+ * Makefile: Deleted.
+
+ * xtotroff.c (MapFont): Unlink output file before opening it.
+
+ * Started separate ChangeLog.
diff --git a/contrib/groff/src/devices/xditview/DESC.in b/contrib/groff/src/devices/xditview/DESC.in
new file mode 100644
index 0000000..172170c
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/DESC.in
@@ -0,0 +1,9 @@
+styles R I B BI
+fonts 6 0 0 0 0 0 S
+sizes 8 10 12 14 18 24 0
+res 75
+X11
+hor 1
+vert 1
+unitwidth 10
+postpro gxditview
diff --git a/contrib/groff/src/devices/xditview/Dvi.c b/contrib/groff/src/devices/xditview/Dvi.c
new file mode 100644
index 0000000..f849fb1
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/Dvi.c
@@ -0,0 +1,611 @@
+#ifndef SABER
+#ifndef lint
+static char Xrcsid[] = "$XConsortium: Dvi.c,v 1.9 89/12/10 16:12:25 rws Exp $";
+#endif /* lint */
+#endif /* SABER */
+
+/*
+ * Dvi.c - Dvi display widget
+ *
+ */
+
+#define XtStrlen(s) ((s) ? strlen(s) : 0)
+
+ /* The following are defined for the reader's convenience. Any
+ Xt..Field macro in this code just refers to some field in
+ one of the substructures of the WidgetRec. */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xmu/Converters.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+/****************************************************************
+ *
+ * Full class record constant
+ *
+ ****************************************************************/
+
+/* Private Data */
+
+static char default_font_map_1[] = "\
+TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
+TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
+CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
+CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
+";
+static char default_font_map_2[] = "\
+HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\n\
+HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\n\
+";
+static char default_font_map_3[] = "\
+NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\n\
+NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\n\
+NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\n\
+NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\n\
+S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
+SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\n\
+";
+
+#define offset(field) XtOffset(DviWidget, field)
+
+#define MY_WIDTH(dw) ((int)(dw->dvi.paperwidth * dw->dvi.scale_factor + .5))
+#define MY_HEIGHT(dw) ((int)(dw->dvi.paperlength * dw->dvi.scale_factor + .5))
+
+static XtResource resources[] = {
+ {(String)XtNfontMap, (String)XtCFontMap, (String)XtRString,
+ sizeof (char *), offset(dvi.font_map_string),
+ (String)XtRString, NULL /* set in code */},
+ {(String)XtNforeground, (String)XtCForeground, (String)XtRPixel,
+ sizeof (unsigned long), offset(dvi.foreground),
+ (String)XtRString, (XtPointer)"XtDefaultForeground"},
+ {(String)XtNbackground, (String)XtCBackground, (String)XtRPixel,
+ sizeof (unsigned long), offset(dvi.background),
+ (String)XtRString, (XtPointer)"XtDefaultBackground"},
+ {(String)XtNpageNumber, (String)XtCPageNumber, (String)XtRInt,
+ sizeof (int), offset(dvi.requested_page),
+ (String)XtRString, (XtPointer)"1"},
+ {(String)XtNlastPageNumber, (String)XtCLastPageNumber, (String)XtRInt,
+ sizeof (int), offset (dvi.last_page),
+ (String)XtRString, (XtPointer)"0"},
+ {(String)XtNfile, (String)XtCFile, (String)XtRFile,
+ sizeof (FILE *), offset (dvi.file),
+ (String)XtRFile, (XtPointer)0},
+ {(String)XtNseek, (String)XtCSeek, (String)XtRBoolean,
+ sizeof (Boolean), offset(dvi.seek),
+ (String)XtRString, (XtPointer)"false"},
+ {(String)XtNfont, (String)XtCFont, (String)XtRFontStruct,
+ sizeof (XFontStruct *), offset(dvi.default_font),
+ (String)XtRString, (XtPointer)"xtdefaultfont"},
+ {(String)XtNbackingStore, (String)XtCBackingStore, (String)XtRBackingStore,
+ sizeof (int), offset(dvi.backing_store),
+ (String)XtRString, (XtPointer)"default"},
+ {(String)XtNnoPolyText, (String)XtCNoPolyText, (String)XtRBoolean,
+ sizeof (Boolean), offset(dvi.noPolyText),
+ (String)XtRString, (XtPointer)"false"},
+ {(String)XtNresolution, (String)XtCResolution, (String)XtRInt,
+ sizeof(int), offset(dvi.default_resolution),
+ (String)XtRString, (XtPointer)"75"},
+};
+
+#undef offset
+
+static void ClassInitialize (void);
+static void ClassPartInitialize(WidgetClass);
+static void Initialize(Widget, Widget, ArgList, Cardinal *);
+static void Realize (Widget, XtValueMask *, XSetWindowAttributes *);
+static void Destroy (Widget);
+static void Redisplay (Widget, XEvent *, Region);
+static Boolean SetValues (Widget, Widget, Widget,
+ ArgList, Cardinal *);
+static Boolean SetValuesHook (Widget, ArgList, Cardinal *);
+static XtGeometryResult QueryGeometry (Widget, XtWidgetGeometry *,
+ XtWidgetGeometry *);
+static void ShowDvi (DviWidget);
+static void CloseFile (DviWidget);
+static void OpenFile (DviWidget);
+static void FindPage (DviWidget);
+
+static void SaveToFile (Widget, FILE *);
+
+/* font.c */
+extern void ParseFontMap(DviWidget);
+extern void DestroyFontMap(DviFontMap *);
+extern void ForgetFonts(DviWidget);
+
+/* page.c */
+extern void DestroyFileMap(DviFileMap *);
+extern long SearchPagePosition(DviWidget, int);
+extern void FileSeek(DviWidget, long);
+extern void ForgetPagePositions(DviWidget);
+
+/* parse.c */
+extern int ParseInput(register DviWidget);
+
+DviClassRec dviClassRec = {
+{
+ &widgetClassRec, /* superclass */
+ (String)"Dvi", /* class_name */
+ sizeof(DviRec), /* size */
+ ClassInitialize, /* class_initialize */
+ ClassPartInitialize, /* class_part_initialize */
+ FALSE, /* class_inited */
+ Initialize, /* initialize */
+ NULL, /* initialize_hook */
+ Realize, /* realize */
+ NULL, /* actions */
+ 0, /* num_actions */
+ resources, /* resources */
+ XtNumber(resources), /* resource_count */
+ NULLQUARK, /* xrm_class */
+ FALSE, /* compress_motion */
+ TRUE, /* compress_exposure */
+ TRUE, /* compress_enterleave */
+ FALSE, /* visible_interest */
+ Destroy, /* destroy */
+ NULL, /* resize */
+ Redisplay, /* expose */
+ SetValues, /* set_values */
+ SetValuesHook, /* set_values_hook */
+ NULL, /* set_values_almost */
+ NULL, /* get_values_hook */
+ NULL, /* accept_focus */
+ XtVersion, /* version */
+ NULL, /* callback_private */
+ 0, /* tm_table */
+ QueryGeometry, /* query_geometry */
+ NULL, /* display_accelerator */
+ NULL /* extension */
+},{
+ SaveToFile, /* save */
+},
+};
+
+WidgetClass dviWidgetClass = (WidgetClass) &dviClassRec;
+
+static void ClassInitialize (void)
+{
+ int len1 = strlen(default_font_map_1);
+ int len2 = strlen(default_font_map_2);
+ int len3 = strlen(default_font_map_3);
+ char *dfm = XtMalloc(len1 + len2 + len3 + 1);
+ char *ptr = dfm;
+ strcpy(ptr, default_font_map_1); ptr += len1;
+ strcpy(ptr, default_font_map_2); ptr += len2;
+ strcpy(ptr, default_font_map_3);
+ resources[0].default_addr = dfm;
+
+ XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
+ NULL, 0 );
+}
+
+/****************************************************************
+ *
+ * Private Procedures
+ *
+ ****************************************************************/
+
+/* ARGSUSED */
+static void Initialize(Widget request, Widget new_wd,
+ ArgList args, Cardinal *num_args)
+{
+ DviWidget dw = (DviWidget) new_wd;
+
+ dw->dvi.current_page = 0;
+ dw->dvi.font_map = 0;
+ dw->dvi.cache.index = 0;
+ dw->dvi.text_x_width = 0;
+ dw->dvi.text_device_width = 0;
+ dw->dvi.word_flag = 0;
+ dw->dvi.file = 0;
+ dw->dvi.tmpFile = 0;
+ dw->dvi.state = 0;
+ dw->dvi.readingTmp = 0;
+ dw->dvi.cache.char_index = 0;
+ dw->dvi.cache.font_size = -1;
+ dw->dvi.cache.font_number = -1;
+ dw->dvi.cache.adjustable[0] = 0;
+ dw->dvi.file_map = 0;
+ dw->dvi.fonts = 0;
+ dw->dvi.seek = False;
+ dw->dvi.device_resolution = dw->dvi.default_resolution;
+ dw->dvi.display_resolution = dw->dvi.default_resolution;
+ dw->dvi.paperlength = dw->dvi.default_resolution*11;
+ dw->dvi.paperwidth = (dw->dvi.default_resolution*8
+ + dw->dvi.default_resolution/2);
+ dw->dvi.scale_factor = 1.0;
+ dw->dvi.sizescale = 1;
+ dw->dvi.line_thickness = -1;
+ dw->dvi.line_width = 1;
+ dw->dvi.fill = DVI_FILL_MAX;
+ dw->dvi.device_font = 0;
+ dw->dvi.device_font_number = -1;
+ dw->dvi.device = 0;
+ dw->dvi.native = 0;
+
+ request = request; /* unused; suppress compiler warning */
+ args = args;
+ num_args = num_args;
+}
+
+#include "gray1.bm"
+#include "gray2.bm"
+#include "gray3.bm"
+#include "gray4.bm"
+#include "gray5.bm"
+#include "gray6.bm"
+#include "gray7.bm"
+#include "gray8.bm"
+
+static void
+Realize (Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
+{
+ DviWidget dw = (DviWidget) w;
+ XGCValues values;
+
+ if (dw->dvi.backing_store != Always + WhenMapped + NotUseful) {
+ attrs->backing_store = dw->dvi.backing_store;
+ *valueMask |= CWBackingStore;
+ }
+ XtCreateWindow (w, (unsigned)InputOutput, (Visual *) CopyFromParent,
+ *valueMask, attrs);
+ values.foreground = dw->dvi.foreground;
+ values.cap_style = CapRound;
+ values.join_style = JoinRound;
+ values.line_width = dw->dvi.line_width;
+ dw->dvi.normal_GC = XCreateGC (XtDisplay (w), XtWindow (w),
+ GCForeground|GCCapStyle|GCJoinStyle
+ |GCLineWidth,
+ &values);
+ dw->dvi.gray[0] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray1_bits,
+ gray1_width, gray1_height);
+ dw->dvi.gray[1] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray2_bits,
+ gray2_width, gray2_height);
+ dw->dvi.gray[2] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray3_bits,
+ gray3_width, gray3_height);
+ dw->dvi.gray[3] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray4_bits,
+ gray4_width, gray4_height);
+ dw->dvi.gray[4] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray5_bits,
+ gray5_width, gray5_height);
+ dw->dvi.gray[5] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray6_bits,
+ gray6_width, gray6_height);
+ dw->dvi.gray[6] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray7_bits,
+ gray7_width, gray7_height);
+ dw->dvi.gray[7] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
+ gray8_bits,
+ gray8_width, gray8_height);
+ values.background = dw->dvi.background;
+ values.stipple = dw->dvi.gray[5];
+ dw->dvi.fill_GC = XCreateGC (XtDisplay (w), XtWindow (w),
+ GCForeground|GCBackground|GCStipple,
+ &values);
+
+ dw->dvi.fill_type = 9;
+
+ if (dw->dvi.file)
+ OpenFile (dw);
+ ParseFontMap (dw);
+}
+
+static void
+Destroy(Widget w)
+{
+ DviWidget dw = (DviWidget) w;
+
+ XFreeGC (XtDisplay (w), dw->dvi.normal_GC);
+ XFreeGC (XtDisplay (w), dw->dvi.fill_GC);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[0]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[1]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[2]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[3]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[4]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[5]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[6]);
+ XFreePixmap (XtDisplay (w), dw->dvi.gray[7]);
+ DestroyFontMap (dw->dvi.font_map);
+ DestroyFileMap (dw->dvi.file_map);
+ device_destroy (dw->dvi.device);
+}
+
+/*
+ * Repaint the widget window
+ */
+
+/* ARGSUSED */
+static void
+Redisplay(Widget w, XEvent *event, Region region)
+{
+ DviWidget dw = (DviWidget) w;
+ XRectangle extents;
+
+ XClipBox (region, &extents);
+ dw->dvi.extents.x1 = extents.x;
+ dw->dvi.extents.y1 = extents.y;
+ dw->dvi.extents.x2 = extents.x + extents.width;
+ dw->dvi.extents.y2 = extents.y + extents.height;
+ ShowDvi (dw);
+
+ event = event; /* unused; suppress compiler warning */
+}
+
+/*
+ * Set specified arguments into widget
+ */
+/* ARGSUSED */
+static Boolean
+SetValues (Widget wcurrent, Widget wrequest, Widget wnew,
+ ArgList args, Cardinal *num_args)
+{
+ Boolean redisplay = FALSE;
+ char *new_map;
+ int cur, req;
+ DviWidget current = (DviWidget)wcurrent;
+ DviWidget request = (DviWidget)wrequest;
+ DviWidget new_wd = (DviWidget)wnew;
+
+ if (current->dvi.font_map_string != request->dvi.font_map_string) {
+ new_map = XtMalloc (strlen (request->dvi.font_map_string) + 1);
+ if (new_map) {
+ redisplay = TRUE;
+ strcpy (new_map, request->dvi.font_map_string);
+ new_wd->dvi.font_map_string = new_map;
+ if (current->dvi.font_map_string)
+ XtFree (current->dvi.font_map_string);
+ current->dvi.font_map_string = 0;
+ ParseFontMap (new_wd);
+ }
+ }
+
+ req = request->dvi.requested_page;
+ cur = current->dvi.requested_page;
+ if (cur != req) {
+ if (!request->dvi.file)
+ req = 0;
+ else {
+ if (req < 1)
+ req = 1;
+ if (current->dvi.last_page != 0 &&
+ req > current->dvi.last_page)
+ req = current->dvi.last_page;
+ }
+ if (cur != req)
+ redisplay = TRUE;
+ new_wd->dvi.requested_page = req;
+ if (current->dvi.last_page == 0 && req > cur)
+ FindPage (new_wd);
+ }
+
+ args = args; /* unused; suppress compiler warning */
+ num_args = num_args;
+
+ return redisplay;
+}
+
+/*
+ * use the set_values_hook entry to check when
+ * the file is set
+ */
+
+static Boolean
+SetValuesHook (Widget wdw, ArgList args, Cardinal *num_argsp)
+{
+ Cardinal i;
+ DviWidget dw = (DviWidget)wdw;
+
+ for (i = 0; i < *num_argsp; i++) {
+ if (!strcmp (args[i].name, XtNfile)) {
+ CloseFile (dw);
+ OpenFile (dw);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static void CloseFile (DviWidget dw)
+{
+ if (dw->dvi.tmpFile)
+ fclose (dw->dvi.tmpFile);
+ ForgetPagePositions (dw);
+}
+
+static void OpenFile (DviWidget dw)
+{
+ dw->dvi.tmpFile = 0;
+ if (!dw->dvi.seek)
+ dw->dvi.tmpFile = tmpfile();
+ dw->dvi.requested_page = 1;
+ dw->dvi.last_page = 0;
+}
+
+static XtGeometryResult
+QueryGeometry (Widget w, XtWidgetGeometry *request,
+ XtWidgetGeometry *geometry_return)
+{
+ XtGeometryResult ret;
+ DviWidget dw = (DviWidget) w;
+
+ ret = XtGeometryYes;
+ if (((request->request_mode & CWWidth)
+ && request->width < MY_WIDTH(dw))
+ || ((request->request_mode & CWHeight)
+ && request->height < MY_HEIGHT(dw)))
+ ret = XtGeometryAlmost;
+ geometry_return->width = MY_WIDTH(dw);
+ geometry_return->height = MY_HEIGHT(dw);
+ geometry_return->request_mode = CWWidth|CWHeight;
+ return ret;
+}
+
+void
+SetDevice (DviWidget dw, const char *name)
+{
+ XtWidgetGeometry request, reply;
+ XtGeometryResult ret;
+
+ ForgetFonts (dw);
+ dw->dvi.device = device_load (name);
+ if (!dw->dvi.device)
+ return;
+ dw->dvi.sizescale = dw->dvi.device->sizescale;
+ dw->dvi.device_resolution = dw->dvi.device->res;
+ dw->dvi.native = dw->dvi.device->X11;
+ dw->dvi.paperlength = dw->dvi.device->paperlength;
+ dw->dvi.paperwidth = dw->dvi.device->paperwidth;
+ if (dw->dvi.native) {
+ dw->dvi.display_resolution = dw->dvi.device_resolution;
+ dw->dvi.scale_factor = 1.0;
+ }
+ else {
+ dw->dvi.display_resolution = dw->dvi.default_resolution;
+ dw->dvi.scale_factor = ((double)dw->dvi.display_resolution
+ / dw->dvi.device_resolution);
+ }
+ request.request_mode = CWWidth|CWHeight;
+ request.width = MY_WIDTH(dw);
+ request.height = MY_HEIGHT(dw);
+ ret = XtMakeGeometryRequest ((Widget)dw, &request, &reply);
+ if (ret == XtGeometryAlmost
+ && reply.height >= request.height
+ && reply.width >= request.width) {
+ request.width = reply.width;
+ request.height = reply.height;
+ XtMakeGeometryRequest ((Widget)dw, &request, &reply);
+ }
+}
+
+static void
+ShowDvi (DviWidget dw)
+{
+ if (!dw->dvi.file) {
+ static char Error[] = "No file selected";
+
+ XSetFont (XtDisplay(dw), dw->dvi.normal_GC,
+ dw->dvi.default_font->fid);
+ XDrawString (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ 20, 20, Error, strlen (Error));
+ return;
+ }
+
+ FindPage (dw);
+
+ dw->dvi.display_enable = 1;
+ ParseInput (dw);
+ if (dw->dvi.last_page && dw->dvi.requested_page > dw->dvi.last_page)
+ dw->dvi.requested_page = dw->dvi.last_page;
+}
+
+static void
+FindPage (DviWidget dw)
+{
+ int i;
+ long file_position;
+
+ if (dw->dvi.requested_page < 1)
+ dw->dvi.requested_page = 1;
+
+ if (dw->dvi.last_page != 0 && dw->dvi.requested_page > dw->dvi.last_page)
+ dw->dvi.requested_page = dw->dvi.last_page;
+
+ file_position = SearchPagePosition (dw, dw->dvi.requested_page);
+ if (file_position != -1) {
+ FileSeek(dw, file_position);
+ dw->dvi.current_page = dw->dvi.requested_page;
+ } else {
+ for (i=dw->dvi.requested_page; i > 0; i--) {
+ file_position = SearchPagePosition (dw, i);
+ if (file_position != -1)
+ break;
+ }
+ if (file_position == -1)
+ file_position = 0;
+ FileSeek (dw, file_position);
+
+ dw->dvi.current_page = i;
+
+ dw->dvi.display_enable = 0;
+ while (dw->dvi.current_page != dw->dvi.requested_page) {
+ dw->dvi.current_page = ParseInput (dw);
+ /*
+ * at EOF, seek back to the beginning of this page.
+ */
+ if (!dw->dvi.readingTmp && feof (dw->dvi.file)) {
+ file_position = SearchPagePosition (dw,
+ dw->dvi.current_page);
+ if (file_position != -1)
+ FileSeek (dw, file_position);
+ dw->dvi.requested_page = dw->dvi.current_page;
+ break;
+ }
+ }
+ }
+}
+
+void DviSaveToFile(Widget w, FILE *fp)
+{
+ XtCheckSubclass(w, dviWidgetClass, NULL);
+ (*((DviWidgetClass) XtClass(w))->command_class.save)(w, fp);
+}
+
+static
+void SaveToFile(Widget w, FILE *fp)
+{
+ DviWidget dw = (DviWidget)w;
+ long pos;
+ int c;
+
+ if (dw->dvi.tmpFile) {
+ pos = ftell(dw->dvi.tmpFile);
+ if (dw->dvi.ungot) {
+ pos--;
+ dw->dvi.ungot = 0;
+ /* The ungot character is in the tmpFile, so we don't
+ want to read it from file. */
+ (void)getc(dw->dvi.file);
+ }
+ }
+ else
+ pos = ftell(dw->dvi.file);
+ FileSeek(dw, 0L);
+ while (DviGetC(dw, &c) != EOF)
+ if (putc(c, fp) == EOF) {
+ /* XXX print error message */
+ break;
+ }
+ FileSeek(dw, pos);
+}
+
+static
+void ClassPartInitialize(WidgetClass widget_class)
+{
+ DviWidgetClass wc = (DviWidgetClass)widget_class;
+ DviWidgetClass super = (DviWidgetClass) wc->core_class.superclass;
+ if (wc->command_class.save == InheritSaveToFile)
+ wc->command_class.save = super->command_class.save;
+}
+
+/*
+Local Variables:
+c-indent-level: 8
+c-continued-statement-offset: 8
+c-brace-offset: -8
+c-argdecl-indent: 8
+c-label-offset: -8
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/Dvi.h b/contrib/groff/src/devices/xditview/Dvi.h
new file mode 100644
index 0000000..bf97374
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/Dvi.h
@@ -0,0 +1,46 @@
+/*
+* $XConsortium: Dvi.h,v 1.4 89/07/21 14:22:06 jim Exp $
+*/
+
+#ifndef _XtDvi_h
+#define _XtDvi_h
+
+/***********************************************************************
+ *
+ * Dvi Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name Class RepType Default Value
+ ---- ----- ------- -------------
+ background Background pixel White
+ foreground Foreground Pixel Black
+ fontMap FontMap char * ...
+ pageNumber PageNumber int 1
+*/
+
+#define XtNfontMap (String)"fontMap"
+#define XtNpageNumber (String)"pageNumber"
+#define XtNlastPageNumber (String)"lastPageNumber"
+#define XtNnoPolyText (String)"noPolyText"
+#define XtNseek (String)"seek"
+#define XtNresolution (String)"resolution"
+
+#define XtCFontMap (String)"FontMap"
+#define XtCPageNumber (String)"PageNumber"
+#define XtCLastPageNumber (String)"LastPageNumber"
+#define XtCNoPolyText (String)"NoPolyText"
+#define XtCSeek (String)"Seek"
+#define XtCResolution (String)"Resolution"
+
+typedef struct _DviRec *DviWidget; /* completely defined in DviP.h */
+typedef struct _DviClassRec *DviWidgetClass; /* completely defined in DviP.h */
+
+extern WidgetClass dviWidgetClass;
+
+void DviSaveToFile(Widget, FILE *);
+
+#endif /* _XtDvi_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/contrib/groff/src/devices/xditview/DviP.h b/contrib/groff/src/devices/xditview/DviP.h
new file mode 100644
index 0000000..00f32c8
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/DviP.h
@@ -0,0 +1,233 @@
+/*
+ * $XConsortium: DviP.h,v 1.5 89/07/22 19:44:08 keith Exp $
+ */
+
+/*
+ * DviP.h - Private definitions for Dvi widget
+ */
+
+#ifndef _XtDviP_h
+#define _XtDviP_h
+
+#include "Dvi.h"
+#include "DviChar.h"
+#include "device.h"
+
+/***********************************************************************
+ *
+ * Dvi Widget Private Data
+ *
+ ***********************************************************************/
+
+/************************************
+ *
+ * Class structure
+ *
+ ***********************************/
+
+/* Type for save method. */
+
+typedef void (*DviSaveProc)(Widget, FILE *);
+
+/*
+ * New fields for the Dvi widget class record
+ */
+
+
+typedef struct _DviClass {
+ DviSaveProc save;
+} DviClassPart;
+
+/*
+ * Full class record declaration
+ */
+
+typedef struct _DviClassRec {
+ CoreClassPart core_class;
+ DviClassPart command_class;
+} DviClassRec;
+
+extern DviClassRec dviClassRec;
+
+/***************************************
+ *
+ * Instance (widget) structure
+ *
+ **************************************/
+
+/*
+ * a list of fonts we've used for this widget
+ */
+
+typedef struct _dviFontSizeList {
+ struct _dviFontSizeList *next;
+ int size;
+ char *x_name;
+ XFontStruct *font;
+ int doesnt_exist;
+} DviFontSizeList;
+
+typedef struct _dviFontList {
+ struct _dviFontList *next;
+ char *dvi_name;
+ char *x_name;
+ int dvi_number;
+ Boolean initialized;
+ Boolean scalable;
+ DviFontSizeList *sizes;
+ DviCharNameMap *char_map;
+ DeviceFont *device_font;
+} DviFontList;
+
+typedef struct _dviFontMap {
+ struct _dviFontMap *next;
+ char *dvi_name;
+ char *x_name;
+} DviFontMap;
+
+#define DVI_TEXT_CACHE_SIZE 256
+#define DVI_CHAR_CACHE_SIZE 1024
+
+typedef struct _dviCharCache {
+ XTextItem cache[DVI_TEXT_CACHE_SIZE];
+ char adjustable[DVI_TEXT_CACHE_SIZE];
+ char char_cache[DVI_CHAR_CACHE_SIZE];
+ int index;
+ int max;
+ int char_index;
+ int font_size;
+ int font_number;
+ XFontStruct *font;
+ int start_x, start_y;
+ int x, y;
+} DviCharCache;
+
+typedef struct _dviState {
+ struct _dviState *next;
+ int font_size;
+ int font_number;
+ int x;
+ int y;
+} DviState;
+
+typedef struct _dviFileMap {
+ struct _dviFileMap *next;
+ long position;
+ int page_number;
+} DviFileMap;
+
+/*
+ * New fields for the Dvi widget record
+ */
+
+typedef struct {
+ /*
+ * resource specifiable items
+ */
+ char *font_map_string;
+ unsigned long foreground;
+ unsigned long background;
+ int requested_page;
+ int last_page;
+ XFontStruct *default_font;
+ FILE *file;
+ Boolean noPolyText;
+ Boolean seek; /* file is "seekable" */
+ int default_resolution;
+ /*
+ * private state
+ */
+ FILE *tmpFile; /* used when reading stdin */
+ char readingTmp; /* reading now from tmp */
+ char ungot; /* have ungetc'd a char */
+ GC normal_GC;
+ GC fill_GC;
+ DviFileMap *file_map;
+ DviFontList *fonts;
+ DviFontMap *font_map;
+ int current_page;
+ int font_size;
+ int font_number;
+ DeviceFont *device_font;
+ int device_font_number;
+ Device *device;
+ int native;
+ int device_resolution;
+ int display_resolution;
+ int paperlength;
+ int paperwidth;
+ double scale_factor; /* display res / device res */
+ int sizescale;
+ int line_thickness;
+ int line_width;
+
+#define DVI_FILL_MAX 1000
+
+ int fill;
+#define DVI_FILL_WHITE 0
+#define DVI_FILL_GRAY 1
+#define DVI_FILL_BLACK 2
+ int fill_type;
+ Pixmap gray[8];
+ int backing_store;
+ XFontStruct *font;
+ int display_enable;
+ struct ExposedExtents {
+ int x1, y1, x2, y2;
+ } extents;
+ DviState *state;
+ DviCharCache cache;
+ int text_x_width;
+ int text_device_width;
+ int word_flag;
+} DviPart;
+
+int DviGetAndPut(DviWidget, int *);
+#define DviGetIn(dw,cp)\
+ (dw->dvi.tmpFile ? (\
+ DviGetAndPut (dw, cp) \
+ ) :\
+ (*cp = getc (dw->dvi.file))\
+)
+
+#define DviGetC(dw, cp)\
+ (dw->dvi.readingTmp ? (\
+ ((*cp = getc (dw->dvi.tmpFile)) == EOF) ? (\
+ fseek (dw->dvi.tmpFile, 0l, 2),\
+ (dw->dvi.readingTmp = 0),\
+ DviGetIn (dw,cp)\
+ ) : (\
+ *cp\
+ )\
+ ) : (\
+ DviGetIn(dw,cp)\
+ )\
+)
+
+#define DviUngetC(dw, c)\
+ (dw->dvi.readingTmp ? (\
+ ungetc (c, dw->dvi.tmpFile)\
+ ) : ( \
+ (dw->dvi.ungot = 1),\
+ ungetc (c, dw->dvi.file)))
+
+/*
+ * Full widget declaration
+ */
+
+typedef struct _DviRec {
+ CorePart core;
+ DviPart dvi;
+} DviRec;
+
+#define InheritSaveToFile ((DviSaveProc)_XtInherit)
+
+XFontStruct *QueryFont (DviWidget, int, int);
+
+DviCharNameMap *QueryFontMap (DviWidget, int);
+
+DeviceFont *QueryDeviceFont (DviWidget, int);
+
+char *GetWord(DviWidget, char *, int);
+char *GetLine(DviWidget, char *, int);
+#endif /* _XtDviP_h */
diff --git a/contrib/groff/src/devices/xditview/FontMap b/contrib/groff/src/devices/xditview/FontMap
new file mode 100644
index 0000000..90911f0
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/FontMap
@@ -0,0 +1,17 @@
+TR -adobe-times-medium-r-normal--*-*-*-*-p-*-iso8859-1
+TI -adobe-times-medium-i-normal--*-*-*-*-p-*-iso8859-1
+TB -adobe-times-bold-r-normal--*-*-*-*-p-*-iso8859-1
+TBI -adobe-times-bold-i-normal--*-*-*-*-p-*-iso8859-1
+CR -adobe-courier-medium-r-normal--*-*-*-*-m-*-iso8859-1
+CI -adobe-courier-medium-o-normal--*-*-*-*-m-*-iso8859-1
+CB -adobe-courier-bold-r-normal--*-*-*-*-m-*-iso8859-1
+CBI -adobe-courier-bold-o-normal--*-*-*-*-m-*-iso8859-1
+HR -adobe-helvetica-medium-r-normal--*-*-*-*-p-*-iso8859-1
+HI -adobe-helvetica-medium-o-normal--*-*-*-*-p-*-iso8859-1
+HB -adobe-helvetica-bold-r-normal--*-*-*-*-p-*-iso8859-1
+HBI -adobe-helvetica-bold-o-normal--*-*-*-*-p-*-iso8859-1
+NR -adobe-new century schoolbook-medium-r-normal--*-*-*-*-p-*-iso8859-1
+NI -adobe-new century schoolbook-medium-i-normal--*-*-*-*-p-*-iso8859-1
+NB -adobe-new century schoolbook-bold-r-normal--*-*-*-*-p-*-iso8859-1
+NBI -adobe-new century schoolbook-bold-i-normal--*-*-*-*-p-*-iso8859-1
+S -adobe-symbol-medium-r-normal--*-*-*-*-p-*-adobe-fontspecific
diff --git a/contrib/groff/src/devices/xditview/GXditview.ad b/contrib/groff/src/devices/xditview/GXditview.ad
new file mode 100644
index 0000000..e99ff5e
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/GXditview.ad
@@ -0,0 +1,57 @@
+GXditview.height: 840
+
+GXditview.paned.allowResize: true
+GXditview.paned.viewport.allowVert: true
+GXditview.paned.viewport.allowHoriz: true
+GXditview.paned.viewport.skipAdjust: false
+GXditview.paned.viewport.width: 600
+GXditview.paned.viewport.height: 800
+GXditview.paned.viewport.showGrip: false
+GXditview.paned.label.skipAdjust: true
+
+GXditview.paned.viewport.dvi.translations: #augment \
+ <Btn1Down>: XawPositionSimpleMenu(menu) MenuPopup(menu)\n\
+ <Key>Next: NextPage()\n\
+ <Key>n: NextPage()\n\
+ <Key>space: NextPage()\n\
+ <Key>Return: NextPage()\n\
+ <Key>Prior: PreviousPage()\n\
+ <Key>p: PreviousPage()\n\
+ <Key>BackSpace: PreviousPage()\n\
+ <Key>Delete: PreviousPage()\n\
+ <Key>Select: SelectPage()\n\
+ <Key>Find: OpenFile()\n\
+ <Key>r: Rerasterize()\n\
+ <Key>q: Quit()
+GXditview.paned.label.translations: #augment \
+ <Btn1Down>: XawPositionSimpleMenu(menu) MenuPopup(menu)\n\
+ <Key>Next: NextPage()\n\
+ <Key>n: NextPage()\n\
+ <Key>space: NextPage()\n\
+ <Key>Return: NextPage()\n\
+ <Key>Prior: PreviousPage()\n\
+ <Key>p: PreviousPage()\n\
+ <Key>BackSpace: PreviousPage()\n\
+ <Key>Delete: PreviousPage()\n\
+ <Key>Select: SelectPage()\n\
+ <Key>Find: OpenFile()\n\
+ <Key>r: Rerasterize()\n\
+ <Key>q: Quit()
+GXditview.menu.nextPage.label: Next Page
+GXditview.menu.previousPage.label: Previous Page
+GXditview.menu.selectPage.label: Select Page
+GXditview.menu.print.label: Print
+GXditview.menu.openFile.label: Open
+GXditview.menu.quit.label: Quit
+
+GXditview.promptShell.allowShellResize: true
+GXditview.promptShell.promptDialog.value.translations: #override \
+ <Key>Return: Accept()
+
+GXditview.promptShell.promptDialog.accept.label: Accept
+GXditview.promptShell.promptDialog.accept.translations: #override \
+ <BtnUp>: Accept() unset()
+
+GXditview.promptShell.promptDialog.cancel.label: Cancel
+GXditview.promptShell.promptDialog.cancel.translations: #override \
+ <BtnUp>: Cancel() unset()
diff --git a/contrib/groff/src/devices/xditview/Makefile.sub b/contrib/groff/src/devices/xditview/Makefile.sub
new file mode 100644
index 0000000..f403020
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/Makefile.sub
@@ -0,0 +1,47 @@
+PROG=gxditview$(EXEEXT)
+MAN1=gxditview.n
+MLIB=$(LIBM)
+XLIBS=$(LIBXUTIL)
+EXTRA_CFLAGS=$(X_CFLAGS)
+EXTRA_LDFLAGS=$(X_LIBS) $(X_PRE_LIBS) -lXaw -lXmu -lXt -lX11 $(X_EXTRA_LIBS)
+OBJS=\
+ device.$(OBJEXT) \
+ draw.$(OBJEXT) \
+ Dvi.$(OBJEXT) \
+ font.$(OBJEXT) \
+ lex.$(OBJEXT) \
+ page.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ xditview.$(OBJEXT)
+CSRCS=\
+ $(srcdir)/device.c \
+ $(srcdir)/draw.c \
+ $(srcdir)/Dvi.c \
+ $(srcdir)/font.c \
+ $(srcdir)/lex.c \
+ $(srcdir)/page.c \
+ $(srcdir)/parse.c \
+ $(srcdir)/xditview.c
+HDRS=\
+ $(srcdir)/device.h \
+ $(srcdir)/Dvi.h \
+ $(srcdir)/DviP.h \
+ $(srcdir)/Menu.h
+GENHDRS=GXditview-ad.h
+
+all depend: $(GENHDRS)
+
+GXditview-ad.h: $(srcdir)/GXditview.ad
+ @echo Making $@
+ @-rm -f $@
+ $(SHELL) $(srcdir)/ad2c $(srcdir)/GXditview.ad >GXditview-ad.h
+
+install_data: $(srcdir)/GXditview.ad
+ -test -d $(appresdir) || $(mkinstalldirs) $(appresdir)
+ if test -f $(appresdir)/GXditview; then \
+ mv $(appresdir)/GXditview $(appresdir)/GXditview.old; \
+ fi
+ $(INSTALL_DATA) $(srcdir)/GXditview.ad $(appresdir)/GXditview
+
+uninstall_sub:
+ -rm -f $(appresdir)/GXditview
diff --git a/contrib/groff/src/devices/xditview/Menu.h b/contrib/groff/src/devices/xditview/Menu.h
new file mode 100644
index 0000000..c306b27
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/Menu.h
@@ -0,0 +1,46 @@
+/*
+ * $XConsortium: Menu.h,v 1.2 89/07/21 14:22:10 jim Exp $
+ */
+
+#ifndef _XtMenu_h
+#define _XtMenu_h
+
+/***********************************************************************
+ *
+ * Menu Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name Class RepType Default Value
+ ---- ----- ------- -------------
+ background Background pixel White
+ border BorderColor pixel Black
+ borderWidth BorderWidth int 1
+ height Height int 120
+ mappedWhenManaged MappedWhenManaged Boolean True
+ reverseVideo ReverseVideo Boolean False
+ width Width int 120
+ x Position int 0
+ y Position int 0
+
+*/
+
+#define XtNmenuEntries "menuEntries"
+#define XtNhorizontalPadding "horizontalPadding"
+#define XtNverticalPadding "verticalPadding"
+#define XtNselection "Selection"
+
+#define XtCMenuEntries "MenuEntries"
+#define XtCPadding "Padding"
+#define XtCSelection "Selection"
+
+typedef struct _MenuRec *MenuWidget; /* completely defined in MenuPrivate.h */
+typedef struct _MenuClassRec *MenuWidgetClass; /* completely defined in MenuPrivate.h */
+
+extern WidgetClass menuWidgetClass;
+
+extern Widget XawMenuCreate ();
+#endif /* _XtMenu_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/contrib/groff/src/devices/xditview/README b/contrib/groff/src/devices/xditview/README
new file mode 100644
index 0000000..1461b5a
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/README
@@ -0,0 +1,13 @@
+This is gxditview, an X11 previewer for groff based on MIT's xditview.
+This version can be used with the output of gtroff -Tps as well as
+with -TX75 and -TX100. You will need X11R5 or newer to install it (it
+might work on X11R4, but I haven't tested it.)
+
+Previously, gxditview was installed in the usual place for X binaries
+(e.g., /usr/bin/X11); you have to remove it manually.
+
+xditview is copyrighted by MIT under the usual X terms (see
+gxditview.man); the changes to that which come along with the groff package
+are in the public domain.
+
+Please report bugs to bug-groff@gnu.org.
diff --git a/contrib/groff/src/devices/xditview/TODO b/contrib/groff/src/devices/xditview/TODO
new file mode 100644
index 0000000..161a7cf
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/TODO
@@ -0,0 +1,17 @@
+Replace Imakefile with a configure script.
+
+Better error handling.
+
+Resource and command-line option to specify font path.
+
+Resource to specify name of environment variable from which to get the
+font path.
+
+Have character substitutions (currently done in draw.c:FakeCharacter)
+specified in a resource (similar format to FontMap).
+
+The initial width of the dialog box should expand to accommodate the
+default value.
+
+Option in Print dialog to specify that only the current page should be
+printed.
diff --git a/contrib/groff/src/devices/xditview/ad2c b/contrib/groff/src/devices/xditview/ad2c
new file mode 100644
index 0000000..ad5d121
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/ad2c
@@ -0,0 +1,64 @@
+#! /bin/sh
+#
+# ad2c : Convert app-defaults file to C strings decls.
+#
+# George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
+# 19 Mar 1991: gf
+# Made it self-contained.
+# 6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
+# Removed use of "-n" and ":read" label since Gnu and
+# IBM sed print pattern space on "n" command. Still works
+# with Sun sed, of course.
+# 7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
+# Escape quotes after escaping backslashes.
+# 8 Jul 1992: Version 1.6
+# Manpage fixes.
+# 19 Apr 1993: Version 1.7
+# Remove comments that were inside the sed command since
+# some versions of sed don't like them. The comments are
+# now given here in the header.
+# 31 May 2004: Werner Lemberg <wl@gnu.org>
+# Force casts to `String'.
+#
+# Comments on the script by line:
+# /^!/d Remove comments
+# /^$/d Remove blanks
+# s/\\/\\\\/g Escape backslashes...
+# s/\\$//g ...except the line continuation ones
+# s/"/\\"/g Escape quotes
+# s/^/"/ Add leading quote and cast
+# : test Establish label for later branch
+# /\\$/b slash Branch to label "slash" if line ends in backslash
+# s/$/",/ Otherwise add closing quote and comma...
+# p ...output the line...
+# d ...and clear the pattern space so it's not printed again
+# : slash Branch comes here if line ends in backslash
+# n Read next line, append to pattern space
+# [...] The "d" and "s" commands that follow just delete
+# comments and blank lines and escape control sequences
+# b test Branch up to see if the line ends in backslash or not
+#
+
+sed '
+/^!/d
+/^$/d
+s/\\/\\\\/g
+s/\\$//g
+s/"/\\"/g
+s/^/(String)"/
+: test
+/\\$/b slash
+s/$/",/
+p
+d
+: slash
+n
+/^!/d
+/^$/d
+s/"/\\"/g
+s/\\\\/\\/g
+s/\\n/\\\\n/g
+s/\\t/\\\\t/g
+s/\\f/\\\\f/g
+s/\\b/\\\\b/g
+b test' "$@"
diff --git a/contrib/groff/src/devices/xditview/device.c b/contrib/groff/src/devices/xditview/device.c
new file mode 100644
index 0000000..2cb2219
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/device.c
@@ -0,0 +1,565 @@
+/* device.c */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xos.h>
+#include <X11/Intrinsic.h>
+
+#include "device.h"
+#include "defs.h"
+
+#ifndef isascii
+#define isascii(c) (1)
+#endif
+
+/* Name of environment variable containing path to be used for
+searching for device and font description files. */
+#define FONTPATH_ENV_VAR "GROFF_FONT_PATH"
+
+#define WS " \t\r\n"
+
+#ifndef INT_MIN
+/* Minimum and maximum values a `signed int' can hold. */
+#define INT_MIN (-INT_MAX-1)
+#define INT_MAX 2147483647
+#endif
+
+#define CHAR_TABLE_SIZE 307
+
+struct _DeviceFont {
+ char *name;
+ int special;
+ DeviceFont *next;
+ Device *dev;
+ struct charinfo *char_table[CHAR_TABLE_SIZE];
+ struct charinfo *code_table[256];
+};
+
+struct charinfo {
+ int width;
+ int code;
+ struct charinfo *next;
+ struct charinfo *code_next;
+ char name[1];
+};
+
+static char *current_filename = 0;
+static int current_lineno = -1;
+
+static void error(const char *s);
+static FILE *open_device_file(const char *, const char *, char **);
+static DeviceFont *load_font(Device *, const char *);
+static Device *new_device(const char *);
+static DeviceFont *new_font(const char *, Device *);
+static void delete_font(DeviceFont *);
+static unsigned hash_name(const char *);
+static struct charinfo *add_char(DeviceFont *, const char *, int, int);
+static int read_charset_section(DeviceFont *, FILE *);
+static char *canonicalize_name(const char *);
+static int scale_round(int, int, int);
+
+static
+Device *new_device(const char *name)
+{
+ Device *dev;
+
+ dev = XtNew(Device);
+ dev->sizescale = 1;
+ dev->res = 0;
+ dev->unitwidth = 0;
+ dev->fonts = 0;
+ dev->X11 = 0;
+ dev->paperlength = 0;
+ dev->paperwidth = 0;
+ dev->name = XtNewString(name);
+ return dev;
+}
+
+void device_destroy(Device *dev)
+{
+ DeviceFont *f;
+
+ if (!dev)
+ return;
+ f = dev->fonts;
+ while (f) {
+ DeviceFont *tem = f;
+ f = f->next;
+ delete_font(tem);
+ }
+
+ XtFree(dev->name);
+ XtFree((char *)dev);
+}
+
+Device *device_load(const char *name)
+{
+ Device *dev;
+ FILE *fp;
+ int err = 0;
+ char buf[256];
+
+ fp = open_device_file(name, "DESC", &current_filename);
+ if (!fp)
+ return 0;
+ dev = new_device(name);
+ current_lineno = 0;
+ while (fgets(buf, sizeof(buf), fp)) {
+ char *p;
+ current_lineno++;
+ p = strtok(buf, WS);
+ if (p) {
+ int *np = 0;
+ char *q;
+
+ if (strcmp(p, "charset") == 0)
+ break;
+ if (strcmp(p, "X11") == 0)
+ dev->X11 = 1;
+ else if (strcmp(p, "sizescale") == 0)
+ np = &dev->sizescale;
+ else if (strcmp(p, "res") == 0)
+ np = &dev->res;
+ else if (strcmp(p, "unitwidth") == 0)
+ np = &dev->unitwidth;
+ else if (strcmp(p, "paperwidth") == 0)
+ np = &dev->paperwidth;
+ else if (strcmp(p, "paperlength") == 0)
+ np = &dev->paperlength;
+
+ if (np) {
+ q = strtok((char *)0, WS);
+ if (!q || sscanf(q, "%d", np) != 1 || *np <= 0) {
+ error("bad argument");
+ err = 1;
+ break;
+ }
+ }
+ }
+ }
+ fclose(fp);
+ current_lineno = -1;
+ if (!err) {
+ if (dev->res == 0) {
+ error("missing res line");
+ err = 1;
+ }
+ else if (dev->unitwidth == 0) {
+ error("missing unitwidth line");
+ err = 1;
+ }
+ }
+ if (dev->paperlength == 0)
+ dev->paperlength = dev->res*11;
+ if (dev->paperwidth == 0)
+ dev->paperwidth = dev->res*8 + dev->res/2;
+ if (err) {
+ device_destroy(dev);
+ dev = 0;
+ }
+ XtFree(current_filename);
+ current_filename = 0;
+ return dev;
+}
+
+
+DeviceFont *device_find_font(Device *dev, const char *name)
+{
+ DeviceFont *f;
+
+ if (!dev)
+ return 0;
+ for (f = dev->fonts; f; f = f->next)
+ if (strcmp(f->name, name) == 0)
+ return f;
+ return load_font(dev, name);
+}
+
+static
+DeviceFont *load_font(Device *dev, const char *name)
+{
+ FILE *fp;
+ char buf[256];
+ DeviceFont *f;
+ int special = 0;
+
+ fp = open_device_file(dev->name, name, &current_filename);
+ if (!fp)
+ return 0;
+ current_lineno = 0;
+ for (;;) {
+ char *p;
+
+ if (!fgets(buf, sizeof(buf), fp)) {
+ error("no charset line");
+ return 0;
+ }
+ current_lineno++;
+ p = strtok(buf, WS);
+ /* charset must be on a line by itself */
+ if (p && strcmp(p, "charset") == 0 && strtok((char *)0, WS) == 0)
+ break;
+ if (p && strcmp(p, "special") == 0)
+ special = 1;
+ }
+ f = new_font(name, dev);
+ f->special = special;
+ if (!read_charset_section(f, fp)) {
+ delete_font(f);
+ f = 0;
+ }
+ else {
+ f->next = dev->fonts;
+ dev->fonts = f;
+ }
+ fclose(fp);
+ XtFree(current_filename);
+ current_filename = 0;
+ return f;
+}
+
+static
+DeviceFont *new_font(const char *name, Device *dev)
+{
+ int i;
+ DeviceFont *f;
+
+ f = XtNew(DeviceFont);
+ f->name = XtNewString(name);
+ f->dev = dev;
+ f->special = 0;
+ f->next = 0;
+ for (i = 0; i < CHAR_TABLE_SIZE; i++)
+ f->char_table[i] = 0;
+ for (i = 0; i < 256; i++)
+ f->code_table[i] = 0;
+ return f;
+}
+
+static
+void delete_font(DeviceFont *f)
+{
+ int i;
+
+ if (!f)
+ return;
+ XtFree(f->name);
+ for (i = 0; i < CHAR_TABLE_SIZE; i++) {
+ struct charinfo *ptr = f->char_table[i];
+ while (ptr) {
+ struct charinfo *tem = ptr;
+ ptr = ptr->next;
+ XtFree((char *)tem);
+ }
+ }
+ XtFree((char *)f);
+}
+
+
+static
+unsigned hash_name(const char *name)
+{
+ unsigned n = 0;
+ /* XXX do better than this */
+ while (*name)
+ n = (n << 1) ^ *name++;
+
+ return n;
+}
+
+static
+int scale_round(int n, int x, int y)
+{
+ int y2;
+
+ if (x == 0)
+ return 0;
+ y2 = y/2;
+ if (n >= 0) {
+ if (n <= (INT_MAX - y2)/x)
+ return (n*x + y2)/y;
+ return (int)(n*(double)x/(double)y + .5);
+ }
+ else {
+ if (-(unsigned)n <= (-(unsigned)INT_MIN - y2)/x)
+ return (n*x - y2)/y;
+ return (int)(n*(double)x/(double)y + .5);
+ }
+}
+
+static
+char *canonicalize_name(const char *s)
+{
+ static char ch[2];
+ if (s[0] == 'c' && s[1] == 'h' && s[2] == 'a' && s[3] == 'r') {
+ const char *p;
+ int n;
+
+ for (p = s + 4; *p; p++)
+ if (!isascii(*p) || !isdigit((unsigned char)*p))
+ return (char *)s;
+ n = atoi(s + 4);
+ if (n >= 0 && n <= 0xff) {
+ ch[0] = (char)n;
+ return ch;
+ }
+ }
+ return (char *)s;
+}
+
+/* Return 1 if the character is present in the font; widthp gets the
+width if non-null. */
+
+int device_char_width(DeviceFont *f, int ps, const char *name, int *widthp)
+{
+ struct charinfo *p;
+
+ name = canonicalize_name(name);
+ for (p = f->char_table[hash_name(name) % CHAR_TABLE_SIZE];; p = p->next) {
+ if (!p)
+ return 0;
+ if (strcmp(p->name, name) == 0)
+ break;
+ }
+ *widthp = scale_round(p->width, ps, f->dev->unitwidth);
+ return 1;
+}
+
+int device_code_width(DeviceFont *f, int ps, int code, int *widthp)
+{
+ struct charinfo *p;
+
+ for (p = f->code_table[code & 0xff];; p = p->code_next) {
+ if (!p)
+ return 0;
+ if (p->code == code)
+ break;
+ }
+ *widthp = scale_round(p->width, ps, f->dev->unitwidth);
+ return 1;
+}
+
+char *device_name_for_code(DeviceFont *f, int code)
+{
+ static struct charinfo *state = 0;
+ if (f)
+ state = f->code_table[code & 0xff];
+ for (; state; state = state->code_next)
+ if (state->code == code && state->name[0] != '\0') {
+ char *name = state->name;
+ state = state->code_next;
+ return name;
+ }
+ return 0;
+}
+
+int device_font_special(DeviceFont *f)
+{
+ return f->special;
+}
+
+static
+struct charinfo *add_char(DeviceFont *f, const char *name, int width, int code)
+{
+ struct charinfo **pp;
+ struct charinfo *ci;
+
+ name = canonicalize_name(name);
+ if (strcmp(name, "---") == 0)
+ name = "";
+
+ ci = (struct charinfo *)XtMalloc(XtOffsetOf(struct charinfo, name[0])
+ + strlen(name) + 1);
+
+ strcpy(ci->name, name);
+ ci->width = width;
+ ci->code = code;
+
+ if (*name != '\0') {
+ pp = &f->char_table[hash_name(name) % CHAR_TABLE_SIZE];
+ ci->next = *pp;
+ *pp = ci;
+ }
+ pp = &f->code_table[code & 0xff];
+ ci->code_next = *pp;
+ *pp = ci;
+ return ci;
+}
+
+/* Return non-zero for success. */
+
+static
+int read_charset_section(DeviceFont *f, FILE *fp)
+{
+ struct charinfo *last_charinfo = 0;
+ char buf[256];
+
+ while (fgets(buf, sizeof(buf), fp)) {
+ char *name;
+ int width;
+ int code;
+ char *p;
+
+ current_lineno++;
+ name = strtok(buf, WS);
+ if (!name)
+ continue; /* ignore blank lines */
+ p = strtok((char *)0, WS);
+ if (!p) /* end of charset section */
+ break;
+ if (strcmp(p, "\"") == 0) {
+ if (!last_charinfo) {
+ error("first line of charset section cannot use `\"'");
+ return 0;
+ }
+ else
+ (void)add_char(f, name,
+ last_charinfo->width, last_charinfo->code);
+ }
+ else {
+ char *q;
+ if (sscanf(p, "%d", &width) != 1) {
+ error("bad width field");
+ return 0;
+ }
+ p = strtok((char *)0, WS);
+ if (!p) {
+ error("missing type field");
+ return 0;
+ }
+ p = strtok((char *)0, WS);
+ if (!p) {
+ error("missing code field");
+ return 0;
+ }
+ code = (int)strtol(p, &q, 0);
+ if (q == p) {
+ error("bad code field");
+ return 0;
+ }
+ last_charinfo = add_char(f, name, width, code);
+ }
+ }
+ return 1;
+}
+
+static
+FILE *find_file(const char *file, char **result)
+{
+ char *buf = NULL;
+ int bufsiz = 0;
+ int flen;
+ FILE *fp;
+ char *path;
+ char *env;
+
+ env = getenv(FONTPATH_ENV_VAR);
+ path = XtMalloc(((env && *env) ? strlen(env) + 1 : 0)
+ + strlen(FONTPATH) + 1);
+ *path = '\0';
+ if (env && *env) {
+ strcat(path, env);
+ strcat(path, ":");
+ }
+ strcat(path, FONTPATH);
+
+ *result = NULL;
+
+ if (file == NULL)
+ return NULL;
+ if (*file == '\0')
+ return NULL;
+
+ if (*file == '/') {
+ fp = fopen(file, "r");
+ if (fp)
+ *result = XtNewString(file);
+ return fp;
+ }
+
+ flen = strlen(file);
+
+ while (*path) {
+ int len;
+ char *start, *end;
+
+ start = path;
+ end = strchr(path, ':');
+ if (end)
+ path = end + 1;
+ else
+ path = end = strchr(path, '\0');
+ if (start >= end)
+ continue;
+ if (end[-1] == '/')
+ --end;
+ len = (end - start) + 1 + flen + 1;
+ if (len > bufsiz) {
+ if (buf)
+ buf = XtRealloc(buf, len);
+ else
+ buf = XtMalloc(len);
+ bufsiz = len;
+ }
+ memcpy(buf, start, end - start);
+ buf[end - start] = '/';
+ strcpy(buf + (end - start) + 1, file);
+ fp = fopen(buf, "r");
+ if (fp) {
+ *result = buf;
+ return fp;
+ }
+ }
+ XtFree(buf);
+ return NULL;
+}
+
+static
+FILE *open_device_file(const char *device_name, const char *file_name,
+ char **result)
+{
+ char *buf;
+ FILE *fp;
+
+ buf = XtMalloc(3 + strlen(device_name) + 1 + strlen(file_name) + 1);
+ sprintf(buf, "dev%s/%s", device_name, file_name);
+ fp = find_file(buf, result);
+ if (!fp) {
+ fprintf(stderr, "can't find device file `%s'\n", file_name);
+ fflush(stderr);
+ }
+ XtFree(buf);
+ return fp;
+}
+
+static
+void error(const char *s)
+{
+ if (current_filename) {
+ fprintf(stderr, "%s:", current_filename);
+ if (current_lineno > 0)
+ fprintf(stderr, "%d:", current_lineno);
+ putc(' ', stderr);
+ }
+ fputs(s, stderr);
+ putc('\n', stderr);
+ fflush(stderr);
+}
+
+/*
+Local Variables:
+c-indent-level: 4
+c-continued-statement-offset: 4
+c-brace-offset: -4
+c-argdecl-indent: 4
+c-label-offset: -4
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/device.h b/contrib/groff/src/devices/xditview/device.h
new file mode 100644
index 0000000..6f2944b
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/device.h
@@ -0,0 +1,21 @@
+
+typedef struct _DeviceFont DeviceFont;
+
+typedef struct _Device {
+ char *name;
+ int sizescale;
+ int res;
+ int unitwidth;
+ int paperlength;
+ int paperwidth;
+ int X11;
+ DeviceFont *fonts;
+} Device;
+
+void device_destroy(Device *);
+Device *device_load(const char *);
+DeviceFont *device_find_font(Device *, const char *);
+int device_char_width(DeviceFont *, int, const char *, int *);
+char *device_name_for_code(DeviceFont *, int);
+int device_code_width(DeviceFont *, int, int, int *);
+int device_font_special(DeviceFont *);
diff --git a/contrib/groff/src/devices/xditview/draw.c b/contrib/groff/src/devices/xditview/draw.c
new file mode 100644
index 0000000..a808aba
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/draw.c
@@ -0,0 +1,699 @@
+/*
+ * draw.c
+ *
+ * accept dvi function calls and translate to X
+ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+/* math.h on a Sequent doesn't define M_PI, apparently */
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#include "DviP.h"
+
+#define DeviceToX(dw, n) ((int)((n) * (dw)->dvi.scale_factor + .5))
+#define XPos(dw) (DeviceToX((dw), (dw)->dvi.state->x - \
+ (dw)->dvi.text_device_width) + (dw)->dvi.text_x_width)
+#define YPos(dw) (DeviceToX((dw), (dw)->dvi.state->y))
+
+static int FakeCharacter(DviWidget, char *, int);
+
+/* font.c */
+extern int MaxFontPosition(DviWidget);
+
+void
+HorizontalMove(DviWidget dw, int delta)
+{
+ dw->dvi.state->x += delta;
+}
+
+void
+HorizontalGoto(DviWidget dw, int NewPosition)
+{
+ dw->dvi.state->x = NewPosition;
+}
+
+void
+VerticalMove(DviWidget dw, int delta)
+{
+ dw->dvi.state->y += delta;
+}
+
+void
+VerticalGoto(DviWidget dw, int NewPosition)
+{
+ dw->dvi.state->y = NewPosition;
+}
+
+void
+AdjustCacheDeltas (DviWidget dw)
+{
+ int extra;
+ int nadj;
+ int i;
+
+ nadj = 0;
+ extra = DeviceToX(dw, dw->dvi.text_device_width)
+ - dw->dvi.text_x_width;
+ if (extra == 0)
+ return;
+ for (i = 0; i <= dw->dvi.cache.index; i++)
+ if (dw->dvi.cache.adjustable[i])
+ ++nadj;
+ dw->dvi.text_x_width += extra;
+ if (nadj <= 1)
+ return;
+ for (i = 0; i <= dw->dvi.cache.index; i++)
+ if (dw->dvi.cache.adjustable[i]) {
+ int x;
+ int *deltap;
+
+ x = extra/nadj;
+ deltap = &dw->dvi.cache.cache[i].delta;
+#define MIN_DELTA 2
+ if (*deltap > 0 && x + *deltap < MIN_DELTA) {
+ x = MIN_DELTA - *deltap;
+ if (x <= 0)
+ *deltap = MIN_DELTA;
+ else
+ x = 0;
+ }
+ else
+ *deltap += x;
+ extra -= x;
+ --nadj;
+ dw->dvi.cache.adjustable[i] = 0;
+ }
+}
+
+void
+FlushCharCache (DviWidget dw)
+{
+ if (dw->dvi.cache.char_index != 0) {
+ AdjustCacheDeltas (dw);
+ XDrawText (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ dw->dvi.cache.start_x, dw->dvi.cache.start_y,
+ dw->dvi.cache.cache, dw->dvi.cache.index + 1);
+ }
+ dw->dvi.cache.index = 0;
+ dw->dvi.cache.max = DVI_TEXT_CACHE_SIZE;
+#if 0
+ if (dw->dvi.noPolyText)
+ dw->dvi.cache.max = 1;
+#endif
+ dw->dvi.cache.char_index = 0;
+ dw->dvi.cache.cache[0].nchars = 0;
+ dw->dvi.cache.start_x = dw->dvi.cache.x = XPos (dw);
+ dw->dvi.cache.start_y = dw->dvi.cache.y = YPos (dw);
+}
+
+void
+Newline (DviWidget dw)
+{
+ FlushCharCache (dw);
+ dw->dvi.text_x_width = dw->dvi.text_device_width = 0;
+ dw->dvi.word_flag = 0;
+}
+
+void
+Word (DviWidget dw)
+{
+ dw->dvi.word_flag = 1;
+}
+
+#define charWidth(fi,c) (\
+ (fi)->per_char ?\
+ (fi)->per_char[(c) - (fi)->min_char_or_byte2].width\
+ :\
+ (fi)->max_bounds.width\
+)
+
+
+static
+int charExists (XFontStruct *fi, int c)
+{
+ XCharStruct *p;
+
+ /* `c' is always >= 0 */
+ if (fi->per_char == NULL
+ || (unsigned int)c < fi->min_char_or_byte2
+ || (unsigned int)c > fi->max_char_or_byte2)
+ return 0;
+ p = fi->per_char + (c - fi->min_char_or_byte2);
+ return (p->lbearing != 0 || p->rbearing != 0 || p->width != 0
+ || p->ascent != 0 || p->descent != 0 || p->attributes != 0);
+}
+
+/* `wid' is in device units */
+static void
+DoCharacter (DviWidget dw, int c, int wid)
+{
+ register XFontStruct *font;
+ register XTextItem *text;
+ int x, y;
+
+ x = XPos(dw);
+ y = YPos(dw);
+
+ /*
+ * quick and dirty extents calculation:
+ */
+ if (!(y + 24 >= dw->dvi.extents.y1
+ && y - 24 <= dw->dvi.extents.y2
+#if 0
+ && x + 24 >= dw->dvi.extents.x1
+ && x - 24 <= dw->dvi.extents.x2
+#endif
+ ))
+ return;
+
+ if (y != dw->dvi.cache.y
+ || dw->dvi.cache.char_index >= DVI_CHAR_CACHE_SIZE) {
+ FlushCharCache (dw);
+ x = dw->dvi.cache.x;
+ dw->dvi.cache.adjustable[dw->dvi.cache.index] = 0;
+ }
+ /*
+ * load a new font, if the current block is not empty,
+ * step to the next.
+ */
+ if (dw->dvi.cache.font_size != dw->dvi.state->font_size ||
+ dw->dvi.cache.font_number != dw->dvi.state->font_number)
+ {
+ FlushCharCache (dw);
+ x = dw->dvi.cache.x;
+ dw->dvi.cache.font_size = dw->dvi.state->font_size;
+ dw->dvi.cache.font_number = dw->dvi.state->font_number;
+ dw->dvi.cache.font = QueryFont (dw,
+ dw->dvi.cache.font_number,
+ dw->dvi.cache.font_size);
+ if (dw->dvi.cache.cache[dw->dvi.cache.index].nchars != 0) {
+ ++dw->dvi.cache.index;
+ if (dw->dvi.cache.index >= dw->dvi.cache.max)
+ FlushCharCache (dw);
+ dw->dvi.cache.cache[dw->dvi.cache.index].nchars = 0;
+ dw->dvi.cache.adjustable[dw->dvi.cache.index] = 0;
+ }
+ }
+ if (x != dw->dvi.cache.x || dw->dvi.word_flag) {
+ if (dw->dvi.cache.cache[dw->dvi.cache.index].nchars != 0) {
+ ++dw->dvi.cache.index;
+ if (dw->dvi.cache.index >= dw->dvi.cache.max)
+ FlushCharCache (dw);
+ dw->dvi.cache.cache[dw->dvi.cache.index].nchars = 0;
+ dw->dvi.cache.adjustable[dw->dvi.cache.index] = 0;
+ }
+ dw->dvi.cache.adjustable[dw->dvi.cache.index]
+ = dw->dvi.word_flag;
+ dw->dvi.word_flag = 0;
+ }
+ font = dw->dvi.cache.font;
+ text = &dw->dvi.cache.cache[dw->dvi.cache.index];
+ if (text->nchars == 0) {
+ text->chars = &dw->dvi.cache.char_cache[dw->dvi.cache.char_index];
+ text->delta = x - dw->dvi.cache.x;
+ if (font != dw->dvi.font) {
+ text->font = font->fid;
+ dw->dvi.font = font;
+ } else
+ text->font = None;
+ dw->dvi.cache.x += text->delta;
+ }
+ if (charExists(font, c)) {
+ int w;
+ dw->dvi.cache.char_cache[dw->dvi.cache.char_index++] = (char) c;
+ ++text->nchars;
+ w = charWidth(font, c);
+ dw->dvi.cache.x += w;
+ if (wid != 0) {
+ dw->dvi.text_x_width += w;
+ dw->dvi.text_device_width += wid;
+ }
+ }
+}
+
+static
+int FindCharWidth (DviWidget dw, char *buf, int *widp)
+{
+ int maxpos;
+ int i;
+
+ if (dw->dvi.device_font == 0
+ || dw->dvi.state->font_number != dw->dvi.device_font_number) {
+ dw->dvi.device_font_number = dw->dvi.state->font_number;
+ dw->dvi.device_font
+ = QueryDeviceFont (dw, dw->dvi.device_font_number);
+ }
+ if (dw->dvi.device_font
+ && device_char_width (dw->dvi.device_font,
+ dw->dvi.state->font_size, buf, widp))
+ return 1;
+
+ maxpos = MaxFontPosition (dw);
+ for (i = 1; i <= maxpos; i++) {
+ DeviceFont *f = QueryDeviceFont (dw, i);
+ if (f && device_font_special (f)
+ && device_char_width (f, dw->dvi.state->font_size,
+ buf, widp)) {
+ dw->dvi.state->font_number = i;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* Return the width of the character in device units. */
+
+int PutCharacter (DviWidget dw, char *buf)
+{
+ int prevFont;
+ int c = -1;
+ int wid = 0;
+ DviCharNameMap *map;
+
+ if (!dw->dvi.display_enable)
+ return 0; /* The width doesn't matter in this case. */
+ prevFont = dw->dvi.state->font_number;
+ if (!FindCharWidth (dw, buf, &wid))
+ return 0;
+ map = QueryFontMap (dw, dw->dvi.state->font_number);
+ if (map)
+ c = DviCharIndex (map, buf);
+ if (c >= 0)
+ DoCharacter (dw, c, wid);
+ else
+ (void) FakeCharacter (dw, buf, wid);
+ dw->dvi.state->font_number = prevFont;
+ return wid;
+}
+
+/* Return 1 if we can fake it; 0 otherwise. */
+
+static
+int FakeCharacter (DviWidget dw, char *buf, int wid)
+{
+ int oldx, oldw;
+ char ch[2];
+ const char *chars = 0;
+
+ if (buf[0] == '\0' || buf[1] == '\0' || buf[2] != '\0')
+ return 0;
+#define pack2(c1, c2) (((c1) << 8) | (c2))
+
+ switch (pack2(buf[0], buf[1])) {
+ case pack2('f', 'i'):
+ chars = "fi";
+ break;
+ case pack2('f', 'l'):
+ chars = "fl";
+ break;
+ case pack2('f', 'f'):
+ chars = "ff";
+ break;
+ case pack2('F', 'i'):
+ chars = "ffi";
+ break;
+ case pack2('F', 'l'):
+ chars = "ffl";
+ break;
+ }
+ if (!chars)
+ return 0;
+ oldx = dw->dvi.state->x;
+ oldw = dw->dvi.text_device_width;
+ ch[1] = '\0';
+ for (; *chars; chars++) {
+ ch[0] = *chars;
+ dw->dvi.state->x += PutCharacter (dw, ch);
+ }
+ dw->dvi.state->x = oldx;
+ dw->dvi.text_device_width = oldw + wid;
+ return 1;
+}
+
+void
+PutNumberedCharacter (DviWidget dw, int c)
+{
+ char *name;
+ int wid;
+ DviCharNameMap *map;
+
+ if (!dw->dvi.display_enable)
+ return;
+
+ if (dw->dvi.device_font == 0
+ || dw->dvi.state->font_number != dw->dvi.device_font_number) {
+ dw->dvi.device_font_number = dw->dvi.state->font_number;
+ dw->dvi.device_font
+ = QueryDeviceFont (dw, dw->dvi.device_font_number);
+ }
+
+ if (dw->dvi.device_font == 0
+ || !device_code_width (dw->dvi.device_font,
+ dw->dvi.state->font_size, c, &wid))
+ return;
+ if (dw->dvi.native) {
+ DoCharacter (dw, c, wid);
+ return;
+ }
+ map = QueryFontMap (dw, dw->dvi.state->font_number);
+ if (!map)
+ return;
+ for (name = device_name_for_code (dw->dvi.device_font, c);
+ name;
+ name = device_name_for_code ((DeviceFont *)0, c)) {
+ int code = DviCharIndex (map, name);
+ if (code >= 0) {
+ DoCharacter (dw, code, wid);
+ break;
+ }
+ if (FakeCharacter (dw, name, wid))
+ break;
+ }
+}
+
+void
+ClearPage (DviWidget dw)
+{
+ XClearWindow (XtDisplay (dw), XtWindow (dw));
+}
+
+static void
+setGC (DviWidget dw)
+{
+ int desired_line_width;
+
+ if (dw->dvi.line_thickness < 0)
+ desired_line_width = (int)(((double)dw->dvi.device_resolution
+ * dw->dvi.state->font_size)
+ / (10.0*72.0*dw->dvi.sizescale));
+ else
+ desired_line_width = dw->dvi.line_thickness;
+
+ if (desired_line_width != dw->dvi.line_width) {
+ XGCValues values;
+ values.line_width = DeviceToX(dw, desired_line_width);
+ if (values.line_width == 0)
+ values.line_width = 1;
+ XChangeGC(XtDisplay (dw), dw->dvi.normal_GC,
+ GCLineWidth, &values);
+ dw->dvi.line_width = desired_line_width;
+ }
+}
+
+static void
+setFillGC (DviWidget dw)
+{
+ int fill_type;
+ unsigned long mask = GCFillStyle | GCForeground;
+
+ fill_type = (dw->dvi.fill * 10) / (DVI_FILL_MAX + 1);
+ if (dw->dvi.fill_type != fill_type) {
+ XGCValues values;
+ if (fill_type <= 0) {
+ values.foreground = dw->dvi.background;
+ values.fill_style = FillSolid;
+ } else if (fill_type >= 9) {
+ values.foreground = dw->dvi.foreground;
+ values.fill_style = FillSolid;
+ } else {
+ values.foreground = dw->dvi.foreground;
+ values.fill_style = FillOpaqueStippled;
+ values.stipple = dw->dvi.gray[fill_type - 1];
+ mask |= GCStipple;
+ }
+ XChangeGC(XtDisplay (dw), dw->dvi.fill_GC, mask, &values);
+ dw->dvi.fill_type = fill_type;
+ }
+}
+
+void
+DrawLine (DviWidget dw, int x, int y)
+{
+ int xp, yp;
+
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+ xp = XPos (dw);
+ yp = YPos (dw);
+ XDrawLine (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ xp, yp,
+ xp + DeviceToX (dw, x), yp + DeviceToX (dw, y));
+}
+
+void
+DrawCircle (DviWidget dw, int diam)
+{
+ int d;
+
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+ d = DeviceToX (dw, diam);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ XPos (dw), YPos (dw) - d/2,
+ d, d, 0, 64*360);
+}
+
+void
+DrawFilledCircle (DviWidget dw, int diam)
+{
+ int d;
+
+ AdjustCacheDeltas (dw);
+ setFillGC (dw);
+ d = DeviceToX (dw, diam);
+ XFillArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - d/2,
+ d, d, 0, 64*360);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - d/2,
+ d, d, 0, 64*360);
+}
+
+void
+DrawEllipse (DviWidget dw, int a, int b)
+{
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ XPos (dw), YPos (dw) - DeviceToX (dw, b/2),
+ DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360);
+}
+
+void
+DrawFilledEllipse (DviWidget dw, int a, int b)
+{
+ AdjustCacheDeltas (dw);
+ setFillGC (dw);
+ XFillArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - DeviceToX (dw, b/2),
+ DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ XPos (dw), YPos (dw) - DeviceToX (dw, b/2),
+ DeviceToX (dw, a), DeviceToX (dw, b), 0, 64*360);
+}
+
+void
+DrawArc (DviWidget dw, int x_0, int y_0, int x_1, int y_1)
+{
+ int angle1, angle2;
+ int rad = (int)((sqrt ((double)x_0*x_0 + (double)y_0*y_0)
+ + sqrt ((double)x_1*x_1 + (double)y_1*y_1)
+ + 1.0)/2.0);
+ if ((x_0 == 0 && y_0 == 0) || (x_1 == 0 && y_1 == 0))
+ return;
+ angle1 = (int)(atan2 ((double)y_0, (double)-x_0)*180.0*64.0/M_PI);
+ angle2 = (int)(atan2 ((double)-y_1, (double)x_1)*180.0*64.0/M_PI);
+
+ angle2 -= angle1;
+ if (angle2 < 0)
+ angle2 += 64*360;
+
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+
+ rad = DeviceToX (dw, rad);
+ XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ XPos (dw) + DeviceToX (dw, x_0) - rad,
+ YPos (dw) + DeviceToX (dw, y_0) - rad,
+ rad*2, rad*2, angle1, angle2);
+}
+
+void
+DrawPolygon (DviWidget dw, int *v, int n)
+{
+ XPoint *p;
+ int i;
+ int dx, dy;
+
+ n /= 2;
+
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+ p = (XPoint *)XtMalloc((n + 2)*sizeof(XPoint));
+ p[0].x = XPos (dw);
+ p[0].y = YPos (dw);
+ dx = 0;
+ dy = 0;
+ for (i = 0; i < n; i++) {
+ dx += v[2*i];
+ p[i + 1].x = DeviceToX (dw, dx) + p[0].x;
+ dy += v[2*i + 1];
+ p[i + 1].y = DeviceToX (dw, dy) + p[0].y;
+ }
+ p[n+1].x = p[0].x;
+ p[n+1].y = p[0].y;
+ XDrawLines (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ p, n + 2, CoordModeOrigin);
+ XtFree((char *)p);
+}
+
+void
+DrawFilledPolygon (DviWidget dw, int *v, int n)
+{
+ XPoint *p;
+ int i;
+ int dx, dy;
+
+ n /= 2;
+ if (n < 2)
+ return;
+
+ AdjustCacheDeltas (dw);
+ setFillGC (dw);
+ p = (XPoint *)XtMalloc((n + 2)*sizeof(XPoint));
+ p[0].x = p[n+1].x = XPos (dw);
+ p[0].y = p[n+1].y = YPos (dw);
+ dx = 0;
+ dy = 0;
+ for (i = 0; i < n; i++) {
+ dx += v[2*i];
+ p[i + 1].x = DeviceToX (dw, dx) + p[0].x;
+ dy += v[2*i + 1];
+ p[i + 1].y = DeviceToX (dw, dy) + p[0].y;
+ }
+ XFillPolygon (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ p, n + 1, Complex, CoordModeOrigin);
+ XDrawLines (XtDisplay (dw), XtWindow (dw), dw->dvi.fill_GC,
+ p, n + 2, CoordModeOrigin);
+ XtFree((char *)p);
+}
+
+#define POINTS_MAX 10000
+
+static void
+appendPoint(XPoint *points, int *pointi, int x, int y)
+{
+ if (*pointi < POINTS_MAX) {
+ points[*pointi].x = x;
+ points[*pointi].y = y;
+ *pointi += 1;
+ }
+}
+
+#define FLATNESS 1
+
+static void
+flattenCurve(XPoint *points, int *pointi,
+ int x_2, int y_2, int x_3, int y_3, int x_4, int y_4)
+{
+ int x_1, y_1, dx, dy, n1, n2, n;
+
+ x_1 = points[*pointi - 1].x;
+ y_1 = points[*pointi - 1].y;
+
+ dx = x_4 - x_1;
+ dy = y_4 - y_1;
+
+ n1 = dy*(x_2 - x_1) - dx*(y_2 - y_1);
+ n2 = dy*(x_3 - x_1) - dx*(y_3 - y_1);
+ if (n1 < 0)
+ n1 = -n1;
+ if (n2 < 0)
+ n2 = -n2;
+ n = n1 > n2 ? n1 : n2;
+
+ if (n*n / (dy*dy + dx*dx) <= FLATNESS*FLATNESS)
+ appendPoint (points, pointi, x_4, y_4);
+ else {
+ flattenCurve (points, pointi,
+ (x_1 + x_2)/2,
+ (y_1 + y_2)/2,
+ (x_1 + x_2*2 + x_3)/4,
+ (y_1 + y_2*2 + y_3)/4,
+ (x_1 + 3*x_2 + 3*x_3 + x_4)/8,
+ (y_1 + 3*y_2 + 3*y_3 + y_4)/8);
+ flattenCurve (points, pointi,
+ (x_2 + x_3*2 + x_4)/4,
+ (y_2 + y_3*2 + y_4)/4,
+ (x_3 + x_4)/2,
+ (y_3 + y_4)/2,
+ x_4,
+ y_4);
+ }
+}
+
+void
+DrawSpline (DviWidget dw, int *v, int n)
+{
+ int sx, sy, tx, ty;
+ int ox, oy, dx, dy;
+ int i;
+ int pointi;
+ XPoint points[POINTS_MAX];
+
+ if (n == 0 || (n & 1) != 0)
+ return;
+ AdjustCacheDeltas (dw);
+ setGC (dw);
+ ox = XPos (dw);
+ oy = YPos (dw);
+ dx = v[0];
+ dy = v[1];
+ sx = ox;
+ sy = oy;
+ tx = sx + DeviceToX (dw, dx);
+ ty = sy + DeviceToX (dw, dy);
+
+ pointi = 0;
+
+ appendPoint (points, &pointi, sx, sy);
+ appendPoint (points, &pointi, (sx + tx)/2, (sy + ty)/2);
+
+ for (i = 2; i < n; i += 2) {
+ int ux = ox + DeviceToX (dw, dx += v[i]);
+ int uy = oy + DeviceToX (dw, dy += v[i+1]);
+ flattenCurve (points, &pointi,
+ (sx + tx*5)/6, (sy + ty*5)/6,
+ (tx*5 + ux)/6, (ty*5 + uy)/6,
+ (tx + ux)/2, (ty + uy)/2);
+ sx = tx;
+ sy = ty;
+ tx = ux;
+ ty = uy;
+ }
+
+ appendPoint (points, &pointi, tx, ty);
+
+ XDrawLines (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+ points, pointi, CoordModeOrigin);
+}
+
+
+/*
+Local Variables:
+c-indent-level: 8
+c-continued-statement-offset: 8
+c-brace-offset: -8
+c-argdecl-indent: 8
+c-label-offset: -8
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/font.c b/contrib/groff/src/devices/xditview/font.c
new file mode 100644
index 0000000..c111a7b
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/font.c
@@ -0,0 +1,442 @@
+/*
+ * font.c
+ *
+ * map dvi fonts to X fonts
+ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include "DviP.h"
+#include "XFontName.h"
+
+static void DisposeFontSizes(DviWidget, DviFontSizeList *);
+void DestroyFontMap(DviFontMap *);
+
+static char *
+savestr (const char *s)
+{
+ char *n;
+
+ if (!s)
+ return 0;
+ n = XtMalloc (strlen (s) + 1);
+ if (n)
+ strcpy (n, s);
+ return n;
+}
+
+static DviFontList *
+LookupFontByPosition (DviWidget dw, int position)
+{
+ DviFontList *f;
+
+ for (f = dw->dvi.fonts; f; f = f->next)
+ if (f->dvi_number == position)
+ break;
+ return f;
+}
+
+int
+MaxFontPosition (DviWidget dw)
+{
+ DviFontList *f;
+ int n = -1;
+
+ for (f = dw->dvi.fonts; f; f = f->next)
+ if (f->dvi_number > n)
+ n = f->dvi_number;
+ return n;
+}
+
+static DviFontSizeList *
+LookupFontSizeBySize (DviWidget dw, DviFontList *f, int size)
+{
+ DviFontSizeList *fs, *best = 0, *smallest = 0;
+ int bestsize = 0;
+ XFontName fontName;
+ unsigned int fontNameAttributes;
+ char fontNameString[2048];
+ int decipointsize;
+
+ if (f->scalable) {
+ decipointsize = (10*size)/dw->dvi.sizescale;
+ for (best = f->sizes; best; best = best->next)
+ if (best->size == decipointsize)
+ return best;
+ best = (DviFontSizeList *) XtMalloc(sizeof *best);
+ best->next = f->sizes;
+ best->size = decipointsize;
+ f->sizes = best;
+ XParseFontName (f->x_name, &fontName, &fontNameAttributes);
+ fontNameAttributes &= ~(FontNamePixelSize|FontNameAverageWidth);
+ fontNameAttributes |= FontNameResolutionX;
+ fontNameAttributes |= FontNameResolutionY;
+ fontNameAttributes |= FontNamePointSize;
+ fontName.ResolutionX = dw->dvi.display_resolution;
+ fontName.ResolutionY = dw->dvi.display_resolution;
+ fontName.PointSize = decipointsize;
+ XFormatFontName (&fontName, fontNameAttributes, fontNameString);
+ best->x_name = savestr (fontNameString);
+ best->doesnt_exist = 0;
+ best->font = 0;
+ return best;
+ }
+ for (fs = f->sizes; fs; fs=fs->next) {
+ if (dw->dvi.sizescale*fs->size <= 10*size
+ && fs->size >= bestsize) {
+ best = fs;
+ bestsize = fs->size;
+ }
+ if (smallest == 0 || fs->size < smallest->size)
+ smallest = fs;
+ }
+ return best ? best : smallest;
+}
+
+static char *
+SkipFontNameElement (char *n)
+{
+ while (*n != '-')
+ if (!*++n)
+ return 0;
+ return n+1;
+}
+
+# define SizePosition 8
+# define EncodingPosition 13
+
+static int
+ConvertFontNameToSize (char *n)
+{
+ int i, size;
+
+ for (i = 0; i < SizePosition; i++) {
+ n = SkipFontNameElement (n);
+ if (!n)
+ return -1;
+ }
+ size = atoi (n);
+ return size;
+}
+
+static char *
+ConvertFontNameToEncoding (char *n)
+{
+ int i;
+ for (i = 0; i < EncodingPosition; i++) {
+ n = SkipFontNameElement (n);
+ if (!n)
+ return 0;
+ }
+ return n;
+}
+
+DviFontSizeList *
+InstallFontSizes (DviWidget dw, const char *x_name, Boolean *scalablep)
+{
+ char fontNameString[2048];
+ char **fonts;
+ int i, count;
+ int size;
+ DviFontSizeList *sizes, *new_size;
+ XFontName fontName;
+ unsigned int fontNameAttributes;
+
+ *scalablep = FALSE;
+ if (!XParseFontName ((XFontNameString)x_name, &fontName,
+ &fontNameAttributes))
+ return 0;
+ fontNameAttributes &= ~(FontNamePixelSize|FontNamePointSize
+ |FontNameAverageWidth);
+ fontNameAttributes |= FontNameResolutionX;
+ fontNameAttributes |= FontNameResolutionY;
+ fontName.ResolutionX = dw->dvi.display_resolution;
+ fontName.ResolutionY = dw->dvi.display_resolution;
+ XFormatFontName (&fontName, fontNameAttributes, fontNameString);
+ fonts = XListFonts (XtDisplay (dw), fontNameString, 10000000, &count);
+ sizes = 0;
+ for (i = 0; i < count; i++) {
+ size = ConvertFontNameToSize (fonts[i]);
+ if (size == 0) {
+ DisposeFontSizes (dw, sizes);
+ sizes = 0;
+ *scalablep = TRUE;
+ break;
+ }
+ if (size != -1) {
+ new_size = (DviFontSizeList *) XtMalloc (sizeof *new_size);
+ new_size->next = sizes;
+ new_size->size = size;
+ new_size->x_name = savestr (fonts[i]);
+ new_size->doesnt_exist = 0;
+ new_size->font = 0;
+ sizes = new_size;
+ }
+ }
+ XFreeFontNames (fonts);
+ return sizes;
+}
+
+static void
+DisposeFontSizes (DviWidget dw, DviFontSizeList *fs)
+{
+ DviFontSizeList *next;
+
+ for (; fs; fs=next) {
+ next = fs->next;
+ if (fs->x_name)
+ XtFree (fs->x_name);
+ if (fs->font && fs->font != dw->dvi.default_font) {
+ XUnloadFont (XtDisplay (dw), fs->font->fid);
+ XFree ((char *)fs->font);
+ }
+ XtFree ((char *) fs);
+ }
+}
+
+static DviFontList *
+InstallFont (DviWidget dw, int position,
+ const char *dvi_name, const char *x_name)
+{
+ DviFontList *f;
+ char *encoding;
+
+ if ((f = LookupFontByPosition (dw, position)) != NULL) {
+ /*
+ * ignore gratuitous font loading
+ */
+ if (!strcmp (f->dvi_name, dvi_name) &&
+ !strcmp (f->x_name, x_name))
+ return f;
+
+ DisposeFontSizes (dw, f->sizes);
+ if (f->dvi_name)
+ XtFree (f->dvi_name);
+ if (f->x_name)
+ XtFree (f->x_name);
+ f->device_font = 0;
+ } else {
+ f = (DviFontList *) XtMalloc (sizeof (*f));
+ f->next = dw->dvi.fonts;
+ dw->dvi.fonts = f;
+ }
+ f->initialized = FALSE;
+ f->dvi_name = savestr (dvi_name);
+ f->device_font = device_find_font (dw->dvi.device, dvi_name);
+ f->x_name = savestr (x_name);
+ f->dvi_number = position;
+ f->sizes = 0;
+ f->scalable = FALSE;
+ if (f->x_name) {
+ encoding = ConvertFontNameToEncoding (f->x_name);
+ f->char_map = DviFindMap (encoding);
+ } else
+ f->char_map = 0;
+ /*
+ * force requery of fonts
+ */
+ dw->dvi.font = 0;
+ dw->dvi.font_number = -1;
+ dw->dvi.cache.font = 0;
+ dw->dvi.cache.font_number = -1;
+ dw->dvi.device_font = 0;
+ dw->dvi.device_font_number = -1;
+ return f;
+}
+
+void
+ForgetFonts (DviWidget dw)
+{
+ DviFontList *f = dw->dvi.fonts;
+
+ while (f) {
+ DviFontList *tem = f;
+
+ if (f->sizes)
+ DisposeFontSizes (dw, f->sizes);
+ if (f->dvi_name)
+ XtFree (f->dvi_name);
+ if (f->x_name)
+ XtFree (f->x_name);
+ f = f->next;
+ XtFree ((char *) tem);
+ }
+
+ /*
+ * force requery of fonts
+ */
+ dw->dvi.font = 0;
+ dw->dvi.font_number = -1;
+ dw->dvi.cache.font = 0;
+ dw->dvi.cache.font_number = -1;
+ dw->dvi.device_font = 0;
+ dw->dvi.device_font_number = -1;
+ dw->dvi.fonts = 0;
+}
+
+
+static char *
+MapDviNameToXName (DviWidget dw, const char *dvi_name)
+{
+ DviFontMap *fm;
+
+ for (fm = dw->dvi.font_map; fm; fm=fm->next)
+ if (!strcmp (fm->dvi_name, dvi_name))
+ return fm->x_name;
+ return 0;
+}
+
+#if 0
+static char *
+MapXNameToDviName (DviWidget dw, const char *x_name)
+{
+ DviFontMap *fm;
+
+ for (fm = dw->dvi.font_map; fm; fm=fm->next)
+ if (!strcmp (fm->x_name, x_name))
+ return fm->dvi_name;
+ return 0;
+}
+#endif
+
+void
+ParseFontMap (DviWidget dw)
+{
+ char dvi_name[1024];
+ char x_name[2048];
+ char *m, *s;
+ DviFontMap *fm, *new_map;
+
+ if (dw->dvi.font_map)
+ DestroyFontMap (dw->dvi.font_map);
+ fm = 0;
+ m = dw->dvi.font_map_string;
+ while (*m) {
+ s = m;
+ while (*m && !isspace (*m))
+ ++m;
+ strncpy (dvi_name, s, m-s);
+ dvi_name[m-s] = '\0';
+ while (isspace (*m))
+ ++m;
+ s = m;
+ while (*m && *m != '\n')
+ ++m;
+ strncpy (x_name, s, m-s);
+ x_name[m-s] = '\0';
+ new_map = (DviFontMap *) XtMalloc (sizeof *new_map);
+ new_map->x_name = savestr (x_name);
+ new_map->dvi_name = savestr (dvi_name);
+ new_map->next = fm;
+ fm = new_map;
+ ++m;
+ }
+ dw->dvi.font_map = fm;
+}
+
+void
+DestroyFontMap (DviFontMap *font_map)
+{
+ DviFontMap *next;
+
+ for (; font_map; font_map = next) {
+ next = font_map->next;
+ if (font_map->x_name)
+ XtFree (font_map->x_name);
+ if (font_map->dvi_name)
+ XtFree (font_map->dvi_name);
+ XtFree ((char *) font_map);
+ }
+}
+
+/* ARGSUSED */
+
+void
+SetFontPosition (DviWidget dw, int position,
+ const char *dvi_name, const char *extra)
+{
+ char *x_name;
+
+ x_name = MapDviNameToXName (dw, dvi_name);
+ if (x_name)
+ (void) InstallFont (dw, position, dvi_name, x_name);
+
+ extra = extra; /* unused; suppress compiler warning */
+}
+
+XFontStruct *
+QueryFont (DviWidget dw, int position, int size)
+{
+ DviFontList *f;
+ DviFontSizeList *fs;
+
+ f = LookupFontByPosition (dw, position);
+ if (!f)
+ return dw->dvi.default_font;
+ if (!f->initialized) {
+ f->sizes = InstallFontSizes (dw, f->x_name, &f->scalable);
+ f->initialized = TRUE;
+ }
+ fs = LookupFontSizeBySize (dw, f, size);
+ if (!fs)
+ return dw->dvi.default_font;
+ if (!fs->font) {
+ if (fs->x_name)
+ fs->font = XLoadQueryFont (XtDisplay (dw), fs->x_name);
+ if (!fs->font)
+ fs->font = dw->dvi.default_font;
+ }
+ return fs->font;
+}
+
+DeviceFont *
+QueryDeviceFont (DviWidget dw, int position)
+{
+ DviFontList *f;
+
+ f = LookupFontByPosition (dw, position);
+ if (!f)
+ return 0;
+ return f->device_font;
+}
+
+DviCharNameMap *
+QueryFontMap (DviWidget dw, int position)
+{
+ DviFontList *f;
+
+ f = LookupFontByPosition (dw, position);
+ if (f)
+ return f->char_map;
+ else
+ return 0;
+}
+
+#if 0
+LoadFont (DviWidget dw, int position, int size)
+{
+ XFontStruct *font;
+
+ font = QueryFont (dw, position, size);
+ dw->dvi.font_number = position;
+ dw->dvi.font_size = size;
+ dw->dvi.font = font;
+ XSetFont (XtDisplay (dw), dw->dvi.normal_GC, font->fid);
+ return;
+}
+#endif
+
+/*
+Local Variables:
+c-indent-level: 8
+c-continued-statement-offset: 8
+c-brace-offset: -8
+c-argdecl-indent: 8
+c-label-offset: -8
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/gray1.bm b/contrib/groff/src/devices/xditview/gray1.bm
new file mode 100644
index 0000000..c40a95e
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray1.bm
@@ -0,0 +1,4 @@
+#define gray1_width 3
+#define gray1_height 3
+static char gray1_bits[] = {
+ 0x00, 0x02, 0x00};
diff --git a/contrib/groff/src/devices/xditview/gray2.bm b/contrib/groff/src/devices/xditview/gray2.bm
new file mode 100644
index 0000000..e87a1bc
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray2.bm
@@ -0,0 +1,4 @@
+#define gray2_width 3
+#define gray2_height 3
+static char gray2_bits[] = {
+ 0x00, 0x03, 0x00};
diff --git a/contrib/groff/src/devices/xditview/gray3.bm b/contrib/groff/src/devices/xditview/gray3.bm
new file mode 100644
index 0000000..d9313eb
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray3.bm
@@ -0,0 +1,4 @@
+#define gray3_width 3
+#define gray3_height 3
+static char gray3_bits[] = {
+ 0x00, 0x03, 0x02};
diff --git a/contrib/groff/src/devices/xditview/gray4.bm b/contrib/groff/src/devices/xditview/gray4.bm
new file mode 100644
index 0000000..dad142a
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray4.bm
@@ -0,0 +1,4 @@
+#define gray4_width 3
+#define gray4_height 3
+static char gray4_bits[] = {
+ 0x00, 0x07, 0x02};
diff --git a/contrib/groff/src/devices/xditview/gray5.bm b/contrib/groff/src/devices/xditview/gray5.bm
new file mode 100644
index 0000000..5f57618
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray5.bm
@@ -0,0 +1,4 @@
+#define gray5_width 3
+#define gray5_height 3
+static char gray5_bits[] = {
+ 0x04, 0x07, 0x02};
diff --git a/contrib/groff/src/devices/xditview/gray6.bm b/contrib/groff/src/devices/xditview/gray6.bm
new file mode 100644
index 0000000..b76701d
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray6.bm
@@ -0,0 +1,4 @@
+#define gray6_width 3
+#define gray6_height 3
+static char gray6_bits[] = {
+ 0x04, 0x07, 0x03};
diff --git a/contrib/groff/src/devices/xditview/gray7.bm b/contrib/groff/src/devices/xditview/gray7.bm
new file mode 100644
index 0000000..ef47bc6
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray7.bm
@@ -0,0 +1,4 @@
+#define gray7_width 3
+#define gray7_height 3
+static char gray7_bits[] = {
+ 0x05, 0x07, 0x03};
diff --git a/contrib/groff/src/devices/xditview/gray8.bm b/contrib/groff/src/devices/xditview/gray8.bm
new file mode 100644
index 0000000..12de7cb
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gray8.bm
@@ -0,0 +1,4 @@
+#define gray8_width 3
+#define gray8_height 3
+static char gray8_bits[] = {
+ 0x05, 0x07, 0x07};
diff --git a/contrib/groff/src/devices/xditview/gxditview.man b/contrib/groff/src/devices/xditview/gxditview.man
new file mode 100644
index 0000000..2c1302b
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/gxditview.man
@@ -0,0 +1,410 @@
+.TH GXDITVIEW @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
+.SH NAME
+gxditview \- display groff intermediate output files
+.
+.
+.SH SYNOPSIS
+.B \%gxditview
+.RI [\fB\- toolkitoption\ .\|.\|.\|]
+.RI [\fB\- option\ .\|.\|.\|]
+.RI [ filename ]
+.
+.
+.SH DESCRIPTION
+The
+.B \%gxditview
+program displays the
+.I groff intermediate
+.IR output ,
+see
+.BR groff_out (@MAN5EXT@),
+on an X\~display.
+.
+It uses the standard X11 fonts, so it does not require access to the
+server machine for font loading.
+.
+There are several ways to use
+.BR \%gxditview .
+.
+.
+.PP
+The
+.I groff intermediate output
+can be generated by
+.BR groff\~\-Z .
+This can be viewed by explicity calling
+.B \%gxditview
+.IR \%filename .
+If
+.I filename
+is
+.BR \- ,
+.B \%gxditview
+will read the standard input;
+.I \%filename
+cannot be omitted.
+.
+The
+.I groff intermediate output
+is different for all devices.
+.
+.B \%gxditview
+can view it for all devices, but the quality is not always good.
+.
+.
+.PP
+The best result is achieved with the
+.BR X *
+devices for
+.BR groff 's
+option
+.BR \-T .
+.
+There are four
+.BR X *
+devices:
+.BR \%\-TX75 ,
+.BR \%\-TX75\-12 ,
+.BR \%\-TX100 ,
+.BR \%\-TX100\-12 .
+They differ by the X\~resolution (75dpi or 100dpi) and the used base font
+size (10pt or 12pt).
+.
+They are especially built for
+.BR \%gxditview .
+When using one of them
+.B groff
+generates the
+.I intermediate output
+for this device and calls
+.B \%gxditview
+automatically for viewing.
+.
+.
+.PP
+.BR groff 's
+option
+.B \-X
+should be considered obsolete today; it produces
+.I intermediate output
+for
+.I Postscript
+and uses
+.B \%gxditview
+as a viewer for it, but with a bad quality.
+.
+Simply don't use it.
+.
+.
+.PP
+During the run of
+.BR \%gxditview ,
+the left mouse button brings up a menu with the following entries:
+.
+.TP 8
+.B "Next Page"
+Display the next page.
+.
+.TP
+.B "Previous Page"
+Display the previous page.
+.
+.TP
+.B "Select Page"
+Select a particular numbered page specified by a dialog box.
+.
+.TP
+.B Print
+Print the
+.I groff intermediate output
+using a command specified by a dialog box.
+.
+The default command initially displayed is controlled by the
+.B printCommand
+application resource, and by the
+.B \-printCommand
+option.
+.
+.TP
+.B Open
+Open for display a new file specified by a dialog box.
+.
+The file should contain some
+.I groff intermediate
+.IR output .
+If the filename starts with
+.B |
+it will be taken to be a command to read from.
+.
+.TP
+.B Quit
+Exit from
+.BR \%gxditview .
+.
+.
+.PP
+The
+.IR n ,
+.I Space
+and
+.I Return
+keys are bound to the
+.B Next\ Page
+action.
+.
+The
+.IR p ,
+.I BackSpace
+and
+.I Delete
+keys are bound to the
+.B Previous\ Page
+action.
+.
+The
+.I q
+key is bound to the
+.B Quit
+action.
+.
+The
+.I r
+key is bound to the
+.B Rerasterize
+action which rereads the current file, and redisplays the current
+page; if the current file is a command, the command will be
+reexecuted.
+.
+.
+.PP
+The
+.B paperlength
+and
+.B paperwidth
+commands in the DESC file specify the length and width in machine units
+of the virtual page displayed by
+.BR \%gxditview .
+.
+.
+.SH OPTIONS
+The
+.B \%gxditview
+program accepts all of the standard X\~Toolkit command line options
+along with the additional options listed below:
+.
+.TP 8
+.B \-help
+This option indicates that a brief summary of the allowed options should be
+printed.
+.
+.TP
+.B \-page
+This option specifies the page number of the document to be displayed.
+.
+.TP
+.BI \-backingStore\ backing-store-type
+Redisplay of the
+.I groff intermediate output
+window can take up to a second or so, this option causes the server to
+save the window contents so that when it is scrolled around the
+viewport, the window is painted from contents saved in backing store.
+.I backing-store-type
+can be one of
+.BR Always ,
+.B WhenMapped
+or
+.BR NotUseful .
+.
+.TP
+.BI \-printCommand\ command
+The default command displayed in the dialog box for the
+.B Print
+menu entry will be
+.IR command .
+.
+.TP
+.BI \-resolution\ res
+The
+.I groff intermediate output
+file will be displayed at a resolution of
+.I res
+dpi, unless the DESC file contains the
+.B X11
+command, in which case the device resolution will be used.
+.
+This corresponds to the
+.I Dvi
+widget's
+.B resolution
+resource.
+.
+The default is 75.
+.
+.TP
+.BI \-filename\ string
+The default filename displayed in the dialog box for the
+.B Open
+menu entry will be
+.IR string .
+This can be either a filename, or a command starting with
+.BR | .
+.
+.
+.PP
+The following standard X\~Toolkit command line arguments are commonly used
+with
+.BR \%gxditview :
+.
+.TP 8
+.BI \-bg\ color
+This option specifies the color to use for the background of the window.
+.
+The default is \fIwhite\fP.
+.
+.TP
+.BI \-bd\ color
+This option specifies the color to use for the border of the window.
+.
+The default is \fIblack\fP.
+.
+.TP
+.BI \-bw\ number
+This option specifies the width in pixels of the border surrounding the
+window.
+.
+.TP
+.BI \-fg\ color
+This option specifies the color to use for displaying text.
+.
+The default is
+\fIblack\fP.
+.
+.TP
+.BI \-fn\ font
+This option specifies the font to be used for displaying widget text.
+.
+The default is \fIfixed\fP.
+.
+.TP
+.B \-rv
+This option indicates that reverse video should be simulated by swapping
+the foreground and background colors.
+.
+.TP
+.BI \-geometry\ geometry
+This option specifies the preferred size and position of the window.
+.
+.TP
+.BI \-display\ host : display
+This option specifies the X\~server to contact.
+.
+.TP
+.BI \-xrm\ resourcestring
+This option specifies a resource string to be used.
+.
+.
+.SH X DEFAULTS
+This program uses the
+.I Dvi
+widget in the X\~Toolkit.
+.
+It understands all of the core resource names and classes as well as:
+.
+.TP 8
+.BR width\ (class\ Width )
+Specifies the width of the window.
+.
+.TP
+.BR height\ (class\ Height )
+Specifies the height of the window.
+.
+.TP
+.BR foreground\ (class\ Foreground )
+Specifies the default foreground color.
+.
+.TP
+.BR font\ (class\ Font )
+Specifies the font to be used for error messages.
+.
+.TP
+.BR fontMap\ (class\ FontMap )
+Specifies the mapping from
+.I groff
+font names to X\~font names.
+.
+This must be a string containing a sequence of lines.
+.
+Each line contains two whitespace separated fields: first the
+.I groff
+font name, and secondly the X\~font name.
+.
+The default is
+.nf
+"\e
+TR -adobe-times-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+TI -adobe-times-medium-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+TB -adobe-times-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+TBI -adobe-times-bold-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+CR -adobe-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+CI -adobe-courier-medium-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+CB -adobe-courier-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+CBI -adobe-courier-bold-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+HR -adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+HI -adobe-helvetica-medium-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+HB -adobe-helvetica-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+HBI -adobe-helvetica-bold-o-normal--*-100-*-*-*-*-iso8859-1\en\e
+NR -adobe-new century schoolbook-medium-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+NI -adobe-new century schoolbook-medium-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+NB -adobe-new century schoolbook-bold-r-normal--*-100-*-*-*-*-iso8859-1\en\e
+NBI -adobe-new century schoolbook-bold-i-normal--*-100-*-*-*-*-iso8859-1\en\e
+S -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\en\e
+SS -adobe-symbol-medium-r-normal--*-100-*-*-*-*-adobe-fontspecific\en\e
+"
+.fi
+.
+.
+.SH "SEE ALSO"
+.BR X (1),
+.BR xrdb (1),
+.BR xditview (1),
+.BR groff (@MAN1EXT@),
+.BR groff_out (@MAN5EXT@)
+.
+.
+.SH ORIGIN
+This program is derived from
+.BR \%xditview ;
+portions of
+.B \%xditview
+originated in
+.B \%xtroff
+which was derived from
+.BR \%suntroff .
+.
+.
+.SH COPYRIGHT
+Copyright 1989, Massachusetts Institute of Technology.
+.br
+See
+.BR X (1)
+for a full statement of rights and permissions.
+.
+.
+.SH AUTHORS
+Keith Packard (MIT X Consortium)
+.br
+Richard L. Hyde (Purdue)
+.br
+David Slattengren (Berkeley)
+.br
+Malcolm Slaney (Schlumberger Palo Alto Research)
+.br
+Mark Moraes (University of Toronto)
+.br
+James Clark
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/groff/src/devices/xditview/lex.c b/contrib/groff/src/devices/xditview/lex.c
new file mode 100644
index 0000000..dfe1e0d
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/lex.c
@@ -0,0 +1,96 @@
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include "DviP.h"
+
+int
+DviGetAndPut(DviWidget dw, int *cp)
+{
+ if (dw->dvi.ungot) {
+ dw->dvi.ungot = 0;
+ *cp = getc (dw->dvi.file);
+ }
+ else {
+ *cp = getc (dw->dvi.file);
+ if (*cp != EOF)
+ putc (*cp, dw->dvi.tmpFile);
+ }
+ return *cp;
+}
+
+char *
+GetLine(DviWidget dw, char *Buffer, int Length)
+{
+ int i = 0, c;
+
+ Length--; /* Save room for final '\0' */
+
+ while (DviGetC (dw, &c) != EOF) {
+ if (Buffer && i < Length)
+ Buffer[i++] = c;
+ if (c == '\n') {
+ DviUngetC(dw, c);
+ break;
+ }
+ }
+ if (Buffer)
+ Buffer[i] = '\0';
+ return Buffer;
+}
+
+char *
+GetWord(DviWidget dw, char *Buffer, int Length)
+{
+ int i = 0, c;
+
+ Length--; /* Save room for final '\0' */
+ while (DviGetC(dw, &c) == ' ' || c == '\n')
+ ;
+ while (c != EOF) {
+ if (Buffer && i < Length)
+ Buffer[i++] = c;
+ if (DviGetC(dw, &c) == ' ' || c == '\n') {
+ DviUngetC(dw, c);
+ break;
+ }
+ }
+ if (Buffer)
+ Buffer[i] = '\0';
+ return Buffer;
+}
+
+int
+GetNumber(DviWidget dw)
+{
+ int i = 0, c;
+ int negative = 0;
+
+ while (DviGetC(dw, &c) == ' ' || c == '\n')
+ ;
+ if (c == '-') {
+ negative = 1;
+ DviGetC(dw, &c);
+ }
+
+ for (; c >= '0' && c <= '9'; DviGetC(dw, &c)) {
+ if (negative)
+ i = i*10 - (c - '0');
+ else
+ i = i*10 + c - '0';
+ }
+ if (c != EOF)
+ DviUngetC(dw, c);
+ return i;
+}
+
+/*
+Local Variables:
+c-indent-level: 8
+c-continued-statement-offset: 8
+c-brace-offset: -8
+c-argdecl-indent: 8
+c-label-offset: -8
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/page.c b/contrib/groff/src/devices/xditview/page.c
new file mode 100644
index 0000000..d1c5c9f
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/page.c
@@ -0,0 +1,82 @@
+/*
+ * page.c
+ *
+ * map page numbers to file position
+ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+#ifdef X_NOT_STDC_ENV
+extern long ftell();
+#endif
+
+static DviFileMap *
+MapPageNumberToFileMap (DviWidget dw, int number)
+{
+ DviFileMap *m;
+
+ for (m = dw->dvi.file_map; m; m=m->next)
+ if (m->page_number == number)
+ break;
+ return m;
+}
+
+void
+DestroyFileMap (DviFileMap *m)
+{
+ DviFileMap *next;
+
+ for (; m; m = next) {
+ next = m->next;
+ XtFree ((char *) m);
+ }
+}
+
+void
+ForgetPagePositions (DviWidget dw)
+{
+ DestroyFileMap (dw->dvi.file_map);
+ dw->dvi.file_map = 0;
+}
+
+void
+RememberPagePosition(DviWidget dw, int number)
+{
+ DviFileMap *m;
+
+ if (!(m = MapPageNumberToFileMap (dw, number))) {
+ m = (DviFileMap *) XtMalloc (sizeof *m);
+ m->page_number = number;
+ m->next = dw->dvi.file_map;
+ dw->dvi.file_map = m;
+ }
+ if (dw->dvi.tmpFile)
+ m->position = ftell (dw->dvi.tmpFile);
+ else
+ m->position = ftell (dw->dvi.file);
+}
+
+long
+SearchPagePosition (DviWidget dw, int number)
+{
+ DviFileMap *m;
+
+ if (!(m = MapPageNumberToFileMap (dw, number)))
+ return -1;
+ return m->position;
+}
+
+void
+FileSeek(DviWidget dw, long position)
+{
+ if (dw->dvi.tmpFile) {
+ dw->dvi.readingTmp = 1;
+ fseek (dw->dvi.tmpFile, position, 0);
+ } else
+ fseek (dw->dvi.file, position, 0);
+}
diff --git a/contrib/groff/src/devices/xditview/parse.c b/contrib/groff/src/devices/xditview/parse.c
new file mode 100644
index 0000000..de7d6ba
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/parse.c
@@ -0,0 +1,366 @@
+/*
+ * parse.c
+ *
+ * parse dvi input
+ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+static int StopSeen = 0;
+static void ParseDrawFunction(DviWidget, char *);
+static void ParseDeviceControl(DviWidget);
+static void push_env(DviWidget);
+static void pop_env(DviWidget);
+
+/* draw.c */
+extern int PutCharacter(DviWidget, char *);
+extern int PutNumberedCharacter(DviWidget, int);
+extern void HorizontalGoto(DviWidget, int);
+extern void Word(DviWidget);
+extern void VerticalGoto(DviWidget, int);
+extern void VerticalMove(DviWidget, int);
+extern void FlushCharCache(DviWidget);
+extern void Newline(DviWidget);
+extern void DrawLine(DviWidget, int, int);
+extern void DrawCircle(DviWidget, int);
+extern void DrawFilledCircle(DviWidget, int);
+extern void DrawEllipse(DviWidget, int, int);
+extern void DrawFilledEllipse(DviWidget, int, int);
+extern void DrawArc(DviWidget, int, int, int, int);
+extern void DrawPolygon(DviWidget, int *, int);
+extern void DrawFilledPolygon(DviWidget, int *, int);
+extern void DrawSpline(DviWidget, int *, int);
+
+/* Dvi.c */
+extern void SetDevice(DviWidget, const char *);
+
+/* page.c */
+extern void RememberPagePosition(DviWidget, int);
+
+/* font.c */
+extern void SetFontPosition(DviWidget, int, const char *, const char *);
+
+/* lex.c */
+extern int GetNumber(DviWidget);
+
+#define HorizontalMove(dw, delta) ((dw)->dvi.state->x += (delta))
+
+
+int
+ParseInput(register DviWidget dw)
+{
+ int n, k;
+ int c;
+ char Buffer[BUFSIZ];
+ int NextPage;
+ int otherc;
+
+ StopSeen = 0;
+
+ /*
+ * make sure some state exists
+ */
+
+ if (!dw->dvi.state)
+ push_env (dw);
+ for (;;) {
+ switch (DviGetC(dw, &c)) {
+ case '\n':
+ break;
+ case ' ': /* when input is text */
+ case 0: /* occasional noise creeps in */
+ break;
+ case '{': /* push down current environment */
+ push_env(dw);
+ break;
+ case '}':
+ pop_env(dw);
+ break;
+ /*
+ * two motion digits plus a character
+ */
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ HorizontalMove(dw, (c-'0')*10 +
+ DviGetC(dw,&otherc)-'0');
+ /* fall through */
+ case 'c': /* single ascii character */
+ DviGetC(dw,&c);
+ if (c == ' ')
+ break;
+ Buffer[0] = c;
+ Buffer[1] = '\0';
+ (void) PutCharacter (dw, Buffer);
+ break;
+ case 'C':
+ GetWord (dw, Buffer, BUFSIZ);
+ (void) PutCharacter (dw, Buffer);
+ break;
+ case 't':
+ Buffer[1] = '\0';
+ while (DviGetC (dw, &c) != EOF
+ && c != ' ' && c != '\n') {
+ Buffer[0] = c;
+ HorizontalMove (dw, PutCharacter (dw, Buffer));
+ }
+ break;
+ case 'u':
+ n = GetNumber(dw);
+ Buffer[1] = '\0';
+ while (DviGetC (dw, &c) == ' ')
+ ;
+ while (c != EOF && c != ' ' && c != '\n') {
+ Buffer[0] = c;
+ HorizontalMove (dw,
+ PutCharacter (dw, Buffer) + n);
+ DviGetC (dw, &c);
+ }
+ break;
+
+ case 'D': /* draw function */
+ (void) GetLine(dw, Buffer, BUFSIZ);
+ if (dw->dvi.display_enable)
+ ParseDrawFunction(dw, Buffer);
+ break;
+ case 's': /* ignore fractional sizes */
+ n = GetNumber(dw);
+ dw->dvi.state->font_size = n;
+ break;
+ case 'f':
+ n = GetNumber(dw);
+ dw->dvi.state->font_number = n;
+ break;
+ case 'H': /* absolute horizontal motion */
+ k = GetNumber(dw);
+ HorizontalGoto(dw, k);
+ break;
+ case 'h': /* relative horizontal motion */
+ k = GetNumber(dw);
+ HorizontalMove(dw, k);
+ break;
+ case 'w': /* word space */
+ Word (dw);
+ break;
+ case 'V':
+ n = GetNumber(dw);
+ VerticalGoto(dw, n);
+ break;
+ case 'v':
+ n = GetNumber(dw);
+ VerticalMove(dw, n);
+ break;
+ case 'P': /* new spread */
+ break;
+ case 'p': /* new page */
+ (void) GetNumber(dw);
+ NextPage = dw->dvi.current_page + 1;
+ RememberPagePosition(dw, NextPage);
+ FlushCharCache (dw);
+ return(NextPage);
+ case 'N':
+ n = GetNumber(dw);
+ PutNumberedCharacter (dw, n);
+ break;
+ case 'n': /* end of line */
+ GetNumber(dw);
+ GetNumber(dw);
+ Newline (dw);
+ HorizontalGoto(dw, 0);
+ break;
+ case 'F': /* input files */
+ case '+': /* continuation of X device control */
+ case 'm': /* color */
+ case '#': /* comment */
+ GetLine(dw, NULL, 0);
+ break;
+ case 'x': /* device control */
+ ParseDeviceControl(dw);
+ break;
+ case EOF:
+ dw->dvi.last_page = dw->dvi.current_page;
+ FlushCharCache (dw);
+ return dw->dvi.current_page;
+ default:
+ break;
+ }
+ }
+}
+
+static void
+push_env(DviWidget dw)
+{
+ DviState *new_state;
+
+ new_state = (DviState *) XtMalloc (sizeof (*new_state));
+ if (dw->dvi.state)
+ *new_state = *(dw->dvi.state);
+ else {
+ new_state->font_size = 10;
+ new_state->font_number = 1;
+ new_state->x = 0;
+ new_state->y = 0;
+ }
+ new_state->next = dw->dvi.state;
+ dw->dvi.state = new_state;
+}
+
+static void
+pop_env(DviWidget dw)
+{
+ DviState *old;
+
+ old = dw->dvi.state;
+ dw->dvi.state = old->next;
+ XtFree ((char *) old);
+}
+
+static void
+InitTypesetter (DviWidget dw)
+{
+ while (dw->dvi.state)
+ pop_env (dw);
+ push_env (dw);
+ FlushCharCache (dw);
+}
+
+#define DRAW_ARGS_MAX 128
+
+static void
+ParseDrawFunction(DviWidget dw, char *buf)
+{
+ int v[DRAW_ARGS_MAX];
+ int i, no_move = 0;
+ char *ptr;
+
+ v[0] = v[1] = v[2] = v[3] = 0;
+
+ if (buf[0] == '\0')
+ return;
+ ptr = buf+1;
+
+ for (i = 0; i < DRAW_ARGS_MAX; i++) {
+ if (sscanf(ptr, "%d", v + i) != 1)
+ break;
+ while (*ptr == ' ')
+ ptr++;
+ while (*ptr != '\0' && *ptr != ' ')
+ ptr++;
+ }
+
+ switch (buf[0]) {
+ case 'l': /* draw a line */
+ DrawLine(dw, v[0], v[1]);
+ break;
+ case 'c': /* circle */
+ DrawCircle(dw, v[0]);
+ break;
+ case 'C':
+ DrawFilledCircle(dw, v[0]);
+ break;
+ case 'e': /* ellipse */
+ DrawEllipse(dw, v[0], v[1]);
+ break;
+ case 'E':
+ DrawFilledEllipse(dw, v[0], v[1]);
+ break;
+ case 'a': /* arc */
+ DrawArc(dw, v[0], v[1], v[2], v[3]);
+ break;
+ case 'p':
+ DrawPolygon(dw, v, i);
+ break;
+ case 'P':
+ DrawFilledPolygon(dw, v, i);
+ break;
+ case '~': /* wiggly line */
+ DrawSpline(dw, v, i);
+ break;
+ case 't':
+ dw->dvi.line_thickness = v[0];
+ break;
+ case 'f':
+ if (i > 0 && v[0] >= 0 && v[0] <= DVI_FILL_MAX)
+ dw->dvi.fill = v[0];
+ no_move = 1;
+ break;
+ default:
+#if 0
+ warning("unknown drawing function %s", buf);
+#endif
+ no_move = 1;
+ break;
+ }
+
+ if (!no_move) {
+ if (buf[0] == 'e') {
+ if (i > 0)
+ dw->dvi.state->x += v[0];
+ }
+ else {
+ while (--i >= 0) {
+ if (i & 1)
+ dw->dvi.state->y += v[i];
+ else
+ dw->dvi.state->x += v[i];
+ }
+ }
+ }
+}
+
+static void
+ParseDeviceControl(DviWidget dw) /* Parse the x commands */
+{
+ char str[20], str1[50];
+ int c, n;
+
+ GetWord (dw, str, 20);
+ switch (str[0]) { /* crude for now */
+ case 'T': /* output device */
+ GetWord (dw, str, 20);
+ SetDevice (dw, str);
+ break;
+ case 'i': /* initialize */
+ InitTypesetter (dw);
+ break;
+ case 't': /* trailer */
+ break;
+ case 'p': /* pause -- can restart */
+ break;
+ case 's': /* stop */
+ StopSeen = 1;
+ return;
+ case 'r': /* resolution when prepared */
+ break;
+ case 'f': /* font used */
+ n = GetNumber (dw);
+ GetWord (dw, str, 20);
+ GetLine (dw, str1, 50);
+ SetFontPosition (dw, n, str, str1);
+ break;
+ case 'H': /* char height */
+ break;
+ case 'S': /* slant */
+ break;
+ }
+ while (DviGetC (dw, &c) != '\n') /* skip rest of input line */
+ if (c == EOF)
+ return;
+ return;
+}
+
+
+/*
+Local Variables:
+c-indent-level: 8
+c-continued-statement-offset: 8
+c-brace-offset: -8
+c-argdecl-indent: 8
+c-label-offset: -8
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/devices/xditview/xdit.bm b/contrib/groff/src/devices/xditview/xdit.bm
new file mode 100644
index 0000000..0c7aa8c
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/xdit.bm
@@ -0,0 +1,14 @@
+#define xdit_width 32
+#define xdit_height 32
+static unsigned char xdit_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x03, 0x02, 0x00, 0x00, 0x02,
+ 0x8a, 0xa2, 0xfc, 0x03, 0x52, 0x14, 0x03, 0x04, 0x02, 0x80, 0x00, 0x08,
+ 0x52, 0x54, 0x00, 0x10, 0x8a, 0x22, 0x8f, 0x23, 0x02, 0x20, 0x06, 0x21,
+ 0x8a, 0x12, 0x8c, 0x40, 0x52, 0x14, 0x8c, 0x40, 0x02, 0x10, 0x58, 0x40,
+ 0x52, 0x14, 0x30, 0x40, 0x8a, 0x12, 0x30, 0x40, 0x02, 0x10, 0x70, 0x40,
+ 0x8a, 0x12, 0xc8, 0x40, 0x52, 0x24, 0xc4, 0xe0, 0x02, 0x20, 0x84, 0xe1,
+ 0x52, 0x54, 0xce, 0xf3, 0x8a, 0xa2, 0x00, 0xf8, 0x02, 0x00, 0x03, 0xfc,
+ 0x8a, 0x22, 0xfc, 0xf3, 0x52, 0x14, 0x00, 0xc2, 0x02, 0x00, 0x00, 0x02,
+ 0x52, 0x14, 0x45, 0x02, 0x8a, 0xa2, 0x28, 0x02, 0x02, 0x00, 0x00, 0x02,
+ 0x02, 0x00, 0x00, 0x02, 0xfe, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/contrib/groff/src/devices/xditview/xdit_mask.bm b/contrib/groff/src/devices/xditview/xdit_mask.bm
new file mode 100644
index 0000000..a584629
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/xdit_mask.bm
@@ -0,0 +1,14 @@
+#define xdit_mask_width 32
+#define xdit_mask_height 32
+static unsigned char xdit_mask_bits[] = {
+ 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+ 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x1f,
+ 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xc7,
+ 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+ 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/contrib/groff/src/devices/xditview/xditview.c b/contrib/groff/src/devices/xditview/xditview.c
new file mode 100644
index 0000000..7afdb47
--- /dev/null
+++ b/contrib/groff/src/devices/xditview/xditview.c
@@ -0,0 +1,657 @@
+/*
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+/*
+ * xditview --
+ *
+ * Display ditroff output in an X window
+ */
+
+#ifndef SABER
+#ifndef lint
+static char rcsid[] = "$XConsortium: xditview.c,v 1.17 89/12/10 17:05:08 rws Exp $";
+#endif /* lint */
+#endif /* SABER */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <X11/Xos.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+
+#include <stdlib.h>
+#include <signal.h>
+#include <stdio.h>
+
+#include "Dvi.h"
+
+#include "xdit.bm"
+#include "xdit_mask.bm"
+
+#ifdef NEED_DECLARATION_POPEN
+FILE *popen(const char *, const char *);
+#endif /* NEED_DECLARATION_POPEN */
+
+#ifdef NEED_DECLARATION_PCLOSE
+int pclose (FILE *);
+#endif /* NEED_DECLARATION_PCLOSE */
+
+typedef void (*MakePromptFunc)(const char *);
+
+static String fallback_resources[] = {
+#include "GXditview-ad.h"
+ NULL
+};
+
+static struct app_resources {
+ char *print_command;
+ char *filename;
+} app_resources;
+
+#define offset(field) XtOffset(struct app_resources *, field)
+
+/* Application resources. */
+
+static XtResource resources[] = {
+ {(String)"printCommand", (String)"PrintCommand", (String)XtRString,
+ sizeof(char*), offset(print_command), (String)XtRString, NULL},
+ {(String)"filename", (String)"Filename", (String)XtRString,
+ sizeof(char*), offset(filename), (String)XtRString, NULL},
+};
+
+#undef offset
+
+/* Command line options table. Only resources are entered here...there is a
+ pass over the remaining options after XtParseCommand is let loose. */
+
+static XrmOptionDescRec options[] = {
+{(char *)"-page", (char *)"*dvi.pageNumber",
+ XrmoptionSepArg, NULL},
+{(char *)"-backingStore", (char *)"*dvi.backingStore",
+ XrmoptionSepArg, NULL},
+{(char *)"-resolution", (char *)"*dvi.resolution",
+ XrmoptionSepArg, NULL},
+{(char *)"-printCommand", (char *)".printCommand",
+ XrmoptionSepArg, NULL},
+{(char *)"-filename", (char *)".filename",
+ XrmoptionSepArg, NULL},
+{(char *)"-noPolyText", (char *)"*dvi.noPolyText",
+ XrmoptionNoArg, (XPointer)"TRUE"},
+};
+
+static char current_print_command[1024];
+
+static char current_file_name[1024];
+static FILE *current_file;
+
+/*
+ * Report the syntax for calling xditview.
+ */
+
+static void
+Syntax(const char *call)
+{
+ (void) printf ("Usage: %s [-fg <color>] [-bg <color>]\n", call);
+ (void) printf (" [-bd <color>] [-bw <pixels>] [-help]\n");
+ (void) printf (" [-display displayname] [-geometry geom]\n");
+ (void) printf (" [-page <page-number>] [-backing <backing-store>]\n");
+ (void) printf (" [-resolution <res>] [-print <command>]\n");
+ (void) printf (" [-filename <file>] [filename]\n\n");
+ exit(1);
+}
+
+static void NewFile (const char *);
+static void SetPageNumber (int);
+static Widget toplevel, paned, viewport, dvi;
+static Widget page;
+static Widget simpleMenu;
+
+static void NextPage(Widget, XtPointer, XtPointer);
+static void PreviousPage(Widget, XtPointer, XtPointer);
+static void SelectPage(Widget, XtPointer, XtPointer);
+static void OpenFile(Widget, XtPointer, XtPointer);
+static void Quit(Widget, XtPointer, XtPointer);
+static void Print(Widget, XtPointer, XtPointer);
+
+static struct menuEntry {
+ const char *name;
+ XtCallbackProc function;
+} menuEntries[] = {
+ {"nextPage", NextPage},
+ {"previousPage", PreviousPage},
+ {"selectPage", SelectPage},
+ {"print", Print},
+ {"openFile", OpenFile},
+ {"quit", Quit},
+};
+
+static void NextPageAction(Widget, XEvent *, String *, Cardinal *);
+static void PreviousPageAction(Widget, XEvent *, String *, Cardinal *);
+static void SelectPageAction(Widget, XEvent *, String *, Cardinal *);
+static void OpenFileAction(Widget, XEvent *, String *, Cardinal *);
+static void QuitAction(Widget, XEvent *, String *, Cardinal *);
+static void AcceptAction(Widget, XEvent *, String *, Cardinal *);
+static void CancelAction(Widget, XEvent *, String *, Cardinal *);
+static void PrintAction(Widget, XEvent *, String *, Cardinal *);
+static void RerasterizeAction(Widget, XEvent *, String *, Cardinal *);
+
+static void MakePrompt(Widget, const char *, MakePromptFunc, const char *);
+
+XtActionsRec xditview_actions[] = {
+ {(String)"NextPage", NextPageAction},
+ {(String)"PreviousPage", PreviousPageAction},
+ {(String)"SelectPage", SelectPageAction},
+ {(String)"Print", PrintAction},
+ {(String)"OpenFile", OpenFileAction},
+ {(String)"Rerasterize", RerasterizeAction},
+ {(String)"Quit", QuitAction},
+ {(String)"Accept", AcceptAction},
+ {(String)"Cancel", CancelAction},
+};
+
+#define MenuNextPage 0
+#define MenuPreviousPage 1
+#define MenuSelectPage 2
+#define MenuPrint 3
+#define MenuOpenFile 4
+#define MenuQuit 5
+
+static char pageLabel[256] = "Page <none>";
+
+int main(int argc, char **argv)
+{
+ char *file_name = 0;
+ Cardinal i;
+ static Arg labelArgs[] = {
+ {XtNlabel, (XtArgVal) pageLabel},
+ };
+ XtAppContext xtcontext;
+ Arg topLevelArgs[2];
+ Widget entry;
+ Arg pageNumberArgs[1];
+ int page_number;
+
+ toplevel = XtAppInitialize(&xtcontext, "GXditview",
+ options, XtNumber (options),
+ &argc, argv, fallback_resources, NULL, 0);
+ if (argc > 2
+ || (argc == 2 && (!strcmp(argv[1], "-help")
+ || !strcmp(argv[1], "--help"))))
+ Syntax(argv[0]);
+
+ XtGetApplicationResources(toplevel, (XtPointer)&app_resources,
+ resources, XtNumber(resources),
+ NULL, (Cardinal) 0);
+ if (app_resources.print_command)
+ strcpy(current_print_command, app_resources.print_command);
+
+ XtAppAddActions(xtcontext, xditview_actions, XtNumber (xditview_actions));
+
+ XtSetArg (topLevelArgs[0], XtNiconPixmap,
+ XCreateBitmapFromData (XtDisplay (toplevel),
+ XtScreen(toplevel)->root,
+ (char *)xdit_bits,
+ xdit_width, xdit_height));
+
+ XtSetArg (topLevelArgs[1], XtNiconMask,
+ XCreateBitmapFromData (XtDisplay (toplevel),
+ XtScreen(toplevel)->root,
+ (char *)xdit_mask_bits,
+ xdit_mask_width, xdit_mask_height));
+ XtSetValues (toplevel, topLevelArgs, 2);
+ if (argc > 1)
+ file_name = argv[1];
+
+ /*
+ * create the menu and insert the entries
+ */
+ simpleMenu = XtCreatePopupShell ("menu", simpleMenuWidgetClass, toplevel,
+ NULL, 0);
+ for (i = 0; i < XtNumber (menuEntries); i++) {
+ entry = XtCreateManagedWidget(menuEntries[i].name,
+ smeBSBObjectClass, simpleMenu,
+ NULL, (Cardinal) 0);
+ XtAddCallback(entry, XtNcallback, menuEntries[i].function, NULL);
+ }
+
+ paned = XtCreateManagedWidget("paned", panedWidgetClass, toplevel,
+ NULL, (Cardinal) 0);
+ viewport = XtCreateManagedWidget("viewport", viewportWidgetClass, paned,
+ NULL, (Cardinal) 0);
+ dvi = XtCreateManagedWidget ("dvi", dviWidgetClass, viewport, NULL, 0);
+ page = XtCreateManagedWidget ("label", labelWidgetClass, paned,
+ labelArgs, XtNumber (labelArgs));
+ XtSetArg (pageNumberArgs[0], XtNpageNumber, &page_number);
+ XtGetValues (dvi, pageNumberArgs, 1);
+ if (file_name)
+ NewFile (file_name);
+ /* NewFile modifies current_file_name, so do this here. */
+ if (app_resources.filename)
+ strcpy(current_file_name, app_resources.filename);
+ XtRealizeWidget (toplevel);
+ if (file_name)
+ SetPageNumber (page_number);
+ XtAppMainLoop(xtcontext);
+ return 0;
+}
+
+static void
+SetPageNumber (int number)
+{
+ Arg arg[2];
+ int actual_number, last_page;
+
+ XtSetArg (arg[0], XtNpageNumber, number);
+ XtSetValues (dvi, arg, 1);
+ XtSetArg (arg[0], XtNpageNumber, &actual_number);
+ XtSetArg (arg[1], XtNlastPageNumber, &last_page);
+ XtGetValues (dvi, arg, 2);
+ if (actual_number == 0)
+ sprintf (pageLabel, "Page <none>");
+ else if (last_page > 0)
+ sprintf (pageLabel, "Page %d of %d", actual_number, last_page);
+ else
+ sprintf (pageLabel, "Page %d", actual_number);
+ XtSetArg (arg[0], XtNlabel, pageLabel);
+ XtSetValues (page, arg, 1);
+}
+
+static void
+SelectPageNumber (const char *number_string)
+{
+ SetPageNumber (atoi(number_string));
+}
+
+static int hadFile = 0;
+
+static void
+NewFile (const char *name)
+{
+ Arg arg[2];
+ char *n;
+ FILE *new_file;
+ Boolean seek = 0;
+
+ if (current_file) {
+ if (!strcmp (current_file_name, "-"))
+ ;
+ else if (current_file_name[0] == '|')
+ pclose (current_file);
+ else
+ fclose (current_file);
+ }
+ if (!strcmp (name, "-"))
+ new_file = stdin;
+ else if (name[0] == '|')
+ new_file = popen (name+1, "r");
+ else {
+ new_file = fopen (name, "r");
+ seek = 1;
+ }
+ if (!new_file) {
+ /* XXX display error message */
+ return;
+ }
+ XtSetArg (arg[0], XtNfile, new_file);
+ XtSetArg (arg[1], XtNseek, seek);
+ XtSetValues (dvi, arg, 2);
+ if (hadFile || name[0] != '-' || name[1] != '\0') {
+ XtSetArg (arg[0], XtNtitle, name);
+ if (name[0] != '/' && (n = strrchr (name, '/')))
+ n = n + 1;
+ else
+ n = (char *)name;
+ XtSetArg (arg[1], XtNiconName, n);
+ XtSetValues (toplevel, arg, 2);
+ }
+ hadFile = 1;
+ SelectPageNumber ("1");
+ strcpy (current_file_name, name);
+ current_file = new_file;
+}
+
+static char fileBuf[1024];
+
+static void
+ResetMenuEntry (Widget entry)
+{
+ Arg arg[1];
+
+ XtSetArg (arg[0], (String)XtNpopupOnEntry, entry);
+ XtSetValues (XtParent(entry) , arg, (Cardinal) 1);
+}
+
+/*ARGSUSED*/
+
+static void
+NextPage (Widget entry, XtPointer name, XtPointer data)
+{
+ name = name; /* unused; suppress compiler warning */
+ data = data;
+
+ NextPageAction((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+ ResetMenuEntry (entry);
+}
+
+static void
+NextPageAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ Arg args[1];
+ int number;
+
+ XtSetArg (args[0], XtNpageNumber, &number);
+ XtGetValues (dvi, args, 1);
+ SetPageNumber (number+1);
+
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+}
+
+/*ARGSUSED*/
+
+static void
+PreviousPage (Widget entry, XtPointer name, XtPointer data)
+{
+ name = name; /* unused; suppress compiler warning */
+ data = data;
+
+ PreviousPageAction ((Widget)NULL, (XEvent *) 0, (String *) 0,
+ (Cardinal *) 0);
+ ResetMenuEntry (entry);
+}
+
+static void
+PreviousPageAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ Arg args[1];
+ int number;
+
+ XtSetArg (args[0], XtNpageNumber, &number);
+ XtGetValues (dvi, args, 1);
+ SetPageNumber (number-1);
+
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+}
+
+/* ARGSUSED */
+
+static void
+SelectPage (Widget entry, XtPointer name, XtPointer data)
+{
+ name = name; /* unused; suppress compiler warning */
+ data = data;
+
+ SelectPageAction ((Widget)NULL, (XEvent *) 0, (String *) 0,
+ (Cardinal *) 0);
+ ResetMenuEntry (entry);
+}
+
+static void
+SelectPageAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+
+ MakePrompt (toplevel, "Page number", SelectPageNumber, "");
+}
+
+
+static void
+DoPrint (const char *name)
+{
+ FILE *print_file;
+ RETSIGTYPE (*handler)(int);
+
+ /* Avoid dieing because of an invalid command. */
+ handler = signal(SIGPIPE, SIG_IGN);
+
+ print_file = popen(name, "w");
+ if (!print_file)
+ /* XXX print error message */
+ return;
+ DviSaveToFile(dvi, print_file);
+ pclose(print_file);
+ signal(SIGPIPE, handler);
+ strcpy(current_print_command, name);
+}
+
+static void
+RerasterizeAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ Arg args[1];
+ int number;
+
+ if (current_file_name[0] == 0) {
+ /* XXX display an error message */
+ return;
+ }
+ XtSetArg (args[0], XtNpageNumber, &number);
+ XtGetValues (dvi, args, 1);
+ NewFile(current_file_name);
+ SetPageNumber (number);
+
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+}
+
+/* ARGSUSED */
+
+static void
+Print (Widget entry, XtPointer name, XtPointer data)
+{
+ name = name; /* unused; suppress compiler warning */
+ data = data;
+
+ PrintAction ((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+ ResetMenuEntry (entry);
+}
+
+static void
+PrintAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+
+ if (current_print_command[0])
+ strcpy (fileBuf, current_print_command);
+ else
+ fileBuf[0] = '\0';
+ MakePrompt (toplevel, "Print command:", DoPrint, fileBuf);
+}
+
+
+/* ARGSUSED */
+
+static void
+OpenFile (Widget entry, XtPointer name, XtPointer data)
+{
+ name = name; /* unused; suppress compiler warning */
+ data = data;
+
+ OpenFileAction ((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+ ResetMenuEntry (entry);
+}
+
+static void
+OpenFileAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+
+ if (current_file_name[0])
+ strcpy (fileBuf, current_file_name);
+ else
+ fileBuf[0] = '\0';
+ MakePrompt (toplevel, "File to open:", NewFile, fileBuf);
+}
+
+/* ARGSUSED */
+
+static void
+Quit (Widget entry, XtPointer closure, XtPointer data)
+{
+ entry = entry; /* unused; suppress compiler warning */
+ closure = closure;
+ data = data;
+
+ QuitAction ((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+}
+
+static void
+QuitAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+
+ exit (0);
+}
+
+Widget promptShell, promptDialog;
+MakePromptFunc promptfunction;
+
+/* ARGSUSED */
+static
+void CancelAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ widget = widget; /* unused; suppress compiler warning */
+ event = event;
+ params = params;
+ num_params = num_params;
+
+ if (promptShell) {
+ XtSetKeyboardFocus(toplevel, (Widget) None);
+ XtDestroyWidget(promptShell);
+ promptShell = (Widget) 0;
+ }
+}
+
+static
+void AcceptAction (Widget widget, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ (*promptfunction)(XawDialogGetValueString(promptDialog));
+ CancelAction (widget, event, params, num_params);
+}
+
+static void
+MakePrompt(Widget centerw, const char *prompt,
+ MakePromptFunc func, const char *def)
+{
+ static Arg dialogArgs[] = {
+ {XtNlabel, 0},
+ {XtNvalue, 0},
+ };
+ Arg valueArgs[1];
+ Arg centerArgs[2];
+ Position source_x, source_y;
+ Position dest_x, dest_y;
+ Dimension center_width, center_height;
+ Dimension prompt_width, prompt_height;
+ Widget valueWidget;
+
+ CancelAction ((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+ promptShell = XtCreatePopupShell ("promptShell", transientShellWidgetClass,
+ toplevel, NULL, (Cardinal) 0);
+ dialogArgs[0].value = (XtArgVal)prompt;
+ dialogArgs[1].value = (XtArgVal)def;
+ promptDialog = XtCreateManagedWidget( "promptDialog", dialogWidgetClass,
+ promptShell, dialogArgs, XtNumber (dialogArgs));
+ XawDialogAddButton(promptDialog, "accept", NULL, (XtPointer) 0);
+ XawDialogAddButton(promptDialog, "cancel", NULL, (XtPointer) 0);
+ valueWidget = XtNameToWidget (promptDialog, "value");
+ if (valueWidget) {
+ XtSetArg (valueArgs[0], (String)XtNresizable, TRUE);
+ XtSetValues (valueWidget, valueArgs, 1);
+ /*
+ * as resizable isn't set until just above, the
+ * default value will be displayed incorrectly.
+ * rectify the situation by resetting the values
+ */
+ XtSetValues (promptDialog, dialogArgs, XtNumber (dialogArgs));
+ }
+ XtSetKeyboardFocus (promptDialog, valueWidget);
+ XtSetKeyboardFocus (toplevel, valueWidget);
+ XtRealizeWidget (promptShell);
+ /*
+ * place the widget in the center of the "parent"
+ */
+ XtSetArg (centerArgs[0], XtNwidth, &center_width);
+ XtSetArg (centerArgs[1], XtNheight, &center_height);
+ XtGetValues (centerw, centerArgs, 2);
+ XtSetArg (centerArgs[0], XtNwidth, &prompt_width);
+ XtSetArg (centerArgs[1], XtNheight, &prompt_height);
+ XtGetValues (promptShell, centerArgs, 2);
+ source_x = (center_width - prompt_width) / 2;
+ source_y = (center_height - prompt_height) / 3;
+ XtTranslateCoords (centerw, source_x, source_y, &dest_x, &dest_y);
+ XtSetArg (centerArgs[0], XtNx, dest_x);
+ XtSetArg (centerArgs[1], XtNy, dest_y);
+ XtSetValues (promptShell, centerArgs, 2);
+ XtMapWidget(promptShell);
+ promptfunction = func;
+}
+
+/*
+Local Variables:
+c-indent-level: 4
+c-continued-statement-offset: 4
+c-brace-offset: -4
+c-argdecl-indent: 4
+c-label-offset: -4
+c-tab-always-indent: nil
+End:
+*/
diff --git a/contrib/groff/src/include/DviChar.h b/contrib/groff/src/include/DviChar.h
new file mode 100644
index 0000000..a77f036
--- /dev/null
+++ b/contrib/groff/src/include/DviChar.h
@@ -0,0 +1,37 @@
+/*
+ * DviChar.h
+ *
+ * descriptions for mapping dvi names to
+ * font indexes and back. Dvi fonts are all
+ * 256 elements (actually only 256-32 are usable).
+ *
+ * The encoding names are taken from X -
+ * case insensitive, a dash separating the
+ * CharSetRegistry from the CharSetEncoding
+ */
+
+# define DVI_MAX_SYNONYMS 10
+# define DVI_MAP_SIZE 256
+# define DVI_HASH_SIZE 256
+
+typedef struct _dviCharNameHash {
+ struct _dviCharNameHash *next;
+ const char *name;
+ int position;
+} DviCharNameHash;
+
+typedef struct _dviCharNameMap {
+ const char *encoding;
+ int special;
+ const char *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
+ DviCharNameHash *buckets[DVI_HASH_SIZE];
+} DviCharNameMap;
+
+DviCharNameMap *DviFindMap (char *);
+void DviRegisterMap (DviCharNameMap *);
+#ifdef NOTDEF
+char *DviCharName (DviCharNameMap *, int, int);
+#else
+#define DviCharName(map,index,synonym) ((map)->dvi_names[index][synonym])
+#endif
+int DviCharIndex (DviCharNameMap *, const char *);
diff --git a/contrib/groff/src/include/Makefile.sub b/contrib/groff/src/include/Makefile.sub
index 620d345..58e1ac9 100644
--- a/contrib/groff/src/include/Makefile.sub
+++ b/contrib/groff/src/include/Makefile.sub
@@ -5,12 +5,14 @@ HDRS=\
color.h \
device.h \
driver.h \
+ DviChar.h \
errarg.h \
error.h \
font.h \
geometry.h \
getopt.h \
- groff-getopt.h \
+ getopt_int.h \
+ gettext.h \
htmlhint.h \
index.h \
lib.h \
@@ -20,9 +22,13 @@ HDRS=\
printer.h \
ptable.h \
refid.h \
+ relocate.h \
search.h \
searchpath.h \
- stringclass.h
+ stringclass.h \
+ symbol.h \
+ unicode.h \
+ XFontName.h
GENHDRS=defs.h
all depend: $(GENHDRS)
@@ -31,6 +37,7 @@ defs.h: FORCE
@$(SHELL) $(top_srcdir)/gendef.sh defs.h \
"PROG_PREFIX=\"$(g)\"" \
"DEVICE=\"$(DEVICE)\"" \
+ "INSTALLPATH=\"$(prefix)\"" \
"BINPATH=\"$(bindir)\"" \
"FONTPATH=\"$(fontpath)\"" \
"MACROPATH=\"$(tmacpath)\"" \
diff --git a/contrib/groff/src/include/XFontName.h b/contrib/groff/src/include/XFontName.h
new file mode 100644
index 0000000..4e9c694
--- /dev/null
+++ b/contrib/groff/src/include/XFontName.h
@@ -0,0 +1,50 @@
+typedef struct _xFontName {
+ char Registry[256];
+ char Foundry[256];
+ char FamilyName[256];
+ char WeightName[256];
+ char Slant[3];
+ char SetwidthName[256];
+ char AddStyleName[256];
+ unsigned int PixelSize;
+ unsigned int PointSize;
+ unsigned int ResolutionX;
+ unsigned int ResolutionY;
+ char Spacing[2];
+ unsigned int AverageWidth;
+ char CharSetRegistry[256];
+ char CharSetEncoding[256];
+} XFontName;
+
+#define FontNameRegistry (1<<0)
+#define FontNameFoundry (1<<1)
+#define FontNameFamilyName (1<<2)
+#define FontNameWeightName (1<<3)
+#define FontNameSlant (1<<4)
+#define FontNameSetwidthName (1<<5)
+#define FontNameAddStyleName (1<<6)
+#define FontNamePixelSize (1<<7)
+#define FontNamePointSize (1<<8)
+#define FontNameResolutionX (1<<9)
+#define FontNameResolutionY (1<<10)
+#define FontNameSpacing (1<<11)
+#define FontNameAverageWidth (1<<12)
+#define FontNameCharSetRegistry (1<<13)
+#define FontNameCharSetEncoding (1<<14)
+
+#define SlantRoman "R"
+#define SlantItalic "I"
+#define SlantOblique "O"
+#define SlantReverseItalic "RI"
+#define SlantReverseOblique "RO"
+
+#define SpacingMonoSpaced "M"
+#define SpacingProportional "P"
+#define SpacingCharacterCell "C"
+
+typedef char *XFontNameString;
+
+Bool XParseFontName (XFontNameString, XFontName *, unsigned int *);
+Bool XFormatFontName (XFontName *, unsigned int, XFontNameString);
+Bool XCompareFontName (XFontName *, XFontName *, unsigned int);
+Bool XCopyFontName (XFontName *, XFontName *, unsigned int);
diff --git a/contrib/groff/src/include/assert.h b/contrib/groff/src/include/assert.h
index 18d9c26..76b3b20 100644
--- a/contrib/groff/src/include/assert.h
+++ b/contrib/groff/src/include/assert.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef ASSERT_H
#define ASSERT_H
diff --git a/contrib/groff/src/include/cmap.h b/contrib/groff/src/include/cmap.h
index 1537d46..d786829 100644
--- a/contrib/groff/src/include/cmap.h
+++ b/contrib/groff/src/include/cmap.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef UCHAR_MAX
#define UCHAR_MAX 255
diff --git a/contrib/groff/src/include/color.h b/contrib/groff/src/include/color.h
index 205f70e..52f97c6 100644
--- a/contrib/groff/src/include/color.h
+++ b/contrib/groff/src/include/color.h
@@ -21,9 +21,10 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stddef.h>
+#include "symbol.h"
enum color_scheme {DEFAULT, CMY, CMYK, RGB, GRAY};
@@ -38,8 +39,9 @@ private:
const size_t);
public:
+ symbol nm;
enum {MAX_COLOR_VAL = 0xffff};
- color() : scheme(DEFAULT){}
+ color(symbol s = default_symbol) : scheme(DEFAULT), nm(s) {}
color(const color * const);
~color();
void *operator new(size_t);
diff --git a/contrib/groff/src/include/config.hin b/contrib/groff/src/include/config.hin
index 13a3630..5f871aa 100644
--- a/contrib/groff/src/include/config.hin
+++ b/contrib/groff/src/include/config.hin
@@ -3,14 +3,21 @@
/* Define if your C++ doesn't understand `delete []'. */
#undef ARRAY_DELETE_NEEDS_SIZE
+/* Define if you have a C++ <inttypes.h>. */
+#undef HAVE_CC_INTTYPES_H
+
/* Define if you have a C++ <limits.h>. */
#undef HAVE_CC_LIMITS_H
/* Define if you have a C++ <osfcn.h>. */
#undef HAVE_CC_OSFCN_H
-/* Define if you have a C++ <stdint.h>. */
-#undef HAVE_CC_STDINT_H
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_SIGLIST
+
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -33,6 +40,9 @@
/* Define to 1 if you have the `isatty' function. */
#undef HAVE_ISATTY
+/* Define to 1 if you have the `kill' function. */
+#undef HAVE_KILL
+
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
@@ -48,6 +58,9 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define to 1 if you have the <process.h> header file. */
+#undef HAVE_PROCESS_H
+
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
@@ -93,10 +106,10 @@
/* Define to 1 if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
-/* Define if you have sys_errlist in <errno.h> or in <stdio.h>. */
+/* Define if you have sys_errlist in <errno.h>, <stdio.h>, or <stdlib.h>. */
#undef HAVE_SYS_ERRLIST
-/* Define if you have sysnerr in <errno.h> or <stdio.h>. */
+/* Define if you have sys_nerr in <errno.h>, <stdio.h>, or <stdio.h>. */
#undef HAVE_SYS_NERR
/* Define to 1 if you have the <sys/stat.h> header file. */
@@ -111,6 +124,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
/* Define if the host's encoding is EBCDIC. */
#undef IS_EBCDIC_HOST
@@ -147,6 +163,12 @@
/* Define if your C++ doesn't declare strncasecmp(). */
#undef NEED_DECLARATION_STRNCASECMP
+/* Define if your C++ doesn't declare vfprintf(). */
+#undef NEED_DECLARATION_VFPRINTF
+
+/* Define if your C++ doesn't declare vsnprintf(). */
+#undef NEED_DECLARATION_VSNPRINTF
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -174,9 +196,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
-#undef SYS_SIGLIST_DECLARED
-
/* Define if your C++ compiler uses a traditional (Reiser) preprocessor. */
#undef TRADITIONAL_CPP
@@ -184,6 +203,9 @@
core image was produced for a process that was terminated by a signal. */
#undef WCOREFLAG
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
/* Define if -D_POSIX_SOURCE is necessary. */
#undef _POSIX_SOURCE
diff --git a/contrib/groff/src/include/cset.h b/contrib/groff/src/include/cset.h
index b3a1a97..a241c00 100644
--- a/contrib/groff/src/include/cset.h
+++ b/contrib/groff/src/include/cset.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CC_LIMITS_H
#include <limits.h>
diff --git a/contrib/groff/src/include/device.h b/contrib/groff/src/include/device.h
index 341af8d..ecafc26 100644
--- a/contrib/groff/src/include/device.h
+++ b/contrib/groff/src/include/device.h
@@ -16,6 +16,6 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern const char *device;
diff --git a/contrib/groff/src/include/driver.h b/contrib/groff/src/include/driver.h
index b15d6c9..f6804ef 100644
--- a/contrib/groff/src/include/driver.h
+++ b/contrib/groff/src/include/driver.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/include/errarg.h b/contrib/groff/src/include/errarg.h
index 08af44a..1aa191a 100644
--- a/contrib/groff/src/include/errarg.h
+++ b/contrib/groff/src/include/errarg.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class errarg {
enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type;
diff --git a/contrib/groff/src/include/error.h b/contrib/groff/src/include/error.h
index e227682..b9d48d0 100644
--- a/contrib/groff/src/include/error.h
+++ b/contrib/groff/src/include/error.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern void fatal_with_file_and_line(const char *filename, int lineno,
const char *format,
@@ -52,7 +53,7 @@ extern void warning(const char *,
const errarg &arg3 = empty_errarg);
-extern const char *program_name;
+extern "C" const char *program_name;
extern int current_lineno;
extern const char *current_filename;
extern const char *current_source_filename;
diff --git a/contrib/groff/src/include/font.h b/contrib/groff/src/include/font.h
index 43bf121..3ef4fed 100644
--- a/contrib/groff/src/include/font.h
+++ b/contrib/groff/src/include/font.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
typedef void (*FONT_COMMAND_HANDLER)(const char *, const char *,
const char *, int);
@@ -53,10 +54,11 @@ public:
const char *get_special_device_encoding(int index);
const char *get_name();
const char *get_internal_name();
+ const char *get_image_generator();
static int scan_papersize(const char *, const char **, double *, double *);
- static font *load_font(const char *, int *not_found = 0);
+ static font *load_font(const char *, int * = 0, int = 0);
static void command_line_font_dir(const char *path);
static FILE *open_file(const char *name, char **pathp);
static int load_desc();
@@ -76,8 +78,10 @@ public:
static int spare2;
static int sizescale;
static int tcommand;
+ static int unscaled_charwidths;
static int pass_filenames;
static int use_charnames_in_special;
+ static const char *image_generator;
static const char **font_name_table;
static const char **style_table;
@@ -87,7 +91,7 @@ private:
unsigned ligatures;
font_kern_list **kern_hash_table;
int space_width;
- short *ch_index;
+ int *ch_index;
int nindices;
font_char_metric *ch;
int ch_used;
@@ -116,5 +120,5 @@ private:
const char *file, int lineno);
protected:
font(const char *);
- int load(int *not_found = 0);
+ int load(int * = 0, int = 0);
};
diff --git a/contrib/groff/src/include/geometry.h b/contrib/groff/src/include/geometry.h
index d425f15..1ce0df0 100644
--- a/contrib/groff/src/include/geometry.h
+++ b/contrib/groff/src/include/geometry.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
int adjust_arc_center(const int *, double *);
void check_output_arc_limits(int x, int y,
diff --git a/contrib/groff/src/include/getopt_int.h b/contrib/groff/src/include/getopt_int.h
new file mode 100644
index 0000000..401579f
--- /dev/null
+++ b/contrib/groff/src/include/getopt_int.h
@@ -0,0 +1,131 @@
+/* Internal declarations for getopt.
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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 this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _GETOPT_INT_H
+#define _GETOPT_INT_H 1
+
+extern int _getopt_internal (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct);
+
+
+/* Reentrant versions which can handle parsing multiple argument
+ vectors at the same time. */
+
+/* Data type for reentrant functions. */
+struct _getopt_data
+{
+ /* These have exactly the same meaning as the corresponding global
+ variables, except that they are used for the reentrant
+ versions of getopt. */
+ int optind;
+ int opterr;
+ int optopt;
+ char *optarg;
+
+ /* Internal members. */
+
+ /* True if the internal members have been initialized. */
+ int __initialized;
+
+ /* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+ char *__nextchar;
+
+ /* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters, or by calling getopt.
+
+ PERMUTE is the default. We permute the contents of ARGV as we
+ scan, so that eventually all the non-options are at the end.
+ This allows options to be given in any order, even with programs
+ that were not written to expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were
+ written to expect options and other ARGV-elements in any order
+ and that care about the ordering of the two. We describe each
+ non-option ARGV-element as if it were the argument of an option
+ with character code 1. Using `-' as the first character of the
+ list of option characters selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
+
+ enum
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ } __ordering;
+
+ /* If the POSIXLY_CORRECT environment variable is set
+ or getopt was called. */
+ int __posixly_correct;
+
+
+ /* Handle permutation of arguments. */
+
+ /* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first
+ of them; `last_nonopt' is the index after the last of them. */
+
+ int __first_nonopt;
+ int __last_nonopt;
+
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+ int __nonoption_flags_max_len;
+ int __nonoption_flags_len;
+# endif
+};
+
+/* The initializer is necessary to set OPTIND and OPTERR to their
+ default values and to clear the initialization flag. */
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
+
+extern int _getopt_internal_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_only_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts,
+ int *__longind,
+ struct _getopt_data *__data);
+
+#endif /* getopt_int.h */
diff --git a/contrib/groff/src/include/gettext.h b/contrib/groff/src/include/gettext.h
new file mode 100644
index 0000000..26fd2c5
--- /dev/null
+++ b/contrib/groff/src/include/gettext.h
@@ -0,0 +1,4 @@
+/* This is a dummy header file to make getopt compile without gettext
+ support. */
+
+#define gettext(s) s
diff --git a/contrib/groff/src/include/html-strings.h b/contrib/groff/src/include/html-strings.h
index fd757c3f..26daeb6 100644
--- a/contrib/groff/src/include/html-strings.h
+++ b/contrib/groff/src/include/html-strings.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* defines the image tags issued by the pre-processors (tbl, pic, eqn)
diff --git a/contrib/groff/src/include/htmlhint.h b/contrib/groff/src/include/htmlhint.h
index f1f46f7..e0b41dd 100644
--- a/contrib/groff/src/include/htmlhint.h
+++ b/contrib/groff/src/include/htmlhint.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef HTMLINDICATE_H
#define HTMLINDICATE_H
diff --git a/contrib/groff/src/include/index.h b/contrib/groff/src/include/index.h
index 7e60813..c90610e 100644
--- a/contrib/groff/src/include/index.h
+++ b/contrib/groff/src/include/index.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define INDEX_MAGIC 0x23021964
#define INDEX_VERSION 1
diff --git a/contrib/groff/src/include/lib.h b/contrib/groff/src/include/lib.h
index bebad98..bb59337 100644
--- a/contrib/groff/src/include/lib.h
+++ b/contrib/groff/src/include/lib.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -31,18 +32,8 @@ extern "C" {
const char *if_to_a(int, int);
}
-/* stdio.h on IRIX, OSF/1, emx, and UWIN include getopt.h */
-/* unistd.h on CYGWIN includes getopt.h */
-
-#if !(defined(__sgi) \
- || (defined(__osf__) && defined(__alpha)) \
- || defined(_UWIN) \
- || defined(__EMX__) \
- || defined(__CYGWIN__))
-#include <groff-getopt.h>
-#else
+#define __GETOPT_PREFIX groff_
#include <getopt.h>
-#endif
#ifdef HAVE_SETLOCALE
#include <locale.h>
@@ -52,6 +43,7 @@ extern "C" {
char *strsave(const char *s);
int is_prime(unsigned);
+double groff_hypot(double, double);
#include <stdio.h>
#include <string.h>
@@ -59,13 +51,21 @@ int is_prime(unsigned);
#include <strings.h>
#endif
-/* HP-UX 10.20 doesn't declare snprintf() */
-#if !defined(HAVE_SNPRINTF) || defined(NEED_DECLARATION_SNPRINTF)
#include <stdarg.h>
-extern "C" {
- int snprintf(char *, size_t, const char *, /*args*/ ...);
- int vsnprintf(char *, size_t, const char *, va_list);
-}
+
+/* HP-UX 10.20 and LynxOS 4.0.0 don't declare snprintf() */
+#if !defined(HAVE_SNPRINTF) || defined(NEED_DECLARATION_SNPRINTF)
+extern "C" { int snprintf(char *, size_t, const char *, /*args*/ ...); }
+#endif
+
+/* LynxOS 4.0.0 has snprintf() but no vsnprintf() */
+#if !defined(HAVE_VSNPRINTF) || defined(NEED_DECLARATION_VSNPRINTF)
+extern "C" { int vsnprintf(char *, size_t, const char *, va_list); }
+#endif
+
+/* LynxOS 4.0.0 doesn't declare vfprintf() */
+#ifdef NEED_DECLARATION_VFPRINTF
+extern "C" { int vfprintf(FILE *, const char *, va_list); }
#endif
#ifndef HAVE_MKSTEMP
@@ -90,6 +90,7 @@ extern "C" { int pclose (FILE *); }
#endif /* NEED_DECLARATION_PCLOSE */
size_t file_name_max(const char *fname);
+size_t path_name_max();
int interpret_lf_args(const char *p);
@@ -102,29 +103,21 @@ inline int invalid_input_char(int c)
#ifdef HAVE_STRCASECMP
#ifdef NEED_DECLARATION_STRCASECMP
-extern "C" {
- // Ultrix4.3's string.h fails to declare this.
- int strcasecmp(const char *, const char *);
-}
+// Ultrix4.3's string.h fails to declare this.
+extern "C" { int strcasecmp(const char *, const char *); }
#endif /* NEED_DECLARATION_STRCASECMP */
#else /* not HAVE_STRCASECMP */
-extern "C" {
- int strcasecmp(const char *, const char *);
-}
+extern "C" { int strcasecmp(const char *, const char *); }
#endif /* HAVE_STRCASECMP */
#if !defined(_AIX) && !defined(sinix) && !defined(__sinix__)
#ifdef HAVE_STRNCASECMP
#ifdef NEED_DECLARATION_STRNCASECMP
-extern "C" {
- // SunOS's string.h fails to declare this.
- int strncasecmp(const char *, const char *, int);
-}
+// SunOS's string.h fails to declare this.
+extern "C" { int strncasecmp(const char *, const char *, int); }
#endif /* NEED_DECLARATION_STRNCASECMP */
#else /* not HAVE_STRNCASECMP */
-extern "C" {
- int strncasecmp(const char *, const char *, size_t);
-}
+extern "C" { int strncasecmp(const char *, const char *, size_t); }
#endif /* HAVE_STRNCASECMP */
#endif /* !_AIX && !sinix && !__sinix__ */
diff --git a/contrib/groff/src/include/macropath.h b/contrib/groff/src/include/macropath.h
index b4a2bd0..3b38baa 100644
--- a/contrib/groff/src/include/macropath.h
+++ b/contrib/groff/src/include/macropath.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern search_path macro_path;
extern search_path safer_macro_path;
diff --git a/contrib/groff/src/include/nonposix.h b/contrib/groff/src/include/nonposix.h
index 73422d9..9564a8b 100644
--- a/contrib/groff/src/include/nonposix.h
+++ b/contrib/groff/src/include/nonposix.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Eli Zaretskii (eliz@is.elta.co.il)
This file is part of groff.
@@ -15,10 +16,12 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This header file compartmentalize all idiosyncrasies of non-Posix
- systems, such as MS-DOS, MS-Windows, etc. */
+ systems, such as MS-DOS, MS-Windows, etc. It should be loaded after
+ the system headers like stdio.h to protect against warnings and error
+ messages w.r.t. redefining macros. */
#if defined _MSC_VER
# ifndef _WIN32
@@ -29,31 +32,48 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if defined(__MSDOS__) || defined(__EMX__) \
|| (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__))
-/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and
- Borland; Windows compilers might need _setmode or some such. */
+/* Binary I/O nuisances. */
# include <fcntl.h>
# include <io.h>
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
-# ifdef _MSC_VER
-# define POPEN_RT "rt"
-# define POPEN_WT "wt"
-# define popen(c,m) _popen(c,m)
-# define pclose(p) _pclose(p)
-# define getpid() (1)
-# define mkdir(p,m) _mkdir(p)
-# define setmode(f,m) _setmode(f,m)
-# define WAIT(s,p,m) _cwait(s,p,m)
-# define creat(p,m) _creat(p,m)
+# ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+# define STDOUT_FILENO 1
+# define STDERR_FILENO 2
# endif
-# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
-# define FOPEN_RB "rb"
-# define FOPEN_WB "wb"
-# define FOPEN_RWB "wb+"
+# ifdef HAVE_DIRECT_H
+# include <direct.h>
+# endif
+# ifdef HAVE_PROCESS_H
+# include <process.h>
+# endif
+# if defined(_MSC_VER) || defined(__MINGW32__)
+# define POPEN_RT "rt"
+# define POPEN_WT "wt"
+# define popen(c,m) _popen(c,m)
+# define pclose(p) _pclose(p)
+# define pipe(pfd) _pipe((pfd),0,_O_BINARY|_O_NOINHERIT)
+# define mkdir(p,m) _mkdir(p)
+# define setmode(f,m) _setmode(f,m)
+# define WAIT(s,p,m) _cwait(s,p,m)
+# define creat(p,m) _creat(p,m)
+# define read(f,b,s) _read(f,b,s)
+# define write(f,b,s) _write(f,b,s)
+# define dup(f) _dup(f)
+# define dup2(f1,f2) _dup2(f1,f2)
+# define close(f) _close(f)
+# define isatty(f) _isatty(f)
+# define access(p,m) _access(p,m)
+# endif
+# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
+# define FOPEN_RB "rb"
+# define FOPEN_WB "wb"
+# define FOPEN_RWB "wb+"
# ifndef O_BINARY
# ifdef _O_BINARY
-# define O_BINARY (_O_BINARY)
+# define O_BINARY (_O_BINARY)
# endif
# endif
@@ -61,96 +81,151 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
systems don't have standard places where it lives, and might not
have it installed to begin with. We want to give them some leeway. */
# ifdef __EMX__
-# define getcwd(b,s) _getcwd2(b,s)
+# define getcwd(b,s) _getcwd2(b,s)
# else
-# define BSHELL (system_shell_name())
-# define BSHELL_DASH_C (system_shell_dash_c())
-# define IS_BSHELL(s) (is_system_shell(s))
+# define BSHELL (system_shell_name())
+# define BSHELL_DASH_C (system_shell_dash_c())
+# define IS_BSHELL(s) (is_system_shell(s))
# endif
/* The separator for directories in PATH and other environment
variables. */
-# define PATH_SEP ";"
+# define PATH_SEP ";"
+# define PATH_SEP_CHAR ';'
/* Characters that separate directories in a path name. */
-# define DIR_SEPS "/\\:"
+# define DIR_SEPS "/\\:"
/* How to tell if the argument is an absolute file name. */
# define IS_ABSOLUTE(f) \
((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':')
/* The executable extension. */
-# define EXE_EXT ".exe"
+# define EXE_EXT ".exe"
+
+/* Possible executable extensions. */
+# define PATH_EXT ".com;.exe;.bat;.cmd"
/* The system null device. */
-# define NULL_DEV "NUL"
+# define NULL_DEV "NUL"
+
+/* The default place to create temporary files. */
+# ifndef P_tmpdir
+# ifdef _P_tmpdir
+# define P_tmpdir _P_tmpdir
+# else
+# define P_tmpdir "c:/temp"
+# endif
+# endif
/* Prototypes. */
# ifdef __cplusplus
extern "C" {
# endif
- const char * system_shell_name(void);
+ char * system_shell_name(void);
const char * system_shell_dash_c(void);
- int is_system_shell(const char *);
+ int is_system_shell(const char *);
+# ifdef __cplusplus
+ }
+# endif
+
+#endif
+
+#if defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)
+/* Win32 implementations which use the Microsoft runtime library
+ * are prone to hanging when a pipe reader quits with unread data in the pipe.
+ * `gtroff' avoids this, by invoking `FLUSH_INPUT_PIPE()', defined as ... */
+# define FLUSH_INPUT_PIPE(fd) \
+ do if (!isatty(fd)) \
+ { \
+ char drain[BUFSIZ]; \
+ while (read(fd, drain, sizeof(drain)) > 0) \
+ ; \
+ } while (0)
+
+/* The Microsoft runtime library also has a broken argument passing mechanism,
+ * which may result in improper grouping of arguments passed to a child process
+ * by the `spawn()' family of functions. In `groff', only the `spawnvp()'
+ * function is affected; we work around this defect, by substituting a
+ * wrapper function in place of `spawnvp()' calls. */
+
+# ifdef __cplusplus
+ extern "C" {
+# endif
+ int spawnvp_wrapper(int, char *, char **);
# ifdef __cplusplus
}
# endif
+# ifndef SPAWN_FUNCTION_WRAPPERS
+# undef spawnvp
+# define spawnvp spawnvp_wrapper
+# undef _spawnvp
+# define _spawnvp spawnvp
+# endif /* SPAWN_FUNCTION_WRAPPERS */
+#else
+/* Other implementations do not suffer from Microsoft runtime bugs,
+ * but `gtroff' requires a dummy definition for FLUSH_INPUT_PIPE() */
+# define FLUSH_INPUT_PIPE(fd) do {} while(0)
#endif
/* Defaults, for Posix systems. */
#ifndef SET_BINARY
-# define SET_BINARY(f) do {} while(0)
+# define SET_BINARY(f) do {} while(0)
#endif
#ifndef FOPEN_RB
-# define FOPEN_RB "r"
+# define FOPEN_RB "r"
#endif
#ifndef FOPEN_WB
-# define FOPEN_WB "w"
+# define FOPEN_WB "w"
#endif
#ifndef FOPEN_RWB
-# define FOPEN_RWB "w+"
+# define FOPEN_RWB "w+"
#endif
#ifndef POPEN_RT
-# define POPEN_RT "r"
+# define POPEN_RT "r"
#endif
#ifndef POPEN_WT
-# define POPEN_WT "w"
+# define POPEN_WT "w"
#endif
#ifndef O_BINARY
-# define O_BINARY 0
+# define O_BINARY 0
#endif
#ifndef BSHELL
-# define BSHELL "/bin/sh"
+# define BSHELL "/bin/sh"
#endif
#ifndef BSHELL_DASH_C
-# define BSHELL_DASH_C "-c"
+# define BSHELL_DASH_C "-c"
#endif
#ifndef IS_BSHELL
-# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
+# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
#endif
#ifndef PATH_SEP
-# define PATH_SEP ":"
+# define PATH_SEP ":"
+# define PATH_SEP_CHAR ':'
#endif
#ifndef DIR_SEPS
-# define DIR_SEPS "/"
+# define DIR_SEPS "/"
#endif
#ifndef IS_ABSOLUTE
-# define IS_ABSOLUTE(f) ((f)[0] == '/')
+# define IS_ABSOLUTE(f) ((f)[0] == '/')
#endif
#ifndef EXE_EXT
-# define EXE_EXT ""
+# define EXE_EXT ""
+#endif
+#ifndef PATH_EXT
+# define PATH_EXT ""
#endif
#ifndef NULL_DEV
-# define NULL_DEV "/dev/null"
+# define NULL_DEV "/dev/null"
#endif
#ifndef GS_NAME
-# define GS_NAME "gs"
+# define GS_NAME "gs"
#endif
#ifndef WAIT
-# define WAIT(s,p,m) wait(s)
+# define WAIT(s,p,m) wait(s)
#endif
#ifndef _WAIT_CHILD
-# define _WAIT_CHILD 0
+# define _WAIT_CHILD 0
#endif
diff --git a/contrib/groff/src/include/paper.h b/contrib/groff/src/include/paper.h
index 7a01fc2..e88965d 100644
--- a/contrib/groff/src/include/paper.h
+++ b/contrib/groff/src/include/paper.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct paper {
char *name;
diff --git a/contrib/groff/src/include/posix.h b/contrib/groff/src/include/posix.h
index e7f38cd..28b807c 100644
--- a/contrib/groff/src/include/posix.h
+++ b/contrib/groff/src/include/posix.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1992, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <sys/types.h>
#include <sys/stat.h>
@@ -58,6 +58,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define O_RDONLY 0
#endif
+#ifndef F_OK
+#define F_OK 0
+#endif
+
#ifndef HAVE_ISATTY
#define isatty(n) (1)
#endif
diff --git a/contrib/groff/src/include/printer.h b/contrib/groff/src/include/printer.h
index 3976215..fb39f48 100644
--- a/contrib/groff/src/include/printer.h
+++ b/contrib/groff/src/include/printer.h
@@ -2,12 +2,12 @@
// <groff_src_dir>/src/include/printer.h
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
- Last update: 12 Apr 2002
+ Last update: 15 Dec 2004
This file is part of groff.
@@ -23,8 +23,8 @@
You should have received a copy of the GNU General Public License
along with groff; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
/* Description
@@ -49,7 +49,7 @@ struct environment {
color *fill;
};
-struct font;
+class font;
struct font_pointer_list {
font *p;
@@ -83,6 +83,9 @@ public:
virtual void end_of_line();
virtual void special(char *arg, const environment *env,
char type = 'p');
+ virtual void devtag(char *arg, const environment *env,
+ char type = 'p');
+
protected:
font_pointer_list *font_list;
font **font_table;
diff --git a/contrib/groff/src/include/ptable.h b/contrib/groff/src/include/ptable.h
index ffbe8e6..b288187 100644
--- a/contrib/groff/src/include/ptable.h
+++ b/contrib/groff/src/include/ptable.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <assert.h>
#include <string.h>
@@ -43,7 +44,7 @@ struct PASSOC(T) { \
PASSOC(T)(); \
}; \
\
-struct PTABLE(T); \
+class PTABLE(T); \
\
class PTABLE_ITERATOR(T) { \
PTABLE(T) *p; \
diff --git a/contrib/groff/src/include/refid.h b/contrib/groff/src/include/refid.h
index 605427e..84e5119 100644
--- a/contrib/groff/src/include/refid.h
+++ b/contrib/groff/src/include/refid.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class reference_id {
int filename_id;
diff --git a/contrib/groff/src/include/relocate.h b/contrib/groff/src/include/relocate.h
new file mode 100644
index 0000000..0d9edc4
--- /dev/null
+++ b/contrib/groff/src/include/relocate.h
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+/* Provide relocation for macro and font files.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+extern char *curr_prefix;
+extern size_t curr_prefix_len;
+
+void set_current_prefix ();
+char *xdirname (char *s);
+char *searchpath (const char *name, const char *pathp);
+char *relocatep (const char *path);
+char *relocate (const char *path);
diff --git a/contrib/groff/src/include/search.h b/contrib/groff/src/include/search.h
index 260410e..3dde894 100644
--- a/contrib/groff/src/include/search.h
+++ b/contrib/groff/src/include/search.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,10 +16,10 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
-struct search_item;
-struct search_item_iterator;
+class search_item;
+class search_item_iterator;
class search_list {
public:
@@ -34,7 +34,7 @@ private:
friend class search_list_iterator;
};
-struct bmpattern;
+class bmpattern;
class linear_searcher {
const char *ignore_fields;
diff --git a/contrib/groff/src/include/searchpath.h b/contrib/groff/src/include/searchpath.h
index 4d89a8d..dab161e 100644
--- a/contrib/groff/src/include/searchpath.h
+++ b/contrib/groff/src/include/searchpath.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class search_path {
char *dirs;
@@ -27,4 +28,5 @@ public:
~search_path();
void command_line_dir(const char *);
FILE *open_file(const char *, char **);
+ FILE *open_file_cautious(const char *, char ** = 0, const char * = 0);
};
diff --git a/contrib/groff/src/include/stringclass.h b/contrib/groff/src/include/stringclass.h
index c6295b0..fb3299c 100644
--- a/contrib/groff/src/include/stringclass.h
+++ b/contrib/groff/src/include/stringclass.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <string.h>
#include <stdio.h>
diff --git a/contrib/groff/src/include/symbol.h b/contrib/groff/src/include/symbol.h
new file mode 100644
index 0000000..c3cc8ee
--- /dev/null
+++ b/contrib/groff/src/include/symbol.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.com)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define DONT_STORE 1
+#define MUST_ALREADY_EXIST 2
+
+class symbol {
+ static const char **table;
+ static int table_used;
+ static int table_size;
+ static char *block;
+ static int block_size;
+ const char *s;
+public:
+ symbol(const char *p, int how = 0);
+ symbol();
+ unsigned long hash() const;
+ int operator ==(symbol) const;
+ int operator !=(symbol) const;
+ const char *contents() const;
+ int is_null() const;
+ int is_empty() const;
+};
+
+
+extern const symbol NULL_SYMBOL;
+extern const symbol EMPTY_SYMBOL;
+
+inline symbol::symbol() : s(0)
+{
+}
+
+inline int symbol::operator==(symbol p) const
+{
+ return s == p.s;
+}
+
+inline int symbol::operator!=(symbol p) const
+{
+ return s != p.s;
+}
+
+inline unsigned long symbol::hash() const
+{
+ return (unsigned long)s;
+}
+
+inline const char *symbol::contents() const
+{
+ return s;
+}
+
+inline int symbol::is_null() const
+{
+ return s == 0;
+}
+
+inline int symbol::is_empty() const
+{
+ return s != 0 && *s == 0;
+}
+
+symbol concat(symbol, symbol);
+
+extern symbol default_symbol;
diff --git a/contrib/groff/src/include/unicode.h b/contrib/groff/src/include/unicode.h
new file mode 100644
index 0000000..90dab11
--- /dev/null
+++ b/contrib/groff/src/include/unicode.h
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+/* Copyright (C) 2002, 2003
+ Free Software Foundation, Inc.
+ Written by Werner Lemberg <wl@gnu.org>
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+const char *glyph_name_to_unicode(const char *);
+const char *unicode_to_glyph_name(const char *);
+const char *decompose_unicode(const char *);
+
+const char *check_unicode_name(const char *);
diff --git a/contrib/groff/src/libs/libbib/common.cpp b/contrib/groff/src/libs/libbib/common.cpp
index 4b2bcca..9d16e7a 100644
--- a/contrib/groff/src/libs/libbib/common.cpp
+++ b/contrib/groff/src/libs/libbib/common.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
unsigned hash(const char *s, int len)
{
diff --git a/contrib/groff/src/libs/libbib/index.cpp b/contrib/groff/src/libs/libbib/index.cpp
index 3633df1..6b9b9e3 100644
--- a/contrib/groff/src/libs/libbib/index.cpp
+++ b/contrib/groff/src/libs/libbib/index.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -349,7 +350,7 @@ int index_search_item_iterator::next(const linear_searcher &,
}
int index_search_item_iterator::get_tag(int tagno,
- const linear_searcher &searcher,
+ const linear_searcher &searchr,
const char **pp, int *lenp,
reference_id *ridp)
{
@@ -389,7 +390,6 @@ int index_search_item_iterator::get_tag(int tagno,
int length = tp->length;
int err = 0;
if (length == 0) {
- struct stat sb;
if (fstat(fileno(fp), &sb) < 0) {
error("can't stat `%1': %2", filename, strerror(errno));
err = 1;
@@ -426,7 +426,7 @@ int index_search_item_iterator::get_tag(int tagno,
buf[didx] = buf[sidx];
}
buf[length + 1] = '\n';
- res = searcher.search(buf + 1, buf + 2 + length, pp, lenp);
+ res = searchr.search(buf + 1, buf + 2 + length, pp, lenp);
if (res && ridp)
*ridp = reference_id(indx->filename_id + tp->filename_index,
tp->start);
diff --git a/contrib/groff/src/libs/libbib/linear.cpp b/contrib/groff/src/libs/libbib/linear.cpp
index 1dd902b..c1919ab7 100644
--- a/contrib/groff/src/libs/libbib/linear.cpp
+++ b/contrib/groff/src/libs/libbib/linear.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/libs/libbib/map.c b/contrib/groff/src/libs/libbib/map.c
index 4d878a2..f45625d 100644
--- a/contrib/groff/src/libs/libbib/map.c
+++ b/contrib/groff/src/libs/libbib/map.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdlib.h>
@@ -34,11 +34,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define MAP_FILE 0
#endif
-char *mapread(fd, nbytes)
- int fd;
- int nbytes;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *mapread(int fd, int nbytes)
{
- char *p = (char *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ,
+ char *p = (char *)mmap((void *)0, (size_t)nbytes, PROT_READ,
MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
if (p == (char *)-1)
return 0;
@@ -48,31 +50,37 @@ char *mapread(fd, nbytes)
return p;
}
-int unmap(p, len)
- char *p;
- int len;
+int unmap(char *p, int len)
{
- return munmap((caddr_t)p, len);
+ return munmap((void *)p, len);
}
+#ifdef __cplusplus
+}
+#endif
+
#else /* not HAVE_MMAP */
#include <errno.h>
-char *mapread(fd, nbytes)
- int fd;
- int nbytes;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *mapread(int fd, int nbytes)
{
errno = ENODEV;
return 0;
}
-int unmap(p, len)
- char *p;
- int len;
+int unmap(char *p, int len)
{
errno = EINVAL;
return -1;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* not HAVE_MMAP */
diff --git a/contrib/groff/src/libs/libbib/search.cpp b/contrib/groff/src/libs/libbib/search.cpp
index 2223fb6..4ed0baa 100644
--- a/contrib/groff/src/libs/libbib/search.cpp
+++ b/contrib/groff/src/libs/libbib/search.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/libs/libdriver/input.cpp b/contrib/groff/src/libs/libdriver/input.cpp
index acb6f13..bf8a74e 100644
--- a/contrib/groff/src/libs/libdriver/input.cpp
+++ b/contrib/groff/src/libs/libdriver/input.cpp
@@ -2,13 +2,13 @@
// <groff_src_dir>/src/libs/libdriver/input.cpp
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
Major rewrite 2001 by Bernd Warken (bwarken@mayn.de)
- Last update: 04 Apr 2003
+ Last update: 15 Jun 2005
This file is part of groff, the GNU roff text processing system.
@@ -24,8 +24,8 @@
You should have received a copy of the GNU General Public License
along with groff; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
/* Description
@@ -272,16 +272,15 @@ public:
IntArray(void);
IntArray(const size_t);
~IntArray(void);
- const IntArg operator[](const size_t i) const
+ IntArg operator[](const size_t i) const
{
if (i >= num_stored)
fatal("index out of range");
return (IntArg) data[i];
}
void append(IntArg);
- const IntArg * const
- get_data(void) const { return (IntArg *) data; }
- const size_t len(void) const { return num_stored; }
+ IntArg *get_data(void) const { return (IntArg *)data; }
+ size_t len(void) const { return num_stored; }
};
// Characters read from the input queue.
@@ -442,7 +441,7 @@ EnvStack::EnvStack(void)
{
num_allocated = 4;
// allocate pointer to array of num_allocated pointers to environment
- data = (environment **) malloc(envp_size * num_allocated);
+ data = (environment **)malloc(envp_size * num_allocated);
if (data == 0)
fatal("could not allocate environment data");
num_stored = 0;
@@ -475,7 +474,7 @@ EnvStack::push(environment *e)
if (num_stored >= num_allocated) {
environment **old_data = data;
num_allocated *= 2;
- data = (environment **) malloc(envp_size * num_allocated);
+ data = (environment **)malloc(envp_size * num_allocated);
if (data == 0)
fatal("could not allocate data");
for (size_t i = 0; i < num_stored; i++)
@@ -608,6 +607,7 @@ void delete_current_env(void)
delete current_env->col;
delete current_env->fill;
delete current_env;
+ current_env = 0;
}
//////////////////////////////////////////////////////////////////////
@@ -1034,13 +1034,13 @@ remember_filename(const char *filename)
{
char *fname;
if (strcmp(filename, "-") == 0)
- fname = "<standard input>";
+ fname = (char *)"<standard input>";
else
- fname = (char *) filename;
+ fname = (char *)filename;
size_t len = strlen(fname) + 1;
if (current_filename != 0)
free((char *)current_filename);
- current_filename = (const char *) malloc(len);
+ current_filename = (const char *)malloc(len);
if (current_filename == 0)
fatal("can't malloc space for filename");
strncpy((char *)current_filename, (char *)fname, len);
@@ -1060,13 +1060,13 @@ remember_source_filename(const char *filename)
{
char *fname;
if (strcmp(filename, "-") == 0)
- fname = "<standard input>";
+ fname = (char *)"<standard input>";
else
- fname = (char *) filename;
+ fname = (char *)filename;
size_t len = strlen(fname) + 1;
if (current_source_filename != 0)
free((char *)current_source_filename);
- current_source_filename = (const char *) malloc(len);
+ current_source_filename = (const char *)malloc(len);
if (current_source_filename == 0)
fatal("can't malloc space for filename");
strncpy((char *)current_source_filename, (char *)fname, len);
@@ -1083,7 +1083,7 @@ void
send_draw(const Char subcmd, const IntArray * const args)
{
EnvInt n = (EnvInt) args->len();
- pr->draw((int) subcmd, (IntArg *) args->get_data(), n, current_env);
+ pr->draw((int) subcmd, (IntArg *)args->get_data(), n, current_env);
}
//////////////////////////////////////////////////////////////////////
@@ -1520,6 +1520,9 @@ parse_x_command(void)
char *str_arg = get_extended_arg(); // includes line skip
if (npages <= 0)
error("`x X' command invalid before first `p' command");
+ else if (str_arg && (strncmp(str_arg, "devtag:",
+ strlen("devtag:")) == 0))
+ pr->devtag(str_arg, current_env);
else
pr->special(str_arg, current_env);
a_delete str_arg;
@@ -1823,6 +1826,7 @@ do_file(const char *filename)
if (npages > 0)
pr->end_page(current_env->vpos);
delete pr;
+ pr = 0;
fclose(current_file);
// If `stopped' is not `true' here then there wasn't any `x stop'.
if (!stopped)
diff --git a/contrib/groff/src/libs/libdriver/printer.cpp b/contrib/groff/src/libs/libdriver/printer.cpp
index 179daf1..fd77d6b 100644
--- a/contrib/groff/src/libs/libdriver/printer.cpp
+++ b/contrib/groff/src/libs/libdriver/printer.cpp
@@ -2,11 +2,11 @@
// <groff_src_dir>/src/libs/libdriver/printer.cpp
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
- Last update: 04 Apr 2003
+ Last update: 02 Mar 2005
This file is part of groff.
@@ -22,12 +22,61 @@
You should have received a copy of the GNU General Public License
along with groff; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
#include "driver.h"
+/* If we are sending output to an onscreen pager (as is the normal case
+ when reading man pages), then we may get an error state on the output
+ stream, if the user does not read all the way to the end.
+
+ We normally expect to catch this, and clean up the error context, when
+ the pager exits, because we should get, and handle, a SIGPIPE.
+
+ However ...
+*/
+
+#if (defined(_MSC_VER) || defined(_WIN32)) \
+ && !defined(__CYGWIN__) && !defined(_UWIN)
+
+ /* Native MS-Windows doesn't know about SIGPIPE, so we cannot detect the
+ early exit from the pager, and therefore, cannot clean up the error
+ context; thus we use the following static function to identify this
+ particular error context, and so suppress unwanted diagnostics.
+ */
+
+ static int
+ check_for_output_error (FILE* stream)
+ {
+ /* First, clean up any prior error context on the output stream */
+ if (ferror (stream))
+ clearerr (stream);
+ /* Clear errno, in case clearerr() and fflush() don't */
+ errno = 0;
+ /* Flush the output stream, so we can capture any error context, other
+ than the specific case we wish to suppress.
+
+ Microsoft doesn't document it, but the error code for the specific
+ context we are trying to suppress seems to be EINVAL -- a strange
+ choice, since it is not normally associated with fflush(); of course,
+ it *should* be EPIPE, but this *definitely* is not used, and *is* so
+ documented.
+ */
+ return ((fflush(stream) < 0) && (errno != EINVAL));
+ }
+
+#else
+
+ /* For other systems, we simply assume that *any* output error context
+ is to be reported.
+ */
+# define check_for_output_error(stream) ferror(stream) || fflush(stream) < 0
+
+#endif
+
+
font_pointer_list::font_pointer_list(font *f, font_pointer_list *fp)
: p(f), next(fp)
{
@@ -47,7 +96,7 @@ printer::~printer()
delete tem->p;
delete tem;
}
- if (ferror(stdout) || fflush(stdout) < 0)
+ if (check_for_output_error(stdout))
fatal("output error");
}
@@ -107,6 +156,10 @@ void printer::special(char *, const environment *, char)
{
}
+void printer::devtag(char *, const environment *, char)
+{
+}
+
void printer::draw(int, int *, int, const environment *)
{
}
diff --git a/contrib/groff/src/libs/libgroff/Makefile.sub b/contrib/groff/src/libs/libgroff/Makefile.sub
index 30277ab..e7606a8 100644
--- a/contrib/groff/src/libs/libgroff/Makefile.sub
+++ b/contrib/groff/src/libs/libgroff/Makefile.sub
@@ -1,4 +1,5 @@
LIB=groff
+EXTRA_CFLAGS=-D__GETOPT_PREFIX=groff_
OBJS=\
assert.$(OBJEXT) \
change_lf.$(OBJEXT) \
@@ -15,12 +16,18 @@ OBJS=\
geometry.$(OBJEXT) \
getopt.$(OBJEXT) \
getopt1.$(OBJEXT) \
+ glyphuni.$(OBJEXT) \
htmlhint.$(OBJEXT) \
+ hypot.$(OBJEXT) \
+ iftoa.$(OBJEXT) \
invalid.$(OBJEXT) \
+ itoa.$(OBJEXT) \
lf.$(OBJEXT) \
lineno.$(OBJEXT) \
macropath.$(OBJEXT) \
+ matherr.$(OBJEXT) \
maxfilename.$(OBJEXT) \
+ maxpathname.$(OBJEXT) \
mksdir.$(OBJEXT) \
nametoindex.$(OBJEXT) \
new.$(OBJEXT) \
@@ -28,14 +35,18 @@ OBJS=\
prime.$(OBJEXT) \
progname.$(OBJEXT) \
ptable.$(OBJEXT) \
+ quotearg.$(OBJEXT) \
+ relocate.$(OBJEXT) \
searchpath.$(OBJEXT) \
+ spawnvp.$(OBJEXT) \
string.$(OBJEXT) \
strsave.$(OBJEXT) \
+ symbol.$(OBJEXT) \
tmpfile.$(OBJEXT) \
tmpname.$(OBJEXT) \
- iftoa.$(OBJEXT) \
- itoa.$(OBJEXT) \
- matherr.$(OBJEXT) \
+ unicode.$(OBJEXT) \
+ uniglyph.$(OBJEXT) \
+ uniuni.$(OBJEXT) \
version.$(OBJEXT) \
$(LIBOBJS)
CCSRCS=\
@@ -52,25 +63,32 @@ CCSRCS=\
$(srcdir)/font.cpp \
$(srcdir)/fontfile.cpp \
$(srcdir)/geometry.cpp \
+ $(srcdir)/glyphuni.cpp \
$(srcdir)/htmlhint.cpp \
+ $(srcdir)/hypot.cpp \
$(srcdir)/invalid.cpp \
$(srcdir)/lf.cpp \
$(srcdir)/lineno.cpp \
$(srcdir)/macropath.cpp \
$(srcdir)/maxfilename.cpp \
+ $(srcdir)/maxpathname.cpp \
$(srcdir)/mksdir.cpp \
$(srcdir)/mkstemp.cpp \
$(srcdir)/nametoindex.cpp \
$(srcdir)/new.cpp \
$(srcdir)/paper.cpp \
$(srcdir)/prime.cpp \
- $(srcdir)/progname.cpp \
$(srcdir)/ptable.cpp \
+ $(srcdir)/relocate.cpp \
$(srcdir)/searchpath.cpp \
$(srcdir)/string.cpp \
$(srcdir)/strsave.cpp \
+ $(srcdir)/symbol.cpp \
$(srcdir)/tmpfile.cpp \
$(srcdir)/tmpname.cpp \
+ $(srcdir)/unicode.cpp \
+ $(srcdir)/uniglyph.cpp \
+ $(srcdir)/uniuni.cpp \
version.cpp
CSRCS=\
$(srcdir)/fmod.c \
@@ -80,7 +98,10 @@ CSRCS=\
$(srcdir)/iftoa.c \
$(srcdir)/itoa.c \
$(srcdir)/matherr.c \
+ $(srcdir)/progname.c \
$(srcdir)/putenv.c \
+ $(srcdir)/quotearg.c \
+ $(srcdir)/spawnvp.c \
$(srcdir)/strcasecmp.c \
$(srcdir)/strerror.c \
$(srcdir)/strncasecmp.c \
diff --git a/contrib/groff/src/libs/libgroff/assert.cpp b/contrib/groff/src/libs/libgroff/assert.cpp
index 89742e3..bc08eab 100644
--- a/contrib/groff/src/libs/libgroff/assert.cpp
+++ b/contrib/groff/src/libs/libgroff/assert.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,13 +15,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "assert.h"
-extern const char *program_name;
+extern "C" const char *program_name;
void assertion_failed(int lineno, const char *filename)
{
diff --git a/contrib/groff/src/libs/libgroff/change_lf.cpp b/contrib/groff/src/libs/libgroff/change_lf.cpp
index 2e44af1..0313779 100644
--- a/contrib/groff/src/libs/libgroff/change_lf.cpp
+++ b/contrib/groff/src/libs/libgroff/change_lf.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <string.h>
diff --git a/contrib/groff/src/libs/libgroff/color.cpp b/contrib/groff/src/libs/libgroff/color.cpp
index da138dc..b82bdcd 100644
--- a/contrib/groff/src/libs/libgroff/color.cpp
+++ b/contrib/groff/src/libs/libgroff/color.cpp
@@ -2,9 +2,9 @@
/* <groff_src_dir>/src/libs/libgroff/color.cpp
-Last update: 13 Apr 2003
+Last update: 26 May 2004
-Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Gaius Mulley <gaius@glam.ac.uk>
This file is part of groff.
@@ -21,8 +21,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+#include "lib.h"
#include "color.h"
#include "cset.h"
#ifdef HAVE_UNISTD_H
@@ -73,6 +74,7 @@ void color::operator delete(void *p)
color::color(const color * const c)
{
+ nm = c->nm;
scheme = c->scheme;
components[0] = c->components[0];
components[1] = c->components[1];
diff --git a/contrib/groff/src/libs/libgroff/device.cpp b/contrib/groff/src/libs/libgroff/device.cpp
index 7efbfef..53baf97 100644
--- a/contrib/groff/src/libs/libgroff/device.cpp
+++ b/contrib/groff/src/libs/libgroff/device.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdlib.h>
#include "device.h"
diff --git a/contrib/groff/src/libs/libgroff/errarg.cpp b/contrib/groff/src/libs/libgroff/errarg.cpp
index 2ddc0cc..1d6ef30 100644
--- a/contrib/groff/src/libs/libgroff/errarg.cpp
+++ b/contrib/groff/src/libs/libgroff/errarg.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "assert.h"
diff --git a/contrib/groff/src/libs/libgroff/error.cpp b/contrib/groff/src/libs/libgroff/error.cpp
index f7d3ec0..8aea0c0 100644
--- a/contrib/groff/src/libs/libgroff/error.cpp
+++ b/contrib/groff/src/libs/libgroff/error.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
diff --git a/contrib/groff/src/libs/libgroff/fatal.cpp b/contrib/groff/src/libs/libgroff/fatal.cpp
index 42560dc..bed8298b 100644
--- a/contrib/groff/src/libs/libgroff/fatal.cpp
+++ b/contrib/groff/src/libs/libgroff/fatal.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdlib.h>
diff --git a/contrib/groff/src/libs/libgroff/fmod.c b/contrib/groff/src/libs/libgroff/fmod.c
index 818f946..92e7306 100644
--- a/contrib/groff/src/libs/libgroff/fmod.c
+++ b/contrib/groff/src/libs/libgroff/fmod.c
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <math.h>
diff --git a/contrib/groff/src/libs/libgroff/font.cpp b/contrib/groff/src/libs/libgroff/font.cpp
index c633cc8..466c71d 100644
--- a/contrib/groff/src/libs/libgroff/font.cpp
+++ b/contrib/groff/src/libs/libgroff/font.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -71,6 +71,7 @@ struct text_file {
int lineno;
int size;
int skip_comments;
+ int silent;
char *buf;
text_file(FILE *fp, char *p);
~text_file();
@@ -82,7 +83,7 @@ struct text_file {
};
text_file::text_file(FILE *p, char *s)
-: fp(p), path(s), lineno(0), size(0), skip_comments(1), buf(0)
+: fp(p), path(s), lineno(0), size(0), skip_comments(1), silent(0), buf(0)
{
}
@@ -141,7 +142,8 @@ void text_file::error(const char *format,
const errarg &arg2,
const errarg &arg3)
{
- error_with_file_and_line(path, lineno, format, arg1, arg2, arg3);
+ if (!silent)
+ error_with_file_and_line(path, lineno, format, arg1, arg2, arg3);
}
@@ -272,7 +274,7 @@ int font::get_width(int c, int point_size)
int i = ch_index[c];
assert(i >= 0);
- if (point_size == unitwidth)
+ if (point_size == unitwidth || font::unscaled_charwidths)
return ch[i].width;
if (!widths_cache)
@@ -394,27 +396,32 @@ const char *font::get_internal_name()
const char *font::get_special_device_encoding(int c)
{
assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return( ch[ch_index[c]].special_device_coding );
+ return ch[ch_index[c]].special_device_coding;
}
-void font::alloc_ch_index(int index)
+const char *font::get_image_generator()
+{
+ return image_generator;
+}
+
+void font::alloc_ch_index(int idx)
{
if (nindices == 0) {
nindices = 128;
- if (index >= nindices)
- nindices = index + 10;
- ch_index = new short[nindices];
+ if (idx >= nindices)
+ nindices = idx + 10;
+ ch_index = new int[nindices];
for (int i = 0; i < nindices; i++)
ch_index[i] = -1;
}
else {
int old_nindices = nindices;
nindices *= 2;
- if (index >= nindices)
- nindices = index + 10;
- short *old_ch_index = ch_index;
- ch_index = new short[nindices];
- memcpy(ch_index, old_ch_index, sizeof(short)*old_nindices);
+ if (idx >= nindices)
+ nindices = idx + 10;
+ int *old_ch_index = ch_index;
+ ch_index = new int[nindices];
+ memcpy(ch_index, old_ch_index, sizeof(int)*old_nindices);
for (int i = old_nindices; i < nindices; i++)
ch_index[i] = -1;
a_delete old_ch_index;
@@ -443,9 +450,9 @@ void font::compact()
break;
i++;
if (i < nindices) {
- short *old_ch_index = ch_index;
- ch_index = new short[i];
- memcpy(ch_index, old_ch_index, i*sizeof(short));
+ int *old_ch_index = ch_index;
+ ch_index = new int[i];
+ memcpy(ch_index, old_ch_index, i*sizeof(int));
a_delete old_ch_index;
nindices = i;
}
@@ -458,16 +465,16 @@ void font::compact()
}
}
-void font::add_entry(int index, const font_char_metric &metric)
+void font::add_entry(int idx, const font_char_metric &metric)
{
- assert(index >= 0);
- if (index >= nindices)
- alloc_ch_index(index);
- assert(index < nindices);
+ assert(idx >= 0);
+ if (idx >= nindices)
+ alloc_ch_index(idx);
+ assert(idx < nindices);
if (ch_used + 1 >= ch_size)
extend_ch();
assert(ch_used + 1 < ch_size);
- ch_index[index] = ch_used;
+ ch_index[idx] = ch_used;
ch[ch_used++] = metric;
}
@@ -479,10 +486,10 @@ void font::copy_entry(int new_index, int old_index)
ch_index[new_index] = ch_index[old_index];
}
-font *font::load_font(const char *s, int *not_found)
+font *font::load_font(const char *s, int *not_found, int head_only)
{
font *f = new font(s);
- if (!f->load(not_found)) {
+ if (!f->load(not_found, head_only)) {
delete f;
return 0;
}
@@ -557,7 +564,7 @@ again:
// If the font can't be found, then if not_found is non-NULL, it will be set
// to 1 otherwise a message will be printed.
-int font::load(int *not_found)
+int font::load(int *not_found, int head_only)
{
char *path;
FILE *fp;
@@ -570,6 +577,7 @@ int font::load(int *not_found)
}
text_file t(fp, path);
t.skip_comments = 1;
+ t.silent = head_only;
char *p;
for (;;) {
if (!t.next()) {
@@ -638,6 +646,8 @@ int font::load(int *not_found)
else
break;
}
+ if (head_only)
+ return 1;
char *command = p;
int had_charset = 0;
t.skip_comments = 0;
@@ -704,12 +714,12 @@ int font::load(int *not_found)
t.error("unnamed character cannot be duplicate");
return 0;
}
- int index = name_to_index(nm);
- if (index < 0) {
+ int idx = name_to_index(nm);
+ if (idx < 0) {
t.error("invalid character `%1'", nm);
return 0;
}
- copy_entry(index, last_index);
+ copy_entry(idx, last_index);
}
else {
font_char_metric metric;
@@ -758,9 +768,9 @@ int font::load(int *not_found)
metric.special_device_coding = NULL;
}
else {
- char *name = new char[strlen(p) + 1];
- strcpy(name, p);
- metric.special_device_coding = name;
+ char *nam = new char[strlen(p) + 1];
+ strcpy(nam, p);
+ metric.special_device_coding = nam;
}
if (strcmp(nm, "---") == 0) {
last_index = number_to_index(metric.code);
@@ -810,7 +820,7 @@ static struct {
{ "spare1", &font::biggestfont },
{ "biggestfont", &font::biggestfont },
{ "spare2", &font::spare2 },
- { "sizescale", &font::sizescale }
+ { "sizescale", &font::sizescale },
};
int font::load_desc()
@@ -905,6 +915,8 @@ int font::load_desc()
return 0;
}
}
+ else if (strcmp("unscaled_charwidths", p) == 0)
+ unscaled_charwidths = 1;
else if (strcmp("pass_filenames", p) == 0)
pass_filenames = 1;
else if (strcmp("sizes", p) == 0) {
@@ -981,6 +993,14 @@ int font::load_desc()
tcommand = 1;
else if (strcmp("use_charnames_in_special", p) == 0)
use_charnames_in_special = 1;
+ else if (strcmp("image_generator", p) == 0) {
+ p = strtok(0, WS);
+ if (!p) {
+ t.error("image_generator command requires an argument");
+ return 0;
+ }
+ image_generator = strsave(p);
+ }
else if (strcmp("charset", p) == 0)
break;
else if (unknown_desc_command_handler) {
diff --git a/contrib/groff/src/libs/libgroff/fontfile.cpp b/contrib/groff/src/libs/libgroff/fontfile.cpp
index 8502d12..18d0b86 100644
--- a/contrib/groff/src/libs/libgroff/fontfile.cpp
+++ b/contrib/groff/src/libs/libgroff/fontfile.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -45,7 +45,9 @@ int font::spare2 = 0;
int font::sizescale = 1;
int font::tcommand = 0;
int font::pass_filenames = 0;
+int font::unscaled_charwidths = 0;
int font::use_charnames_in_special = 0;
+const char *font::image_generator = NULL;
const char **font::font_name_table = 0;
int *font::sizes = 0;
const char *font::family = 0;
@@ -57,10 +59,10 @@ void font::command_line_font_dir(const char *dir)
font_path.command_line_dir(dir);
}
-FILE *font::open_file(const char *name, char **pathp)
+FILE *font::open_file(const char *nm, char **pathp)
{
- char *filename = new char[strlen(name) + strlen(device) + 5];
- sprintf(filename, "dev%s/%s", device, name);
+ char *filename = new char[strlen(nm) + strlen(device) + 5];
+ sprintf(filename, "dev%s/%s", device, nm);
FILE *fp = font_path.open_file(filename, pathp);
a_delete filename;
return fp;
diff --git a/contrib/groff/src/libs/libgroff/geometry.cpp b/contrib/groff/src/libs/libgroff/geometry.cpp
index 256d266..7d96e5c 100644
--- a/contrib/groff/src/libs/libgroff/geometry.cpp
+++ b/contrib/groff/src/libs/libgroff/geometry.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Gaius Mulley <gaius@glam.ac.uk>
using adjust_arc_center() from printer.cpp, written by James Clark.
@@ -18,7 +18,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
@@ -113,174 +113,67 @@ int printer::adjust_arc_center(const int *p, double *c)
* Works out in which quadrant the arc starts and
* stops, and from this it determines the x, y
* max/min limits. The arc is drawn clockwise.
- *
- * [I'm sure there is a better way to do this, but
- * I don't know how. Please can someone let me
- * know or "improve" this function.]
*/
-void check_output_arc_limits(int x1, int y1,
- int xv1, int yv1,
- int xv2, int yv2,
- double c0, double c1,
+void check_output_arc_limits(int x_1, int y_1,
+ int xv_1, int yv_1,
+ int xv_2, int yv_2,
+ double c_0, double c_1,
int *minx, int *maxx,
int *miny, int *maxy)
{
- int radius = (int)sqrt(c0*c0 + c1*c1);
- int x2 = x1 + xv1 + xv2; // end of arc is (x2, y2)
- int y2 = y1 + yv1 + yv2;
-
- // firstly lets use the `circle' limitation
- *minx = x1 + xv1 - radius;
- *maxx = x1 + xv1 + radius;
- *miny = y1 + yv1 - radius;
- *maxy = y1 + yv1 + radius;
-
- /* now to see which min/max can be reduced and increased for the limits of
- * the arc
- *
- * Q2 | Q1
- * -----+-----
- * Q3 | Q4
- *
- *
- * NB. (x1+xv1, y1+yv1) is at the origin
- *
- * below we ask a nested question
- * (i) from which quadrant does the first vector start?
- * (ii) into which quadrant does the second vector go?
- * from the 16 possible answers we determine the limits of the arc
- */
- if (xv1 > 0 && yv1 > 0) {
- // first vector in Q3
- if (xv2 >= 0 && yv2 >= 0 ) {
- // second in Q1
- *maxx = x2;
- *miny = y1;
- }
- else if (xv2 < 0 && yv2 >= 0) {
- // second in Q2
- *maxx = x2;
- *miny = y1;
- }
- else if (xv2 >= 0 && yv2 < 0) {
- // second in Q4
- *miny = MIN(y1, y2);
- }
- else if (xv2 < 0 && yv2 < 0) {
- // second in Q3
- if (x1 >= x2) {
- *minx = x2;
- *maxx = x1;
- *miny = MIN(y1, y2);
- *maxy = MAX(y1, y2);
- }
- else {
- // xv2, yv2 could all be zero?
- }
- }
- }
- else if (xv1 > 0 && yv1 < 0) {
- // first vector in Q2
- if (xv2 >= 0 && yv2 >= 0) {
- // second in Q1
- *maxx = MAX(x1, x2);
- *minx = MIN(x1, x2);
- *miny = y1;
- }
- else if (xv2 < 0 && yv2 >= 0) {
- // second in Q2
- if (x1 < x2) {
- *maxx = x2;
- *minx = x1;
- *miny = MIN(y1, y2);
- *maxy = MAX(y1, y2);
- }
- else {
- // otherwise almost full circle anyway
- }
- }
- else if (xv2 >= 0 && yv2 < 0) {
- // second in Q4
- *miny = y2;
- *minx = x1;
- }
- else if (xv2 < 0 && yv2 < 0) {
- // second in Q3
- *minx = MIN(x1, x2);
- }
- }
- else if (xv1 <= 0 && yv1 <= 0) {
- // first vector in Q1
- if (xv2 >= 0 && yv2 >= 0) {
- // second in Q1
- if (x1 < x2) {
- *minx = x1;
- *maxx = x2;
- *miny = MIN(y1, y2);
- *maxy = MAX(y1, y2);
- }
- else {
- // nearly full circle
- }
- }
- else if (xv2 < 0 && yv2 >= 0) {
- // second in Q2
- *maxy = MAX(y1, y2);
- }
- else if (xv2 >= 0 && yv2 < 0) {
- // second in Q4
- *miny = MIN(y1, y2);
- *maxy = MAX(y1, y2);
- *minx = MIN(x1, x2);
- }
- else if (xv2 < 0 && yv2 < 0) {
- // second in Q3
- *minx = x2;
- *maxy = y1;
- }
- }
- else if (xv1 <= 0 && yv1 > 0) {
- // first vector in Q4
- if (xv2 >= 0 && yv2 >= 0) {
- // second in Q1
- *maxx = MAX(x1, x2);
- }
- else if (xv2 < 0 && yv2 >= 0) {
- // second in Q2
- *maxy = MAX(y1, y2);
- *maxx = MAX(x1, x2);
- }
- else if (xv2 >= 0 && yv2 < 0) {
- // second in Q4
- if (x1 >= x2) {
- *miny = MIN(y1, y2);
- *maxy = MAX(y1, y2);
- *minx = MIN(x1, x2);
- *maxx = MAX(x2, x2);
- }
- else {
- // nearly full circle
- }
- }
- else if (xv2 < 0 && yv2 < 0) {
- // second in Q3
- *maxy = MAX(y1, y2);
- *minx = MIN(x1, x2);
- *maxx = MAX(x1, x2);
- }
- }
-
- // this should *never* happen but if it does it means a case above is wrong
- // this code is only present for safety sake
- if (*maxx < *minx) {
- fprintf(stderr, "assert failed *minx > *maxx\n");
- fflush(stderr);
- *maxx = *minx;
- }
- if (*maxy < *miny) {
- fprintf(stderr, "assert failed *miny > *maxy\n");
- fflush(stderr);
- *maxy = *miny;
- }
+ int radius = (int)sqrt(c_0 * c_0 + c_1 * c_1);
+ // clockwise direction
+ int xcenter = x_1 + xv_1;
+ int ycenter = y_1 + yv_1;
+ int xend = xcenter + xv_2;
+ int yend = ycenter + yv_2;
+ // for convenience, transform to counterclockwise direction,
+ // centered at the origin
+ int xs = xend - xcenter;
+ int ys = yend - ycenter;
+ int xe = x_1 - xcenter;
+ int ye = y_1 - ycenter;
+ *minx = *maxx = xs;
+ *miny = *maxy = ys;
+ if (xe > *maxx)
+ *maxx = xe;
+ else if (xe < *minx)
+ *minx = xe;
+ if (ye > *maxy)
+ *maxy = ye;
+ else if (ye < *miny)
+ *miny = ye;
+ int qs, qe; // quadrants 0..3
+ if (xs >= 0)
+ qs = (ys >= 0) ? 0 : 3;
+ else
+ qs = (ys >= 0) ? 1 : 2;
+ if (xe >= 0)
+ qe = (ye >= 0) ? 0 : 3;
+ else
+ qe = (ye >= 0) ? 1 : 2;
+ // make qs always smaller than qe
+ if ((qs > qe)
+ || ((qs == qe) && (double(xs) * ye < double(xe) * ys)))
+ qe += 4;
+ for (int i = qs; i < qe; i++)
+ switch (i % 4) {
+ case 0:
+ *maxy = radius;
+ break;
+ case 1:
+ *minx = -radius;
+ break;
+ case 2:
+ *miny = -radius;
+ break;
+ case 3:
+ *maxx = radius;
+ break;
+ }
+ *minx += xcenter;
+ *maxx += xcenter;
+ *miny += ycenter;
+ *maxy += ycenter;
}
diff --git a/contrib/groff/src/libs/libgroff/getcwd.c b/contrib/groff/src/libs/libgroff/getcwd.c
index 7a769ff..d7443ec 100644
--- a/contrib/groff/src/libs/libgroff/getcwd.c
+++ b/contrib/groff/src/libs/libgroff/getcwd.c
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* Partial emulation of getcwd in terms of getwd. */
diff --git a/contrib/groff/src/libs/libgroff/glyphuni.cpp b/contrib/groff/src/libs/libgroff/glyphuni.cpp
new file mode 100644
index 0000000..4cd4917
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/glyphuni.cpp
@@ -0,0 +1,504 @@
+// -*- C++ -*-
+/* Copyright (C) 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ Written by Werner Lemberg <wl@gnu.org>
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "lib.h"
+#include "stringclass.h"
+#include "ptable.h"
+
+#include "unicode.h"
+
+struct glyph_to_unicode {
+ char *value;
+};
+
+declare_ptable(glyph_to_unicode)
+implement_ptable(glyph_to_unicode)
+
+PTABLE(glyph_to_unicode) glyph_to_unicode_table;
+
+struct S {
+ const char *key;
+ const char *value;
+} glyph_to_unicode_list[] = {
+ { "!", "0021" },
+ { "\"", "0022" },
+ { "dq", "0022" },
+ { "#", "0023" },
+ { "sh", "0023" },
+ { "$", "0024" },
+ { "Do", "0024" },
+ { "%", "0025" },
+ { "&", "0026" },
+ { "aq", "0027" },
+ { "(", "0028" },
+ { ")", "0029" },
+ { "*", "002A" },
+ { "+", "002B" },
+ { "pl", "002B" },
+ { ",", "002C" },
+ { ".", "002E" },
+ { "/", "002F" },
+ { "sl", "002F" },
+ { "0", "0030" },
+ { "1", "0031" },
+ { "2", "0032" },
+ { "3", "0033" },
+ { "4", "0034" },
+ { "5", "0035" },
+ { "6", "0036" },
+ { "7", "0037" },
+ { "8", "0038" },
+ { "9", "0039" },
+ { ":", "003A" },
+ { ";", "003B" },
+ { "<", "003C" },
+ { "=", "003D" },
+ { "eq", "003D" },
+ { ">", "003E" },
+ { "?", "003F" },
+ { "@", "0040" },
+ { "at", "0040" },
+ { "A", "0041" },
+ { "B", "0042" },
+ { "C", "0043" },
+ { "D", "0044" },
+ { "E", "0045" },
+ { "F", "0046" },
+ { "G", "0047" },
+ { "H", "0048" },
+ { "I", "0049" },
+ { "J", "004A" },
+ { "K", "004B" },
+ { "L", "004C" },
+ { "M", "004D" },
+ { "N", "004E" },
+ { "O", "004F" },
+ { "P", "0050" },
+ { "Q", "0051" },
+ { "R", "0052" },
+ { "S", "0053" },
+ { "T", "0054" },
+ { "U", "0055" },
+ { "V", "0056" },
+ { "W", "0057" },
+ { "X", "0058" },
+ { "Y", "0059" },
+ { "Z", "005A" },
+//{ "[", "005B" },
+ { "lB", "005B" },
+//{ "\\", "005C" },
+ { "rs", "005C" },
+//{ "]", "005D" },
+ { "rB", "005D" },
+ { "a^", "005E" },
+ { "^", "005E" },
+ { "ha", "005E" },
+ { "_", "005F" },
+ { "ru", "005F" },
+ { "ul", "005F" },
+//{ "\\`", "0060" },
+ { "ga", "0060" },
+ { "a", "0061" },
+ { "b", "0062" },
+ { "c", "0063" },
+ { "d", "0064" },
+ { "e", "0065" },
+ { "f", "0066" },
+ { "ff", "0066_0066" },
+ { "Fi", "0066_0066_0069" },
+ { "Fl", "0066_0066_006C" },
+ { "fi", "0066_0069" },
+ { "fl", "0066_006C" },
+ { "g", "0067" },
+ { "h", "0068" },
+ { "i", "0069" },
+ { "j", "006A" },
+ { "k", "006B" },
+ { "l", "006C" },
+ { "m", "006D" },
+ { "n", "006E" },
+ { "o", "006F" },
+ { "p", "0070" },
+ { "q", "0071" },
+ { "r", "0072" },
+ { "s", "0073" },
+ { "t", "0074" },
+ { "u", "0075" },
+ { "v", "0076" },
+ { "w", "0077" },
+ { "x", "0078" },
+ { "y", "0079" },
+ { "z", "007A" },
+ { "lC", "007B" },
+ { "{", "007B" },
+ { "ba", "007C" },
+ { "or", "007C" },
+ { "|", "007C" },
+ { "rC", "007D" },
+ { "}", "007D" },
+ { "a~", "007E" },
+ { "~", "007E" },
+ { "ti", "007E" },
+ { "r!", "00A1" },
+ { "ct", "00A2" },
+ { "Po", "00A3" },
+ { "Cs", "00A4" },
+ { "Ye", "00A5" },
+ { "bb", "00A6" },
+ { "sc", "00A7" },
+ { "ad", "00A8" },
+ { "co", "00A9" },
+ { "Of", "00AA" },
+ { "Fo", "00AB" },
+ { "no", "00AC" },
+ { "tno", "00AC" },
+ { "shc", "00AD" },
+ { "rg", "00AE" },
+ { "a-", "00AF" },
+ { "de", "00B0" },
+ { "+-", "00B1" },
+ { "t+-", "00B1" },
+ { "S2", "00B2" },
+ { "S3", "00B3" },
+ { "aa", "00B4" },
+//{ "\\'", "00B4" },
+ { "mc", "00B5" },
+ { "ps", "00B6" },
+ { "pc", "00B7" },
+ { "ac", "00B8" },
+ { "S1", "00B9" },
+ { "Om", "00BA" },
+ { "Fc", "00BB" },
+ { "14", "00BC" },
+ { "12", "00BD" },
+ { "34", "00BE" },
+ { "r?", "00BF" },
+ { "`A", "00C0" },
+ { "'A", "00C1" },
+ { "^A", "00C2" },
+ { "~A", "00C3" },
+ { ":A", "00C4" },
+ { "oA", "00C5" },
+ { "AE", "00C6" },
+ { ",C", "00C7" },
+ { "`E", "00C8" },
+ { "'E", "00C9" },
+ { "^E", "00CA" },
+ { ":E", "00CB" },
+ { "`I", "00CC" },
+ { "'I", "00CD" },
+ { "^I", "00CE" },
+ { ":I", "00CF" },
+ { "-D", "00D0" },
+ { "~N", "00D1" },
+ { "`O", "00D2" },
+ { "'O", "00D3" },
+ { "^O", "00D4" },
+ { "~O", "00D5" },
+ { ":O", "00D6" },
+ { "mu", "00D7" },
+ { "tmu", "00D7" },
+ { "/O", "00D8" },
+ { "`U", "00D9" },
+ { "'U", "00DA" },
+ { "^U", "00DB" },
+ { ":U", "00DC" },
+ { "'Y", "00DD" },
+ { "TP", "00DE" },
+ { "ss", "00DF" },
+ { "`a", "00E0" },
+ { "'a", "00E1" },
+ { "^a", "00E2" },
+ { "~a", "00E3" },
+ { ":a", "00E4" },
+ { "oa", "00E5" },
+ { "ae", "00E6" },
+ { ",c", "00E7" },
+ { "`e", "00E8" },
+ { "'e", "00E9" },
+ { "^e", "00EA" },
+ { ":e", "00EB" },
+ { "`i", "00EC" },
+ { "'i", "00ED" },
+ { "^i", "00EE" },
+ { ":i", "00EF" },
+ { "Sd", "00F0" },
+ { "~n", "00F1" },
+ { "`o", "00F2" },
+ { "'o", "00F3" },
+ { "^o", "00F4" },
+ { "~o", "00F5" },
+ { ":o", "00F6" },
+ { "di", "00F7" },
+ { "tdi", "00F7" },
+ { "/o", "00F8" },
+ { "`u", "00F9" },
+ { "'u", "00FA" },
+ { "^u", "00FB" },
+ { ":u", "00FC" },
+ { "'y", "00FD" },
+ { "Tp", "00FE" },
+ { ":y", "00FF" },
+ { "'C", "0106" },
+ { "'c", "0107" },
+ { ".i", "0131" },
+ { "IJ", "0132" },
+ { "ij", "0133" },
+ { "/L", "0141" },
+ { "/l", "0142" },
+ { "OE", "0152" },
+ { "oe", "0153" },
+ { "vS", "0160" },
+ { "vs", "0161" },
+ { ":Y", "0178" },
+ { "vZ", "017D" },
+ { "vz", "017E" },
+ { "Fn", "0192" },
+ { "ah", "02C7" },
+ { "ab", "02D8" },
+ { "a.", "02D9" },
+ { "ao", "02DA" },
+ { "ho", "02DB" },
+ { "a\"", "02DD" },
+ { "*A", "0391" },
+ { "*B", "0392" },
+ { "*G", "0393" },
+ { "*D", "0394" },
+ { "*E", "0395" },
+ { "*Z", "0396" },
+ { "*Y", "0397" },
+ { "*H", "0398" },
+ { "*I", "0399" },
+ { "*K", "039A" },
+ { "*L", "039B" },
+ { "*M", "039C" },
+ { "*N", "039D" },
+ { "*C", "039E" },
+ { "*O", "039F" },
+ { "*P", "03A0" },
+ { "*R", "03A1" },
+ { "*S", "03A3" },
+ { "*T", "03A4" },
+ { "*U", "03A5" },
+ { "*F", "03A6" },
+ { "*X", "03A7" },
+ { "*Q", "03A8" },
+ { "*W", "03A9" },
+ { "*a", "03B1" },
+ { "*b", "03B2" },
+ { "*g", "03B3" },
+ { "*d", "03B4" },
+ { "*e", "03B5" },
+ { "*z", "03B6" },
+ { "*y", "03B7" },
+ { "*h", "03B8" },
+ { "*i", "03B9" },
+ { "*k", "03BA" },
+ { "*l", "03BB" },
+ { "*m", "03BC" },
+ { "*n", "03BD" },
+ { "*c", "03BE" },
+ { "*o", "03BF" },
+ { "*p", "03C0" },
+ { "*r", "03C1" },
+ { "ts", "03C2" },
+ { "*s", "03C3" },
+ { "*t", "03C4" },
+ { "*u", "03C5" },
+ { "*f", "03C6" },
+ { "*x", "03C7" },
+ { "*q", "03C8" },
+ { "*w", "03C9" },
+ { "+h", "03D1" },
+ { "+f", "03D5" },
+ { "+p", "03D6" },
+ { "+e", "03F5" },
+ { "-", "2010" },
+ { "hy", "2010" },
+ { "en", "2013" },
+ { "em", "2014" },
+ { "`", "2018" },
+ { "oq", "2018" },
+ { "'", "2019" },
+ { "cq", "2019" },
+ { "bq", "201A" },
+ { "lq", "201C" },
+ { "rq", "201D" },
+ { "Bq", "201E" },
+ { "dg", "2020" },
+ { "dd", "2021" },
+ { "bu", "2022" },
+ { "%0", "2030" },
+ { "fm", "2032" },
+ { "sd", "2033" },
+ { "fo", "2039" },
+ { "fc", "203A" },
+ { "rn", "203E" },
+ { "f/", "2044" },
+ { "eu", "20AC" },
+ { "Eu", "20AC" },
+ { "-h", "210F" },
+ { "hbar", "210F" },
+ { "Im", "2111" },
+ { "wp", "2118" },
+ { "Re", "211C" },
+ { "tm", "2122" },
+ { "Ah", "2135" },
+ { "18", "215B" },
+ { "38", "215C" },
+ { "58", "215D" },
+ { "78", "215E" },
+ { "<-", "2190" },
+ { "ua", "2191" },
+ { "->", "2192" },
+ { "da", "2193" },
+ { "<>", "2194" },
+ { "va", "2195" },
+ { "CR", "21B5" },
+ { "lA", "21D0" },
+ { "uA", "21D1" },
+ { "rA", "21D2" },
+ { "dA", "21D3" },
+ { "hA", "21D4" },
+ { "vA", "21D5" },
+ { "fa", "2200" },
+ { "pd", "2202" },
+ { "te", "2203" },
+ { "es", "2205" },
+ { "gr", "2207" },
+ { "mo", "2208" },
+ { "nm", "2209" },
+ { "st", "220B" },
+ { "product", "220F" },
+ { "coproduct", "2210" },
+ { "sum", "2211" },
+//{ "\\-", "2212" },
+ { "mi", "2212" },
+ { "-+", "2213" },
+ { "**", "2217" },
+ { "sr", "221A" },
+ { "pt", "221D" },
+ { "if", "221E" },
+ { "/_", "2220" },
+ { "AN", "2227" },
+ { "OR", "2228" },
+ { "ca", "2229" },
+ { "cu", "222A" },
+ { "is", "222B" },
+ { "integral", "222B" },
+ { "tf", "2234" },
+ { "3d", "2234" },
+ { "ap", "223C" },
+ { "|=", "2243" },
+ { "=~", "2245" },
+ { "~~", "2248" },
+ { "~=", "2248" },
+ { "!=", "2260" },
+ { "==", "2261" },
+ { "ne", "2262" },
+ { "<=", "2264" },
+ { ">=", "2265" },
+ { ">>", "226A" },
+ { "<<", "226B" },
+ { "sb", "2282" },
+ { "sp", "2283" },
+ { "nb", "2284" },
+ { "nc", "2285" },
+ { "ib", "2286" },
+ { "ip", "2287" },
+ { "c+", "2295" },
+ { "c*", "2297" },
+ { "pp", "22A5" },
+ { "md", "22C5" },
+ { "lc", "2308" },
+ { "rc", "2309" },
+ { "lf", "230A" },
+ { "rf", "230B" },
+ { "parenlefttp", "239B" },
+ { "parenleftex", "239C" },
+ { "parenleftbt", "239D" },
+ { "parenrighttp", "239E" },
+ { "parenrightex", "239F" },
+ { "parenrightbt", "23A0" },
+ { "bracketlefttp", "23A1" },
+ { "bracketleftex", "23A2" },
+ { "bracketleftbt", "23A3" },
+ { "bracketrighttp", "23A4" },
+ { "bracketrightex", "23A5" },
+ { "bracketrightbt", "23A6" },
+ { "lt", "23A7" },
+ { "bracelefttp", "23A7" },
+ { "lk", "23A8" },
+ { "braceleftmid", "23A8" },
+ { "lb", "23A9" },
+ { "braceleftbt", "23A9" },
+ { "bv", "23AA" },
+ { "braceex", "23AA" },
+ { "braceleftex", "23AA" },
+ { "bracerightex", "23AA" },
+ { "rt", "23AB" },
+ { "bracerighttp", "23AB" },
+ { "rk", "23AC" },
+ { "bracerightmid", "23AC" },
+ { "rb", "23AD" },
+ { "bracerightbt", "23AD" },
+ { "an", "23AF" },
+ { "br", "2502" },
+ { "rk", "251D" },
+ { "lk", "2525" },
+ { "lt", "256D" },
+ { "rt", "256E" },
+ { "rb", "256F" },
+ { "lb", "2570" },
+ { "sq", "25A1" },
+ { "lz", "25CA" },
+ { "ci", "25CB" },
+ { "lh", "261C" },
+ { "rh", "261E" },
+ { "SP", "2660" },
+ { "CL", "2663" },
+ { "HE", "2665" },
+ { "DI", "2666" },
+ { "OK", "2713" },
+ { "la", "27E8" },
+ { "ra", "27E9" },
+};
+
+// global constructor
+static struct glyph_to_unicode_init {
+ glyph_to_unicode_init();
+} _glyph_to_unicode_init;
+
+glyph_to_unicode_init::glyph_to_unicode_init() {
+ for (unsigned int i = 0;
+ i < sizeof(glyph_to_unicode_list)/sizeof(glyph_to_unicode_list[0]);
+ i++) {
+ glyph_to_unicode *gtu = new glyph_to_unicode[1];
+ gtu->value = (char *)glyph_to_unicode_list[i].value;
+ glyph_to_unicode_table.define(glyph_to_unicode_list[i].key, gtu);
+ }
+}
+
+const char *glyph_name_to_unicode(const char *s)
+{
+ glyph_to_unicode *result = glyph_to_unicode_table.lookup(s);
+ return result ? result->value : 0;
+}
diff --git a/contrib/groff/src/libs/libgroff/htmlhint.cpp b/contrib/groff/src/libs/libgroff/htmlhint.cpp
index 3015767..6ade077 100644
--- a/contrib/groff/src/libs/libgroff/htmlhint.cpp
+++ b/contrib/groff/src/libs/libgroff/htmlhint.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/libs/libgroff/hypot.cpp b/contrib/groff/src/libs/libgroff/hypot.cpp
new file mode 100644
index 0000000..6d2606d
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/hypot.cpp
@@ -0,0 +1,40 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <math.h>
+
+#ifdef NEED_DECLARATION_HYPOT
+ double hypot(double, double);
+#endif /* NEED_DECLARATION_HYPOT */
+
+double groff_hypot(double x, double y)
+{
+ double result = hypot(x, y);
+
+#ifdef __INTERIX
+ /* hypot() on Interix is broken */
+ if (isnan(result) && !isnan(x) && !isnan(y))
+ return 0.0;
+#endif
+
+ return result;
+}
diff --git a/contrib/groff/src/libs/libgroff/iftoa.c b/contrib/groff/src/libs/libgroff/iftoa.c
index 29a3d89..d1751c57c 100644
--- a/contrib/groff/src/libs/libgroff/iftoa.c
+++ b/contrib/groff/src/libs/libgroff/iftoa.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,12 +16,15 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define INT_DIGITS 19 /* enough for 64-bit integer */
-char *if_to_a(i, decimal_point)
- int i, decimal_point;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *if_to_a(int i, int decimal_point)
{
/* room for a -, INT_DIGITS digits, a decimal point, and a terminating '\0' */
static char buf[INT_DIGITS + 3];
@@ -63,3 +67,7 @@ char *if_to_a(i, decimal_point)
}
return p;
}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/groff/src/libs/libgroff/itoa.c b/contrib/groff/src/libs/libgroff/itoa.c
index 245c7df..85fb68b 100644
--- a/contrib/groff/src/libs/libgroff/itoa.c
+++ b/contrib/groff/src/libs/libgroff/itoa.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -16,13 +16,16 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define INT_DIGITS 19 /* enough for 64 bit integer */
#define UINT_DIGITS 20
-char *i_to_a(i)
- int i;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *i_to_a(int i)
{
/* Room for INT_DIGITS digits, - and '\0' */
static char buf[INT_DIGITS + 2];
@@ -44,8 +47,7 @@ char *i_to_a(i)
return p;
}
-char *ui_to_a(i)
- unsigned int i;
+char *ui_to_a(unsigned int i)
{
/* Room for UINT_DIGITS digits and '\0' */
static char buf[UINT_DIGITS + 1];
@@ -56,3 +58,7 @@ char *ui_to_a(i)
} while (i != 0);
return p;
}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/groff/src/libs/libgroff/lf.cpp b/contrib/groff/src/libs/libgroff/lf.cpp
index 34272c7..3254fcf 100644
--- a/contrib/groff/src/libs/libgroff/lf.cpp
+++ b/contrib/groff/src/libs/libgroff/lf.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,10 +16,11 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <string.h>
#include <ctype.h>
+
+#include "lib.h"
#include "cset.h"
#include "stringclass.h"
diff --git a/contrib/groff/src/libs/libgroff/macropath.cpp b/contrib/groff/src/libs/libgroff/macropath.cpp
index 03c04cb..2c09fd7 100644
--- a/contrib/groff/src/libs/libgroff/macropath.cpp
+++ b/contrib/groff/src/libs/libgroff/macropath.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
#include "searchpath.h"
diff --git a/contrib/groff/src/libs/libgroff/matherr.c b/contrib/groff/src/libs/libgroff/matherr.c
index 757a540..2a65e18 100644
--- a/contrib/groff/src/libs/libgroff/matherr.c
+++ b/contrib/groff/src/libs/libgroff/matherr.c
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/contrib/groff/src/libs/libgroff/maxfilename.cpp b/contrib/groff/src/libs/libgroff/maxfilename.cpp
index 25f5549..9215cd9 100644
--- a/contrib/groff/src/libs/libgroff/maxfilename.cpp
+++ b/contrib/groff/src/libs/libgroff/maxfilename.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2001, 2003, 2005 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* file_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
@@ -37,10 +37,6 @@ size_t file_name_max(const char *fname)
#else /* not _POSIX_VERSION */
-#ifdef HAVE_CC_LIMITS_H
-#include <limits.h>
-#endif /* HAVE_CC_LIMITS_H */
-
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#else /* not HAVE_DIRENT_H */
diff --git a/contrib/groff/src/libs/libgroff/maxpathname.cpp b/contrib/groff/src/libs/libgroff/maxpathname.cpp
new file mode 100644
index 0000000..7bca55c
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/maxpathname.cpp
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+ Written by Werner Lemberg (wl@gnu.org)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* path_name_max(dir) does the same as pathconf(dir, _PC_PATH_MAX) */
+
+#include "lib.h"
+
+#include <sys/types.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef _POSIX_VERSION
+
+size_t path_name_max()
+{
+ return pathconf("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf("/",_PC_PATH_MAX);
+}
+
+#else /* not _POSIX_VERSION */
+
+#include <stdlib.h>
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+#endif /* not HAVE_DIRENT_H */
+
+#ifndef PATH_MAX
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else /* !MAXPATHLEN */
+# ifdef MAX_PATH
+# define PATH_MAX MAX_PATH
+# else /* !MAX_PATH */
+# ifdef _MAX_PATH
+# define PATH_MAX _MAX_PATH
+# else /* !_MAX_PATH */
+# define PATH_MAX 255
+# endif /* !_MAX_PATH */
+# endif /* !MAX_PATH */
+# endif /* !MAXPATHLEN */
+#endif /* !PATH_MAX */
+
+size_t path_name_max()
+{
+ return PATH_MAX;
+}
+
+#endif /* not _POSIX_VERSION */
diff --git a/contrib/groff/src/libs/libgroff/mksdir.cpp b/contrib/groff/src/libs/libgroff/mksdir.cpp
index bf4d300..472bd9e 100644
--- a/contrib/groff/src/libs/libgroff/mksdir.cpp
+++ b/contrib/groff/src/libs/libgroff/mksdir.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is heavily based on the file mkstemp.c which is part of the
diff --git a/contrib/groff/src/libs/libgroff/mkstemp.cpp b/contrib/groff/src/libs/libgroff/mkstemp.cpp
index cd2717c..3279d77 100644
--- a/contrib/groff/src/libs/libgroff/mkstemp.cpp
+++ b/contrib/groff/src/libs/libgroff/mkstemp.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is heavily based on the file mkstemp.c which is part of the
diff --git a/contrib/groff/src/libs/libgroff/nametoindex.cpp b/contrib/groff/src/libs/libgroff/nametoindex.cpp
index def26b3..e4dacff 100644
--- a/contrib/groff/src/libs/libgroff/nametoindex.cpp
+++ b/contrib/groff/src/libs/libgroff/nametoindex.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -107,9 +107,9 @@ int font::name_to_index(const char *s)
return indexer.ascii_char_index(s[0]);
/* char128 and \200 are synonyms */
if (s[0] == 'c' && s[1] == 'h' && s[2] == 'a' && s[3] == 'r') {
- char *res;
- long n = strtol(s + 4, &res, 10);
- if (res != s + 4 && *res == '\0' && n >= 0 && n < 256)
+ char *val;
+ long n = strtol(s + 4, &val, 10);
+ if (val != s + 4 && *val == '\0' && n >= 0 && n < 256)
return indexer.ascii_char_index((unsigned char)n);
}
return indexer.named_char_index(s);
diff --git a/contrib/groff/src/libs/libgroff/new.cpp b/contrib/groff/src/libs/libgroff/new.cpp
index 739cffa..84393fd 100644
--- a/contrib/groff/src/libs/libgroff/new.cpp
+++ b/contrib/groff/src/libs/libgroff/new.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -26,7 +26,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "posix.h"
#include "nonposix.h"
-extern const char *program_name;
+extern "C" const char *program_name;
static void ewrite(const char *s)
{
diff --git a/contrib/groff/src/libs/libgroff/paper.cpp b/contrib/groff/src/libs/libgroff/paper.cpp
index db8f5bc..4f114f4 100644
--- a/contrib/groff/src/libs/libgroff/paper.cpp
+++ b/contrib/groff/src/libs/libgroff/paper.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2002, 2003
+/* Copyright (C) 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Werner Lemberg (wl@gnu.org)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
#include "paper.h"
@@ -49,14 +49,14 @@ static void add_iso_paper(char series, int offset,
}
// length and width in inch
-static void add_american_paper(const char *name, int index,
+static void add_american_paper(const char *name, int idx,
double length, double width )
{
char *p = new char[strlen(name) + 1];
strcpy(p, name);
- papersizes[index].name = p;
- papersizes[index].length = length;
- papersizes[index].width = width;
+ papersizes[idx].name = p;
+ papersizes[idx].length = length;
+ papersizes[idx].width = width;
}
int papersize_init::initialised = 0;
diff --git a/contrib/groff/src/libs/libgroff/progname.c b/contrib/groff/src/libs/libgroff/progname.c
new file mode 100644
index 0000000..a70e341
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/progname.c
@@ -0,0 +1 @@
+const char *program_name = 0;
diff --git a/contrib/groff/src/libs/libgroff/ptable.cpp b/contrib/groff/src/libs/libgroff/ptable.cpp
index 76735c2..bde2c3c 100644
--- a/contrib/groff/src/libs/libgroff/ptable.cpp
+++ b/contrib/groff/src/libs/libgroff/ptable.cpp
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "ptable.h"
#include "errarg.h"
diff --git a/contrib/groff/src/libs/libgroff/quotearg.c b/contrib/groff/src/libs/libgroff/quotearg.c
new file mode 100644
index 0000000..0ab3dc6
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/quotearg.c
@@ -0,0 +1,209 @@
+/* Copyright (C) 2004
+ Free Software Foundation, Inc.
+ Written by: Jeff Conrad (jeff_conrad@msn.com)
+ and Keith Marshall (keith.d.marshall@ntlworld.com)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+
+/* Define the default mechanism, and messages, for error reporting
+ * (user may substitute a preferred alternative, by defining his own
+ * implementation of the macros REPORT_ERROR, QUOTE_ARG_MALLOC_FAILED
+ * and QUOTE_ARG_REALLOC_FAILED, in the header file `nonposix.h').
+ */
+
+#include "nonposix.h"
+
+#ifndef REPORT_ERROR
+# define REPORT_ERROR(WHY) fprintf(stderr, "%s:%s\n", program_name, WHY)
+#endif
+#ifndef QUOTE_ARG_MALLOC_ERROR
+# define QUOTE_ARG_MALLOC_ERROR "malloc: Buffer allocation failed"
+#endif
+#ifndef QUOTE_ARG_REALLOC_ERROR
+# define QUOTE_ARG_REALLOC_ERROR "realloc: Buffer resize failed"
+#endif
+
+extern char *program_name; /* main program must define this */
+
+#undef FALSE
+#undef TRUE
+#define FALSE 0
+#define TRUE 1
+
+static int
+needs_quoting(const char *string)
+{
+ /* Scan `string' to see whether it needs quoting for MSVC `spawn'/`exec'
+ * (i.e., whether it contains whitespace or embedded quotes).
+ */
+
+ if (string == NULL) /* ignore NULL strings */
+ return FALSE;
+
+ if (*string == '\0') /* explicit arguments of zero length */
+ return TRUE; /* need quoting, so they aren't discarded */
+
+ while (*string) {
+ /* Scan non-NULL strings, up to '\0' terminator,
+ * returning 'TRUE' if quote or white space found.
+ */
+
+ if (*string == '"' || isspace(*string))
+ return TRUE;
+
+ /* otherwise, continue scanning to end of string */
+
+ ++string;
+ }
+
+ /* Fall through, if no quotes or white space found,
+ * in which case, return `FALSE'.
+ */
+
+ return FALSE;
+}
+
+char *
+quote_arg(char *string)
+{
+ /* Enclose arguments in double quotes so that the parsing done in the
+ * MSVC runtime startup code doesn't split them at whitespace. Escape
+ * embedded double quotes so that they emerge intact from the parsing.
+ */
+
+ int backslashes;
+ char *quoted, *p, *q;
+
+ if (needs_quoting(string)) {
+ /* Need to create a quoted copy of `string';
+ * maximum buffer space needed is twice the original length,
+ * plus two enclosing quotes and one `\0' terminator.
+ */
+
+ if ((quoted = (char *)malloc(2 * strlen(string) + 3)) == NULL) {
+ /* Couldn't get a buffer for the quoted string,
+ * so complain, and bail out gracefully.
+ */
+
+ REPORT_ERROR(QUOTE_ARG_MALLOC_ERROR);
+ exit(1);
+ }
+
+ /* Ok to proceed:
+ * insert the opening quote, then copy the source string,
+ * adding escapes as required.
+ */
+
+ *quoted = '"';
+ for (backslashes = 0, p = string, q = quoted; *p; p++) {
+ if (*p == '\\') {
+ /* Just count backslashes when we find them.
+ * We will copy them out later, when we know if the count
+ * needs to be adjusted, to escape an embedded quote.
+ */
+
+ ++backslashes;
+ }
+ else if (*p == '"') {
+ /* This embedded quote character must be escaped,
+ * but first double up any immediately preceding backslashes,
+ * with one extra, as the escape character.
+ */
+
+ for (backslashes += backslashes + 1; backslashes; backslashes--)
+ *++q = '\\';
+
+ /* and now, add the quote character itself */
+
+ *++q = '"';
+ }
+ else {
+ /* Any other character is simply copied,
+ * but first, if we have any pending backslashes,
+ * we must now insert them, without any count adjustment.
+ */
+
+ while (backslashes) {
+ *++q = '\\';
+ --backslashes;
+ }
+
+ /* and then, copy the current character */
+
+ *++q = *p;
+ }
+ }
+
+ /* At end of argument:
+ * If any backslashes remain to be copied out, append them now,
+ * doubling the actual count to protect against reduction by MSVC,
+ * as a consequence of the immediately following closing quote.
+ */
+
+ for (backslashes += backslashes; backslashes; backslashes--)
+ *++q = '\\';
+
+ /* Finally,
+ * add the closing quote, terminate the quoted string,
+ * and adjust its size to what was actually required,
+ * ready for return.
+ */
+
+ *++q = '"';
+ *++q = '\0';
+ if ((string = (char *)realloc(quoted, strlen(quoted) + 1)) == NULL) {
+ /* but bail out gracefully, on error */
+
+ REPORT_ERROR(QUOTE_ARG_REALLOC_ERROR);
+ exit(1);
+ }
+ }
+
+ /* `string' now refers to the argument,
+ * quoted and escaped, as required.
+ */
+
+ return string;
+}
+
+void
+purge_quoted_args(char **argv)
+{
+ /* To avoid memory leaks,
+ * free all memory previously allocated by `quoted_arg()',
+ * within the scope of the referring argument vector, `argv'.
+ */
+
+ if (argv)
+ while (*argv) {
+ /* Any argument beginning with a double quote
+ * SHOULD have been allocated by `quoted_arg()'.
+ */
+
+ if (**argv == '"')
+ free( *argv ); /* so free its allocation */
+ ++argv; /* and continue to the next argument */
+ }
+}
+
+/* quotearg.c: end of file */
diff --git a/contrib/groff/src/libs/libgroff/relocate.cpp b/contrib/groff/src/libs/libgroff/relocate.cpp
new file mode 100644
index 0000000..5aace8b
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/relocate.cpp
@@ -0,0 +1,238 @@
+// -*- C++ -*-
+/* Provide relocation for macro and font files.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+// Made after relocation code in kpathsea and gettext.
+
+#include "lib.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+#include "defs.h"
+#include "posix.h"
+#include "nonposix.h"
+#include "relocate.h"
+
+#if defined _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#define INSTALLPATHLEN (sizeof(INSTALLPATH) - 1)
+#ifndef DEBUG
+# define DEBUG 0
+#endif
+
+extern "C" const char *program_name;
+
+// The prefix (parent directory) corresponding to the binary.
+char *curr_prefix = 0;
+size_t curr_prefix_len = 0;
+
+// Return the directory part of a filename, or `.' if no path separators.
+char *xdirname(char *s)
+{
+ static const char dot[] = ".";
+ if (!s)
+ return 0;
+ // DIR_SEPS[] are possible directory separator characters, see nonposix.h.
+ // We want the rightmost separator of all possible ones.
+ // Example: d:/foo\\bar.
+ char *p = strrchr(s, DIR_SEPS[0]);
+ const char *sep = &DIR_SEPS[1];
+ while (*sep) {
+ char *p1 = strrchr(s, *sep);
+ if (p1 && (!p || p1 > p))
+ p = p1;
+ sep++;
+ }
+ if (p)
+ *p = '\0';
+ else
+ s = (char *)dot;
+ return s;
+}
+
+// Return the full path of NAME along the path PATHP.
+// Adapted from search_path::open_file in searchpath.cpp.
+char *searchpath(const char *name, const char *pathp)
+{
+ char *path;
+ if (!name || !*name)
+ return 0;
+#if DEBUG
+ fprintf(stderr, "searchpath: pathp: `%s'\n", pathp);
+ fprintf(stderr, "searchpath: trying `%s'\n", name);
+#endif
+ // Try first NAME as such; success if NAME is an absolute filename,
+ // or if NAME is found in the current directory.
+ if (!access (name, F_OK)) {
+ path = new char[path_name_max()];
+#ifdef _WIN32
+ path = _fullpath(path, name, path_name_max());
+#else
+ path = realpath(name, path);
+#endif
+#if DEBUG
+ fprintf(stderr, "searchpath: found `%s'\n", path);
+#endif
+ return path;
+ }
+ // Secondly, try the current directory.
+ // Now search along PATHP.
+ size_t namelen = strlen(name);
+ char *p = (char *)pathp;
+ for (;;) {
+ char *end = strchr(p, PATH_SEP_CHAR);
+ if (!end)
+ end = strchr(p, '\0');
+ int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
+ path = new char[end - p + need_slash + namelen + 1];
+ memcpy(path, p, end - p);
+ if (need_slash)
+ path[end - p] = '/';
+ strcpy(path + (end - p) + need_slash, name);
+#if DEBUG
+ fprintf(stderr, "searchpath: trying `%s'\n", path);
+#endif
+ if (!access(path, F_OK)) {
+#if DEBUG
+ fprintf(stderr, "searchpath: found `%s'\n", name);
+#endif
+ return path;
+ }
+ a_delete path;
+ if (*end == '\0')
+ break;
+ p = end + 1;
+ }
+ return 0;
+}
+
+// Search NAME along PATHP with the elements of PATHEXT in turn added.
+char *searchpathext(const char *name, const char *pathext, const char *pathp)
+{
+ char *found = 0;
+ char *tmpathext = strsave(pathext); // strtok modifies this string,
+ // so make a copy
+ char *ext = strtok(tmpathext, PATH_SEP);
+ while (ext) {
+ char *namex = new char[strlen(name) + strlen(ext) + 1];
+ strcpy(namex, name);
+ strcat(namex, ext);
+ found = searchpath(namex, pathp);
+ a_delete namex;
+ if (found)
+ break;
+ ext = strtok(0, PATH_SEP);
+ }
+ a_delete tmpathext;
+ return found;
+}
+
+// Convert an MS path to a POSIX path.
+char *msw2posixpath(char *path)
+{
+ char *s = path;
+ while (*s) {
+ if (*s == '\\')
+ *s = '/';
+ *s++;
+ }
+ return path;
+}
+
+// Compute the current prefix.
+void set_current_prefix()
+{
+ char *pathextstr;
+ curr_prefix = new char[path_name_max()];
+ // Obtain the full path of the current binary;
+ // using GetModuleFileName on MS-Windows,
+ // and searching along PATH on other systems.
+#ifdef _WIN32
+ int len = GetModuleFileName(0, curr_prefix, path_name_max());
+ if (len)
+ len = GetShortPathName(curr_prefix, curr_prefix, path_name_max());
+# if DEBUG
+ fprintf(stderr, "curr_prefix: %s\n", curr_prefix);
+# endif /* DEBUG */
+#else /* !_WIN32 */
+ curr_prefix = searchpath(program_name, getenv("PATH"));
+ if (!curr_prefix && !strchr(program_name, '.')) { // try with extensions
+ pathextstr = strsave(getenv("PATHEXT"));
+ if (!pathextstr)
+ pathextstr = strsave(PATH_EXT);
+ curr_prefix = searchpathext(program_name, pathextstr, getenv("PATH"));
+ a_delete pathextstr;
+ }
+ if (!curr_prefix)
+ return;
+#endif /* !_WIN32 */
+ msw2posixpath(curr_prefix);
+#if DEBUG
+ fprintf(stderr, "curr_prefix: %s\n", curr_prefix);
+#endif
+ curr_prefix = xdirname(curr_prefix); // directory of executable
+ curr_prefix = xdirname(curr_prefix); // parent directory of executable
+ curr_prefix_len = strlen(curr_prefix);
+#if DEBUG
+ fprintf(stderr, "curr_prefix: %s\n", curr_prefix);
+ fprintf(stderr, "curr_prefix_len: %d\n", curr_prefix_len);
+#endif
+}
+
+// Strip the installation prefix and replace it
+// with the current installation prefix; return the relocated path.
+char *relocatep(const char *path)
+{
+#if DEBUG
+ fprintf(stderr, "relocatep: path = %s\n", path);
+ fprintf(stderr, "relocatep: INSTALLPATH = %s\n", INSTALLPATH);
+ fprintf(stderr, "relocatep: INSTALLPATHLEN = %d\n", INSTALLPATHLEN);
+#endif
+ if (!curr_prefix)
+ set_current_prefix();
+ if (strncmp(INSTALLPATH, path, INSTALLPATHLEN))
+ return strsave(path);
+ char *relative_path = (char *)path + INSTALLPATHLEN;
+ size_t relative_path_len = strlen(relative_path);
+ char *relocated_path = new char[curr_prefix_len + relative_path_len + 1];
+ strcpy(relocated_path, curr_prefix);
+ strcat(relocated_path, relative_path);
+#if DEBUG
+ fprintf(stderr, "relocated_path: %s\n", relocated_path);
+#endif /* DEBUG */
+ return relocated_path;
+}
+
+// Return the original pathname if it exists;
+// otherwise return the relocated path.
+char *relocate(const char *path)
+{
+ char *p;
+ if (access(path, F_OK))
+ p = relocatep(path);
+ else
+ p = strsave(path);
+#if DEBUG
+ fprintf (stderr, "relocate: %s\n", p);
+#endif
+ return p;
+}
diff --git a/contrib/groff/src/libs/libgroff/searchpath.cpp b/contrib/groff/src/libs/libgroff/searchpath.cpp
index 1f8b233..6b9b81c 100644
--- a/contrib/groff/src/libs/libgroff/searchpath.cpp
+++ b/contrib/groff/src/libs/libgroff/searchpath.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,16 +17,23 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
#include <stdlib.h>
#include <assert.h>
+#include <errno.h>
#include "searchpath.h"
#include "nonposix.h"
+#ifdef _WIN32
+# include "relocate.h"
+#else
+# define relocate(path) strsave(path)
+#endif
+
search_path::search_path(const char *envvar, const char *standard,
int add_home, int add_current)
{
@@ -75,11 +82,11 @@ void search_path::command_line_dir(const char *s)
char *p = dirs;
p += old_len - init_len;
if (init_len == 0)
- *p++ = PATH_SEP[0];
+ *p++ = PATH_SEP_CHAR;
memcpy(p, s, slen);
p += slen;
if (init_len > 0) {
- *p++ = PATH_SEP[0];
+ *p++ = PATH_SEP_CHAR;
memcpy(p, old + old_len - init_len, init_len);
p += init_len;
}
@@ -103,15 +110,20 @@ FILE *search_path::open_file(const char *name, char **pathp)
unsigned namelen = strlen(name);
char *p = dirs;
for (;;) {
- char *end = strchr(p, PATH_SEP[0]);
+ char *end = strchr(p, PATH_SEP_CHAR);
if (!end)
end = strchr(p, '\0');
int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
- char *path = new char[(end - p) + need_slash + namelen + 1];
- memcpy(path, p, end - p);
+ char *origpath = new char[(end - p) + need_slash + namelen + 1];
+ memcpy(origpath, p, end - p);
if (need_slash)
- path[end - p] = '/';
- strcpy(path + (end - p) + need_slash, name);
+ origpath[end - p] = '/';
+ strcpy(origpath + (end - p) + need_slash, name);
+#if 0
+ fprintf(stderr, "origpath `%s'\n", origpath);
+#endif
+ char *path = relocate(origpath);
+ a_delete origpath;
#if 0
fprintf(stderr, "trying `%s'\n", path);
#endif
@@ -130,3 +142,67 @@ FILE *search_path::open_file(const char *name, char **pathp)
}
return 0;
}
+
+FILE *search_path::open_file_cautious(const char *name, char **pathp,
+ const char *mode)
+{
+ if (!mode)
+ mode = "r";
+ bool reading = (strchr(mode, 'r') != 0);
+ if (name == 0 || strcmp(name, "-") == 0) {
+ if (pathp)
+ *pathp = strsave(reading ? "stdin" : "stdout");
+ return (reading ? stdin : stdout);
+ }
+ if (!reading || IS_ABSOLUTE(name) || *dirs == '\0') {
+ FILE *fp = fopen(name, mode);
+ if (fp) {
+ if (pathp)
+ *pathp = strsave(name);
+ return fp;
+ }
+ else
+ return 0;
+ }
+ unsigned namelen = strlen(name);
+ char *p = dirs;
+ for (;;) {
+ char *end = strchr(p, PATH_SEP_CHAR);
+ if (!end)
+ end = strchr(p, '\0');
+ int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
+ char *origpath = new char[(end - p) + need_slash + namelen + 1];
+ memcpy(origpath, p, end - p);
+ if (need_slash)
+ origpath[end - p] = '/';
+ strcpy(origpath + (end - p) + need_slash, name);
+#if 0
+ fprintf(stderr, "origpath `%s'\n", origpath);
+#endif
+ char *path = relocate(origpath);
+ a_delete origpath;
+#if 0
+ fprintf(stderr, "trying `%s'\n", path);
+#endif
+ FILE *fp = fopen(path, mode);
+ if (fp) {
+ if (pathp)
+ *pathp = path;
+ else
+ a_delete path;
+ return fp;
+ }
+ int err = errno;
+ a_delete path;
+ if (err != ENOENT)
+ {
+ errno = err;
+ return 0;
+ }
+ if (*end == '\0')
+ break;
+ p = end + 1;
+ }
+ errno = ENOENT;
+ return 0;
+}
diff --git a/contrib/groff/src/libs/libgroff/spawnvp.c b/contrib/groff/src/libs/libgroff/spawnvp.c
new file mode 100644
index 0000000..1848124
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/spawnvp.c
@@ -0,0 +1,122 @@
+/* Copyright (C) 2004
+ Free Software Foundation, Inc.
+ Written by: Keith Marshall (keith.d.marshall@ntlworld.com)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef HAVE_PROCESS_H
+# include <process.h>
+#endif
+
+#if defined(__MSDOS__) \
+ || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) \
+ || defined(__EMX__)
+
+#define SPAWN_FUNCTION_WRAPPERS 1
+
+/* Define the default mechanism, and messages, for error reporting
+ * (user may substitute a preferred alternative, by defining his own
+ * implementation of the macros REPORT_ERROR and ARGV_MALLOC_ERROR,
+ * in the header file `nonposix.h').
+ */
+
+#include "nonposix.h"
+
+#ifndef REPORT_ERROR
+# define REPORT_ERROR(WHY) fprintf(stderr, "%s:%s\n", program_name, WHY)
+#endif
+#ifndef ARGV_MALLOC_ERROR
+# define ARGV_MALLOC_ERROR "malloc: Allocation for 'argv' failed"
+#endif
+
+extern char *program_name;
+
+extern char *quote_arg(char *string);
+extern void purge_quoted_args(char **argv);
+
+int
+spawnvp_wrapper(int mode, char *path, char **argv)
+{
+ /* Invoke the system `spawnvp' service
+ * enclosing the passed arguments in double quotes, as required,
+ * so that the (broken) default parsing in the MSVC runtime doesn't
+ * split them at whitespace. */
+
+ char **quoted_argv; /* used to build a quoted local copy of `argv' */
+
+ int i; /* used as an index into `argv' or `quoted_argv' */
+ int status = -1; /* initialise return code, in case we fail */
+ int argc = 0; /* initialise argument count; may be none */
+
+ /* First count the number of arguments
+ * which are actually present in the passed `argv'. */
+
+ if (argv)
+ for (quoted_argv = argv; *quoted_argv; ++argc, ++quoted_argv)
+ ;
+
+ /* If we do not now have an argument count,
+ * then we must fall through and fail. */
+
+ if (argc) {
+ /* We do have at least one argument:
+ * We will use a copy of the `argv', in which to do the quoting,
+ * so we must allocate space for it. */
+
+ if ((quoted_argv = (char **)malloc(++argc * sizeof(char **))) == NULL) {
+ /* If we didn't get enough space,
+ * then complain, and bail out gracefully. */
+
+ REPORT_ERROR(ARGV_MALLOC_ERROR);
+ exit(1);
+ }
+
+ /* Now copy the passed `argv' into our new vector,
+ * quoting its contents as required. */
+
+ for (i = 0; i < argc; i++)
+ quoted_argv[i] = quote_arg(argv[i]);
+
+ /* Invoke the MSVC `spawnvp' service
+ * passing our now appropriately quoted copy of `argv'. */
+
+ status = spawnvp(mode, path, quoted_argv);
+
+ /* Clean up our memory allocations
+ * for the quoted copy of `argv', which is no longer required. */
+
+ purge_quoted_args(quoted_argv);
+ free(quoted_argv);
+ }
+
+ /* Finally,
+ * return the status code returned by `spawnvp',
+ * or a failure code if we fell through. */
+
+ return status;
+}
+
+#endif /* __MSDOS__ || _WIN32 */
+
+/* spawnvp.c: end of file */
diff --git a/contrib/groff/src/libs/libgroff/strcasecmp.c b/contrib/groff/src/libs/libgroff/strcasecmp.c
index ae7601d..6ed6cc2 100644
--- a/contrib/groff/src/libs/libgroff/strcasecmp.c
+++ b/contrib/groff/src/libs/libgroff/strcasecmp.c
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#if HAVE_CONFIG_H
# include <config.h>
@@ -29,7 +29,7 @@
# define LENGTH_LIMIT_EXPR(Expr) 0
#endif
-#include <sys/types.h>
+#include <stddef.h>
#include <ctype.h>
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
diff --git a/contrib/groff/src/libs/libgroff/strerror.c b/contrib/groff/src/libs/libgroff/strerror.c
index be2d1f3..d5757f3 100644
--- a/contrib/groff/src/libs/libgroff/strerror.c
+++ b/contrib/groff/src/libs/libgroff/strerror.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,13 +16,15 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h> /* for MinGW */
#define INT_DIGITS 19 /* enough for 64 bit integer */
diff --git a/contrib/groff/src/libs/libgroff/string.cpp b/contrib/groff/src/libs/libgroff/string.cpp
index 2ef547e..9be873c 100644
--- a/contrib/groff/src/libs/libgroff/string.cpp
+++ b/contrib/groff/src/libs/libgroff/string.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/libs/libgroff/strsave.cpp b/contrib/groff/src/libs/libgroff/strsave.cpp
index dfd2b6f..2db7073 100644
--- a/contrib/groff/src/libs/libgroff/strsave.cpp
+++ b/contrib/groff/src/libs/libgroff/strsave.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <string.h>
diff --git a/contrib/groff/src/libs/libgroff/strtol.c b/contrib/groff/src/libs/libgroff/strtol.c
index 46b1702..0c758a0 100644
--- a/contrib/groff/src/libs/libgroff/strtol.c
+++ b/contrib/groff/src/libs/libgroff/strtol.c
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/contrib/groff/src/libs/libgroff/symbol.cpp b/contrib/groff/src/libs/libgroff/symbol.cpp
new file mode 100644
index 0000000..38e3071
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/symbol.cpp
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.com)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "lib.h"
+
+#include "errarg.h"
+#include "error.h"
+#include "symbol.h"
+
+const char **symbol::table = 0;
+int symbol::table_used = 0;
+int symbol::table_size = 0;
+char *symbol::block = 0;
+int symbol::block_size = 0;
+
+const symbol NULL_SYMBOL;
+const symbol EMPTY_SYMBOL("");
+
+#ifdef BLOCK_SIZE
+#undef BLOCK_SIZE
+#endif
+
+const int BLOCK_SIZE = 1024;
+// the table will increase in size as necessary
+// the size will be chosen from the following array
+// add some more if you want
+static const unsigned int table_sizes[] = {
+ 101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021,
+ 160001, 500009, 1000003, 1500007, 2000003, 0
+};
+const double FULL_MAX = 0.3; // don't let the table get more than this full
+
+static unsigned int hash_string(const char *p)
+{
+ // compute a hash code; this assumes 32-bit unsigned ints
+ // see p436 of Compilers by Aho, Sethi & Ullman
+ // give special treatment to two-character names
+ unsigned int hc = 0, g;
+ if (*p != 0) {
+ hc = *p++;
+ if (*p != 0) {
+ hc <<= 7;
+ hc += *p++;
+ for (; *p != 0; p++) {
+ hc <<= 4;
+ hc += *p;
+ if ((g = (hc & 0xf0000000)) == 0) {
+ hc ^= g >> 24;
+ hc ^= g;
+ }
+ }
+ }
+ }
+ return hc;
+}
+
+// Tell compiler that a variable is intentionally unused.
+inline void unused(void *) { }
+
+symbol::symbol(const char *p, int how)
+{
+ if (p == 0) {
+ s = 0;
+ return;
+ }
+ if (*p == 0) {
+ s = "";
+ return;
+ }
+ if (table == 0) {
+ table_size = table_sizes[0];
+ table = (const char **)new char*[table_size];
+ for (int i = 0; i < table_size; i++)
+ table[i] = 0;
+ table_used = 0;
+ }
+ unsigned int hc = hash_string(p);
+ const char **pp;
+ for (pp = table + hc % table_size;
+ *pp != 0;
+ (pp == table ? pp = table + table_size - 1 : --pp))
+ if (strcmp(p, *pp) == 0) {
+ s = *pp;
+ return;
+ }
+ if (how == MUST_ALREADY_EXIST) {
+ s = 0;
+ return;
+ }
+ if (table_used >= table_size - 1 || table_used >= table_size*FULL_MAX) {
+ const char **old_table = table;
+ unsigned int old_table_size = table_size;
+ int i;
+ for (i = 1; table_sizes[i] <= old_table_size; i++)
+ if (table_sizes[i] == 0)
+ fatal("too many symbols");
+ table_size = table_sizes[i];
+ table_used = 0;
+ table = (const char **)new char*[table_size];
+ for (i = 0; i < table_size; i++)
+ table[i] = 0;
+ for (pp = old_table + old_table_size - 1;
+ pp >= old_table;
+ --pp) {
+ symbol temp(*pp, 1); /* insert it into the new table */
+ unused(&temp);
+ }
+ a_delete old_table;
+ for (pp = table + hc % table_size;
+ *pp != 0;
+ (pp == table ? pp = table + table_size - 1 : --pp))
+ ;
+ }
+ ++table_used;
+ if (how == DONT_STORE) {
+ s = *pp = p;
+ }
+ else {
+ int len = strlen(p)+1;
+ if (block == 0 || block_size < len) {
+ block_size = len > BLOCK_SIZE ? len : BLOCK_SIZE;
+ block = new char [block_size];
+ }
+ (void)strcpy(block, p);
+ s = *pp = block;
+ block += len;
+ block_size -= len;
+ }
+}
+
+symbol concat(symbol s1, symbol s2)
+{
+ char *buf = new char [strlen(s1.contents()) + strlen(s2.contents()) + 1];
+ strcpy(buf, s1.contents());
+ strcat(buf, s2.contents());
+ symbol res(buf);
+ a_delete buf;
+ return res;
+}
+
+symbol default_symbol("default");
diff --git a/contrib/groff/src/libs/libgroff/tmpfile.cpp b/contrib/groff/src/libs/libgroff/tmpfile.cpp
index 41b7f06..fbc48c8 100644
--- a/contrib/groff/src/libs/libgroff/tmpfile.cpp
+++ b/contrib/groff/src/libs/libgroff/tmpfile.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -33,6 +33,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR"
// otherwise if this is set, create temporary files there
#define TMPDIR_ENVVAR "TMPDIR"
+// otherwise, on MS-DOS or MS-Windows ...
+#if defined(__MSDOS__) || defined(_WIN32)
+// if either of these is set, create temporary files there
+// (giving priority to WIN32_TMPDIR_ENVVAR)
+#define WIN32_TMPDIR_ENVVAR "TMP"
+#define MSDOS_TMPDIR_ENVVAR "TEMP"
+#endif
// otherwise if P_tmpdir is defined, create temporary files there
#ifdef P_tmpdir
# define DEFAULT_TMPDIR P_tmpdir
@@ -55,12 +62,23 @@ struct temp_init {
temp_init::temp_init()
{
- const char *tem = getenv(GROFF_TMPDIR_ENVVAR);
- if (!tem) {
- tem = getenv(TMPDIR_ENVVAR);
- if (!tem)
- tem = DEFAULT_TMPDIR;
- }
+ // First, choose a location for creating temporary files...
+ const char *tem;
+ // using the first match for any of the environment specs in listed order.
+ if (
+ (tem = getenv(GROFF_TMPDIR_ENVVAR)) == NULL
+ && (tem = getenv(TMPDIR_ENVVAR)) == NULL
+#if defined(__MSDOS__) || defined(_WIN32)
+ // If we didn't find a match for either of the above
+ // (which are preferred, regardless of the host operating system),
+ // and we are hosted on either MS-Windows or MS-DOS,
+ // then try the Microsoft conventions.
+ && (tem = getenv(WIN32_TMPDIR_ENVVAR)) == NULL
+ && (tem = getenv(MSDOS_TMPDIR_ENVVAR)) == NULL
+#endif
+ )
+ // If we didn't find an environment spec fall back to this default.
+ tem = DEFAULT_TMPDIR;
size_t tem_len = strlen(tem);
const char *tem_end = tem + tem_len - 1;
int need_slash = strchr(DIR_SEPS, *tem_end) == NULL ? 1 : 0;
diff --git a/contrib/groff/src/libs/libgroff/tmpname.cpp b/contrib/groff/src/libs/libgroff/tmpname.cpp
index f867fe0..8d80f4b 100644
--- a/contrib/groff/src/libs/libgroff/tmpname.cpp
+++ b/contrib/groff/src/libs/libgroff/tmpname.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
Written by Werner Lemberg (wl@gnu.org)
This file is part of groff.
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is heavily based on the function __gen_tempname() in the
@@ -48,8 +48,8 @@ extern "C" {
#endif
#endif
-#if HAVE_CC_STDINT_H
-# include <stdint.h>
+#if HAVE_CC_INTTYPES_H
+# include <inttypes.h>
#endif
/* Use the widest available unsigned type if uint64_t is not
diff --git a/contrib/groff/src/libs/libgroff/unicode.cpp b/contrib/groff/src/libs/libgroff/unicode.cpp
new file mode 100644
index 0000000..32810df
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/unicode.cpp
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+/* Copyright (C) 2002
+ Free Software Foundation, Inc.
+ Written by Werner Lemberg <wl@gnu.org>
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "lib.h"
+#include "cset.h"
+#include "stringclass.h"
+
+#include "unicode.h"
+
+const char *check_unicode_name(const char *u)
+{
+ if (*u != 'u')
+ return 0;
+ const char *p = ++u;
+ for (;;) {
+ int val = 0;
+ const char *start = p;
+ for (;;) {
+ // only uppercase hex digits allowed
+ if (!csxdigit(*p))
+ return 0;
+ if (csdigit(*p))
+ val = val*0x10 + (*p-'0');
+ else if (csupper(*p))
+ val = val*0x10 + (*p-'A'+10);
+ else
+ return 0;
+ // biggest Unicode value is U+10FFFF
+ if (val > 0x10FFFF)
+ return 0;
+ p++;
+ if (*p == '\0' || *p == '_')
+ break;
+ }
+ // surrogates not allowed
+ if ((val >= 0xD800 && val <= 0xDBFF) || (val >= 0xDC00 && val <= 0xDFFF))
+ return 0;
+ if (val > 0xFFFF) {
+ if (*start == '0') // no leading zeros allowed if > 0xFFFF
+ return 0;
+ }
+ else if (p - start != 4) // otherwise, check for exactly 4 hex digits
+ return 0;
+ if (*p == '\0')
+ break;
+ p++;
+ }
+ return u;
+}
diff --git a/contrib/groff/src/libs/libgroff/uniglyph.cpp b/contrib/groff/src/libs/libgroff/uniglyph.cpp
new file mode 100644
index 0000000..ab6f531
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/uniglyph.cpp
@@ -0,0 +1,504 @@
+// -*- C++ -*-
+/* Copyright (C) 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ Written by Werner Lemberg <wl@gnu.org>
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "lib.h"
+#include "stringclass.h"
+#include "ptable.h"
+
+#include "unicode.h"
+
+struct unicode_to_glyph {
+ char *value;
+};
+
+declare_ptable(unicode_to_glyph)
+implement_ptable(unicode_to_glyph)
+
+PTABLE(unicode_to_glyph) unicode_to_glyph_table;
+
+struct S {
+ const char *key;
+ const char *value;
+} unicode_to_glyph_list[] = {
+ { "0021", "!" },
+//{ "0022", "\"" },
+ { "0022", "dq" },
+//{ "0023", "#" },
+ { "0023", "sh" },
+//{ "0024", "$" },
+ { "0024", "Do" },
+ { "0025", "%" },
+ { "0026", "&" },
+ { "0027", "aq" },
+ { "0028", "(" },
+ { "0029", ")" },
+ { "002A", "*" },
+//{ "002B", "+" },
+ { "002B", "pl" },
+ { "002C", "," },
+ { "002E", "." },
+//{ "002F", "/" },
+ { "002F", "sl" },
+ { "0030", "0" },
+ { "0031", "1" },
+ { "0032", "2" },
+ { "0033", "3" },
+ { "0034", "4" },
+ { "0035", "5" },
+ { "0036", "6" },
+ { "0037", "7" },
+ { "0038", "8" },
+ { "0039", "9" },
+ { "003A", ":" },
+ { "003B", ";" },
+ { "003C", "<" },
+//{ "003D", "=" },
+ { "003D", "eq" },
+ { "003D_0338", "!=" },
+ { "003E", ">" },
+ { "003F", "?" },
+//{ "0040", "@" },
+ { "0040", "at" },
+ { "0041", "A" },
+ { "0041_0300", "`A" },
+ { "0041_0301", "'A" },
+ { "0041_0302", "^A" },
+ { "0041_0303", "~A" },
+ { "0041_0308", ":A" },
+ { "0041_030A", "oA" },
+ { "0042", "B" },
+ { "0043", "C" },
+ { "0043_0301", "'C" },
+ { "0043_0327", ",C" },
+ { "0044", "D" },
+ { "0045", "E" },
+ { "0045_0300", "`E" },
+ { "0045_0301", "'E" },
+ { "0045_0302", "^E" },
+ { "0045_0308", ":E" },
+ { "0046", "F" },
+ { "0047", "G" },
+ { "0048", "H" },
+ { "0049", "I" },
+ { "0049_0300", "`I" },
+ { "0049_0301", "'I" },
+ { "0049_0302", "^I" },
+ { "0049_0308", ":I" },
+ { "004A", "J" },
+ { "004B", "K" },
+ { "004C", "L" },
+ { "004D", "M" },
+ { "004E", "N" },
+ { "004E_0303", "~N" },
+ { "004F", "O" },
+ { "004F_0300", "`O" },
+ { "004F_0301", "'O" },
+ { "004F_0302", "^O" },
+ { "004F_0303", "~O" },
+ { "004F_0308", ":O" },
+ { "0050", "P" },
+ { "0051", "Q" },
+ { "0052", "R" },
+ { "0053", "S" },
+ { "0053_030C", "vS" },
+ { "0054", "T" },
+ { "0055", "U" },
+ { "0055_0300", "`U" },
+ { "0055_0301", "'U" },
+ { "0055_0302", "^U" },
+ { "0055_0308", ":U" },
+ { "0056", "V" },
+ { "0057", "W" },
+ { "0058", "X" },
+ { "0059", "Y" },
+ { "0059_0301", "'Y" },
+ { "0059_0308", ":Y" },
+ { "005A", "Z" },
+ { "005A_030C", "vZ" },
+ { "005B", "lB" },
+//{ "005B", "[" },
+ { "005C", "rs" },
+//{ "005C", "\\" },
+ { "005D", "rB" },
+//{ "005D", "]" },
+//{ "005E", "^" },
+//{ "005E", "a^" },
+ { "005E", "ha" },
+//{ "005F", "_" },
+//{ "005F", "ru" },
+ { "005F", "ul" },
+ { "0060", "ga" },
+//{ "0060", "\\`" },
+ { "0061", "a" },
+ { "0061_0300", "`a" },
+ { "0061_0301", "'a" },
+ { "0061_0302", "^a" },
+ { "0061_0303", "~a" },
+ { "0061_0308", ":a" },
+ { "0061_030A", "oa" },
+ { "0062", "b" },
+ { "0063", "c" },
+ { "0063_0301", "'c" },
+ { "0063_0327", ",c" },
+ { "0064", "d" },
+ { "0065", "e" },
+ { "0065_0300", "`e" },
+ { "0065_0301", "'e" },
+ { "0065_0302", "^e" },
+ { "0065_0308", ":e" },
+ { "0066", "f" },
+ { "0066_0066", "ff" },
+ { "0066_0066_0069", "Fi" },
+ { "0066_0066_006C", "Fl" },
+ { "0066_0069", "fi" },
+ { "0066_006C", "fl" },
+ { "0067", "g" },
+ { "0068", "h" },
+ { "0069", "i" },
+ { "0069_0300", "`i" },
+ { "0069_0301", "'i" },
+ { "0069_0302", "^i" },
+ { "0069_0308", ":i" },
+ { "006A", "j" },
+ { "006B", "k" },
+ { "006C", "l" },
+ { "006D", "m" },
+ { "006E", "n" },
+ { "006E_0303", "~n" },
+ { "006F", "o" },
+ { "006F_0300", "`o" },
+ { "006F_0301", "'o" },
+ { "006F_0302", "^o" },
+ { "006F_0303", "~o" },
+ { "006F_0308", ":o" },
+ { "0070", "p" },
+ { "0071", "q" },
+ { "0072", "r" },
+ { "0073", "s" },
+ { "0073_030C", "vs" },
+ { "0074", "t" },
+ { "0075", "u" },
+ { "0075_0300", "`u" },
+ { "0075_0301", "'u" },
+ { "0075_0302", "^u" },
+ { "0075_0308", ":u" },
+ { "0076", "v" },
+ { "0077", "w" },
+ { "0078", "x" },
+ { "0079", "y" },
+ { "0079_0301", "'y" },
+ { "0079_0308", ":y" },
+ { "007A", "z" },
+ { "007A_030C", "vz" },
+ { "007B", "lC" },
+//{ "007B", "{" },
+ { "007C", "ba" },
+//{ "007C", "or" },
+//{ "007C", "|" },
+ { "007D", "rC" },
+//{ "007D", "}" },
+//{ "007E", "a~" },
+ { "007E", "ti" },
+//{ "007E", "~" },
+ { "00A1", "r!" },
+ { "00A2", "ct" },
+ { "00A3", "Po" },
+ { "00A4", "Cs" },
+ { "00A5", "Ye" },
+ { "00A6", "bb" },
+ { "00A7", "sc" },
+ { "00A8", "ad" },
+ { "00A9", "co" },
+ { "00AA", "Of" },
+ { "00AB", "Fo" },
+ { "00AC", "no" },
+//{ "00AC", "tno" },
+ { "00AD", "shc" },
+ { "00AE", "rg" },
+ { "00AF", "a-" },
+ { "00B0", "de" },
+ { "00B1", "+-" },
+//{ "00B1", "t+-" },
+ { "00B2", "S2" },
+ { "00B3", "S3" },
+ { "00B4", "aa" },
+//{ "00B4", "\\'" },
+ { "00B5", "mc" },
+ { "00B6", "ps" },
+ { "00B7", "pc" },
+ { "00B8", "ac" },
+ { "00B9", "S1" },
+ { "00BA", "Om" },
+ { "00BB", "Fc" },
+ { "00BC", "14" },
+ { "00BD", "12" },
+ { "00BE", "34" },
+ { "00BF", "r?" },
+ { "00C6", "AE" },
+ { "00D0", "-D" },
+ { "00D7", "mu" },
+//{ "00D7", "tmu" },
+ { "00D8", "/O" },
+ { "00DE", "TP" },
+ { "00DF", "ss" },
+ { "00E6", "ae" },
+ { "00F0", "Sd" },
+ { "00F7", "di" },
+//{ "00F7", "tdi" },
+ { "00F8", "/o" },
+ { "00FE", "Tp" },
+ { "0131", ".i" },
+ { "0132", "IJ" },
+ { "0133", "ij" },
+ { "0141", "/L" },
+ { "0142", "/l" },
+ { "0152", "OE" },
+ { "0153", "oe" },
+ { "0192", "Fn" },
+ { "02C7", "ah" },
+ { "02D8", "ab" },
+ { "02D9", "a." },
+ { "02DA", "ao" },
+ { "02DB", "ho" },
+ { "02DD", "a\"" },
+ { "0391", "*A" },
+ { "0392", "*B" },
+ { "0393", "*G" },
+ { "0394", "*D" },
+ { "0395", "*E" },
+ { "0396", "*Z" },
+ { "0397", "*Y" },
+ { "0398", "*H" },
+ { "0399", "*I" },
+ { "039A", "*K" },
+ { "039B", "*L" },
+ { "039C", "*M" },
+ { "039D", "*N" },
+ { "039E", "*C" },
+ { "039F", "*O" },
+ { "03A0", "*P" },
+ { "03A1", "*R" },
+ { "03A3", "*S" },
+ { "03A4", "*T" },
+ { "03A5", "*U" },
+ { "03A6", "*F" },
+ { "03A7", "*X" },
+ { "03A8", "*Q" },
+ { "03A9", "*W" },
+ { "03B1", "*a" },
+ { "03B2", "*b" },
+ { "03B3", "*g" },
+ { "03B4", "*d" },
+ { "03B5", "*e" },
+ { "03B6", "*z" },
+ { "03B7", "*y" },
+ { "03B8", "*h" },
+ { "03B9", "*i" },
+ { "03BA", "*k" },
+ { "03BB", "*l" },
+ { "03BC", "*m" },
+ { "03BD", "*n" },
+ { "03BE", "*c" },
+ { "03BF", "*o" },
+ { "03C0", "*p" },
+ { "03C1", "*r" },
+ { "03C2", "ts" },
+ { "03C3", "*s" },
+ { "03C4", "*t" },
+ { "03C5", "*u" },
+ { "03C6", "*f" },
+ { "03C7", "*x" },
+ { "03C8", "*q" },
+ { "03C9", "*w" },
+ { "03D1", "+h" },
+ { "03D5", "+f" },
+ { "03D6", "+p" },
+ { "03F5", "+e" },
+//{ "2010", "-" },
+ { "2010", "hy" },
+ { "2013", "en" },
+ { "2014", "em" },
+//{ "2018", "`" },
+ { "2018", "oq" },
+//{ "2019", "'" },
+ { "2019", "cq" },
+ { "201A", "bq" },
+ { "201C", "lq" },
+ { "201D", "rq" },
+ { "201E", "Bq" },
+ { "2020", "dg" },
+ { "2021", "dd" },
+ { "2022", "bu" },
+ { "2030", "%0" },
+ { "2032", "fm" },
+ { "2033", "sd" },
+ { "2039", "fo" },
+ { "203A", "fc" },
+ { "203E", "rn" },
+ { "2044", "f/" },
+ { "20AC", "Eu" },
+//{ "20AC", "eu" },
+ { "210F", "-h" },
+//{ "210F", "hbar" },
+ { "2111", "Im" },
+ { "2118", "wp" },
+ { "211C", "Re" },
+ { "2122", "tm" },
+ { "2135", "Ah" },
+ { "215B", "18" },
+ { "215C", "38" },
+ { "215D", "58" },
+ { "215E", "78" },
+ { "2190", "<-" },
+ { "2191", "ua" },
+ { "2192", "->" },
+ { "2193", "da" },
+ { "2194", "<>" },
+ { "2195", "va" },
+ { "21B5", "CR" },
+ { "21D0", "lA" },
+ { "21D1", "uA" },
+ { "21D2", "rA" },
+ { "21D3", "dA" },
+ { "21D4", "hA" },
+ { "21D5", "vA" },
+ { "2200", "fa" },
+ { "2202", "pd" },
+ { "2203", "te" },
+ { "2205", "es" },
+ { "2207", "gr" },
+ { "2208", "mo" },
+ { "2208_0338", "nm" },
+ { "220B", "st" },
+ { "220F", "product" },
+ { "2210", "coproduct" },
+ { "2211", "sum" },
+ { "2212", "mi" },
+//{ "2212", "\\-" },
+ { "2213", "-+" },
+ { "2217", "**" },
+ { "221A", "sr" },
+ { "221D", "pt" },
+ { "221E", "if" },
+ { "2220", "/_" },
+ { "2227", "AN" },
+ { "2228", "OR" },
+ { "2229", "ca" },
+ { "222A", "cu" },
+ { "222B", "is" },
+//{ "222B", "integral" },
+//{ "2234", "3d" },
+ { "2234", "tf" },
+ { "223C", "ap" },
+ { "2243", "|=" },
+ { "2245", "=~" },
+//{ "2248", "~=" },
+ { "2248", "~~" },
+ { "2261", "==" },
+ { "2261_0338", "ne" },
+ { "2264", "<=" },
+ { "2265", ">=" },
+ { "226A", ">>" },
+ { "226B", "<<" },
+ { "2282", "sb" },
+ { "2282_0338", "nb" },
+ { "2283", "sp" },
+ { "2283_0338", "nc" },
+ { "2286", "ib" },
+ { "2287", "ip" },
+ { "2295", "c+" },
+ { "2297", "c*" },
+ { "22A5", "pp" },
+ { "22C5", "md" },
+ { "2308", "lc" },
+ { "2309", "rc" },
+ { "230A", "lf" },
+ { "230B", "rf" },
+ { "239B", "parenlefttp" },
+ { "239C", "parenleftex" },
+ { "239D", "parenleftbt" },
+ { "239E", "parenrighttp" },
+ { "239F", "parenrightex" },
+ { "23A0", "parenrightbt" },
+//{ "23A1", "bracketlefttp" },
+ { "23A2", "bracketleftex" },
+//{ "23A3", "bracketleftbt" },
+//{ "23A4", "bracketrighttp" },
+ { "23A5", "bracketrightex" },
+//{ "23A6", "bracketrightbt" },
+ { "23A7", "lt" },
+//{ "23A7", "bracelefttp" },
+ { "23A8", "lk" },
+//{ "23A8", "braceleftmid" },
+ { "23A9", "lb" },
+//{ "23A9", "braceleftbt" },
+ { "23AA", "bv" },
+//{ "23AA", "braceex" },
+//{ "23AA", "braceleftex" },
+//{ "23AA", "bracerightex" },
+ { "23AB", "rt" },
+//{ "23AB", "bracerighttp" },
+ { "23AC", "rk" },
+//{ "23AC", "bracerightmid" },
+ { "23AD", "rb" },
+//{ "23AD", "bracerightbt" },
+ { "23AF", "an" },
+ { "2502", "br" },
+ { "251D", "rk" },
+ { "2525", "lk" },
+ { "256D", "lt" },
+ { "256E", "rt" },
+ { "256F", "rb" },
+ { "2570", "lb" },
+ { "25A1", "sq" },
+ { "25CA", "lz" },
+ { "25CB", "ci" },
+ { "261C", "lh" },
+ { "261E", "rh" },
+ { "2660", "SP" },
+ { "2663", "CL" },
+ { "2665", "HE" },
+ { "2666", "DI" },
+ { "2713", "OK" },
+ { "27E8", "la" },
+ { "27E9", "ra" },
+};
+
+// global constructor
+static struct unicode_to_glyph_init {
+ unicode_to_glyph_init();
+} _unicode_to_glyph_init;
+
+unicode_to_glyph_init::unicode_to_glyph_init() {
+ for (unsigned int i = 0;
+ i < sizeof(unicode_to_glyph_list)/sizeof(unicode_to_glyph_list[0]);
+ i++) {
+ unicode_to_glyph *utg = new unicode_to_glyph[1];
+ utg->value = (char *)unicode_to_glyph_list[i].value;
+ unicode_to_glyph_table.define(unicode_to_glyph_list[i].key, utg);
+ }
+}
+
+const char *unicode_to_glyph_name(const char *s)
+{
+ unicode_to_glyph *result = unicode_to_glyph_table.lookup(s);
+ return result ? result->value : 0;
+}
diff --git a/contrib/groff/src/libs/libgroff/uniuni.cpp b/contrib/groff/src/libs/libgroff/uniuni.cpp
new file mode 100644
index 0000000..61bc833
--- /dev/null
+++ b/contrib/groff/src/libs/libgroff/uniuni.cpp
@@ -0,0 +1,1994 @@
+// -*- C++ -*-
+/* Copyright (C) 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ Written by Werner Lemberg <wl@gnu.org>
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+// This code has been algorithmically derived from the file
+// UnicodeData-3.2.0.txt, available from unicode.org.
+
+#include "lib.h"
+#include "stringclass.h"
+#include "ptable.h"
+
+#include "unicode.h"
+
+struct unicode_decompose {
+ char *value;
+};
+
+declare_ptable(unicode_decompose)
+implement_ptable(unicode_decompose)
+
+PTABLE(unicode_decompose) unicode_decompose_table;
+
+// the first digit in the composite string gives the number of composites
+
+struct S {
+ const char *key;
+ const char *value;
+} unicode_decompose_list[] = {
+ { "00C0", "20041_0300" },
+ { "00C1", "20041_0301" },
+ { "00C2", "20041_0302" },
+ { "00C3", "20041_0303" },
+ { "00C4", "20041_0308" },
+ { "00C5", "20041_030A" },
+ { "00C7", "20043_0327" },
+ { "00C8", "20045_0300" },
+ { "00C9", "20045_0301" },
+ { "00CA", "20045_0302" },
+ { "00CB", "20045_0308" },
+ { "00CC", "20049_0300" },
+ { "00CD", "20049_0301" },
+ { "00CE", "20049_0302" },
+ { "00CF", "20049_0308" },
+ { "00D1", "2004E_0303" },
+ { "00D2", "2004F_0300" },
+ { "00D3", "2004F_0301" },
+ { "00D4", "2004F_0302" },
+ { "00D5", "2004F_0303" },
+ { "00D6", "2004F_0308" },
+ { "00D9", "20055_0300" },
+ { "00DA", "20055_0301" },
+ { "00DB", "20055_0302" },
+ { "00DC", "20055_0308" },
+ { "00DD", "20059_0301" },
+ { "00E0", "20061_0300" },
+ { "00E1", "20061_0301" },
+ { "00E2", "20061_0302" },
+ { "00E3", "20061_0303" },
+ { "00E4", "20061_0308" },
+ { "00E5", "20061_030A" },
+ { "00E7", "20063_0327" },
+ { "00E8", "20065_0300" },
+ { "00E9", "20065_0301" },
+ { "00EA", "20065_0302" },
+ { "00EB", "20065_0308" },
+ { "00EC", "20069_0300" },
+ { "00ED", "20069_0301" },
+ { "00EE", "20069_0302" },
+ { "00EF", "20069_0308" },
+ { "00F1", "2006E_0303" },
+ { "00F2", "2006F_0300" },
+ { "00F3", "2006F_0301" },
+ { "00F4", "2006F_0302" },
+ { "00F5", "2006F_0303" },
+ { "00F6", "2006F_0308" },
+ { "00F9", "20075_0300" },
+ { "00FA", "20075_0301" },
+ { "00FB", "20075_0302" },
+ { "00FC", "20075_0308" },
+ { "00FD", "20079_0301" },
+ { "00FF", "20079_0308" },
+ { "0100", "20041_0304" },
+ { "0101", "20061_0304" },
+ { "0102", "20041_0306" },
+ { "0103", "20061_0306" },
+ { "0104", "20041_0328" },
+ { "0105", "20061_0328" },
+ { "0106", "20043_0301" },
+ { "0107", "20063_0301" },
+ { "0108", "20043_0302" },
+ { "0109", "20063_0302" },
+ { "010A", "20043_0307" },
+ { "010B", "20063_0307" },
+ { "010C", "20043_030C" },
+ { "010D", "20063_030C" },
+ { "010E", "20044_030C" },
+ { "010F", "20064_030C" },
+ { "0112", "20045_0304" },
+ { "0113", "20065_0304" },
+ { "0114", "20045_0306" },
+ { "0115", "20065_0306" },
+ { "0116", "20045_0307" },
+ { "0117", "20065_0307" },
+ { "0118", "20045_0328" },
+ { "0119", "20065_0328" },
+ { "011A", "20045_030C" },
+ { "011B", "20065_030C" },
+ { "011C", "20047_0302" },
+ { "011D", "20067_0302" },
+ { "011E", "20047_0306" },
+ { "011F", "20067_0306" },
+ { "0120", "20047_0307" },
+ { "0121", "20067_0307" },
+ { "0122", "20047_0327" },
+ { "0123", "20067_0327" },
+ { "0124", "20048_0302" },
+ { "0125", "20068_0302" },
+ { "0128", "20049_0303" },
+ { "0129", "20069_0303" },
+ { "012A", "20049_0304" },
+ { "012B", "20069_0304" },
+ { "012C", "20049_0306" },
+ { "012D", "20069_0306" },
+ { "012E", "20049_0328" },
+ { "012F", "20069_0328" },
+ { "0130", "20049_0307" },
+ { "0134", "2004A_0302" },
+ { "0135", "2006A_0302" },
+ { "0136", "2004B_0327" },
+ { "0137", "2006B_0327" },
+ { "0139", "2004C_0301" },
+ { "013A", "2006C_0301" },
+ { "013B", "2004C_0327" },
+ { "013C", "2006C_0327" },
+ { "013D", "2004C_030C" },
+ { "013E", "2006C_030C" },
+ { "0143", "2004E_0301" },
+ { "0144", "2006E_0301" },
+ { "0145", "2004E_0327" },
+ { "0146", "2006E_0327" },
+ { "0147", "2004E_030C" },
+ { "0148", "2006E_030C" },
+ { "014C", "2004F_0304" },
+ { "014D", "2006F_0304" },
+ { "014E", "2004F_0306" },
+ { "014F", "2006F_0306" },
+ { "0150", "2004F_030B" },
+ { "0151", "2006F_030B" },
+ { "0154", "20052_0301" },
+ { "0155", "20072_0301" },
+ { "0156", "20052_0327" },
+ { "0157", "20072_0327" },
+ { "0158", "20052_030C" },
+ { "0159", "20072_030C" },
+ { "015A", "20053_0301" },
+ { "015B", "20073_0301" },
+ { "015C", "20053_0302" },
+ { "015D", "20073_0302" },
+ { "015E", "20053_0327" },
+ { "015F", "20073_0327" },
+ { "0160", "20053_030C" },
+ { "0161", "20073_030C" },
+ { "0162", "20054_0327" },
+ { "0163", "20074_0327" },
+ { "0164", "20054_030C" },
+ { "0165", "20074_030C" },
+ { "0168", "20055_0303" },
+ { "0169", "20075_0303" },
+ { "016A", "20055_0304" },
+ { "016B", "20075_0304" },
+ { "016C", "20055_0306" },
+ { "016D", "20075_0306" },
+ { "016E", "20055_030A" },
+ { "016F", "20075_030A" },
+ { "0170", "20055_030B" },
+ { "0171", "20075_030B" },
+ { "0172", "20055_0328" },
+ { "0173", "20075_0328" },
+ { "0174", "20057_0302" },
+ { "0175", "20077_0302" },
+ { "0176", "20059_0302" },
+ { "0177", "20079_0302" },
+ { "0178", "20059_0308" },
+ { "0179", "2005A_0301" },
+ { "017A", "2007A_0301" },
+ { "017B", "2005A_0307" },
+ { "017C", "2007A_0307" },
+ { "017D", "2005A_030C" },
+ { "017E", "2007A_030C" },
+ { "01A0", "2004F_031B" },
+ { "01A1", "2006F_031B" },
+ { "01AF", "20055_031B" },
+ { "01B0", "20075_031B" },
+ { "01CD", "20041_030C" },
+ { "01CE", "20061_030C" },
+ { "01CF", "20049_030C" },
+ { "01D0", "20069_030C" },
+ { "01D1", "2004F_030C" },
+ { "01D2", "2006F_030C" },
+ { "01D3", "20055_030C" },
+ { "01D4", "20075_030C" },
+ { "01D5", "30055_0308_0304" },
+ { "01D6", "30075_0308_0304" },
+ { "01D7", "30055_0308_0301" },
+ { "01D8", "30075_0308_0301" },
+ { "01D9", "30055_0308_030C" },
+ { "01DA", "30075_0308_030C" },
+ { "01DB", "30055_0308_0300" },
+ { "01DC", "30075_0308_0300" },
+ { "01DE", "30041_0308_0304" },
+ { "01DF", "30061_0308_0304" },
+ { "01E0", "30041_0307_0304" },
+ { "01E1", "30061_0307_0304" },
+ { "01E2", "200C6_0304" },
+ { "01E3", "200E6_0304" },
+ { "01E6", "20047_030C" },
+ { "01E7", "20067_030C" },
+ { "01E8", "2004B_030C" },
+ { "01E9", "2006B_030C" },
+ { "01EA", "2004F_0328" },
+ { "01EB", "2006F_0328" },
+ { "01EC", "3004F_0328_0304" },
+ { "01ED", "3006F_0328_0304" },
+ { "01EE", "201B7_030C" },
+ { "01EF", "20292_030C" },
+ { "01F0", "2006A_030C" },
+ { "01F4", "20047_0301" },
+ { "01F5", "20067_0301" },
+ { "01F8", "2004E_0300" },
+ { "01F9", "2006E_0300" },
+ { "01FA", "30041_030A_0301" },
+ { "01FB", "30061_030A_0301" },
+ { "01FC", "200C6_0301" },
+ { "01FD", "200E6_0301" },
+ { "01FE", "200D8_0301" },
+ { "01FF", "200F8_0301" },
+ { "0200", "20041_030F" },
+ { "0201", "20061_030F" },
+ { "0202", "20041_0311" },
+ { "0203", "20061_0311" },
+ { "0204", "20045_030F" },
+ { "0205", "20065_030F" },
+ { "0206", "20045_0311" },
+ { "0207", "20065_0311" },
+ { "0208", "20049_030F" },
+ { "0209", "20069_030F" },
+ { "020A", "20049_0311" },
+ { "020B", "20069_0311" },
+ { "020C", "2004F_030F" },
+ { "020D", "2006F_030F" },
+ { "020E", "2004F_0311" },
+ { "020F", "2006F_0311" },
+ { "0210", "20052_030F" },
+ { "0211", "20072_030F" },
+ { "0212", "20052_0311" },
+ { "0213", "20072_0311" },
+ { "0214", "20055_030F" },
+ { "0215", "20075_030F" },
+ { "0216", "20055_0311" },
+ { "0217", "20075_0311" },
+ { "0218", "20053_0326" },
+ { "0219", "20073_0326" },
+ { "021A", "20054_0326" },
+ { "021B", "20074_0326" },
+ { "021E", "20048_030C" },
+ { "021F", "20068_030C" },
+ { "0226", "20041_0307" },
+ { "0227", "20061_0307" },
+ { "0228", "20045_0327" },
+ { "0229", "20065_0327" },
+ { "022A", "3004F_0308_0304" },
+ { "022B", "3006F_0308_0304" },
+ { "022C", "3004F_0303_0304" },
+ { "022D", "3006F_0303_0304" },
+ { "022E", "2004F_0307" },
+ { "022F", "2006F_0307" },
+ { "0230", "3004F_0307_0304" },
+ { "0231", "3006F_0307_0304" },
+ { "0232", "20059_0304" },
+ { "0233", "20079_0304" },
+ { "0340", "10300" },
+ { "0341", "10301" },
+ { "0343", "10313" },
+ { "0344", "20308_0301" },
+ { "0374", "102B9" },
+ { "037E", "1003B" },
+ { "0385", "200A8_0301" },
+ { "0386", "20391_0301" },
+ { "0387", "100B7" },
+ { "0388", "20395_0301" },
+ { "0389", "20397_0301" },
+ { "038A", "20399_0301" },
+ { "038C", "2039F_0301" },
+ { "038E", "203A5_0301" },
+ { "038F", "203A9_0301" },
+ { "0390", "303B9_0308_0301" },
+ { "03AA", "20399_0308" },
+ { "03AB", "203A5_0308" },
+ { "03AC", "203B1_0301" },
+ { "03AD", "203B5_0301" },
+ { "03AE", "203B7_0301" },
+ { "03AF", "203B9_0301" },
+ { "03B0", "303C5_0308_0301" },
+ { "03CA", "203B9_0308" },
+ { "03CB", "203C5_0308" },
+ { "03CC", "203BF_0301" },
+ { "03CD", "203C5_0301" },
+ { "03CE", "203C9_0301" },
+ { "03D3", "203D2_0301" },
+ { "03D4", "203D2_0308" },
+ { "0400", "20415_0300" },
+ { "0401", "20415_0308" },
+ { "0403", "20413_0301" },
+ { "0407", "20406_0308" },
+ { "040C", "2041A_0301" },
+ { "040D", "20418_0300" },
+ { "040E", "20423_0306" },
+ { "0419", "20418_0306" },
+ { "0439", "20438_0306" },
+ { "0450", "20435_0300" },
+ { "0451", "20435_0308" },
+ { "0453", "20433_0301" },
+ { "0457", "20456_0308" },
+ { "045C", "2043A_0301" },
+ { "045D", "20438_0300" },
+ { "045E", "20443_0306" },
+ { "0476", "20474_030F" },
+ { "0477", "20475_030F" },
+ { "04C1", "20416_0306" },
+ { "04C2", "20436_0306" },
+ { "04D0", "20410_0306" },
+ { "04D1", "20430_0306" },
+ { "04D2", "20410_0308" },
+ { "04D3", "20430_0308" },
+ { "04D6", "20415_0306" },
+ { "04D7", "20435_0306" },
+ { "04DA", "204D8_0308" },
+ { "04DB", "204D9_0308" },
+ { "04DC", "20416_0308" },
+ { "04DD", "20436_0308" },
+ { "04DE", "20417_0308" },
+ { "04DF", "20437_0308" },
+ { "04E2", "20418_0304" },
+ { "04E3", "20438_0304" },
+ { "04E4", "20418_0308" },
+ { "04E5", "20438_0308" },
+ { "04E6", "2041E_0308" },
+ { "04E7", "2043E_0308" },
+ { "04EA", "204E8_0308" },
+ { "04EB", "204E9_0308" },
+ { "04EC", "2042D_0308" },
+ { "04ED", "2044D_0308" },
+ { "04EE", "20423_0304" },
+ { "04EF", "20443_0304" },
+ { "04F0", "20423_0308" },
+ { "04F1", "20443_0308" },
+ { "04F2", "20423_030B" },
+ { "04F3", "20443_030B" },
+ { "04F4", "20427_0308" },
+ { "04F5", "20447_0308" },
+ { "04F8", "2042B_0308" },
+ { "04F9", "2044B_0308" },
+ { "0622", "20627_0653" },
+ { "0623", "20627_0654" },
+ { "0624", "20648_0654" },
+ { "0625", "20627_0655" },
+ { "0626", "2064A_0654" },
+ { "06C0", "206D5_0654" },
+ { "06C2", "206C1_0654" },
+ { "06D3", "206D2_0654" },
+ { "0929", "20928_093C" },
+ { "0931", "20930_093C" },
+ { "0934", "20933_093C" },
+ { "0958", "20915_093C" },
+ { "0959", "20916_093C" },
+ { "095A", "20917_093C" },
+ { "095B", "2091C_093C" },
+ { "095C", "20921_093C" },
+ { "095D", "20922_093C" },
+ { "095E", "2092B_093C" },
+ { "095F", "2092F_093C" },
+ { "09CB", "209C7_09BE" },
+ { "09CC", "209C7_09D7" },
+ { "09DC", "209A1_09BC" },
+ { "09DD", "209A2_09BC" },
+ { "09DF", "209AF_09BC" },
+ { "0A33", "20A32_0A3C" },
+ { "0A36", "20A38_0A3C" },
+ { "0A59", "20A16_0A3C" },
+ { "0A5A", "20A17_0A3C" },
+ { "0A5B", "20A1C_0A3C" },
+ { "0A5E", "20A2B_0A3C" },
+ { "0B48", "20B47_0B56" },
+ { "0B4B", "20B47_0B3E" },
+ { "0B4C", "20B47_0B57" },
+ { "0B5C", "20B21_0B3C" },
+ { "0B5D", "20B22_0B3C" },
+ { "0B94", "20B92_0BD7" },
+ { "0BCA", "20BC6_0BBE" },
+ { "0BCB", "20BC7_0BBE" },
+ { "0BCC", "20BC6_0BD7" },
+ { "0C48", "20C46_0C56" },
+ { "0CC0", "20CBF_0CD5" },
+ { "0CC7", "20CC6_0CD5" },
+ { "0CC8", "20CC6_0CD6" },
+ { "0CCA", "20CC6_0CC2" },
+ { "0CCB", "30CC6_0CC2_0CD5" },
+ { "0D4A", "20D46_0D3E" },
+ { "0D4B", "20D47_0D3E" },
+ { "0D4C", "20D46_0D57" },
+ { "0DDA", "20DD9_0DCA" },
+ { "0DDC", "20DD9_0DCF" },
+ { "0DDD", "30DD9_0DCF_0DCA" },
+ { "0DDE", "20DD9_0DDF" },
+ { "0F43", "20F42_0FB7" },
+ { "0F4D", "20F4C_0FB7" },
+ { "0F52", "20F51_0FB7" },
+ { "0F57", "20F56_0FB7" },
+ { "0F5C", "20F5B_0FB7" },
+ { "0F69", "20F40_0FB5" },
+ { "0F73", "20F71_0F72" },
+ { "0F75", "20F71_0F74" },
+ { "0F76", "20FB2_0F80" },
+ { "0F78", "20FB3_0F80" },
+ { "0F81", "20F71_0F80" },
+ { "0F93", "20F92_0FB7" },
+ { "0F9D", "20F9C_0FB7" },
+ { "0FA2", "20FA1_0FB7" },
+ { "0FA7", "20FA6_0FB7" },
+ { "0FAC", "20FAB_0FB7" },
+ { "0FB9", "20F90_0FB5" },
+ { "1026", "21025_102E" },
+ { "1E00", "20041_0325" },
+ { "1E01", "20061_0325" },
+ { "1E02", "20042_0307" },
+ { "1E03", "20062_0307" },
+ { "1E04", "20042_0323" },
+ { "1E05", "20062_0323" },
+ { "1E06", "20042_0331" },
+ { "1E07", "20062_0331" },
+ { "1E08", "30043_0327_0301" },
+ { "1E09", "30063_0327_0301" },
+ { "1E0A", "20044_0307" },
+ { "1E0B", "20064_0307" },
+ { "1E0C", "20044_0323" },
+ { "1E0D", "20064_0323" },
+ { "1E0E", "20044_0331" },
+ { "1E0F", "20064_0331" },
+ { "1E10", "20044_0327" },
+ { "1E11", "20064_0327" },
+ { "1E12", "20044_032D" },
+ { "1E13", "20064_032D" },
+ { "1E14", "30045_0304_0300" },
+ { "1E15", "30065_0304_0300" },
+ { "1E16", "30045_0304_0301" },
+ { "1E17", "30065_0304_0301" },
+ { "1E18", "20045_032D" },
+ { "1E19", "20065_032D" },
+ { "1E1A", "20045_0330" },
+ { "1E1B", "20065_0330" },
+ { "1E1C", "30045_0327_0306" },
+ { "1E1D", "30065_0327_0306" },
+ { "1E1E", "20046_0307" },
+ { "1E1F", "20066_0307" },
+ { "1E20", "20047_0304" },
+ { "1E21", "20067_0304" },
+ { "1E22", "20048_0307" },
+ { "1E23", "20068_0307" },
+ { "1E24", "20048_0323" },
+ { "1E25", "20068_0323" },
+ { "1E26", "20048_0308" },
+ { "1E27", "20068_0308" },
+ { "1E28", "20048_0327" },
+ { "1E29", "20068_0327" },
+ { "1E2A", "20048_032E" },
+ { "1E2B", "20068_032E" },
+ { "1E2C", "20049_0330" },
+ { "1E2D", "20069_0330" },
+ { "1E2E", "30049_0308_0301" },
+ { "1E2F", "30069_0308_0301" },
+ { "1E30", "2004B_0301" },
+ { "1E31", "2006B_0301" },
+ { "1E32", "2004B_0323" },
+ { "1E33", "2006B_0323" },
+ { "1E34", "2004B_0331" },
+ { "1E35", "2006B_0331" },
+ { "1E36", "2004C_0323" },
+ { "1E37", "2006C_0323" },
+ { "1E38", "3004C_0323_0304" },
+ { "1E39", "3006C_0323_0304" },
+ { "1E3A", "2004C_0331" },
+ { "1E3B", "2006C_0331" },
+ { "1E3C", "2004C_032D" },
+ { "1E3D", "2006C_032D" },
+ { "1E3E", "2004D_0301" },
+ { "1E3F", "2006D_0301" },
+ { "1E40", "2004D_0307" },
+ { "1E41", "2006D_0307" },
+ { "1E42", "2004D_0323" },
+ { "1E43", "2006D_0323" },
+ { "1E44", "2004E_0307" },
+ { "1E45", "2006E_0307" },
+ { "1E46", "2004E_0323" },
+ { "1E47", "2006E_0323" },
+ { "1E48", "2004E_0331" },
+ { "1E49", "2006E_0331" },
+ { "1E4A", "2004E_032D" },
+ { "1E4B", "2006E_032D" },
+ { "1E4C", "3004F_0303_0301" },
+ { "1E4D", "3006F_0303_0301" },
+ { "1E4E", "3004F_0303_0308" },
+ { "1E4F", "3006F_0303_0308" },
+ { "1E50", "3004F_0304_0300" },
+ { "1E51", "3006F_0304_0300" },
+ { "1E52", "3004F_0304_0301" },
+ { "1E53", "3006F_0304_0301" },
+ { "1E54", "20050_0301" },
+ { "1E55", "20070_0301" },
+ { "1E56", "20050_0307" },
+ { "1E57", "20070_0307" },
+ { "1E58", "20052_0307" },
+ { "1E59", "20072_0307" },
+ { "1E5A", "20052_0323" },
+ { "1E5B", "20072_0323" },
+ { "1E5C", "30052_0323_0304" },
+ { "1E5D", "30072_0323_0304" },
+ { "1E5E", "20052_0331" },
+ { "1E5F", "20072_0331" },
+ { "1E60", "20053_0307" },
+ { "1E61", "20073_0307" },
+ { "1E62", "20053_0323" },
+ { "1E63", "20073_0323" },
+ { "1E64", "30053_0301_0307" },
+ { "1E65", "30073_0301_0307" },
+ { "1E66", "30053_030C_0307" },
+ { "1E67", "30073_030C_0307" },
+ { "1E68", "30053_0323_0307" },
+ { "1E69", "30073_0323_0307" },
+ { "1E6A", "20054_0307" },
+ { "1E6B", "20074_0307" },
+ { "1E6C", "20054_0323" },
+ { "1E6D", "20074_0323" },
+ { "1E6E", "20054_0331" },
+ { "1E6F", "20074_0331" },
+ { "1E70", "20054_032D" },
+ { "1E71", "20074_032D" },
+ { "1E72", "20055_0324" },
+ { "1E73", "20075_0324" },
+ { "1E74", "20055_0330" },
+ { "1E75", "20075_0330" },
+ { "1E76", "20055_032D" },
+ { "1E77", "20075_032D" },
+ { "1E78", "30055_0303_0301" },
+ { "1E79", "30075_0303_0301" },
+ { "1E7A", "30055_0304_0308" },
+ { "1E7B", "30075_0304_0308" },
+ { "1E7C", "20056_0303" },
+ { "1E7D", "20076_0303" },
+ { "1E7E", "20056_0323" },
+ { "1E7F", "20076_0323" },
+ { "1E80", "20057_0300" },
+ { "1E81", "20077_0300" },
+ { "1E82", "20057_0301" },
+ { "1E83", "20077_0301" },
+ { "1E84", "20057_0308" },
+ { "1E85", "20077_0308" },
+ { "1E86", "20057_0307" },
+ { "1E87", "20077_0307" },
+ { "1E88", "20057_0323" },
+ { "1E89", "20077_0323" },
+ { "1E8A", "20058_0307" },
+ { "1E8B", "20078_0307" },
+ { "1E8C", "20058_0308" },
+ { "1E8D", "20078_0308" },
+ { "1E8E", "20059_0307" },
+ { "1E8F", "20079_0307" },
+ { "1E90", "2005A_0302" },
+ { "1E91", "2007A_0302" },
+ { "1E92", "2005A_0323" },
+ { "1E93", "2007A_0323" },
+ { "1E94", "2005A_0331" },
+ { "1E95", "2007A_0331" },
+ { "1E96", "20068_0331" },
+ { "1E97", "20074_0308" },
+ { "1E98", "20077_030A" },
+ { "1E99", "20079_030A" },
+ { "1E9B", "2017F_0307" },
+ { "1EA0", "20041_0323" },
+ { "1EA1", "20061_0323" },
+ { "1EA2", "20041_0309" },
+ { "1EA3", "20061_0309" },
+ { "1EA4", "30041_0302_0301" },
+ { "1EA5", "30061_0302_0301" },
+ { "1EA6", "30041_0302_0300" },
+ { "1EA7", "30061_0302_0300" },
+ { "1EA8", "30041_0302_0309" },
+ { "1EA9", "30061_0302_0309" },
+ { "1EAA", "30041_0302_0303" },
+ { "1EAB", "30061_0302_0303" },
+ { "1EAC", "30041_0323_0302" },
+ { "1EAD", "30061_0323_0302" },
+ { "1EAE", "30041_0306_0301" },
+ { "1EAF", "30061_0306_0301" },
+ { "1EB0", "30041_0306_0300" },
+ { "1EB1", "30061_0306_0300" },
+ { "1EB2", "30041_0306_0309" },
+ { "1EB3", "30061_0306_0309" },
+ { "1EB4", "30041_0306_0303" },
+ { "1EB5", "30061_0306_0303" },
+ { "1EB6", "30041_0323_0306" },
+ { "1EB7", "30061_0323_0306" },
+ { "1EB8", "20045_0323" },
+ { "1EB9", "20065_0323" },
+ { "1EBA", "20045_0309" },
+ { "1EBB", "20065_0309" },
+ { "1EBC", "20045_0303" },
+ { "1EBD", "20065_0303" },
+ { "1EBE", "30045_0302_0301" },
+ { "1EBF", "30065_0302_0301" },
+ { "1EC0", "30045_0302_0300" },
+ { "1EC1", "30065_0302_0300" },
+ { "1EC2", "30045_0302_0309" },
+ { "1EC3", "30065_0302_0309" },
+ { "1EC4", "30045_0302_0303" },
+ { "1EC5", "30065_0302_0303" },
+ { "1EC6", "30045_0323_0302" },
+ { "1EC7", "30065_0323_0302" },
+ { "1EC8", "20049_0309" },
+ { "1EC9", "20069_0309" },
+ { "1ECA", "20049_0323" },
+ { "1ECB", "20069_0323" },
+ { "1ECC", "2004F_0323" },
+ { "1ECD", "2006F_0323" },
+ { "1ECE", "2004F_0309" },
+ { "1ECF", "2006F_0309" },
+ { "1ED0", "3004F_0302_0301" },
+ { "1ED1", "3006F_0302_0301" },
+ { "1ED2", "3004F_0302_0300" },
+ { "1ED3", "3006F_0302_0300" },
+ { "1ED4", "3004F_0302_0309" },
+ { "1ED5", "3006F_0302_0309" },
+ { "1ED6", "3004F_0302_0303" },
+ { "1ED7", "3006F_0302_0303" },
+ { "1ED8", "3004F_0323_0302" },
+ { "1ED9", "3006F_0323_0302" },
+ { "1EDA", "3004F_031B_0301" },
+ { "1EDB", "3006F_031B_0301" },
+ { "1EDC", "3004F_031B_0300" },
+ { "1EDD", "3006F_031B_0300" },
+ { "1EDE", "3004F_031B_0309" },
+ { "1EDF", "3006F_031B_0309" },
+ { "1EE0", "3004F_031B_0303" },
+ { "1EE1", "3006F_031B_0303" },
+ { "1EE2", "3004F_031B_0323" },
+ { "1EE3", "3006F_031B_0323" },
+ { "1EE4", "20055_0323" },
+ { "1EE5", "20075_0323" },
+ { "1EE6", "20055_0309" },
+ { "1EE7", "20075_0309" },
+ { "1EE8", "30055_031B_0301" },
+ { "1EE9", "30075_031B_0301" },
+ { "1EEA", "30055_031B_0300" },
+ { "1EEB", "30075_031B_0300" },
+ { "1EEC", "30055_031B_0309" },
+ { "1EED", "30075_031B_0309" },
+ { "1EEE", "30055_031B_0303" },
+ { "1EEF", "30075_031B_0303" },
+ { "1EF0", "30055_031B_0323" },
+ { "1EF1", "30075_031B_0323" },
+ { "1EF2", "20059_0300" },
+ { "1EF3", "20079_0300" },
+ { "1EF4", "20059_0323" },
+ { "1EF5", "20079_0323" },
+ { "1EF6", "20059_0309" },
+ { "1EF7", "20079_0309" },
+ { "1EF8", "20059_0303" },
+ { "1EF9", "20079_0303" },
+ { "1F00", "203B1_0313" },
+ { "1F01", "203B1_0314" },
+ { "1F02", "303B1_0313_0300" },
+ { "1F03", "303B1_0314_0300" },
+ { "1F04", "303B1_0313_0301" },
+ { "1F05", "303B1_0314_0301" },
+ { "1F06", "303B1_0313_0342" },
+ { "1F07", "303B1_0314_0342" },
+ { "1F08", "20391_0313" },
+ { "1F09", "20391_0314" },
+ { "1F0A", "30391_0313_0300" },
+ { "1F0B", "30391_0314_0300" },
+ { "1F0C", "30391_0313_0301" },
+ { "1F0D", "30391_0314_0301" },
+ { "1F0E", "30391_0313_0342" },
+ { "1F0F", "30391_0314_0342" },
+ { "1F10", "203B5_0313" },
+ { "1F11", "203B5_0314" },
+ { "1F12", "303B5_0313_0300" },
+ { "1F13", "303B5_0314_0300" },
+ { "1F14", "303B5_0313_0301" },
+ { "1F15", "303B5_0314_0301" },
+ { "1F18", "20395_0313" },
+ { "1F19", "20395_0314" },
+ { "1F1A", "30395_0313_0300" },
+ { "1F1B", "30395_0314_0300" },
+ { "1F1C", "30395_0313_0301" },
+ { "1F1D", "30395_0314_0301" },
+ { "1F20", "203B7_0313" },
+ { "1F21", "203B7_0314" },
+ { "1F22", "303B7_0313_0300" },
+ { "1F23", "303B7_0314_0300" },
+ { "1F24", "303B7_0313_0301" },
+ { "1F25", "303B7_0314_0301" },
+ { "1F26", "303B7_0313_0342" },
+ { "1F27", "303B7_0314_0342" },
+ { "1F28", "20397_0313" },
+ { "1F29", "20397_0314" },
+ { "1F2A", "30397_0313_0300" },
+ { "1F2B", "30397_0314_0300" },
+ { "1F2C", "30397_0313_0301" },
+ { "1F2D", "30397_0314_0301" },
+ { "1F2E", "30397_0313_0342" },
+ { "1F2F", "30397_0314_0342" },
+ { "1F30", "203B9_0313" },
+ { "1F31", "203B9_0314" },
+ { "1F32", "303B9_0313_0300" },
+ { "1F33", "303B9_0314_0300" },
+ { "1F34", "303B9_0313_0301" },
+ { "1F35", "303B9_0314_0301" },
+ { "1F36", "303B9_0313_0342" },
+ { "1F37", "303B9_0314_0342" },
+ { "1F38", "20399_0313" },
+ { "1F39", "20399_0314" },
+ { "1F3A", "30399_0313_0300" },
+ { "1F3B", "30399_0314_0300" },
+ { "1F3C", "30399_0313_0301" },
+ { "1F3D", "30399_0314_0301" },
+ { "1F3E", "30399_0313_0342" },
+ { "1F3F", "30399_0314_0342" },
+ { "1F40", "203BF_0313" },
+ { "1F41", "203BF_0314" },
+ { "1F42", "303BF_0313_0300" },
+ { "1F43", "303BF_0314_0300" },
+ { "1F44", "303BF_0313_0301" },
+ { "1F45", "303BF_0314_0301" },
+ { "1F48", "2039F_0313" },
+ { "1F49", "2039F_0314" },
+ { "1F4A", "3039F_0313_0300" },
+ { "1F4B", "3039F_0314_0300" },
+ { "1F4C", "3039F_0313_0301" },
+ { "1F4D", "3039F_0314_0301" },
+ { "1F50", "203C5_0313" },
+ { "1F51", "203C5_0314" },
+ { "1F52", "303C5_0313_0300" },
+ { "1F53", "303C5_0314_0300" },
+ { "1F54", "303C5_0313_0301" },
+ { "1F55", "303C5_0314_0301" },
+ { "1F56", "303C5_0313_0342" },
+ { "1F57", "303C5_0314_0342" },
+ { "1F59", "203A5_0314" },
+ { "1F5B", "303A5_0314_0300" },
+ { "1F5D", "303A5_0314_0301" },
+ { "1F5F", "303A5_0314_0342" },
+ { "1F60", "203C9_0313" },
+ { "1F61", "203C9_0314" },
+ { "1F62", "303C9_0313_0300" },
+ { "1F63", "303C9_0314_0300" },
+ { "1F64", "303C9_0313_0301" },
+ { "1F65", "303C9_0314_0301" },
+ { "1F66", "303C9_0313_0342" },
+ { "1F67", "303C9_0314_0342" },
+ { "1F68", "203A9_0313" },
+ { "1F69", "203A9_0314" },
+ { "1F6A", "303A9_0313_0300" },
+ { "1F6B", "303A9_0314_0300" },
+ { "1F6C", "303A9_0313_0301" },
+ { "1F6D", "303A9_0314_0301" },
+ { "1F6E", "303A9_0313_0342" },
+ { "1F6F", "303A9_0314_0342" },
+ { "1F70", "203B1_0300" },
+ { "1F71", "203B1_0301" },
+ { "1F72", "203B5_0300" },
+ { "1F73", "203B5_0301" },
+ { "1F74", "203B7_0300" },
+ { "1F75", "203B7_0301" },
+ { "1F76", "203B9_0300" },
+ { "1F77", "203B9_0301" },
+ { "1F78", "203BF_0300" },
+ { "1F79", "203BF_0301" },
+ { "1F7A", "203C5_0300" },
+ { "1F7B", "203C5_0301" },
+ { "1F7C", "203C9_0300" },
+ { "1F7D", "203C9_0301" },
+ { "1F80", "303B1_0313_0345" },
+ { "1F81", "303B1_0314_0345" },
+ { "1F82", "403B1_0313_0300_0345" },
+ { "1F83", "403B1_0314_0300_0345" },
+ { "1F84", "403B1_0313_0301_0345" },
+ { "1F85", "403B1_0314_0301_0345" },
+ { "1F86", "403B1_0313_0342_0345" },
+ { "1F87", "403B1_0314_0342_0345" },
+ { "1F88", "30391_0313_0345" },
+ { "1F89", "30391_0314_0345" },
+ { "1F8A", "40391_0313_0300_0345" },
+ { "1F8B", "40391_0314_0300_0345" },
+ { "1F8C", "40391_0313_0301_0345" },
+ { "1F8D", "40391_0314_0301_0345" },
+ { "1F8E", "40391_0313_0342_0345" },
+ { "1F8F", "40391_0314_0342_0345" },
+ { "1F90", "303B7_0313_0345" },
+ { "1F91", "303B7_0314_0345" },
+ { "1F92", "403B7_0313_0300_0345" },
+ { "1F93", "403B7_0314_0300_0345" },
+ { "1F94", "403B7_0313_0301_0345" },
+ { "1F95", "403B7_0314_0301_0345" },
+ { "1F96", "403B7_0313_0342_0345" },
+ { "1F97", "403B7_0314_0342_0345" },
+ { "1F98", "30397_0313_0345" },
+ { "1F99", "30397_0314_0345" },
+ { "1F9A", "40397_0313_0300_0345" },
+ { "1F9B", "40397_0314_0300_0345" },
+ { "1F9C", "40397_0313_0301_0345" },
+ { "1F9D", "40397_0314_0301_0345" },
+ { "1F9E", "40397_0313_0342_0345" },
+ { "1F9F", "40397_0314_0342_0345" },
+ { "1FA0", "303C9_0313_0345" },
+ { "1FA1", "303C9_0314_0345" },
+ { "1FA2", "403C9_0313_0300_0345" },
+ { "1FA3", "403C9_0314_0300_0345" },
+ { "1FA4", "403C9_0313_0301_0345" },
+ { "1FA5", "403C9_0314_0301_0345" },
+ { "1FA6", "403C9_0313_0342_0345" },
+ { "1FA7", "403C9_0314_0342_0345" },
+ { "1FA8", "303A9_0313_0345" },
+ { "1FA9", "303A9_0314_0345" },
+ { "1FAA", "403A9_0313_0300_0345" },
+ { "1FAB", "403A9_0314_0300_0345" },
+ { "1FAC", "403A9_0313_0301_0345" },
+ { "1FAD", "403A9_0314_0301_0345" },
+ { "1FAE", "403A9_0313_0342_0345" },
+ { "1FAF", "403A9_0314_0342_0345" },
+ { "1FB0", "203B1_0306" },
+ { "1FB1", "203B1_0304" },
+ { "1FB2", "303B1_0300_0345" },
+ { "1FB3", "203B1_0345" },
+ { "1FB4", "303B1_0301_0345" },
+ { "1FB6", "203B1_0342" },
+ { "1FB7", "303B1_0342_0345" },
+ { "1FB8", "20391_0306" },
+ { "1FB9", "20391_0304" },
+ { "1FBA", "20391_0300" },
+ { "1FBB", "20391_0301" },
+ { "1FBC", "20391_0345" },
+ { "1FBE", "103B9" },
+ { "1FC1", "200A8_0342" },
+ { "1FC2", "303B7_0300_0345" },
+ { "1FC3", "203B7_0345" },
+ { "1FC4", "303B7_0301_0345" },
+ { "1FC6", "203B7_0342" },
+ { "1FC7", "303B7_0342_0345" },
+ { "1FC8", "20395_0300" },
+ { "1FC9", "20395_0301" },
+ { "1FCA", "20397_0300" },
+ { "1FCB", "20397_0301" },
+ { "1FCC", "20397_0345" },
+ { "1FCD", "21FBF_0300" },
+ { "1FCE", "21FBF_0301" },
+ { "1FCF", "21FBF_0342" },
+ { "1FD0", "203B9_0306" },
+ { "1FD1", "203B9_0304" },
+ { "1FD2", "303B9_0308_0300" },
+ { "1FD3", "303B9_0308_0301" },
+ { "1FD6", "203B9_0342" },
+ { "1FD7", "303B9_0308_0342" },
+ { "1FD8", "20399_0306" },
+ { "1FD9", "20399_0304" },
+ { "1FDA", "20399_0300" },
+ { "1FDB", "20399_0301" },
+ { "1FDD", "21FFE_0300" },
+ { "1FDE", "21FFE_0301" },
+ { "1FDF", "21FFE_0342" },
+ { "1FE0", "203C5_0306" },
+ { "1FE1", "203C5_0304" },
+ { "1FE2", "303C5_0308_0300" },
+ { "1FE3", "303C5_0308_0301" },
+ { "1FE4", "203C1_0313" },
+ { "1FE5", "203C1_0314" },
+ { "1FE6", "203C5_0342" },
+ { "1FE7", "303C5_0308_0342" },
+ { "1FE8", "203A5_0306" },
+ { "1FE9", "203A5_0304" },
+ { "1FEA", "203A5_0300" },
+ { "1FEB", "203A5_0301" },
+ { "1FEC", "203A1_0314" },
+ { "1FED", "200A8_0300" },
+ { "1FEE", "200A8_0301" },
+ { "1FEF", "10060" },
+ { "1FF2", "303C9_0300_0345" },
+ { "1FF3", "203C9_0345" },
+ { "1FF4", "303C9_0301_0345" },
+ { "1FF6", "203C9_0342" },
+ { "1FF7", "303C9_0342_0345" },
+ { "1FF8", "2039F_0300" },
+ { "1FF9", "2039F_0301" },
+ { "1FFA", "203A9_0300" },
+ { "1FFB", "203A9_0301" },
+ { "1FFC", "203A9_0345" },
+ { "1FFD", "100B4" },
+ { "2000", "12002" },
+ { "2001", "12003" },
+ { "2126", "103A9" },
+ { "212A", "1004B" },
+ { "212B", "20041_030A" },
+ { "219A", "22190_0338" },
+ { "219B", "22192_0338" },
+ { "21AE", "22194_0338" },
+ { "21CD", "221D0_0338" },
+ { "21CE", "221D4_0338" },
+ { "21CF", "221D2_0338" },
+ { "2204", "22203_0338" },
+ { "2209", "22208_0338" },
+ { "220C", "2220B_0338" },
+ { "2224", "22223_0338" },
+ { "2226", "22225_0338" },
+ { "2241", "2223C_0338" },
+ { "2244", "22243_0338" },
+ { "2247", "22245_0338" },
+ { "2249", "22248_0338" },
+ { "2260", "2003D_0338" },
+ { "2262", "22261_0338" },
+ { "226D", "2224D_0338" },
+ { "226E", "2003C_0338" },
+ { "226F", "2003E_0338" },
+ { "2270", "22264_0338" },
+ { "2271", "22265_0338" },
+ { "2274", "22272_0338" },
+ { "2275", "22273_0338" },
+ { "2278", "22276_0338" },
+ { "2279", "22277_0338" },
+ { "2280", "2227A_0338" },
+ { "2281", "2227B_0338" },
+ { "2284", "22282_0338" },
+ { "2285", "22283_0338" },
+ { "2288", "22286_0338" },
+ { "2289", "22287_0338" },
+ { "22AC", "222A2_0338" },
+ { "22AD", "222A8_0338" },
+ { "22AE", "222A9_0338" },
+ { "22AF", "222AB_0338" },
+ { "22E0", "2227C_0338" },
+ { "22E1", "2227D_0338" },
+ { "22E2", "22291_0338" },
+ { "22E3", "22292_0338" },
+ { "22EA", "222B2_0338" },
+ { "22EB", "222B3_0338" },
+ { "22EC", "222B4_0338" },
+ { "22ED", "222B5_0338" },
+ { "2329", "13008" },
+ { "232A", "13009" },
+ { "2ADC", "22ADD_0338" },
+ { "304C", "2304B_3099" },
+ { "304E", "2304D_3099" },
+ { "3050", "2304F_3099" },
+ { "3052", "23051_3099" },
+ { "3054", "23053_3099" },
+ { "3056", "23055_3099" },
+ { "3058", "23057_3099" },
+ { "305A", "23059_3099" },
+ { "305C", "2305B_3099" },
+ { "305E", "2305D_3099" },
+ { "3060", "2305F_3099" },
+ { "3062", "23061_3099" },
+ { "3065", "23064_3099" },
+ { "3067", "23066_3099" },
+ { "3069", "23068_3099" },
+ { "3070", "2306F_3099" },
+ { "3071", "2306F_309A" },
+ { "3073", "23072_3099" },
+ { "3074", "23072_309A" },
+ { "3076", "23075_3099" },
+ { "3077", "23075_309A" },
+ { "3079", "23078_3099" },
+ { "307A", "23078_309A" },
+ { "307C", "2307B_3099" },
+ { "307D", "2307B_309A" },
+ { "3094", "23046_3099" },
+ { "309E", "2309D_3099" },
+ { "30AC", "230AB_3099" },
+ { "30AE", "230AD_3099" },
+ { "30B0", "230AF_3099" },
+ { "30B2", "230B1_3099" },
+ { "30B4", "230B3_3099" },
+ { "30B6", "230B5_3099" },
+ { "30B8", "230B7_3099" },
+ { "30BA", "230B9_3099" },
+ { "30BC", "230BB_3099" },
+ { "30BE", "230BD_3099" },
+ { "30C0", "230BF_3099" },
+ { "30C2", "230C1_3099" },
+ { "30C5", "230C4_3099" },
+ { "30C7", "230C6_3099" },
+ { "30C9", "230C8_3099" },
+ { "30D0", "230CF_3099" },
+ { "30D1", "230CF_309A" },
+ { "30D3", "230D2_3099" },
+ { "30D4", "230D2_309A" },
+ { "30D6", "230D5_3099" },
+ { "30D7", "230D5_309A" },
+ { "30D9", "230D8_3099" },
+ { "30DA", "230D8_309A" },
+ { "30DC", "230DB_3099" },
+ { "30DD", "230DB_309A" },
+ { "30F4", "230A6_3099" },
+ { "30F7", "230EF_3099" },
+ { "30F8", "230F0_3099" },
+ { "30F9", "230F1_3099" },
+ { "30FA", "230F2_3099" },
+ { "30FE", "230FD_3099" },
+ { "F900", "18C48" },
+ { "F901", "166F4" },
+ { "F902", "18ECA" },
+ { "F903", "18CC8" },
+ { "F904", "16ED1" },
+ { "F905", "14E32" },
+ { "F906", "153E5" },
+ { "F907", "19F9C" },
+ { "F908", "19F9C" },
+ { "F909", "15951" },
+ { "F90A", "191D1" },
+ { "F90B", "15587" },
+ { "F90C", "15948" },
+ { "F90D", "161F6" },
+ { "F90E", "17669" },
+ { "F90F", "17F85" },
+ { "F910", "1863F" },
+ { "F911", "187BA" },
+ { "F912", "188F8" },
+ { "F913", "1908F" },
+ { "F914", "16A02" },
+ { "F915", "16D1B" },
+ { "F916", "170D9" },
+ { "F917", "173DE" },
+ { "F918", "1843D" },
+ { "F919", "1916A" },
+ { "F91A", "199F1" },
+ { "F91B", "14E82" },
+ { "F91C", "15375" },
+ { "F91D", "16B04" },
+ { "F91E", "1721B" },
+ { "F91F", "1862D" },
+ { "F920", "19E1E" },
+ { "F921", "15D50" },
+ { "F922", "16FEB" },
+ { "F923", "185CD" },
+ { "F924", "18964" },
+ { "F925", "162C9" },
+ { "F926", "181D8" },
+ { "F927", "1881F" },
+ { "F928", "15ECA" },
+ { "F929", "16717" },
+ { "F92A", "16D6A" },
+ { "F92B", "172FC" },
+ { "F92C", "190CE" },
+ { "F92D", "14F86" },
+ { "F92E", "151B7" },
+ { "F92F", "152DE" },
+ { "F930", "164C4" },
+ { "F931", "16AD3" },
+ { "F932", "17210" },
+ { "F933", "176E7" },
+ { "F934", "18001" },
+ { "F935", "18606" },
+ { "F936", "1865C" },
+ { "F937", "18DEF" },
+ { "F938", "19732" },
+ { "F939", "19B6F" },
+ { "F93A", "19DFA" },
+ { "F93B", "1788C" },
+ { "F93C", "1797F" },
+ { "F93D", "17DA0" },
+ { "F93E", "183C9" },
+ { "F93F", "19304" },
+ { "F940", "19E7F" },
+ { "F941", "18AD6" },
+ { "F942", "158DF" },
+ { "F943", "15F04" },
+ { "F944", "17C60" },
+ { "F945", "1807E" },
+ { "F946", "17262" },
+ { "F947", "178CA" },
+ { "F948", "18CC2" },
+ { "F949", "196F7" },
+ { "F94A", "158D8" },
+ { "F94B", "15C62" },
+ { "F94C", "16A13" },
+ { "F94D", "16DDA" },
+ { "F94E", "16F0F" },
+ { "F94F", "17D2F" },
+ { "F950", "17E37" },
+ { "F951", "1964B" },
+ { "F952", "152D2" },
+ { "F953", "1808B" },
+ { "F954", "151DC" },
+ { "F955", "151CC" },
+ { "F956", "17A1C" },
+ { "F957", "17DBE" },
+ { "F958", "183F1" },
+ { "F959", "19675" },
+ { "F95A", "18B80" },
+ { "F95B", "162CF" },
+ { "F95C", "16A02" },
+ { "F95D", "18AFE" },
+ { "F95E", "14E39" },
+ { "F95F", "15BE7" },
+ { "F960", "16012" },
+ { "F961", "17387" },
+ { "F962", "17570" },
+ { "F963", "15317" },
+ { "F964", "178FB" },
+ { "F965", "14FBF" },
+ { "F966", "15FA9" },
+ { "F967", "14E0D" },
+ { "F968", "16CCC" },
+ { "F969", "16578" },
+ { "F96A", "17D22" },
+ { "F96B", "153C3" },
+ { "F96C", "1585E" },
+ { "F96D", "17701" },
+ { "F96E", "18449" },
+ { "F96F", "18AAA" },
+ { "F970", "16BBA" },
+ { "F971", "18FB0" },
+ { "F972", "16C88" },
+ { "F973", "162FE" },
+ { "F974", "182E5" },
+ { "F975", "163A0" },
+ { "F976", "17565" },
+ { "F977", "14EAE" },
+ { "F978", "15169" },
+ { "F979", "151C9" },
+ { "F97A", "16881" },
+ { "F97B", "17CE7" },
+ { "F97C", "1826F" },
+ { "F97D", "18AD2" },
+ { "F97E", "191CF" },
+ { "F97F", "152F5" },
+ { "F980", "15442" },
+ { "F981", "15973" },
+ { "F982", "15EEC" },
+ { "F983", "165C5" },
+ { "F984", "16FFE" },
+ { "F985", "1792A" },
+ { "F986", "195AD" },
+ { "F987", "19A6A" },
+ { "F988", "19E97" },
+ { "F989", "19ECE" },
+ { "F98A", "1529B" },
+ { "F98B", "166C6" },
+ { "F98C", "16B77" },
+ { "F98D", "18F62" },
+ { "F98E", "15E74" },
+ { "F98F", "16190" },
+ { "F990", "16200" },
+ { "F991", "1649A" },
+ { "F992", "16F23" },
+ { "F993", "17149" },
+ { "F994", "17489" },
+ { "F995", "179CA" },
+ { "F996", "17DF4" },
+ { "F997", "1806F" },
+ { "F998", "18F26" },
+ { "F999", "184EE" },
+ { "F99A", "19023" },
+ { "F99B", "1934A" },
+ { "F99C", "15217" },
+ { "F99D", "152A3" },
+ { "F99E", "154BD" },
+ { "F99F", "170C8" },
+ { "F9A0", "188C2" },
+ { "F9A1", "18AAA" },
+ { "F9A2", "15EC9" },
+ { "F9A3", "15FF5" },
+ { "F9A4", "1637B" },
+ { "F9A5", "16BAE" },
+ { "F9A6", "17C3E" },
+ { "F9A7", "17375" },
+ { "F9A8", "14EE4" },
+ { "F9A9", "156F9" },
+ { "F9AA", "15BE7" },
+ { "F9AB", "15DBA" },
+ { "F9AC", "1601C" },
+ { "F9AD", "173B2" },
+ { "F9AE", "17469" },
+ { "F9AF", "17F9A" },
+ { "F9B0", "18046" },
+ { "F9B1", "19234" },
+ { "F9B2", "196F6" },
+ { "F9B3", "19748" },
+ { "F9B4", "19818" },
+ { "F9B5", "14F8B" },
+ { "F9B6", "179AE" },
+ { "F9B7", "191B4" },
+ { "F9B8", "196B8" },
+ { "F9B9", "160E1" },
+ { "F9BA", "14E86" },
+ { "F9BB", "150DA" },
+ { "F9BC", "15BEE" },
+ { "F9BD", "15C3F" },
+ { "F9BE", "16599" },
+ { "F9BF", "16A02" },
+ { "F9C0", "171CE" },
+ { "F9C1", "17642" },
+ { "F9C2", "184FC" },
+ { "F9C3", "1907C" },
+ { "F9C4", "19F8D" },
+ { "F9C5", "16688" },
+ { "F9C6", "1962E" },
+ { "F9C7", "15289" },
+ { "F9C8", "1677B" },
+ { "F9C9", "167F3" },
+ { "F9CA", "16D41" },
+ { "F9CB", "16E9C" },
+ { "F9CC", "17409" },
+ { "F9CD", "17559" },
+ { "F9CE", "1786B" },
+ { "F9CF", "17D10" },
+ { "F9D0", "1985E" },
+ { "F9D1", "1516D" },
+ { "F9D2", "1622E" },
+ { "F9D3", "19678" },
+ { "F9D4", "1502B" },
+ { "F9D5", "15D19" },
+ { "F9D6", "16DEA" },
+ { "F9D7", "18F2A" },
+ { "F9D8", "15F8B" },
+ { "F9D9", "16144" },
+ { "F9DA", "16817" },
+ { "F9DB", "17387" },
+ { "F9DC", "19686" },
+ { "F9DD", "15229" },
+ { "F9DE", "1540F" },
+ { "F9DF", "15C65" },
+ { "F9E0", "16613" },
+ { "F9E1", "1674E" },
+ { "F9E2", "168A8" },
+ { "F9E3", "16CE5" },
+ { "F9E4", "17406" },
+ { "F9E5", "175E2" },
+ { "F9E6", "17F79" },
+ { "F9E7", "188CF" },
+ { "F9E8", "188E1" },
+ { "F9E9", "191CC" },
+ { "F9EA", "196E2" },
+ { "F9EB", "1533F" },
+ { "F9EC", "16EBA" },
+ { "F9ED", "1541D" },
+ { "F9EE", "171D0" },
+ { "F9EF", "17498" },
+ { "F9F0", "185FA" },
+ { "F9F1", "196A3" },
+ { "F9F2", "19C57" },
+ { "F9F3", "19E9F" },
+ { "F9F4", "16797" },
+ { "F9F5", "16DCB" },
+ { "F9F6", "181E8" },
+ { "F9F7", "17ACB" },
+ { "F9F8", "17B20" },
+ { "F9F9", "17C92" },
+ { "F9FA", "172C0" },
+ { "F9FB", "17099" },
+ { "F9FC", "18B58" },
+ { "F9FD", "14EC0" },
+ { "F9FE", "18336" },
+ { "F9FF", "1523A" },
+ { "FA00", "15207" },
+ { "FA01", "15EA6" },
+ { "FA02", "162D3" },
+ { "FA03", "17CD6" },
+ { "FA04", "15B85" },
+ { "FA05", "16D1E" },
+ { "FA06", "166B4" },
+ { "FA07", "18F3B" },
+ { "FA08", "1884C" },
+ { "FA09", "1964D" },
+ { "FA0A", "1898B" },
+ { "FA0B", "15ED3" },
+ { "FA0C", "15140" },
+ { "FA0D", "155C0" },
+ { "FA10", "1585A" },
+ { "FA12", "16674" },
+ { "FA15", "151DE" },
+ { "FA16", "1732A" },
+ { "FA17", "176CA" },
+ { "FA18", "1793C" },
+ { "FA19", "1795E" },
+ { "FA1A", "17965" },
+ { "FA1B", "1798F" },
+ { "FA1C", "19756" },
+ { "FA1D", "17CBE" },
+ { "FA1E", "17FBD" },
+ { "FA20", "18612" },
+ { "FA22", "18AF8" },
+ { "FA25", "19038" },
+ { "FA26", "190FD" },
+ { "FA2A", "198EF" },
+ { "FA2B", "198FC" },
+ { "FA2C", "19928" },
+ { "FA2D", "19DB4" },
+ { "FA30", "14FAE" },
+ { "FA31", "150E7" },
+ { "FA32", "1514D" },
+ { "FA33", "152C9" },
+ { "FA34", "152E4" },
+ { "FA35", "15351" },
+ { "FA36", "1559D" },
+ { "FA37", "15606" },
+ { "FA38", "15668" },
+ { "FA39", "15840" },
+ { "FA3A", "158A8" },
+ { "FA3B", "15C64" },
+ { "FA3C", "15C6E" },
+ { "FA3D", "16094" },
+ { "FA3E", "16168" },
+ { "FA3F", "1618E" },
+ { "FA40", "161F2" },
+ { "FA41", "1654F" },
+ { "FA42", "165E2" },
+ { "FA43", "16691" },
+ { "FA44", "16885" },
+ { "FA45", "16D77" },
+ { "FA46", "16E1A" },
+ { "FA47", "16F22" },
+ { "FA48", "1716E" },
+ { "FA49", "1722B" },
+ { "FA4A", "17422" },
+ { "FA4B", "17891" },
+ { "FA4C", "1793E" },
+ { "FA4D", "17949" },
+ { "FA4E", "17948" },
+ { "FA4F", "17950" },
+ { "FA50", "17956" },
+ { "FA51", "1795D" },
+ { "FA52", "1798D" },
+ { "FA53", "1798E" },
+ { "FA54", "17A40" },
+ { "FA55", "17A81" },
+ { "FA56", "17BC0" },
+ { "FA57", "17DF4" },
+ { "FA58", "17E09" },
+ { "FA59", "17E41" },
+ { "FA5A", "17F72" },
+ { "FA5B", "18005" },
+ { "FA5C", "181ED" },
+ { "FA5D", "18279" },
+ { "FA5E", "18279" },
+ { "FA5F", "18457" },
+ { "FA60", "18910" },
+ { "FA61", "18996" },
+ { "FA62", "18B01" },
+ { "FA63", "18B39" },
+ { "FA64", "18CD3" },
+ { "FA65", "18D08" },
+ { "FA66", "18FB6" },
+ { "FA67", "19038" },
+ { "FA68", "196E3" },
+ { "FA69", "197FF" },
+ { "FA6A", "1983B" },
+ { "FB1D", "205D9_05B4" },
+ { "FB1F", "205F2_05B7" },
+ { "FB2A", "205E9_05C1" },
+ { "FB2B", "205E9_05C2" },
+ { "FB2C", "305E9_05BC_05C1" },
+ { "FB2D", "305E9_05BC_05C2" },
+ { "FB2E", "205D0_05B7" },
+ { "FB2F", "205D0_05B8" },
+ { "FB30", "205D0_05BC" },
+ { "FB31", "205D1_05BC" },
+ { "FB32", "205D2_05BC" },
+ { "FB33", "205D3_05BC" },
+ { "FB34", "205D4_05BC" },
+ { "FB35", "205D5_05BC" },
+ { "FB36", "205D6_05BC" },
+ { "FB38", "205D8_05BC" },
+ { "FB39", "205D9_05BC" },
+ { "FB3A", "205DA_05BC" },
+ { "FB3B", "205DB_05BC" },
+ { "FB3C", "205DC_05BC" },
+ { "FB3E", "205DE_05BC" },
+ { "FB40", "205E0_05BC" },
+ { "FB41", "205E1_05BC" },
+ { "FB43", "205E3_05BC" },
+ { "FB44", "205E4_05BC" },
+ { "FB46", "205E6_05BC" },
+ { "FB47", "205E7_05BC" },
+ { "FB48", "205E8_05BC" },
+ { "FB49", "205E9_05BC" },
+ { "FB4A", "205EA_05BC" },
+ { "FB4B", "205D5_05B9" },
+ { "FB4C", "205D1_05BF" },
+ { "FB4D", "205DB_05BF" },
+ { "FB4E", "205E4_05BF" },
+ { "1D15E", "21D157_1D165" },
+ { "1D15F", "21D158_1D165" },
+ { "1D160", "31D158_1D165_1D16E" },
+ { "1D161", "31D158_1D165_1D16F" },
+ { "1D162", "31D158_1D165_1D170" },
+ { "1D163", "31D158_1D165_1D171" },
+ { "1D164", "31D158_1D165_1D172" },
+ { "1D1BB", "21D1B9_1D165" },
+ { "1D1BC", "21D1BA_1D165" },
+ { "1D1BD", "31D1B9_1D165_1D16E" },
+ { "1D1BE", "31D1BA_1D165_1D16E" },
+ { "1D1BF", "31D1B9_1D165_1D16F" },
+ { "1D1C0", "31D1BA_1D165_1D16F" },
+ { "2F800", "14E3D" },
+ { "2F801", "14E38" },
+ { "2F802", "14E41" },
+ { "2F803", "120122" },
+ { "2F804", "14F60" },
+ { "2F805", "14FAE" },
+ { "2F806", "14FBB" },
+ { "2F807", "15002" },
+ { "2F808", "1507A" },
+ { "2F809", "15099" },
+ { "2F80A", "150E7" },
+ { "2F80B", "150CF" },
+ { "2F80C", "1349E" },
+ { "2F80D", "12063A" },
+ { "2F80E", "1514D" },
+ { "2F80F", "15154" },
+ { "2F810", "15164" },
+ { "2F811", "15177" },
+ { "2F812", "12051C" },
+ { "2F813", "134B9" },
+ { "2F814", "15167" },
+ { "2F815", "1518D" },
+ { "2F816", "12054B" },
+ { "2F817", "15197" },
+ { "2F818", "151A4" },
+ { "2F819", "14ECC" },
+ { "2F81A", "151AC" },
+ { "2F81B", "151B5" },
+ { "2F81C", "1291DF" },
+ { "2F81D", "151F5" },
+ { "2F81E", "15203" },
+ { "2F81F", "134DF" },
+ { "2F820", "1523B" },
+ { "2F821", "15246" },
+ { "2F822", "15272" },
+ { "2F823", "15277" },
+ { "2F824", "13515" },
+ { "2F825", "152C7" },
+ { "2F826", "152C9" },
+ { "2F827", "152E4" },
+ { "2F828", "152FA" },
+ { "2F829", "15305" },
+ { "2F82A", "15306" },
+ { "2F82B", "15317" },
+ { "2F82C", "15349" },
+ { "2F82D", "15351" },
+ { "2F82E", "1535A" },
+ { "2F82F", "15373" },
+ { "2F830", "1537D" },
+ { "2F831", "1537F" },
+ { "2F832", "1537F" },
+ { "2F833", "1537F" },
+ { "2F834", "120A2C" },
+ { "2F835", "17070" },
+ { "2F836", "153CA" },
+ { "2F837", "153DF" },
+ { "2F838", "120B63" },
+ { "2F839", "153EB" },
+ { "2F83A", "153F1" },
+ { "2F83B", "15406" },
+ { "2F83C", "1549E" },
+ { "2F83D", "15438" },
+ { "2F83E", "15448" },
+ { "2F83F", "15468" },
+ { "2F840", "154A2" },
+ { "2F841", "154F6" },
+ { "2F842", "15510" },
+ { "2F843", "15553" },
+ { "2F844", "15563" },
+ { "2F845", "15584" },
+ { "2F846", "15584" },
+ { "2F847", "15599" },
+ { "2F848", "155AB" },
+ { "2F849", "155B3" },
+ { "2F84A", "155C2" },
+ { "2F84B", "15716" },
+ { "2F84C", "15606" },
+ { "2F84D", "15717" },
+ { "2F84E", "15651" },
+ { "2F84F", "15674" },
+ { "2F850", "15207" },
+ { "2F851", "158EE" },
+ { "2F852", "157CE" },
+ { "2F853", "157F4" },
+ { "2F854", "1580D" },
+ { "2F855", "1578B" },
+ { "2F856", "15832" },
+ { "2F857", "15831" },
+ { "2F858", "158AC" },
+ { "2F859", "1214E4" },
+ { "2F85A", "158F2" },
+ { "2F85B", "158F7" },
+ { "2F85C", "15906" },
+ { "2F85D", "1591A" },
+ { "2F85E", "15922" },
+ { "2F85F", "15962" },
+ { "2F860", "1216A8" },
+ { "2F861", "1216EA" },
+ { "2F862", "159EC" },
+ { "2F863", "15A1B" },
+ { "2F864", "15A27" },
+ { "2F865", "159D8" },
+ { "2F866", "15A66" },
+ { "2F867", "136EE" },
+ { "2F868", "12136A" },
+ { "2F869", "15B08" },
+ { "2F86A", "15B3E" },
+ { "2F86B", "15B3E" },
+ { "2F86C", "1219C8" },
+ { "2F86D", "15BC3" },
+ { "2F86E", "15BD8" },
+ { "2F86F", "15BE7" },
+ { "2F870", "15BF3" },
+ { "2F871", "121B18" },
+ { "2F872", "15BFF" },
+ { "2F873", "15C06" },
+ { "2F874", "15F33" },
+ { "2F875", "15C22" },
+ { "2F876", "13781" },
+ { "2F877", "15C60" },
+ { "2F878", "15C6E" },
+ { "2F879", "15CC0" },
+ { "2F87A", "15C8D" },
+ { "2F87B", "121DE4" },
+ { "2F87C", "15D43" },
+ { "2F87D", "121DE6" },
+ { "2F87E", "15D6E" },
+ { "2F87F", "15D6B" },
+ { "2F880", "15D7C" },
+ { "2F881", "15DE1" },
+ { "2F882", "15DE2" },
+ { "2F883", "1382F" },
+ { "2F884", "15DFD" },
+ { "2F885", "15E28" },
+ { "2F886", "15E3D" },
+ { "2F887", "15E69" },
+ { "2F888", "13862" },
+ { "2F889", "122183" },
+ { "2F88A", "1387C" },
+ { "2F88B", "15EB0" },
+ { "2F88C", "15EB3" },
+ { "2F88D", "15EB6" },
+ { "2F88E", "15ECA" },
+ { "2F88F", "12A392" },
+ { "2F890", "15EFE" },
+ { "2F891", "122331" },
+ { "2F892", "122331" },
+ { "2F893", "18201" },
+ { "2F894", "15F22" },
+ { "2F895", "15F22" },
+ { "2F896", "138C7" },
+ { "2F897", "1232B8" },
+ { "2F898", "1261DA" },
+ { "2F899", "15F62" },
+ { "2F89A", "15F6B" },
+ { "2F89B", "138E3" },
+ { "2F89C", "15F9A" },
+ { "2F89D", "15FCD" },
+ { "2F89E", "15FD7" },
+ { "2F89F", "15FF9" },
+ { "2F8A0", "16081" },
+ { "2F8A1", "1393A" },
+ { "2F8A2", "1391C" },
+ { "2F8A3", "16094" },
+ { "2F8A4", "1226D4" },
+ { "2F8A5", "160C7" },
+ { "2F8A6", "16148" },
+ { "2F8A7", "1614C" },
+ { "2F8A8", "1614E" },
+ { "2F8A9", "1614C" },
+ { "2F8AA", "1617A" },
+ { "2F8AB", "1618E" },
+ { "2F8AC", "161B2" },
+ { "2F8AD", "161A4" },
+ { "2F8AE", "161AF" },
+ { "2F8AF", "161DE" },
+ { "2F8B0", "161F2" },
+ { "2F8B1", "161F6" },
+ { "2F8B2", "16210" },
+ { "2F8B3", "1621B" },
+ { "2F8B4", "1625D" },
+ { "2F8B5", "162B1" },
+ { "2F8B6", "162D4" },
+ { "2F8B7", "16350" },
+ { "2F8B8", "122B0C" },
+ { "2F8B9", "1633D" },
+ { "2F8BA", "162FC" },
+ { "2F8BB", "16368" },
+ { "2F8BC", "16383" },
+ { "2F8BD", "163E4" },
+ { "2F8BE", "122BF1" },
+ { "2F8BF", "16422" },
+ { "2F8C0", "163C5" },
+ { "2F8C1", "163A9" },
+ { "2F8C2", "13A2E" },
+ { "2F8C3", "16469" },
+ { "2F8C4", "1647E" },
+ { "2F8C5", "1649D" },
+ { "2F8C6", "16477" },
+ { "2F8C7", "13A6C" },
+ { "2F8C8", "1654F" },
+ { "2F8C9", "1656C" },
+ { "2F8CA", "12300A" },
+ { "2F8CB", "165E3" },
+ { "2F8CC", "166F8" },
+ { "2F8CD", "16649" },
+ { "2F8CE", "13B19" },
+ { "2F8CF", "16691" },
+ { "2F8D0", "13B08" },
+ { "2F8D1", "13AE4" },
+ { "2F8D2", "15192" },
+ { "2F8D3", "15195" },
+ { "2F8D4", "16700" },
+ { "2F8D5", "1669C" },
+ { "2F8D6", "180AD" },
+ { "2F8D7", "143D9" },
+ { "2F8D8", "16717" },
+ { "2F8D9", "1671B" },
+ { "2F8DA", "16721" },
+ { "2F8DB", "1675E" },
+ { "2F8DC", "16753" },
+ { "2F8DD", "1233C3" },
+ { "2F8DE", "13B49" },
+ { "2F8DF", "167FA" },
+ { "2F8E0", "16785" },
+ { "2F8E1", "16852" },
+ { "2F8E2", "16885" },
+ { "2F8E3", "12346D" },
+ { "2F8E4", "1688E" },
+ { "2F8E5", "1681F" },
+ { "2F8E6", "16914" },
+ { "2F8E7", "13B9D" },
+ { "2F8E8", "16942" },
+ { "2F8E9", "169A3" },
+ { "2F8EA", "169EA" },
+ { "2F8EB", "16AA8" },
+ { "2F8EC", "1236A3" },
+ { "2F8ED", "16ADB" },
+ { "2F8EE", "13C18" },
+ { "2F8EF", "16B21" },
+ { "2F8F0", "1238A7" },
+ { "2F8F1", "16B54" },
+ { "2F8F2", "13C4E" },
+ { "2F8F3", "16B72" },
+ { "2F8F4", "16B9F" },
+ { "2F8F5", "16BBA" },
+ { "2F8F6", "16BBB" },
+ { "2F8F7", "123A8D" },
+ { "2F8F8", "121D0B" },
+ { "2F8F9", "123AFA" },
+ { "2F8FA", "16C4E" },
+ { "2F8FB", "123CBC" },
+ { "2F8FC", "16CBF" },
+ { "2F8FD", "16CCD" },
+ { "2F8FE", "16C67" },
+ { "2F8FF", "16D16" },
+ { "2F900", "16D3E" },
+ { "2F901", "16D77" },
+ { "2F902", "16D41" },
+ { "2F903", "16D69" },
+ { "2F904", "16D78" },
+ { "2F905", "16D85" },
+ { "2F906", "123D1E" },
+ { "2F907", "16D34" },
+ { "2F908", "16E2F" },
+ { "2F909", "16E6E" },
+ { "2F90A", "13D33" },
+ { "2F90B", "16ECB" },
+ { "2F90C", "16EC7" },
+ { "2F90D", "123ED1" },
+ { "2F90E", "16DF9" },
+ { "2F90F", "16F6E" },
+ { "2F910", "123F5E" },
+ { "2F911", "123F8E" },
+ { "2F912", "16FC6" },
+ { "2F913", "17039" },
+ { "2F914", "1701E" },
+ { "2F915", "1701B" },
+ { "2F916", "13D96" },
+ { "2F917", "1704A" },
+ { "2F918", "1707D" },
+ { "2F919", "17077" },
+ { "2F91A", "170AD" },
+ { "2F91B", "120525" },
+ { "2F91C", "17145" },
+ { "2F91D", "124263" },
+ { "2F91E", "1719C" },
+ { "2F91F", "143AB" },
+ { "2F920", "17228" },
+ { "2F921", "17235" },
+ { "2F922", "17250" },
+ { "2F923", "124608" },
+ { "2F924", "17280" },
+ { "2F925", "17295" },
+ { "2F926", "124735" },
+ { "2F927", "124814" },
+ { "2F928", "1737A" },
+ { "2F929", "1738B" },
+ { "2F92A", "13EAC" },
+ { "2F92B", "173A5" },
+ { "2F92C", "13EB8" },
+ { "2F92D", "13EB8" },
+ { "2F92E", "17447" },
+ { "2F92F", "1745C" },
+ { "2F930", "17471" },
+ { "2F931", "17485" },
+ { "2F932", "174CA" },
+ { "2F933", "13F1B" },
+ { "2F934", "17524" },
+ { "2F935", "124C36" },
+ { "2F936", "1753E" },
+ { "2F937", "124C92" },
+ { "2F938", "17570" },
+ { "2F939", "12219F" },
+ { "2F93A", "17610" },
+ { "2F93B", "124FA1" },
+ { "2F93C", "124FB8" },
+ { "2F93D", "125044" },
+ { "2F93E", "13FFC" },
+ { "2F93F", "14008" },
+ { "2F940", "176F4" },
+ { "2F941", "1250F3" },
+ { "2F942", "1250F2" },
+ { "2F943", "125119" },
+ { "2F944", "125133" },
+ { "2F945", "1771E" },
+ { "2F946", "1771F" },
+ { "2F947", "1771F" },
+ { "2F948", "1774A" },
+ { "2F949", "14039" },
+ { "2F94A", "1778B" },
+ { "2F94B", "14046" },
+ { "2F94C", "14096" },
+ { "2F94D", "12541D" },
+ { "2F94E", "1784E" },
+ { "2F94F", "1788C" },
+ { "2F950", "178CC" },
+ { "2F951", "140E3" },
+ { "2F952", "125626" },
+ { "2F953", "17956" },
+ { "2F954", "12569A" },
+ { "2F955", "1256C5" },
+ { "2F956", "1798F" },
+ { "2F957", "179EB" },
+ { "2F958", "1412F" },
+ { "2F959", "17A40" },
+ { "2F95A", "17A4A" },
+ { "2F95B", "17A4F" },
+ { "2F95C", "12597C" },
+ { "2F95D", "125AA7" },
+ { "2F95E", "125AA7" },
+ { "2F95F", "17AAE" },
+ { "2F960", "14202" },
+ { "2F961", "125BAB" },
+ { "2F962", "17BC6" },
+ { "2F963", "17BC9" },
+ { "2F964", "14227" },
+ { "2F965", "125C80" },
+ { "2F966", "17CD2" },
+ { "2F967", "142A0" },
+ { "2F968", "17CE8" },
+ { "2F969", "17CE3" },
+ { "2F96A", "17D00" },
+ { "2F96B", "125F86" },
+ { "2F96C", "17D63" },
+ { "2F96D", "14301" },
+ { "2F96E", "17DC7" },
+ { "2F96F", "17E02" },
+ { "2F970", "17E45" },
+ { "2F971", "14334" },
+ { "2F972", "126228" },
+ { "2F973", "126247" },
+ { "2F974", "14359" },
+ { "2F975", "1262D9" },
+ { "2F976", "17F7A" },
+ { "2F977", "12633E" },
+ { "2F978", "17F95" },
+ { "2F979", "17FFA" },
+ { "2F97A", "18005" },
+ { "2F97B", "1264DA" },
+ { "2F97C", "126523" },
+ { "2F97D", "18060" },
+ { "2F97E", "1265A8" },
+ { "2F97F", "18070" },
+ { "2F980", "12335F" },
+ { "2F981", "143D5" },
+ { "2F982", "180B2" },
+ { "2F983", "18103" },
+ { "2F984", "1440B" },
+ { "2F985", "1813E" },
+ { "2F986", "15AB5" },
+ { "2F987", "1267A7" },
+ { "2F988", "1267B5" },
+ { "2F989", "123393" },
+ { "2F98A", "12339C" },
+ { "2F98B", "18201" },
+ { "2F98C", "18204" },
+ { "2F98D", "18F9E" },
+ { "2F98E", "1446B" },
+ { "2F98F", "18291" },
+ { "2F990", "1828B" },
+ { "2F991", "1829D" },
+ { "2F992", "152B3" },
+ { "2F993", "182B1" },
+ { "2F994", "182B3" },
+ { "2F995", "182BD" },
+ { "2F996", "182E6" },
+ { "2F997", "126B3C" },
+ { "2F998", "182E5" },
+ { "2F999", "1831D" },
+ { "2F99A", "18363" },
+ { "2F99B", "183AD" },
+ { "2F99C", "18323" },
+ { "2F99D", "183BD" },
+ { "2F99E", "183E7" },
+ { "2F99F", "18457" },
+ { "2F9A0", "18353" },
+ { "2F9A1", "183CA" },
+ { "2F9A2", "183CC" },
+ { "2F9A3", "183DC" },
+ { "2F9A4", "126C36" },
+ { "2F9A5", "126D6B" },
+ { "2F9A6", "126CD5" },
+ { "2F9A7", "1452B" },
+ { "2F9A8", "184F1" },
+ { "2F9A9", "184F3" },
+ { "2F9AA", "18516" },
+ { "2F9AB", "1273CA" },
+ { "2F9AC", "18564" },
+ { "2F9AD", "126F2C" },
+ { "2F9AE", "1455D" },
+ { "2F9AF", "14561" },
+ { "2F9B0", "126FB1" },
+ { "2F9B1", "1270D2" },
+ { "2F9B2", "1456B" },
+ { "2F9B3", "18650" },
+ { "2F9B4", "1865C" },
+ { "2F9B5", "18667" },
+ { "2F9B6", "18669" },
+ { "2F9B7", "186A9" },
+ { "2F9B8", "18688" },
+ { "2F9B9", "1870E" },
+ { "2F9BA", "186E2" },
+ { "2F9BB", "18779" },
+ { "2F9BC", "18728" },
+ { "2F9BD", "1876B" },
+ { "2F9BE", "18786" },
+ { "2F9BF", "14D57" },
+ { "2F9C0", "187E1" },
+ { "2F9C1", "18801" },
+ { "2F9C2", "145F9" },
+ { "2F9C3", "18860" },
+ { "2F9C4", "18863" },
+ { "2F9C5", "127667" },
+ { "2F9C6", "188D7" },
+ { "2F9C7", "188DE" },
+ { "2F9C8", "14635" },
+ { "2F9C9", "188FA" },
+ { "2F9CA", "134BB" },
+ { "2F9CB", "1278AE" },
+ { "2F9CC", "127966" },
+ { "2F9CD", "146BE" },
+ { "2F9CE", "146C7" },
+ { "2F9CF", "18AA0" },
+ { "2F9D0", "18AED" },
+ { "2F9D1", "18B8A" },
+ { "2F9D2", "18C55" },
+ { "2F9D3", "127CA8" },
+ { "2F9D4", "18CAB" },
+ { "2F9D5", "18CC1" },
+ { "2F9D6", "18D1B" },
+ { "2F9D7", "18D77" },
+ { "2F9D8", "127F2F" },
+ { "2F9D9", "120804" },
+ { "2F9DA", "18DCB" },
+ { "2F9DB", "18DBC" },
+ { "2F9DC", "18DF0" },
+ { "2F9DD", "1208DE" },
+ { "2F9DE", "18ED4" },
+ { "2F9DF", "18F38" },
+ { "2F9E0", "1285D2" },
+ { "2F9E1", "1285ED" },
+ { "2F9E2", "19094" },
+ { "2F9E3", "190F1" },
+ { "2F9E4", "19111" },
+ { "2F9E5", "12872E" },
+ { "2F9E6", "1911B" },
+ { "2F9E7", "19238" },
+ { "2F9E8", "192D7" },
+ { "2F9E9", "192D8" },
+ { "2F9EA", "1927C" },
+ { "2F9EB", "193F9" },
+ { "2F9EC", "19415" },
+ { "2F9ED", "128BFA" },
+ { "2F9EE", "1958B" },
+ { "2F9EF", "14995" },
+ { "2F9F0", "195B7" },
+ { "2F9F1", "128D77" },
+ { "2F9F2", "149E6" },
+ { "2F9F3", "196C3" },
+ { "2F9F4", "15DB2" },
+ { "2F9F5", "19723" },
+ { "2F9F6", "129145" },
+ { "2F9F7", "12921A" },
+ { "2F9F8", "14A6E" },
+ { "2F9F9", "14A76" },
+ { "2F9FA", "197E0" },
+ { "2F9FB", "12940A" },
+ { "2F9FC", "14AB2" },
+ { "2F9FD", "129496" },
+ { "2F9FE", "1980B" },
+ { "2F9FF", "1980B" },
+ { "2FA00", "19829" },
+ { "2FA01", "1295B6" },
+ { "2FA02", "198E2" },
+ { "2FA03", "14B33" },
+ { "2FA04", "19929" },
+ { "2FA05", "199A7" },
+ { "2FA06", "199C2" },
+ { "2FA07", "199FE" },
+ { "2FA08", "14BCE" },
+ { "2FA09", "129B30" },
+ { "2FA0A", "19B12" },
+ { "2FA0B", "19C40" },
+ { "2FA0C", "19CFD" },
+ { "2FA0D", "14CCE" },
+ { "2FA0E", "14CED" },
+ { "2FA0F", "19D67" },
+ { "2FA10", "12A0CE" },
+ { "2FA11", "14CF8" },
+ { "2FA12", "12A105" },
+ { "2FA13", "12A20E" },
+ { "2FA14", "12A291" },
+ { "2FA15", "19EBB" },
+ { "2FA16", "14D56" },
+ { "2FA17", "19EF9" },
+ { "2FA18", "19EFE" },
+ { "2FA19", "19F05" },
+ { "2FA1A", "19F0F" },
+ { "2FA1B", "19F16" },
+ { "2FA1C", "19F3B" },
+ { "2FA1D", "12A600" },
+};
+
+// global constructor
+
+static struct unicode_decompose_init {
+ unicode_decompose_init();
+} _unicode_decompose_init;
+
+unicode_decompose_init::unicode_decompose_init() {
+ for (unsigned int i = 0;
+ i < sizeof(unicode_decompose_list)/sizeof(unicode_decompose_list[0]);
+ i++) {
+ unicode_decompose *dec = new unicode_decompose[1];
+ dec->value = (char *)unicode_decompose_list[i].value;
+ unicode_decompose_table.define(unicode_decompose_list[i].key, dec);
+ }
+}
+
+const char *decompose_unicode(const char *s)
+{
+ unicode_decompose *result = unicode_decompose_table.lookup(s);
+ return result ? result->value : 0;
+}
diff --git a/contrib/groff/src/libs/libxutil/DviChar.c b/contrib/groff/src/libs/libxutil/DviChar.c
new file mode 100644
index 0000000..26aff6c
--- /dev/null
+++ b/contrib/groff/src/libs/libxutil/DviChar.c
@@ -0,0 +1,658 @@
+/*
+ * DviChar.c
+ *
+ * Map DVI (ditroff output) character names to
+ * font indexes and back
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "DviChar.h"
+
+extern char *xmalloc(int);
+
+#define allocHash() ((DviCharNameHash *) xmalloc (sizeof (DviCharNameHash)))
+
+struct map_list {
+ struct map_list *next;
+ DviCharNameMap *map;
+};
+
+static struct map_list *world;
+
+static int standard_maps_loaded = 0;
+static void load_standard_maps (void);
+static int hash_name (const char *);
+static void dispose_hash(DviCharNameMap *);
+static void compute_hash(DviCharNameMap *);
+
+DviCharNameMap *
+DviFindMap (char *encoding)
+{
+ struct map_list *m;
+
+ if (!standard_maps_loaded)
+ load_standard_maps ();
+ for (m = world; m; m=m->next)
+ if (!strcmp (m->map->encoding, encoding))
+ return m->map;
+ return 0;
+}
+
+void
+DviRegisterMap (DviCharNameMap *map)
+{
+ struct map_list *m;
+
+ if (!standard_maps_loaded)
+ load_standard_maps ();
+ for (m = world; m; m = m->next)
+ if (!strcmp (m->map->encoding, map->encoding))
+ break;
+ if (!m) {
+ m = (struct map_list *) xmalloc (sizeof *m);
+ m->next = world;
+ world = m;
+ }
+ dispose_hash (map);
+ m->map = map;
+ compute_hash (map);
+}
+
+static void
+dispose_hash (DviCharNameMap *map)
+{
+ DviCharNameHash **buckets;
+ DviCharNameHash *h, *next;
+ int i;
+
+ buckets = map->buckets;
+ for (i = 0; i < DVI_HASH_SIZE; i++) {
+ for (h = buckets[i]; h; h=next) {
+ next = h->next;
+ free (h);
+ }
+ }
+}
+
+static int
+hash_name (const char *name)
+{
+ int i = 0;
+
+ while (*name)
+ i = (i << 1) ^ *name++;
+ if (i < 0)
+ i = -i;
+ return i;
+}
+
+static void
+compute_hash (DviCharNameMap *map)
+{
+ DviCharNameHash **buckets;
+ int c, s, i;
+ DviCharNameHash *h;
+
+ buckets = map->buckets;
+ for (i = 0; i < DVI_HASH_SIZE; i++)
+ buckets[i] = 0;
+ for (c = 0; c < DVI_MAP_SIZE; c++)
+ for (s = 0; s < DVI_MAX_SYNONYMS; s++) {
+ if (!map->dvi_names[c][s])
+ break;
+ i = hash_name (map->dvi_names[c][s]) % DVI_HASH_SIZE;
+ h = allocHash ();
+ h->next = buckets[i];
+ buckets[i] = h;
+ h->name = map->dvi_names[c][s];
+ h->position = c;
+ }
+
+}
+
+int
+DviCharIndex (DviCharNameMap *map, const char *name)
+{
+ int i;
+ DviCharNameHash *h;
+
+ i = hash_name (name) % DVI_HASH_SIZE;
+ for (h = map->buckets[i]; h; h=h->next)
+ if (!strcmp (h->name, name))
+ return h->position;
+ return -1;
+}
+
+static DviCharNameMap ISO8859_1_map = {
+ "iso8859-1",
+ 0,
+{
+{ 0, /* 0 */},
+{ 0, /* 1 */},
+{ 0, /* 2 */},
+{ 0, /* 3 */},
+{ 0, /* 4 */},
+{ 0, /* 5 */},
+{ 0, /* 6 */},
+{ 0, /* 7 */},
+{ 0, /* 8 */},
+{ 0, /* 9 */},
+{ 0, /* 10 */},
+{ 0, /* 11 */},
+{ 0, /* 12 */},
+{ 0, /* 13 */},
+{ 0, /* 14 */},
+{ 0, /* 15 */},
+{ 0, /* 16 */},
+{ 0, /* 17 */},
+{ 0, /* 18 */},
+{ 0, /* 19 */},
+{ 0, /* 20 */},
+{ 0, /* 21 */},
+{ 0, /* 22 */},
+{ 0, /* 23 */},
+{ 0, /* 24 */},
+{ 0, /* 25 */},
+{ 0, /* 26 */},
+{ 0, /* 27 */},
+{ 0, /* 28 */},
+{ 0, /* 29 */},
+{ 0, /* 30 */},
+{ 0, /* 31 */},
+{ 0, /* 32 */},
+{ "!", /* 33 */},
+{ "\"", "dq", /* 34 */},
+{ "#", "sh", /* 35 */},
+{ "$", "Do", /* 36 */},
+{ "%", /* 37 */},
+{ "&", /* 38 */},
+{ "'", "cq", /* 39 */},
+{ "(", /* 40 */},
+{ ")", /* 41 */},
+{ "*", /* 42 */},
+{ "+", /* 43 */},
+{ ",", /* 44 */},
+{ "\\-", /* 45 */},
+{ ".", /* 46 */},
+{ "/", "sl", /* 47 */},
+{ "0", /* 48 */},
+{ "1", /* 49 */},
+{ "2", /* 50 */},
+{ "3", /* 51 */},
+{ "4", /* 52 */},
+{ "5", /* 53 */},
+{ "6", /* 54 */},
+{ "7", /* 55 */},
+{ "8", /* 56 */},
+{ "9", /* 57 */},
+{ ":", /* 58 */},
+{ ";", /* 59 */},
+{ "<", /* 60 */},
+{ "=", /* 61 */},
+{ ">", /* 62 */},
+{ "?", /* 63 */},
+{ "@", "at", /* 64 */},
+{ "A", /* 65 */},
+{ "B", /* 66 */},
+{ "C", /* 67 */},
+{ "D", /* 68 */},
+{ "E", /* 69 */},
+{ "F", /* 70 */},
+{ "G", /* 71 */},
+{ "H", /* 72 */},
+{ "I", /* 73 */},
+{ "J", /* 74 */},
+{ "K", /* 75 */},
+{ "L", /* 76 */},
+{ "M", /* 77 */},
+{ "N", /* 78 */},
+{ "O", /* 79 */},
+{ "P", /* 80 */},
+{ "Q", /* 81 */},
+{ "R", /* 82 */},
+{ "S", /* 83 */},
+{ "T", /* 84 */},
+{ "U", /* 85 */},
+{ "V", /* 86 */},
+{ "W", /* 87 */},
+{ "X", /* 88 */},
+{ "Y", /* 89 */},
+{ "Z", /* 90 */},
+{ "[", "lB", /* 91 */},
+{ "\\", "rs", /* 92 */},
+{ "]", "rB", /* 93 */},
+{ "^", "a^", "ha", /* 94 */},
+{ "_", /* 95 */},
+{ "`", "oq", /* 96 */},
+{ "a", /* 97 */},
+{ "b", /* 98 */},
+{ "c", /* 99 */},
+{ "d", /* 100 */},
+{ "e", /* 101 */},
+{ "f", /* 102 */},
+{ "g", /* 103 */},
+{ "h", /* 104 */},
+{ "i", /* 105 */},
+{ "j", /* 106 */},
+{ "k", /* 107 */},
+{ "l", /* 108 */},
+{ "m", /* 109 */},
+{ "n", /* 110 */},
+{ "o", /* 111 */},
+{ "p", /* 112 */},
+{ "q", /* 113 */},
+{ "r", /* 114 */},
+{ "s", /* 115 */},
+{ "t", /* 116 */},
+{ "u", /* 117 */},
+{ "v", /* 118 */},
+{ "w", /* 119 */},
+{ "x", /* 120 */},
+{ "y", /* 121 */},
+{ "z", /* 122 */},
+{ "{", "lC", /* 123 */},
+{ "|", "ba", /* 124 */},
+{ "}", "rC", /* 125 */},
+{ "~", "a~", "ti", /* 126 */},
+{ 0, /* 127 */},
+{ 0, /* 128 */},
+{ 0, /* 129 */},
+{ 0, /* 130 */},
+{ 0, /* 131 */},
+{ 0, /* 132 */},
+{ 0, /* 133 */},
+{ 0, /* 134 */},
+{ 0, /* 135 */},
+{ 0, /* 136 */},
+{ 0, /* 137 */},
+{ 0, /* 138 */},
+{ 0, /* 139 */},
+{ 0, /* 140 */},
+{ 0, /* 141 */},
+{ 0, /* 142 */},
+{ 0, /* 143 */},
+{ 0, /* 144 */},
+{ 0, /* 145 */},
+{ 0, /* 146 */},
+{ 0, /* 147 */},
+{ 0, /* 148 */},
+{ 0, /* 149 */},
+{ 0, /* 150 */},
+{ 0, /* 151 */},
+{ 0, /* 152 */},
+{ 0, /* 153 */},
+{ 0, /* 154 */},
+{ 0, /* 155 */},
+{ 0, /* 156 */},
+{ 0, /* 157 */},
+{ 0, /* 158 */},
+{ 0, /* 159 */},
+{ 0, /* 160 */},
+{ "r!", /* 161 */},
+{ "ct", /* 162 */},
+{ "Po", /* 163 */},
+{ "Cs", /* 164 */},
+{ "Ye", /* 165 */},
+{ "bb", /* 166 */},
+{ "sc", /* 167 */},
+{ "ad", /* 168 */},
+{ "co", /* 169 */},
+{ "Of", /* 170 */},
+{ "Fo", /* 171 */},
+{ "tno", /* 172 */},
+{ "-", "hy", /* 173 */},
+{ "rg", /* 174 */},
+{ "a-", /* 175 */},
+{ "de", /* 176 */},
+{ "t+-", /* 177 */},
+{ "S2", /* 178 */},
+{ "S3", /* 179 */},
+{ "aa", /* 180 */},
+{ "mc", /* 181 */},
+{ "ps", /* 182 */},
+{ "pc", /* 183 */},
+{ "ac", /* 184 */},
+{ "S1", /* 185 */},
+{ "Om", /* 186 */},
+{ "Fc", /* 187 */},
+{ "14", /* 188 */},
+{ "12", /* 189 */},
+{ "34", /* 190 */},
+{ "r?", /* 191 */},
+{ "`A", /* 192 */},
+{ "'A", /* 193 */},
+{ "^A", /* 194 */},
+{ "~A", /* 195 */},
+{ ":A", /* 196 */},
+{ "oA", /* 197 */},
+{ "AE", /* 198 */},
+{ ",C", /* 199 */},
+{ "`E", /* 200 */},
+{ "'E", /* 201 */},
+{ "^E", /* 202 */},
+{ ":E", /* 203 */},
+{ "`I", /* 204 */},
+{ "'I", /* 205 */},
+{ "^I", /* 206 */},
+{ ":I", /* 207 */},
+{ "-D", /* 208 */},
+{ "~N", /* 209 */},
+{ "`O", /* 210 */},
+{ "'O", /* 211 */},
+{ "^O", /* 212 */},
+{ "~O", /* 213 */},
+{ ":O", /* 214 */},
+{ "tmu", /* 215 */},
+{ "/O", /* 216 */},
+{ "`U", /* 217 */},
+{ "'U", /* 218 */},
+{ "^U", /* 219 */},
+{ ":U", /* 220 */},
+{ "'Y", /* 221 */},
+{ "TP", /* 222 */},
+{ "ss", /* 223 */},
+{ "`a", /* 224 */},
+{ "'a", /* 225 */},
+{ "^a", /* 226 */},
+{ "~a", /* 227 */},
+{ ":a", /* 228 */},
+{ "oa", /* 229 */},
+{ "ae", /* 230 */},
+{ ",c", /* 231 */},
+{ "`e", /* 232 */},
+{ "'e", /* 233 */},
+{ "^e", /* 234 */},
+{ ":e", /* 235 */},
+{ "`i", /* 236 */},
+{ "'i", /* 237 */},
+{ "^i", /* 238 */},
+{ ":i", /* 239 */},
+{ "Sd", /* 240 */},
+{ "~n", /* 241 */},
+{ "`o", /* 242 */},
+{ "'o", /* 243 */},
+{ "^o", /* 244 */},
+{ "~o", /* 245 */},
+{ ":o", /* 246 */},
+{ "tdi", /* 247 */},
+{ "/o", /* 248 */},
+{ "`u", /* 249 */},
+{ "'u", /* 250 */},
+{ "^u", /* 251 */},
+{ ":u", /* 252 */},
+{ "'y", /* 253 */},
+{ "Tp", /* 254 */},
+{ ":y", /* 255 */},
+}};
+
+static DviCharNameMap Adobe_Symbol_map = {
+ "adobe-fontspecific",
+ 1,
+{
+{ 0, /* 0 */},
+{ 0, /* 1 */},
+{ 0, /* 2 */},
+{ 0, /* 3 */},
+{ 0, /* 4 */},
+{ 0, /* 5 */},
+{ 0, /* 6 */},
+{ 0, /* 7 */},
+{ 0, /* 8 */},
+{ 0, /* 9 */},
+{ 0, /* 10 */},
+{ 0, /* 11 */},
+{ 0, /* 12 */},
+{ 0, /* 13 */},
+{ 0, /* 14 */},
+{ 0, /* 15 */},
+{ 0, /* 16 */},
+{ 0, /* 17 */},
+{ 0, /* 18 */},
+{ 0, /* 19 */},
+{ 0, /* 20 */},
+{ 0, /* 21 */},
+{ 0, /* 22 */},
+{ 0, /* 23 */},
+{ 0, /* 24 */},
+{ 0, /* 25 */},
+{ 0, /* 26 */},
+{ 0, /* 27 */},
+{ 0, /* 28 */},
+{ 0, /* 29 */},
+{ 0, /* 30 */},
+{ 0, /* 31 */},
+{ 0, /* 32 */},
+{ "!", /* 33 */},
+{ "fa", /* 34 */},
+{ "#", "sh", /* 35 */},
+{ "te", /* 36 */},
+{ "%", /* 37 */},
+{ "&", /* 38 */},
+{ "st", /* 39 */},
+{ "(", /* 40 */},
+{ ")", /* 41 */},
+{ "**", /* 42 */},
+{ "+", "pl", /* 43 */},
+{ ",", /* 44 */},
+{ "\\-", "mi", /* 45 */},
+{ ".", /* 46 */},
+{ "/", "sl", /* 47 */},
+{ "0", /* 48 */},
+{ "1", /* 49 */},
+{ "2", /* 50 */},
+{ "3", /* 51 */},
+{ "4", /* 52 */},
+{ "5", /* 53 */},
+{ "6", /* 54 */},
+{ "7", /* 55 */},
+{ "8", /* 56 */},
+{ "9", /* 57 */},
+{ ":", /* 58 */},
+{ ";", /* 59 */},
+{ "<", /* 60 */},
+{ "=", "eq", /* 61 */},
+{ ">", /* 62 */},
+{ "?", /* 63 */},
+{ "=~", /* 64 */},
+{ "*A", /* 65 */},
+{ "*B", /* 66 */},
+{ "*X", /* 67 */},
+{ "*D", /* 68 */},
+{ "*E", /* 69 */},
+{ "*F", /* 70 */},
+{ "*G", /* 71 */},
+{ "*Y", /* 72 */},
+{ "*I", /* 73 */},
+{ "+h", /* 74 */},
+{ "*K", /* 75 */},
+{ "*L", /* 76 */},
+{ "*M", /* 77 */},
+{ "*N", /* 78 */},
+{ "*O", /* 79 */},
+{ "*P", /* 80 */},
+{ "*H", /* 81 */},
+{ "*R", /* 82 */},
+{ "*S", /* 83 */},
+{ "*T", /* 84 */},
+{ 0, /* 85 */},
+{ "ts", /* 86 */},
+{ "*W", /* 87 */},
+{ "*C", /* 88 */},
+{ "*Q", /* 89 */},
+{ "*Z", /* 90 */},
+{ "[", "lB", /* 91 */},
+{ "tf", "3d", /* 92 */},
+{ "]", "rB", /* 93 */},
+{ "pp", /* 94 */},
+{ "_", /* 95 */},
+{ "radicalex", /* 96 */},
+{ "*a", /* 97 */},
+{ "*b", /* 98 */},
+{ "*x", /* 99 */},
+{ "*d", /* 100 */},
+{ "*e", /* 101 */},
+{ "*f", /* 102 */},
+{ "*g", /* 103 */},
+{ "*y", /* 104 */},
+{ "*i", /* 105 */},
+{ "+f", /* 106 */},
+{ "*k", /* 107 */},
+{ "*l", /* 108 */},
+{ "*m", /* 109 */},
+{ "*n", /* 110 */},
+{ "*o", /* 111 */},
+{ "*p", /* 112 */},
+{ "*h", /* 113 */},
+{ "*r", /* 114 */},
+{ "*s", /* 115 */},
+{ "*t", /* 116 */},
+{ "*u", /* 117 */},
+{ "+p", /* 118 */},
+{ "*w", /* 119 */},
+{ "*c", /* 120 */},
+{ "*q", /* 121 */},
+{ "*z", /* 122 */},
+{ "lC", "{", /* 123 */},
+{ "ba", "|", /* 124 */},
+{ "rC", "}", /* 125 */},
+{ "ap", /* 126 */},
+{ 0, /* 127 */},
+{ 0, /* 128 */},
+{ 0, /* 129 */},
+{ 0, /* 130 */},
+{ 0, /* 131 */},
+{ 0, /* 132 */},
+{ 0, /* 133 */},
+{ 0, /* 134 */},
+{ 0, /* 135 */},
+{ 0, /* 136 */},
+{ 0, /* 137 */},
+{ 0, /* 138 */},
+{ 0, /* 139 */},
+{ 0, /* 140 */},
+{ 0, /* 141 */},
+{ 0, /* 142 */},
+{ 0, /* 143 */},
+{ 0, /* 144 */},
+{ 0, /* 145 */},
+{ 0, /* 146 */},
+{ 0, /* 147 */},
+{ 0, /* 148 */},
+{ 0, /* 149 */},
+{ 0, /* 150 */},
+{ 0, /* 151 */},
+{ 0, /* 152 */},
+{ 0, /* 153 */},
+{ 0, /* 154 */},
+{ 0, /* 155 */},
+{ 0, /* 156 */},
+{ 0, /* 157 */},
+{ 0, /* 158 */},
+{ 0, /* 159 */},
+{ 0, /* 160 */},
+{ "*U", /* 161 */},
+{ "fm", /* 162 */},
+{ "<=", /* 163 */},
+{ "f/", /* 164 */},
+{ "if", /* 165 */},
+{ "Fn", /* 166 */},
+{ "CL", /* 167 */},
+{ "DI", /* 168 */},
+{ "HE", /* 169 */},
+{ "SP", /* 170 */},
+{ "<>", /* 171 */},
+{ "<-", /* 172 */},
+{ "ua", "arrowverttp", /* 173 */},
+{ "->", /* 174 */},
+{ "da", "arrowvertbt", /* 175 */},
+{ "de", /* 176 */},
+{ "+-", /* 177 */},
+{ "sd", /* 178 */},
+{ ">=", /* 179 */},
+{ "mu", /* 180 */},
+{ "pt", /* 181 */},
+{ "pd", /* 182 */},
+{ "bu", /* 183 */},
+{ "di", /* 184 */},
+{ "!=", /* 185 */},
+{ "==", /* 186 */},
+{ "~=", "~~", /* 187 */},
+{ 0, /* 188 */},
+{ "arrowvertex", /* 189 */},
+{ "an", /* 190 */},
+{ "CR", /* 191 */},
+{ "Ah", /* 192 */},
+{ "Im", /* 193 */},
+{ "Re", /* 194 */},
+{ "wp", /* 195 */},
+{ "c*", /* 196 */},
+{ "c+", /* 197 */},
+{ "es", /* 198 */},
+{ "ca", /* 199 */},
+{ "cu", /* 200 */},
+{ "sp", /* 201 */},
+{ "ip", /* 202 */},
+{ "nb", /* 203 */},
+{ "sb", /* 204 */},
+{ "ib", /* 205 */},
+{ "mo", /* 206 */},
+{ "nm", /* 207 */},
+{ "/_", /* 208 */},
+{ "gr", /* 209 */},
+{ "rg", /* 210 */},
+{ "co", /* 211 */},
+{ "tm", /* 212 */},
+{ 0, /* 213 */},
+{ "sr", "sqrt", /* 214 */},
+{ "md", /* 215 */},
+{ "no", /* 216 */},
+{ "AN", /* 217 */},
+{ "OR", /* 218 */},
+{ "hA", /* 219 */},
+{ "lA", /* 220 */},
+{ "uA", /* 221 */},
+{ "rA", /* 222 */},
+{ "dA", /* 223 */},
+{ "lz", /* 224 */},
+{ "la", /* 225 */},
+{ 0, /* 226 */},
+{ 0, /* 227 */},
+{ 0, /* 228 */},
+{ 0, /* 229 */},
+{ "parenlefttp", /* 230 */},
+{ "parenleftex", /* 231 */},
+{ "parenleftbt", /* 232 */},
+{ "bracketlefttp", "lc", /* 233 */},
+{ "bracketleftex", /* 234 */},
+{ "bracketleftbt", "lf", /* 235 */},
+{ "bracelefttp", "lt", /* 236 */},
+{ "braceleftmid", "lk", /* 237 */},
+{ "braceleftbt", "lb", /* 238 */},
+{ "bracerightex", "braceleftex", "braceex", "bv", /* 239 */},
+{ 0, /* 240 */},
+{ "ra", /* 241 */},
+{ "is", "integral", /* 242 */},
+{ 0, /* 243 */},
+{ 0, /* 244 */},
+{ 0, /* 245 */},
+{ "parenrighttp", /* 246 */},
+{ "parenrightex", /* 247 */},
+{ "parenrightbt", /* 248 */},
+{ "bracketrighttp", "rc", /* 249 */},
+{ "bracketrightex", /* 250 */},
+{ "bracketrightbt", "rf", /* 251 */},
+{ "bracerighttp", "rt", /* 252 */},
+{ "bracerightmid", "rk", /* 253 */},
+{ "bracerightbt", "rb", /* 254 */},
+{ 0, /* 255 */},
+}};
+
+
+static void
+load_standard_maps (void)
+{
+ standard_maps_loaded = 1;
+ DviRegisterMap (&ISO8859_1_map);
+ DviRegisterMap (&Adobe_Symbol_map);
+}
diff --git a/contrib/groff/src/libs/libxutil/Makefile.sub b/contrib/groff/src/libs/libxutil/Makefile.sub
new file mode 100644
index 0000000..24444a6
--- /dev/null
+++ b/contrib/groff/src/libs/libxutil/Makefile.sub
@@ -0,0 +1,10 @@
+LIB=xutil
+EXTRA_CFLAGS=$(X_CFLAGS)
+OBJS=\
+ DviChar.$(OBJEXT) \
+ XFontName.$(OBJEXT) \
+ xmalloc.$(OBJEXT)
+CSRCS=\
+ $(srcdir)/DviChar.c \
+ $(srcdir)/XFontName.c \
+ $(srcdir)/xmalloc.c
diff --git a/contrib/groff/src/libs/libxutil/XFontName.c b/contrib/groff/src/libs/libxutil/XFontName.c
new file mode 100644
index 0000000..7ed78ae
--- /dev/null
+++ b/contrib/groff/src/libs/libxutil/XFontName.c
@@ -0,0 +1,241 @@
+/*
+ * XFontName.c
+ *
+ * build/parse X Font name strings
+ */
+
+#include <X11/Xlib.h>
+#include <X11/Xos.h>
+#include "XFontName.h"
+#include <ctype.h>
+
+static char *
+extractStringField (char *name, char *buffer, int size,
+ unsigned int *attrp, unsigned int bit)
+{
+ char *buf = buffer;
+
+ if (!*name)
+ return 0;
+ while (*name && *name != '-' && size > 0) {
+ *buf++ = *name++;
+ --size;
+ }
+ if (size <= 0)
+ return 0;
+ *buf = '\0';
+ if (buffer[0] != '*' || buffer[1] != '\0')
+ *attrp |= bit;
+ if (*name == '-')
+ return name+1;
+ return name;
+}
+
+static char *
+extractUnsignedField (char *name, unsigned int *result,
+ unsigned int *attrp, unsigned int bit)
+{
+ char buf[256];
+ char *c;
+ unsigned int i;
+
+ name = extractStringField (name, buf, sizeof (buf), attrp, bit);
+ if (!name)
+ return 0;
+ if (!(*attrp & bit))
+ return name;
+ i = 0;
+ for (c = buf; *c; c++) {
+ if (!isdigit (*c))
+ return 0;
+ i = i * 10 + (*c - '0');
+ }
+ *result = i;
+ return name;
+}
+
+Bool
+XParseFontName (XFontNameString fontNameString, XFontName *fontName,
+ unsigned int *fontNameAttributes)
+{
+ char *name = fontNameString;
+ XFontName temp;
+ unsigned int attributes = 0;
+
+#define GetString(field,bit)\
+ if (!(name = extractStringField \
+ (name, temp.field, sizeof (temp.field),\
+ &attributes, bit))) \
+ return False;
+
+#define GetUnsigned(field,bit)\
+ if (!(name = extractUnsignedField \
+ (name, &temp.field, \
+ &attributes, bit))) \
+ return False;
+
+ GetString (Registry, FontNameRegistry)
+ GetString (Foundry, FontNameFoundry)
+ GetString (FamilyName, FontNameFamilyName)
+ GetString (WeightName, FontNameWeightName)
+ GetString (Slant, FontNameSlant)
+ GetString (SetwidthName, FontNameSetwidthName)
+ GetString (AddStyleName, FontNameAddStyleName)
+ GetUnsigned (PixelSize, FontNamePixelSize)
+ GetUnsigned (PointSize, FontNamePointSize)
+ GetUnsigned (ResolutionX, FontNameResolutionX)
+ GetUnsigned (ResolutionY, FontNameResolutionY)
+ GetString (Spacing, FontNameSpacing)
+ GetUnsigned (AverageWidth, FontNameAverageWidth)
+ GetString (CharSetRegistry, FontNameCharSetRegistry)
+ if (!*name) {
+ temp.CharSetEncoding[0] = '\0';
+ attributes |= FontNameCharSetEncoding;
+ } else {
+ GetString (CharSetEncoding, FontNameCharSetEncoding)
+ }
+ *fontName = temp;
+ *fontNameAttributes = attributes;
+ return True;
+}
+
+static char *
+utoa (unsigned int u, char *s, int size)
+{
+ char *t;
+
+ t = s + size;
+ *--t = '\0';
+ do
+ *--t = (u % 10) + '0';
+ while (u /= 10);
+ return t;
+}
+
+Bool
+XFormatFontName (XFontName *fontName, unsigned int fontNameAttributes,
+ XFontNameString fontNameString)
+{
+ char tmp[256];
+ char *name = tmp, *f;
+ int left = sizeof (tmp) - 1;
+ char number[32];
+
+#define PutString(field, bit)\
+ f = (fontNameAttributes & bit) ? \
+ fontName->field \
+ : (char *)"*"; \
+ if ((left -= strlen (f)) < 0) \
+ return False; \
+ while (*f) \
+ if ((*name++ = *f++) == '-') \
+ return False;
+#define PutHyphen()\
+ if (--left < 0) \
+ return False; \
+ *name++ = '-';
+
+#define PutUnsigned(field, bit) \
+ f = (fontNameAttributes & bit) ? \
+ utoa (fontName->field, number, sizeof (number)) \
+ : (char *)"*"; \
+ if ((left -= strlen (f)) < 0) \
+ return False; \
+ while (*f) \
+ *name++ = *f++;
+
+ PutString (Registry, FontNameRegistry)
+ PutHyphen ();
+ PutString (Foundry, FontNameFoundry)
+ PutHyphen ();
+ PutString (FamilyName, FontNameFamilyName)
+ PutHyphen ();
+ PutString (WeightName, FontNameWeightName)
+ PutHyphen ();
+ PutString (Slant, FontNameSlant)
+ PutHyphen ();
+ PutString (SetwidthName, FontNameSetwidthName)
+ PutHyphen ();
+ PutString (AddStyleName, FontNameAddStyleName)
+ PutHyphen ();
+ PutUnsigned (PixelSize, FontNamePixelSize)
+ PutHyphen ();
+ PutUnsigned (PointSize, FontNamePointSize)
+ PutHyphen ();
+ PutUnsigned (ResolutionX, FontNameResolutionX)
+ PutHyphen ();
+ PutUnsigned (ResolutionY, FontNameResolutionY)
+ PutHyphen ();
+ PutString (Spacing, FontNameSpacing)
+ PutHyphen ();
+ PutUnsigned (AverageWidth, FontNameAverageWidth)
+ PutHyphen ();
+ PutString (CharSetRegistry, FontNameCharSetRegistry)
+ PutHyphen ();
+ PutString (CharSetEncoding, FontNameCharSetEncoding)
+ *name = '\0';
+ strcpy (fontNameString, tmp);
+ return True;
+}
+
+Bool
+XCompareFontName (XFontName *name1, XFontName *name2,
+ unsigned int fontNameAttributes)
+{
+#define CompareString(field,bit) \
+ if (fontNameAttributes & bit) \
+ if (strcmp (name1->field, name2->field)) \
+ return False;
+
+#define CompareUnsigned(field,bit) \
+ if (fontNameAttributes & bit) \
+ if (name1->field != name2->field) \
+ return False;
+
+ CompareString (Registry, FontNameRegistry)
+ CompareString (Foundry, FontNameFoundry)
+ CompareString (FamilyName, FontNameFamilyName)
+ CompareString (WeightName, FontNameWeightName)
+ CompareString (Slant, FontNameSlant)
+ CompareString (SetwidthName, FontNameSetwidthName)
+ CompareString (AddStyleName, FontNameAddStyleName)
+ CompareUnsigned (PixelSize, FontNamePixelSize)
+ CompareUnsigned (PointSize, FontNamePointSize)
+ CompareUnsigned (ResolutionX, FontNameResolutionX)
+ CompareUnsigned (ResolutionY, FontNameResolutionY)
+ CompareString (Spacing, FontNameSpacing)
+ CompareUnsigned (AverageWidth, FontNameAverageWidth)
+ CompareString (CharSetRegistry, FontNameCharSetRegistry)
+ CompareString (CharSetEncoding, FontNameCharSetEncoding)
+ return True;
+}
+
+Bool
+XCopyFontName (XFontName *name1, XFontName *name2,
+ unsigned int fontNameAttributes)
+{
+#define CopyString(field,bit) \
+ if (fontNameAttributes & bit) \
+ strcpy (name2->field, name1->field);
+
+#define CopyUnsigned(field,bit) \
+ if (fontNameAttributes & bit) \
+ name2->field = name1->field;
+
+ CopyString (Registry, FontNameRegistry)
+ CopyString (Foundry, FontNameFoundry)
+ CopyString (FamilyName, FontNameFamilyName)
+ CopyString (WeightName, FontNameWeightName)
+ CopyString (Slant, FontNameSlant)
+ CopyString (SetwidthName, FontNameSetwidthName)
+ CopyString (AddStyleName, FontNameAddStyleName)
+ CopyUnsigned (PixelSize, FontNamePixelSize)
+ CopyUnsigned (PointSize, FontNamePointSize)
+ CopyUnsigned (ResolutionX, FontNameResolutionX)
+ CopyUnsigned (ResolutionY, FontNameResolutionY)
+ CopyString (Spacing, FontNameSpacing)
+ CopyUnsigned (AverageWidth, FontNameAverageWidth)
+ CopyString (CharSetRegistry, FontNameCharSetRegistry)
+ CopyString (CharSetEncoding, FontNameCharSetEncoding)
+ return True;
+}
diff --git a/contrib/groff/src/libs/libxutil/xmalloc.c b/contrib/groff/src/libs/libxutil/xmalloc.c
new file mode 100644
index 0000000..f31056b
--- /dev/null
+++ b/contrib/groff/src/libs/libxutil/xmalloc.c
@@ -0,0 +1,7 @@
+#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
+
+char *xmalloc(int n)
+{
+ return XtMalloc(n);
+}
diff --git a/contrib/groff/src/preproc/eqn/Makefile.sub b/contrib/groff/src/preproc/eqn/Makefile.sub
index 7554645..9028f94 100644
--- a/contrib/groff/src/preproc/eqn/Makefile.sub
+++ b/contrib/groff/src/preproc/eqn/Makefile.sub
@@ -1,6 +1,7 @@
PROG=eqn$(EXEEXT)
MAN1=eqn.n neqn.n
XLIBS=$(LIBGROFF)
+MLIB=$(LIBM)
OBJS=\
eqn.$(OBJEXT) \
main.$(OBJEXT) \
@@ -44,11 +45,10 @@ CLEANADD=neqn
all: neqn
-neqn: neqn.sh
+neqn: neqn.sh $(SH_DEPS_SED_SCRIPT)
-rm -f $@
sed -e 's/@g@/$(g)/g' \
- -e 's|@BINDIR@|$(bindir)|g' \
- -e 's|@SEP@|$(SEP)|g' \
+ -f $(SH_DEPS_SED_SCRIPT) \
-e $(SH_SCRIPT_SED_CMD) $(srcdir)/neqn.sh >$@
chmod +x $@
diff --git a/contrib/groff/src/preproc/eqn/box.cpp b/contrib/groff/src/preproc/eqn/box.cpp
index 41d8dff..953218a 100644
--- a/contrib/groff/src/preproc/eqn/box.cpp
+++ b/contrib/groff/src/preproc/eqn/box.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
@@ -80,7 +81,7 @@ int matrix_side_sep = 17; // = thin space
int nroff = 0; // should we grok ndefine or tdefine?
-struct {
+struct S {
const char *name;
int *ptr;
} param_table[] = {
diff --git a/contrib/groff/src/preproc/eqn/box.h b/contrib/groff/src/preproc/eqn/box.h
index 01bfe96..9484207 100644
--- a/contrib/groff/src/preproc/eqn/box.h
+++ b/contrib/groff/src/preproc/eqn/box.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004, 2005
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,9 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
-struct list_box;
+class list_box;
class box {
private:
@@ -62,6 +63,11 @@ public:
friend class list_box;
};
+// declarations to avoid friend name injection problems
+box *make_script_box(box *, box *, box *);
+box *make_mark_box(box *);
+box *make_lineup_box(box *);
+
class list_box : public box {
int is_script;
box_list list;
@@ -238,9 +244,6 @@ public:
};
box *split_text(char *);
-box *make_script_box(box *, box *, box *);
-box *make_mark_box(box *);
-box *make_lineup_box(box *);
box *make_delim_box(char *, box *, char *);
box *make_sqrt_box(box *);
box *make_prime_box(box *);
diff --git a/contrib/groff/src/preproc/eqn/delim.cpp b/contrib/groff/src/preproc/eqn/delim.cpp
index b724180..9bb7c9b 100644
--- a/contrib/groff/src/preproc/eqn/delim.cpp
+++ b/contrib/groff/src/preproc/eqn/delim.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/eqn.h b/contrib/groff/src/preproc/eqn/eqn.h
index ee25f03..fca3e97 100644
--- a/contrib/groff/src/preproc/eqn/eqn.h
+++ b/contrib/groff/src/preproc/eqn/eqn.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/preproc/eqn/eqn.man b/contrib/groff/src/preproc/eqn/eqn.man
index 6d0733c..0f47771 100644
--- a/contrib/groff/src/preproc/eqn/eqn.man
+++ b/contrib/groff/src/preproc/eqn/eqn.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2004, 2005 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,20 +16,41 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
-.ie \n(.V<\n(.v .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
-.el .ds tx TeX
+.
+.
+.ie \n(.V<\n(.v \
+. ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
+.el \
+. ds tx TeX
+.
+.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
+..
+.
+.
+.de TQ
+. br
+. ns
+. TP \\$1
..
+.
+.
.\" The BSD man macros can't handle " in arguments to font change macros,
.\" so use \(ts instead of ".
.tr \(ts"
+.
+.
.TH @G@EQN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
.SH NAME
@g@eqn \- format equations for troff
+.
+.
.SH SYNOPSIS
.nr a \n(.j
.ad l
@@ -38,8 +59,8 @@ the original English.
.ti \niu
.B @g@eqn
.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
+. ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+. el .RB "[\ " "\\$1" "\ ]"
..
.OP \-rvCNR
.OP \-d xy
@@ -52,9 +73,12 @@ the original English.
.RI "[\ " files\|.\|.\|. "\ ]"
.br
.ad \na
-.PP
+.
+.LP
It is possible to have whitespace between a command line option and its
parameter.
+.
+.
.SH DESCRIPTION
This manual page describes the GNU version of
.BR eqn ,
@@ -69,13 +93,16 @@ Normally, it should be invoked using the
option of
.BR groff .
The syntax is quite compatible with Unix eqn.
-The output of GNU eqn cannot be processed with Unix troff;
+The output of GNU
+.B eqn
+cannot be processed with Unix troff;
it must be processed with GNU troff.
If no files are given on the command line, the standard input
will be read.
A filename of
.B \-
will cause the standard input to be read.
+.
.LP
.B eqn
searches for the file
@@ -87,25 +114,33 @@ option first, then in
.BR @LOCALMACRODIR@ ,
and finally in the standard macro directory
.BR @MACRODIR@ .
-If it exists, eqn will process it before the other input files.
+If it exists,
+.B eqn
+will process it before the other input files.
The
.B \-R
option prevents this.
+.
.LP
-GNU eqn does not provide the functionality of neqn:
+GNU
+.B eqn
+does not provide the functionality of neqn:
it does not support low-resolution, typewriter-like devices
(although it may work adequately for very simple input).
+.
+.
.SH OPTIONS
.TP
.BI \-d xy
Specify delimiters
.I x
-and
+and\~\c
.I y
for the left and right end, respectively, of in-line equations.
Any
.B delim
statements in the source file overrides this.
+.
.TP
.B \-C
Recognize
@@ -119,32 +154,38 @@ Don't allow newlines within delimiters.
This option allows
.B eqn
to recover better from missing closing delimiters.
+.
.TP
.B \-v
Print the version number.
+.
.TP
.B \-r
Only one size reduction.
+.
.TP
.BI \-m n
-The minimum point-size is
+The minimum point-size is\~\c
.IR n .
-eqn will not reduce the size of subscripts or superscripts to
-a smaller size than
+.B eqn
+will not reduce the size of subscripts or superscripts to
+a smaller size than\~\c
.IR n .
+.
.TP
.BI \-T name
The output is for device
.IR name .
The only effect of this is to define a macro
.I name
-with a value of
+with a value of\~\c
.BR 1 .
Typically
.B eqnrc
will use this to provide definitions appropriate for the output device.
The default output device is
.BR @DEVICE@ .
+.
.TP
.BI \-M dir
Search
@@ -152,82 +193,109 @@ Search
for
.B eqnrc
before the default directories.
+.
.TP
.B \-R
Don't load
.BR eqnrc .
+.
.TP
.BI \-f F
This is equivalent to a
.BI gfont\ F
command.
+.
.TP
.BI \-s n
This is equivalent to a
.BI gsize\ n
command.
This option is deprecated.
-eqn will normally set equations at whatever the current point size
+.B eqn
+will normally set equations at whatever the current point size
is when the equation is encountered.
+.
.TP
.BI \-p n
This says that subscripts and superscripts should be
-.I n
+.I n\~\c
points smaller than the surrounding text.
This option is deprecated.
-Normally eqn makes sets subscripts and superscripts at 70%
+Normally
+.B eqn
+makes sets subscripts and superscripts at 70%
of the size of the surrounding text.
+.
+.
.SH USAGE
-Only the differences between GNU eqn and Unix eqn are described here.
+Only the differences between GNU
+.B eqn
+and Unix eqn are described here.
+.
.LP
-Most of the new features of GNU eqn
+Most of the new features of GNU
+.B eqn
are based on \*(tx.
-There are some references to the differences between \*(tx and GNU eqn below;
+There are some references to the differences between \*(tx and GNU
+.B eqn
+below;
these may safely be ignored if you do not know \*(tx.
+.
.SS Automatic spacing
-.LP
.B eqn
gives each component of an equation a type, and adjusts the spacing
between components using that type.
Possible types are:
+.
+.RS
.TP \w'punctuation'u+2n
ordinary
-an ordinary character such as 1 or
-.IR x ;
+an ordinary character such as `1' or `\c
+.IR x ';
+.
.TP
operator
a large operator such as
-.ds Su \s+5\(*S\s0
+.ds Su `\s+5\(*S\s0'
.if \n(.g .if !c\(*S .ds Su the summation operator
\*(Su;
+.
.TP
binary
-a binary operator such as +;
+a binary operator such as `\(pl';
+.
.TP
relation
-a relation such as =;
+a relation such as `=';
+.
.TP
opening
-a opening bracket such as (;
+a opening bracket such as `(';
+.
.TP
closing
-a closing bracket such as );
+a closing bracket such as `)';
+.
.TP
punctuation
-a punctuation character such as ,;
+a punctuation character such as `,';
+.
.TP
inner
a subformula contained within brackets;
.TP
suppress
spacing that suppresses automatic spacing adjustment.
+.RE
+.
.LP
Components of an equation get a type in one of two ways.
+.
.TP
.BI type\ t\ e
-This yields an equation component that contains
+This yields an equation component that contains\~\c
.I e
-but that has type
+but that has type\~\c
.IR t ,
where
.I t
@@ -235,14 +303,17 @@ is one of the types mentioned above.
For example,
.B times
is defined as
+.
.RS
.IP
.B
type "binary" \e(mu
.RE
+.
.IP
The name of the type doesn't have to be quoted, but quoting protects
from macro expansion.
+.
.TP
.BI chartype\ t\ text
Unquoted groups of characters are split up into individual characters,
@@ -250,20 +321,20 @@ and the type of each character is looked up;
this changes the type that is stored for each character;
it says that the characters in
.I text
-from now on have type
+from now on have type\~\c
.IR t .
For example,
+.
.RS
.IP
.B
chartype "punctuation" .,;:
.RE
+.
.IP
-would make the characters
-.B .,;:
-have type punctuation
+would make the characters `.,;:' have type punctuation
whenever they subsequently appeared in an equation.
-The type
+The type\~\c
.I t
can also be
.B letter
@@ -272,7 +343,10 @@ or
in these cases
.B chartype
changes the font type of the characters.
-See the Fonts subsection.
+See the
+.B Fonts
+subsection.
+.
.SS New primitives
.TP
.IB e1\ smallover\ e2
@@ -297,22 +371,25 @@ primitive in display styles;
corresponds to
.B \eover
in non-display styles.
+.
.TP
.BI vcenter\ e
This vertically centers
.I e
about the math axis.
The math axis is the vertical position about which characters
-such as + and - are centered; also it is the vertical position
+such as `\(pl' and `\(mi' are centered; also it is the vertical position
used for the bar of fractions.
For example,
.B sum
is defined as
+.
.RS
.IP
.B
{ type "operator" vcenter size +5 \e(*S }
.RE
+.
.TP
.IB e1\ accent\ e2
This sets
@@ -328,21 +405,24 @@ is taller or shorter than a lowercase letter.
For example,
.B hat
is defined as
+.
.RS
.IP
.B
accent { "^" }
.RE
+.
.IP
.BR dotdot ,
.BR dot ,
.BR tilde ,
-.B vec
+.BR vec ,
and
.B dyad
are also defined using the
.B accent
primitive.
+.
.TP
.IB e1\ uaccent\ e2
This sets
@@ -359,13 +439,16 @@ has a descender.
is pre-defined using
.B uaccent
as a tilde accent below the baseline.
+.
.TP
.BI split\ \(ts text \(ts
This has the same effect as simply
+.
.RS
.IP
.I text
.RE
+.
.IP
but
.I text
@@ -373,13 +456,16 @@ is not subject to macro expansion because it is quoted;
.I text
will be split up and the spacing between individual characters
will be adjusted.
+.
.TP
.BI nosplit\ text
This has the same effect as
+.
.RS
.IP
.BI \(ts text \(ts
.RE
+.
.IP
but because
.I text
@@ -387,11 +473,12 @@ is not quoted it will be subject to macro expansion;
.I text
will not be split up
and the spacing between individual characters will not be adjusted.
+.
.TP
.IB e\ opprime
This is a variant of
.B prime
-that acts as an operator on
+that acts as an operator on\~\c
.IR e .
It produces a different result from
.B prime
@@ -399,14 +486,14 @@ in a case such as
.BR A\ opprime\ sub\ 1 :
with
.B opprime
-the
+the\~\c
.B 1
-will be tucked under the prime as a subscript to the
+will be tucked under the prime as a subscript to the\~\c
.B A
(as is conventional in mathematical typesetting),
whereas with
.B prime
-the
+the\~\c
.B 1
will be a subscript to the prime character.
The precedence of
@@ -419,31 +506,32 @@ which is higher than that of everything except
.B accent
and
.BR uaccent .
-In unquoted text a
+In unquoted text a\~\c
.B '
that is not the first character will be treated like
.BR opprime .
+.
.TP
.BI special\ text\ e
-This constructs a new object from
+This constructs a new object from\~\c
.I e
using a
-.BR @g@troff (@MAN1EXT@)
+.BR @g@troff (@MAN1EXT@)
macro named
.IR text .
When the macro is called,
the string
.B 0s
-will contain the output for
+will contain the output for\~\c
.IR e ,
and the number registers
.BR 0w ,
.BR 0h ,
.BR 0d ,
-.BR 0skern
+.BR 0skern ,
and
.BR 0skew
-will contain the width, height, depth, subscript kern, and skew of
+will contain the width, height, depth, subscript kern, and skew of\~\c
.IR e .
(The
.I "subscript kern"
@@ -459,82 +547,178 @@ point, and increase the current horizontal position by the width
of the object.
The number registers must also be modified so that they correspond to the
result.
-.RS
-.LP
+.
+.IP
For example, suppose you wanted a construct that `cancels' an expression
by drawing a diagonal line through it.
+.
+.RS
.IP
-.nf
.ft B
.if t .ne 6+\n(.Vu
+.br
\&.EQ
+.br
define cancel 'special Ca'
+.br
\&.EN
+.br
\&.de Ca
-\&.ds 0s \eZ'\e\e*(0s'\ev'\e\en(0du'\eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\ev'\e\en(0hu'
+.br
+\&.\ \ ds 0s \e
+.br
+\eZ'\e\e*(0s'\e
+.br
+\ev'\e\en(0du'\e
+.br
+\eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\e
+.br
+\ev'\e\en(0hu'
+.br
\&..
.ft
-.fi
-.LP
-Then you could cancel an expression
+.RE
+.
+.IP
+Then you could cancel an expression\~\c
.I e
with
-.BI cancel\ {\ e\ }
-.LP
+.BI \%cancel\ {\ e\ }
+.
+.IP
Here's a more complicated construct that draws a box round an expression:
+.
+.RS
.IP
-.nf
.ft B
.if t .ne 11+\n(.Vu
\&.EQ
+.br
define box 'special Bx'
+.br
\&.EN
+.br
\&.de Bx
-\&.ds 0s \eZ'\eh'1n'\e\e*(0s'\e
-\eZ'\ev'\e\en(0du+1n'\eD'l \e\en(0wu+2n 0'\eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
-\eD'l -\e\en(0wu-2n 0'\eD'l 0 \e\en(0hu+\e\en(0du+2n''\eh'\e\en(0wu+2n'
-\&.nr 0w +2n
-\&.nr 0d +1n
-\&.nr 0h +1n
+.br
+\&.\ \ ds 0s \e
+.br
+\eZ'\eh'1n'\e\e*(0s'\e
+.br
+\eZ'\e
+.br
+\ev'\e\en(0du+1n'\e
+.br
+\eD'l \e\en(0wu+2n 0'\e
+.br
+\eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
+.br
+\eD'l -\e\en(0wu-2n 0'\e
+.br
+\eD'l 0 \e\en(0hu+\e\en(0du+2n'\e
+.br
+\&'\e
+.br
+\eh'\e\en(0wu+2n'
+.br
+\&.\ \ nr 0w +2n
+.br
+\&.\ \ nr 0d +1n
+.br
+\&.\ \ nr 0h +1n
+.br
\&..
.ft
-.fi
.RE
+.
+.TP
+.BI space\ n
+A positive value of the integer\~\c
+.I n
+(in hundredths of an em) sets the vertical spacing before the equation,
+a negative value sets the spacing after the equation, replacing the
+default values.
+This primitive provides an interface to
+.BR groff 's
+.B \ex
+escape (but with opposite sign).
+.
+.IP
+This keyword has no effect if the equation is part of a
+.B pic
+picture.
+.
+.SS Extended primitives
+.TP
+.BI col\ n\ {\ .\|.\|.\ }
+.TQ
+.BI ccol\ n\ {\ .\|.\|.\ }
+.TQ
+.BI lcol\ n\ {\ .\|.\|.\ }
+.TQ
+.BI rcol\ n\ {\ .\|.\|.\ }
+.TQ
+.BI pile\ n\ {\ .\|.\|.\ }
+.TQ
+.BI cpile\ n\ {\ .\|.\|.\ }
+.TQ
+.BI lpile\ n\ {\ .\|.\|.\ }
+.TQ
+.BI rpile\ n\ {\ .\|.\|.\ }
+The integer value\~\c
+.I n
+(in hundredths of an em) increases the vertical spacing between rows,
+using
+.BR groff 's
+.B \ex
+escape.
+Negative values are possible but have no effect.
+If there is more than a single value given in a matrix, the biggest one
+is used.
+.
.SS Customization
-The appearance of equations is controlled by
-a large number of parameters. These can be set using
+The appearance of equations is controlled by a large number of parameters.
+These can be set using
the
.B set
command.
+.
.TP
.BI set\ p\ n
-This sets parameter
+This sets parameter\~\c
.I p
-to value
-.I n ;
-.I n
+to value\~\c
+.IR n ;
+.I n\~\c
is an integer.
For example,
+.
.RS
.IP
.B
set x_height 45
.RE
+.
.IP
says that
.B eqn
-should assume an x height of 0.45 ems.
+should assume an x\~height of 0.45\~ems.
+.
.RS
.LP
Possible parameters are as follows.
Values are in units of hundredths of an em unless otherwise stated.
These descriptions are intended to be expository rather than
definitive.
-.TP \w'\fBdefault_rule_thickness'u+2n
+.
+.ie t \
+. TP \w'\fBdefault_rule_thickness'u+2n
+.el \
+. TP
.B minimum_size
.B eqn
will not set anything at a smaller point-size than this.
The value is in points.
+.
.TP
.B fat_offset
The
@@ -542,12 +726,14 @@ The
primitive emboldens an equation
by overprinting two copies of the equation
horizontally offset by this amount.
+.
.TP
.B over_hang
A fraction bar will be longer by twice this amount than
the maximum of the widths of the numerator and denominator;
in other words, it will overhang the numerator and
denominator by at least this amount.
+.
.TP
.B accent_width
When
@@ -563,6 +749,7 @@ or
produces a line whose length is the width of the object to which it applies;
in the case of a single character,
this tends to produce a line that looks too long.
+.
.TP
.B delimiter_factor
Extensible delimiters produced with the
@@ -572,6 +759,7 @@ and
primitives will have a combined height and depth of at least this many
thousandths of twice the maximum amount by which the sub-equation that
the delimiters enclose extends away from the axis.
+.
.TP
.B delimiter_shortfall
Extensible delimiters produced with the
@@ -583,34 +771,42 @@ not less than the difference of
twice the maximum amount by which the sub-equation that
the delimiters enclose extends away from the axis
and this amount.
+.
.TP
.B null_delimiter_space
This much horizontal space is inserted
on each side of a fraction.
+.
.TP
.B script_space
The width of subscripts and superscripts is increased by this amount.
+.
.TP
.B thin_space
This amount of space is automatically inserted after punctuation
characters.
+.
.TP
.B medium_space
This amount of space is automatically inserted on either side
of binary operators.
+.
.TP
.B thick_space
This amount of space is automatically inserted on either side of
relations.
+.
.TP
.B x_height
-The height of lowercase letters without ascenders such as x.
+The height of lowercase letters without ascenders such as `x'.
+.
.TP
.B axis_height
The height above the baseline of the center of characters
-such as \(pl and \(mi.
+such as `\(pl' and `\(mi'.
It is important that this value is correct for the font
you are using.
+.
.TP
.B default_rule_thickness
This should set to the thickness of the
@@ -618,29 +814,35 @@ This should set to the thickness of the
character, or the thickness of horizontal lines produced with the
.B \eD
escape sequence.
+.
.TP
.B num1
The
.B over
command will shift up the numerator by at least this amount.
+.
.TP
.B num2
The
.B smallover
command will shift up the numerator by at least this amount.
+.
.TP
.B denom1
The
.B over
command will shift down the denominator by at least this amount.
+.
.TP
.B denom2
The
.B smallover
command will shift down the denominator by at least this amount.
+.
.TP
.B sup1
Normally superscripts will be shifted up by at least this amount.
+.
.TP
.B sup2
Superscripts within superscripts or upper limits
@@ -649,47 +851,58 @@ or numerators of
fractions
will be shifted up by at least this amount.
This is usually less than sup1.
+.
.TP
.B sup3
Superscripts within denominators or square roots
or subscripts or lower limits will be shifted up by at least
this amount.
This is usually less than sup2.
+.
.TP
.B sub1
Subscripts will normally be shifted down by at least this amount.
+.
.TP
.B sub2
When there is both a subscript and a superscript, the subscript
will be shifted down by at least this amount.
+.
.TP
.B sup_drop
The baseline of a superscript will be no more
than this much amount below the top of the object on
which the superscript is set.
+.
.TP
.B sub_drop
The baseline of a subscript will be at least this much below
the bottom of the object on which the subscript is set.
+.
.TP
.B big_op_spacing1
The baseline of an upper limit will be at least this
much above the top of the object on which the limit is set.
+.
.TP
.B big_op_spacing2
The baseline of a lower limit will be at least this
much below the bottom of the object on which the limit is set.
+.
.TP
.B big_op_spacing3
The bottom of an upper limit will be at least this much above the
top of the object on which the limit is set.
+.
.TP
.B big_op_spacing4
The top of a lower limit will be at least this much below
the bottom of the object on which the limit is set.
+.
.TP
.B big_op_spacing5
This much vertical space will be added above and below limits.
+.
.TP
.B baseline_sep
The baselines of the rows in a pile or matrix will normally be
@@ -698,18 +911,22 @@ In most cases this should be equal to the sum of
.B num1
and
.BR denom1 .
+.
.TP
.B shift_down
The midpoint between the top baseline and the bottom baseline
in a matrix or pile will be shifted down by this much from the axis.
In most cases this should be equal to
.BR axis_height .
+.
.TP
.B column_sep
This much space will be added between columns in a matrix.
+.
.TP
.B matrix_side_sep
This much space will be added at each side of a matrix.
+.
.TP
.B draw_lines
If this is non-zero, lines will be drawn using the
@@ -719,20 +936,23 @@ escape sequence, rather than with the
escape sequence and the
.B \e(ru
character.
+.
.TP
.B body_height
The amount by which the height of the equation exceeds this
will be added as extra space before the line containing the equation
(using
-.BR \ex .)
+.BR \ex ).
The default value is 85.
+.
.TP
.B body_depth
The amount by which the depth of the equation exceeds this
will be added as extra space after the line containing the equation
(using
-.BR \ex .)
+.BR \ex ).
The default value is 35.
+.
.TP
.B nroff
If this is non-zero,
@@ -750,8 +970,8 @@ will behave like
and
.B ndefine
will be ignored.
-The default value is 0
-(This is typically changed to 1 by the
+The default value is\~0
+(This is typically changed to\~1 by the
.B eqnrc
file for the
.BR ascii ,
@@ -760,23 +980,25 @@ file for the
and
.B cp1047
devices.)
+.
.LP
A more precise description of the role of many of these
-parameters can be found in Appendix H of
-.IR The\ \*(txbook .
+parameters can be found in Appendix\~H of
+.IR "The \*(txbook" .
.RE
+.
.SS Macros
Macros can take arguments.
In a macro body,
.BI $ n
where
.I n
-is between 1 and 9,
+is between 1 and\~9,
will be replaced by the
.IR n-th
argument if the macro is called with arguments;
if there are fewer than
-.I n
+.I n\~\c
arguments, it will be replaced by nothing.
A word containing a left parenthesis where the part of the word
before the left parenthesis has been defined using the
@@ -787,6 +1009,7 @@ characters following the left parenthesis
up to a matching right parenthesis will be treated as comma-separated
arguments;
commas inside nested parentheses do not terminate an argument.
+.
.TP
.BI sdefine\ name\ X\ anything\ X
This is like the
@@ -794,10 +1017,17 @@ This is like the
command, but
.I name
will not be recognized if called with arguments.
+.
.TP
.BI include\ \(ts file \(ts
+.TQ
+.BI copy\ \(ts file \(ts
Include the contents of
-.IR file .
+.I file
+.RB ( include
+and
+.B copy
+are synonyms).
Lines of
.I file
beginning with
@@ -805,6 +1035,7 @@ beginning with
or
.B .EN
will be ignored.
+.
.TP
.BI ifdef\ name\ X\ anything\ X
If
@@ -821,6 +1052,29 @@ otherwise ignore
.I X
can be any character not appearing in
.IR anything .
+.
+.TP
+.BI undef\ name
+Remove definition of
+.IR name ,
+making it undefined.
+.
+.LP
+Besides the macros mentioned above, the following definitions are available:
+.BR Alpha ,
+.BR Beta ,
+\&.\|.\|.,
+.B Omega
+(this is the same as
+.BR ALPHA ,
+.BR BETA ,
+\&.\|.\|.,
+.BR OMEGA ),
+.B ldots
+(three dots on the base line),
+and
+.BR dollar .
+.
.SS Fonts
.B eqn
normally uses at least two fonts to set an equation:
@@ -830,16 +1084,18 @@ The existing
.B gfont
command
changes the font that is used as the italic font.
-By default this is
+By default this is\~\c
.BR I .
The font that is used as the roman font can be changed
using the new
.B grfont
command.
+.
.TP
.BI grfont\ f
-Set the roman font to
+Set the roman font to\~\c
.IR f .
+.
.LP
The
.B italic
@@ -867,6 +1123,7 @@ just by using
and
.B gbfont
commands.
+.
.LP
You can control which characters are treated as letters
(and therefore set in italics) by using the
@@ -878,16 +1135,23 @@ will cause a character to be set in italic type.
A type of
.B digit
will cause a character to be set in roman type.
+.
+.
.SH FILES
.Tp \w'\fB@MACRODIR@/eqnrc'u+2n
.B @MACRODIR@/eqnrc
Initialization file.
+.
+.
.SH BUGS
Inline equations will be set at the point size that is current at the
beginning of the input line.
+.
+.
.SH "SEE ALSO"
.BR groff (@MAN1EXT@),
.BR @g@troff (@MAN1EXT@),
+.BR @g@pic (@MAN1EXT@),
.BR groff_font (@MAN5EXT@),
.I The\ \*(txbook
.
diff --git a/contrib/groff/src/preproc/eqn/eqn.y b/contrib/groff/src/preproc/eqn/eqn.y
index 833a0f0..85157d6 100644
--- a/contrib/groff/src/preproc/eqn/eqn.y
+++ b/contrib/groff/src/preproc/eqn/eqn.y
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
%{
#include <stdio.h>
#include <string.h>
@@ -24,7 +24,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "lib.h"
#include "box.h"
extern int non_empty_flag;
-char *strsave(const char *);
int yylex();
void yyerror(const char *);
%}
diff --git a/contrib/groff/src/preproc/eqn/lex.cpp b/contrib/groff/src/preproc/eqn/lex.cpp
index abc07c9..6aa494d 100644
--- a/contrib/groff/src/preproc/eqn/lex.cpp
+++ b/contrib/groff/src/preproc/eqn/lex.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,13 +17,19 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "eqn_tab.h"
#include "stringclass.h"
#include "ptable.h"
+
+// declarations to avoid friend name injection problems
+int get_char();
+int peek_char();
+int get_location(char **, int *);
+
struct definition {
char is_macro;
char is_simple;
diff --git a/contrib/groff/src/preproc/eqn/limit.cpp b/contrib/groff/src/preproc/eqn/limit.cpp
index c8b5587..b9f35f9 100644
--- a/contrib/groff/src/preproc/eqn/limit.cpp
+++ b/contrib/groff/src/preproc/eqn/limit.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/list.cpp b/contrib/groff/src/preproc/eqn/list.cpp
index 1118fa1..003562af 100644
--- a/contrib/groff/src/preproc/eqn/list.cpp
+++ b/contrib/groff/src/preproc/eqn/list.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/main.cpp b/contrib/groff/src/preproc/eqn/main.cpp
index dabac5f..7971e2c 100644
--- a/contrib/groff/src/preproc/eqn/main.cpp
+++ b/contrib/groff/src/preproc/eqn/main.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "stringclass.h"
diff --git a/contrib/groff/src/preproc/eqn/mark.cpp b/contrib/groff/src/preproc/eqn/mark.cpp
index 99d1b75..9fa6579 100644
--- a/contrib/groff/src/preproc/eqn/mark.cpp
+++ b/contrib/groff/src/preproc/eqn/mark.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/other.cpp b/contrib/groff/src/preproc/eqn/other.cpp
index c052f52..9f360df 100644
--- a/contrib/groff/src/preproc/eqn/other.cpp
+++ b/contrib/groff/src/preproc/eqn/other.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/over.cpp b/contrib/groff/src/preproc/eqn/over.cpp
index 279efc8..302c5b5 100644
--- a/contrib/groff/src/preproc/eqn/over.cpp
+++ b/contrib/groff/src/preproc/eqn/over.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/pbox.h b/contrib/groff/src/preproc/eqn/pbox.h
index d1f16ac..f100f21 100644
--- a/contrib/groff/src/preproc/eqn/pbox.h
+++ b/contrib/groff/src/preproc/eqn/pbox.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern int fat_offset;
diff --git a/contrib/groff/src/preproc/eqn/pile.cpp b/contrib/groff/src/preproc/eqn/pile.cpp
index 0df5241..10d1708 100644
--- a/contrib/groff/src/preproc/eqn/pile.cpp
+++ b/contrib/groff/src/preproc/eqn/pile.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
// piles and matrices
#include "eqn.h"
@@ -114,13 +114,13 @@ void pile_box::debug_print()
int matrix_box::compute_metrics(int style)
{
int i, j;
- int maxlen = 0;
+ int max_len = 0;
int space = 0;
for (i = 0; i < len; i++) {
for (j = 0; j < p[i]->len; j++)
p[i]->p[j]->compute_metrics(style);
- if (p[i]->len > maxlen)
- maxlen = p[i]->len;
+ if (p[i]->len > max_len)
+ max_len = p[i]->len;
if (p[i]->space > space)
space = p[i]->space;
}
@@ -145,7 +145,7 @@ int matrix_box::compute_metrics(int style)
printf("/\\n(.V+(\\n(.V/2)*\\n(.V\n");
printf(".nr " SUP_RAISE_FORMAT " \\n[" BASELINE_SEP_FORMAT "]*%d/2"
"+%dM\n",
- uid, uid, maxlen-1, axis_height - shift_down);
+ uid, uid, max_len-1, axis_height - shift_down);
printf(".nr " HEIGHT_FORMAT " 0\\n[" SUP_RAISE_FORMAT "]+(0",
uid, uid);
for (i = 0; i < len; i++)
@@ -153,10 +153,10 @@ int matrix_box::compute_metrics(int style)
printf(")>?0\n");
printf(".nr " DEPTH_FORMAT " \\n[" BASELINE_SEP_FORMAT "]*%d-\\n["
SUP_RAISE_FORMAT "]+(0",
- uid, uid, maxlen-1, uid);
+ uid, uid, max_len-1, uid);
for (i = 0; i < len; i++)
- if (p[i]->len == maxlen)
- printf(">?\\n[" DEPTH_FORMAT "]", p[i]->p[maxlen-1]->uid);
+ if (p[i]->len == max_len)
+ printf(">?\\n[" DEPTH_FORMAT "]", p[i]->p[max_len-1]->uid);
printf(")>?0\n");
return FOUND_NOTHING;
}
diff --git a/contrib/groff/src/preproc/eqn/script.cpp b/contrib/groff/src/preproc/eqn/script.cpp
index 62a05b4..a9de742 100644
--- a/contrib/groff/src/preproc/eqn/script.cpp
+++ b/contrib/groff/src/preproc/eqn/script.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
@@ -103,20 +104,20 @@ int script_box::compute_metrics(int style)
else {
// sup != 0
// 18c
- int p;
+ int pos;
if (style == DISPLAY_STYLE)
- p = sup1;
+ pos = sup1;
else if (style & 1) // not cramped
- p = sup2;
+ pos = sup2;
else
- p = sup3;
+ pos = sup3;
printf(".nr " SUP_RAISE_FORMAT " \\n[" SUP_RAISE_FORMAT
"]>?%dM>?(\\n[" DEPTH_FORMAT "]+(%dM/4))\n",
- uid, uid, p, sup->uid, x_height);
+ uid, uid, pos, sup->uid, x_height);
// 18d
if (sub != 0) {
printf(".nr " SUB_LOWER_FORMAT " \\n[" SUB_LOWER_FORMAT "]>?%dM\n",
- uid, uid, sub2);
+ uid, uid, sub2);
// 18e
printf(".nr " TEMP_REG " \\n[" DEPTH_FORMAT "]-\\n["
SUP_RAISE_FORMAT "]+\\n[" HEIGHT_FORMAT "]-\\n["
diff --git a/contrib/groff/src/preproc/eqn/special.cpp b/contrib/groff/src/preproc/eqn/special.cpp
index 310261a..172686a 100644
--- a/contrib/groff/src/preproc/eqn/special.cpp
+++ b/contrib/groff/src/preproc/eqn/special.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/sqrt.cpp b/contrib/groff/src/preproc/eqn/sqrt.cpp
index f998ff3..8f3373f 100644
--- a/contrib/groff/src/preproc/eqn/sqrt.cpp
+++ b/contrib/groff/src/preproc/eqn/sqrt.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/eqn/text.cpp b/contrib/groff/src/preproc/eqn/text.cpp
index 83e4a76..e392212 100644
--- a/contrib/groff/src/preproc/eqn/text.cpp
+++ b/contrib/groff/src/preproc/eqn/text.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "eqn.h"
#include "pbox.h"
diff --git a/contrib/groff/src/preproc/grn/gprint.h b/contrib/groff/src/preproc/grn/gprint.h
index b9df60e..ad3be44 100644
--- a/contrib/groff/src/preproc/grn/gprint.h
+++ b/contrib/groff/src/preproc/grn/gprint.h
@@ -66,7 +66,7 @@
#define MOD 3
typedef struct point {
- float x, y;
+ double x, y;
struct point *nextpt;
} POINT;
diff --git a/contrib/groff/src/preproc/grn/grn.man b/contrib/groff/src/preproc/grn/grn.man
index 9722145..575b4ee 100644
--- a/contrib/groff/src/preproc/grn/grn.man
+++ b/contrib/groff/src/preproc/grn/grn.man
@@ -1,6 +1,6 @@
'\" t
.ig
-Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -17,17 +17,24 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.do nr grn_C \n[.C]
+.cp 0
+.
.de TQ
-.br
-.ns
-.TP \\$1
+. br
+. ns
+. TP \\$1
..
+.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
..
+.
+.
.TH @G@GRN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
.SH NAME
@g@grn \- groff preprocessor for gremlin files
@@ -142,7 +149,7 @@ Recognize
.B .GS
and
.B .GE
-(resp.
+(and
.BR .GF )
even when followed by a character other than space or newline.
.\".TP
@@ -188,7 +195,7 @@ Set
text size number 1 (2, 3, or 4) to
.I N
points.
-The default is 12 (resp. 16, 24, and 36).
+The default is 12 (16, 24, and 36, respectively).
.TP
.BI roman\ f
.TQ
@@ -202,7 +209,7 @@ Set the roman (italics, bold, or special) font to
font
.I f
(either a name or number).
-The default is R (resp. I, B, and S).
+The default is R (I, B, and S, respectively).
.TP
.BI l\ f
.TQ
@@ -242,11 +249,11 @@ may be abbreviated down to `sc'.
.BI thick\ N
Set the thickness of
.IR gremlin 's
-narrow (resp. medium and thick) lines to
+narrow (medium and thick, respectively) lines to
.I N
times 0.15pt (this value can be changed at compile time).
-The default is 1.0 (resp. 3.0 and 5.0), which corresponds to 0.15pt
-(resp. 0.45pt and 0.75pt).
+The default is 1.0 (3.0 and 5.0, respectively), which corresponds to 0.15pt
+(0.45pt and 0.75pt, respectively).
A thickness value of zero selects the smallest available line thickness.
Negative values cause the line thickness to be proportional to the current
point size.
@@ -255,7 +262,10 @@ point size.
Scale text to match the picture.
Gremlin text is usually printed in the point size specified with the
commands
-.BR 1 ,\ 2 ,\ 3 ,\ or\ 4
+.BR 1 ,
+.BR 2 ,
+.BR 3 ,
+.RB or\~ 4 ,
regardless of any scaling factors in the picture.
Setting
.B pointscale
@@ -635,6 +645,8 @@ David Slattengren and Barry Roitblat wrote the original Berkeley
Daniel Senderowicz and Werner Lemberg modified it for
.IR groff .
.
+.cp \n[grn_C]
+.
.\" Local Variables:
.\" mode: nroff
.\" End:
diff --git a/contrib/groff/src/preproc/grn/hdb.cpp b/contrib/groff/src/preproc/grn/hdb.cpp
index c9fbb7d..5f54040 100644
--- a/contrib/groff/src/preproc/grn/hdb.cpp
+++ b/contrib/groff/src/preproc/grn/hdb.cpp
@@ -1,4 +1,4 @@
-/* Last non-groff version: hdb.c 1.8 (Berkeley) 84/10/20
+ /* Last non-groff version: hdb.c 1.8 (Berkeley) 84/10/20
*
* Copyright -C- 1982 Barry S. Roitblat
*
@@ -22,12 +22,13 @@
extern int linenum; /* current line number in input file */
extern char gremlinfile[]; /* name of file currently reading */
extern int SUNFILE; /* TRUE if SUN gremlin file */
-extern void savebounds(float x, float y);
+extern int compatibility_flag; /* TRUE if in compatibility mode */
+extern void savebounds(double x, double y);
/* imports from hpoint.cpp */
extern POINT *PTInit();
-extern POINT *PTMakePoint(float x, float y, POINT ** pplist);
+extern POINT *PTMakePoint(double x, double y, POINT ** pplist);
int DBGetType(register char *s);
@@ -79,12 +80,12 @@ DBRead(register FILE *file)
{
register int i;
register int done; /* flag for input exhausted */
- register float nx; /* x holder so x is not set before orienting */
+ register double nx; /* x holder so x is not set before orienting */
int type; /* element type */
ELT *elist; /* pointer to the file's elements */
POINT *plist; /* pointer for reading in points */
char string[MAXSTRING], *txt;
- float x, y; /* x and y are read in point coords */
+ double x, y; /* x and y are read in point coords */
int len, brush, size;
int lastpoint;
@@ -99,7 +100,7 @@ DBRead(register FILE *file)
SUNFILE = TRUE;
}
- (void) fscanf(file, "%d%f%f\n", &size, &x, &y);
+ (void) fscanf(file, "%d%lf%lf\n", &size, &x, &y);
/* ignore orientation and file positioning point */
done = FALSE;
@@ -115,12 +116,11 @@ DBRead(register FILE *file)
type = DBGetType(string); /* interpret element type */
if (type < 0) { /* no more data */
done = TRUE;
- (void) fclose(file);
} else {
#ifdef UW_FASTSCAN
(void) xscanf(file, &x, &y); /* always one point */
#else
- (void) fscanf(file, "%f%f\n", &x, &y); /* always one point */
+ (void) fscanf(file, "%lf%lf\n", &x, &y); /* always one point */
#endif /* UW_FASTSCAN */
plist = PTInit(); /* NULL point list */
@@ -144,9 +144,13 @@ DBRead(register FILE *file)
if (string[0] == '*') { /* SUN gremlin file */
lastpoint = TRUE;
} else {
- (void) sscanf(string, "%f%f", &x, &y);
+ (void) sscanf(string, "%lf%lf", &x, &y);
if ((x == -1.00 && y == -1.00) && (!SUNFILE))
lastpoint = TRUE;
+ else {
+ if (compatibility_flag)
+ savebounds(xorn(x, y), yorn(x, y));
+ }
}
} while (!lastpoint);
#endif /* UW_FASTSCAN */
@@ -170,7 +174,7 @@ DBRead(register FILE *file)
if (string[0] == '*') { /* SUN gremlin file */
lastpoint = TRUE;
} else {
- (void) sscanf(string, "%f%f", &x, &y);
+ (void) sscanf(string, "%lf%lf", &x, &y);
if ((x == -1.00 && y == -1.00) && (!SUNFILE))
lastpoint = TRUE;
}
@@ -182,7 +186,10 @@ DBRead(register FILE *file)
(void) getc(file); /* eat blank */
txt = (char *) malloc((unsigned) len + 1);
for (i = 0; i < len; ++i) { /* read text */
- txt[i] = getc(file);
+ int c = getc(file);
+ if (c == EOF)
+ break;
+ txt[i] = c;
}
txt[len] = '\0';
(void) DBCreateElt(type, plist, brush, size, txt, &elist);
@@ -281,8 +288,8 @@ DBGetType(register char *s)
*/
int
xscanf(FILE *f,
- float *xp,
- float *yp)
+ double *xp,
+ double *yp)
{
register int c, i, j, m, frac;
int iscale = 1, jscale = 1; /* x = i/scale, y=j/jscale */
diff --git a/contrib/groff/src/preproc/grn/hgraph.cpp b/contrib/groff/src/preproc/grn/hgraph.cpp
index d124c6c..0120895 100644
--- a/contrib/groff/src/preproc/grn/hgraph.cpp
+++ b/contrib/groff/src/preproc/grn/hgraph.cpp
@@ -8,19 +8,13 @@
#include "gprint.h"
-#ifdef NEED_DECLARATION_HYPOT
-extern "C" {
- double hypot(double, double);
-}
-#endif /* NEED_DECLARATION_HYPOT */
-
#define MAXVECT 40
#define MAXPOINTS 200
#define LINELENGTH 1
#define PointsPerInterval 64
#define pi 3.14159265358979324
#define twopi (2.0 * pi)
-#define len(a, b) hypot((double)(b.x-a.x), (double)(b.y-a.y))
+#define len(a, b) groff_hypot((double)(b.x-a.x), (double)(b.y-a.y))
extern int dotshifter; /* for the length of dotted curves */
@@ -43,7 +37,7 @@ extern int ytop;
extern int ybottom;
extern int xleft;
extern int xright;
-extern enum {
+extern enum E {
OUTLINE, FILL, BOTH
} polyfill;
@@ -62,17 +56,17 @@ void tmove(POINT * ptr);
void cr();
void drawwig(POINT * ptr, int type);
void HGtline(int x1, int y1);
-void dx(double x);
-void dy(double y);
+void deltax(double x);
+void deltay(double y);
void HGArc(register int cx, register int cy, int px, int py, int angle);
void picurve(register int *x, register int *y, int npts);
void HGCurve(int *x, int *y, int numpoints);
-void Paramaterize(int x[], int y[], float h[], int n);
-void PeriodicSpline(float h[], int z[],
- float dz[], float d2z[], float d3z[],
+void Paramaterize(int x[], int y[], double h[], int n);
+void PeriodicSpline(double h[], int z[],
+ double dz[], double d2z[], double d3z[],
int npoints);
-void NaturalEndSpline(float h[], int z[],
- float dz[], float d2z[], float d3z[],
+void NaturalEndSpline(double h[], int z[],
+ double dz[], double d2z[], double d3z[],
int npoints);
@@ -166,8 +160,8 @@ HGPrintElt(ELT *element,
* stipple fonts).
* If polyfill=BOTH, just use the \D'p ...' command.
*/
- float firstx = p1->x;
- float firsty = p1->y;
+ double firstx = p1->x;
+ double firsty = p1->y;
length = 0; /* keep track of line length so */
/* single lines don't get long */
@@ -223,8 +217,8 @@ HGPrintElt(ELT *element,
while (!Nullpoint((PTNextPoint(p1)))) {
p1 = PTNextPoint(p1);
- dx((double) p1->x);
- dy((double) p1->y);
+ deltax((double) p1->x);
+ deltay((double) p1->y);
if (length++ > LINELENGTH) {
length = 0;
printf("\\\n");
@@ -233,8 +227,8 @@ HGPrintElt(ELT *element,
/* close polygon if not done so by user */
if ((firstx != p1->x) || (firsty != p1->y)) {
- dx((double) firstx);
- dy((double) firsty);
+ deltax((double) firstx);
+ deltay((double) firsty);
}
putchar('\'');
cr();
@@ -412,7 +406,7 @@ HGSetBrush(int mode)
/*----------------------------------------------------------------------------*
- | Routine: dx (x_destination)
+ | Routine: deltax (x_destination)
|
| Results: Scales and outputs a number for delta x (with a leading
| space) given `lastx' and x_destination.
@@ -421,7 +415,7 @@ HGSetBrush(int mode)
*----------------------------------------------------------------------------*/
void
-dx(double x)
+deltax(double x)
{
register int ix = (int) (x * troffscale);
@@ -431,7 +425,7 @@ dx(double x)
/*----------------------------------------------------------------------------*
- | Routine: dy (y_destination)
+ | Routine: deltay (y_destination)
|
| Results: Scales and outputs a number for delta y (with a leading
| space) given `lastyline' and y_destination.
@@ -441,7 +435,7 @@ dx(double x)
*----------------------------------------------------------------------------*/
void
-dy(double y)
+deltay(double y)
{
register int iy = (int) (y * troffscale);
@@ -600,7 +594,7 @@ HGArc(register int cx,
length = 0;
- resolution = (1.0 + hypot(xs, ys) / res) * PointsPerInterval;
+ resolution = (1.0 + groff_hypot(xs, ys) / res) * PointsPerInterval;
/* mask = (1 << (int) log10(resolution + 1.0)) - 1; */
(void) frexp(resolution, &m); /* A bit more elegant than log10 */
for (mask = 1; mask < m; mask = mask << 1);
@@ -671,13 +665,13 @@ picurve(register int *x,
for (; npts--; x++, y++) { /* traverse the line segments */
xp = x[0] - x[1];
yp = y[0] - y[1];
- nseg = (int) hypot((double) xp, (double) yp);
+ nseg = (int) groff_hypot((double) xp, (double) yp);
xp = x[1] - x[2];
yp = y[1] - y[2];
/* `nseg' is the number of line */
/* segments that will be drawn for */
/* each curve segment. */
- nseg = (int) ((double) (nseg + (int) hypot((double) xp, (double) yp)) /
+ nseg = (int) ((double) (nseg + (int) groff_hypot((double) xp, (double) yp)) /
res * PointsPerInterval);
for (i = 1; i < nseg; i++) {
@@ -713,9 +707,9 @@ HGCurve(int *x,
int *y,
int numpoints)
{
- float h[MAXPOINTS], dx[MAXPOINTS], dy[MAXPOINTS];
- float d2x[MAXPOINTS], d2y[MAXPOINTS], d3x[MAXPOINTS], d3y[MAXPOINTS];
- float t, t2, t3;
+ double h[MAXPOINTS], dx[MAXPOINTS], dy[MAXPOINTS];
+ double d2x[MAXPOINTS], d2y[MAXPOINTS], d3x[MAXPOINTS], d3y[MAXPOINTS];
+ double t, t2, t3;
register int j;
register int k;
register int nx;
@@ -751,7 +745,7 @@ HGCurve(int *x,
if ((x[j] == x[j + 1]) && (y[j] == y[j + 1]))
continue;
for (k = 0; k <= PointsPerInterval; ++k) {
- t = (float) k *h[j] / (float) PointsPerInterval;
+ t = (double) k *h[j] / (double) PointsPerInterval;
t2 = t * t;
t3 = t * t * t;
nx = x[j] + (int) (t * dx[j] + t2 * d2x[j] / 2 + t3 * d3x[j] / 6);
@@ -779,14 +773,14 @@ HGCurve(int *x,
void
Paramaterize(int x[],
int y[],
- float h[],
+ double h[],
int n)
{
register int dx;
register int dy;
register int i;
register int j;
- float u[MAXPOINTS];
+ double u[MAXPOINTS];
for (i = 1; i <= n; ++i) {
u[i] = 0;
@@ -795,7 +789,7 @@ Paramaterize(int x[],
dy = y[j + 1] - y[j];
/* Here was overflowing, so I changed it. */
/* u[i] += sqrt ((double) (dx * dx + dy * dy)); */
- u[i] += hypot((double) dx, (double) dy);
+ u[i] += groff_hypot((double) dx, (double) dy);
}
}
for (i = 1; i < n; ++i)
@@ -814,16 +808,16 @@ Paramaterize(int x[],
*----------------------------------------------------------------------------*/
void
-PeriodicSpline(float h[], /* paramaterization */
+PeriodicSpline(double h[], /* paramaterization */
int z[], /* point list */
- float dz[], /* to return the 1st derivative */
- float d2z[], /* 2nd derivative */
- float d3z[], /* 3rd derivative */
+ double dz[], /* to return the 1st derivative */
+ double d2z[], /* 2nd derivative */
+ double d3z[], /* 3rd derivative */
int npoints) /* number of valid points */
{
- float d[MAXPOINTS];
- float deltaz[MAXPOINTS], a[MAXPOINTS], b[MAXPOINTS];
- float c[MAXPOINTS], r[MAXPOINTS], s[MAXPOINTS];
+ double d[MAXPOINTS];
+ double deltaz[MAXPOINTS], a[MAXPOINTS], b[MAXPOINTS];
+ double c[MAXPOINTS], r[MAXPOINTS], s[MAXPOINTS];
int i;
/* step 1 */
@@ -886,15 +880,15 @@ PeriodicSpline(float h[], /* paramaterization */
*----------------------------------------------------------------------------*/
void
-NaturalEndSpline(float h[], /* parameterization */
+NaturalEndSpline(double h[], /* parameterization */
int z[], /* Point list */
- float dz[], /* to return the 1st derivative */
- float d2z[], /* 2nd derivative */
- float d3z[], /* 3rd derivative */
+ double dz[], /* to return the 1st derivative */
+ double d2z[], /* 2nd derivative */
+ double d3z[], /* 3rd derivative */
int npoints) /* number of valid points */
{
- float d[MAXPOINTS];
- float deltaz[MAXPOINTS], a[MAXPOINTS], b[MAXPOINTS];
+ double d[MAXPOINTS];
+ double deltaz[MAXPOINTS], a[MAXPOINTS], b[MAXPOINTS];
int i;
/* step 1 */
@@ -970,11 +964,11 @@ change(register int x,
*----------------------------------------------------------------------------*/
void
-HGtline(int x1,
- int y1)
+HGtline(int x_1,
+ int y_1)
{
- register int x0 = lastx;
- register int y0 = lasty;
+ register int x_0 = lastx;
+ register int y_0 = lasty;
register int dx;
register int dy;
register int oldcoord;
@@ -986,7 +980,7 @@ HGtline(int x1,
register int dotcounter;
if (linmod == SOLID) {
- line(x1, y1);
+ line(x_1, y_1);
return;
}
@@ -995,11 +989,11 @@ HGtline(int x1,
xinc = 1;
yinc = 1;
- if ((dx = x1 - x0) < 0) {
+ if ((dx = x_1 - x_0) < 0) {
xinc = -xinc;
dx = -dx;
}
- if ((dy = y1 - y0) < 0) {
+ if ((dy = y_1 - y_0) < 0) {
yinc = -yinc;
dy = -dy;
}
@@ -1007,48 +1001,48 @@ HGtline(int x1,
res2 = 0;
visible = 0;
if (dx >= dy) {
- oldcoord = y0;
- while (x0 != x1) {
- if ((x0 & dotcounter) && !visible) {
- change(x0, y0, 0);
+ oldcoord = y_0;
+ while (x_0 != x_1) {
+ if ((x_0 & dotcounter) && !visible) {
+ change(x_0, y_0, 0);
visible = 1;
- } else if (visible && !(x0 & dotcounter)) {
- change(x0 - xinc, oldcoord, 1);
+ } else if (visible && !(x_0 & dotcounter)) {
+ change(x_0 - xinc, oldcoord, 1);
visible = 0;
}
if (res1 > res2) {
- oldcoord = y0;
+ oldcoord = y_0;
res2 += dx - res1;
res1 = 0;
- y0 += yinc;
+ y_0 += yinc;
}
res1 += dy;
- x0 += xinc;
+ x_0 += xinc;
}
} else {
- oldcoord = x0;
- while (y0 != y1) {
- if ((y0 & dotcounter) && !visible) {
- change(x0, y0, 0);
+ oldcoord = x_0;
+ while (y_0 != y_1) {
+ if ((y_0 & dotcounter) && !visible) {
+ change(x_0, y_0, 0);
visible = 1;
- } else if (visible && !(y0 & dotcounter)) {
- change(oldcoord, y0 - yinc, 1);
+ } else if (visible && !(y_0 & dotcounter)) {
+ change(oldcoord, y_0 - yinc, 1);
visible = 0;
}
if (res1 > res2) {
- oldcoord = x0;
+ oldcoord = x_0;
res2 += dy - res1;
res1 = 0;
- x0 += xinc;
+ x_0 += xinc;
}
res1 += dx;
- y0 += yinc;
+ y_0 += yinc;
}
}
if (visible)
- change(x1, y1, 1);
+ change(x_1, y_1, 1);
else
- change(x1, y1, 0);
+ change(x_1, y_1, 0);
}
/* EOF */
diff --git a/contrib/groff/src/preproc/grn/hpoint.cpp b/contrib/groff/src/preproc/grn/hpoint.cpp
index f4e1ca8..fa24dca 100644
--- a/contrib/groff/src/preproc/grn/hpoint.cpp
+++ b/contrib/groff/src/preproc/grn/hpoint.cpp
@@ -24,26 +24,26 @@ PTInit()
* into the pointlist.
*/
POINT *
-PTMakePoint(float x,
- float y,
+PTMakePoint(double x,
+ double y,
POINT **pplist)
{
- register POINT *point;
+ register POINT *pt;
- if (Nullpoint(point = *pplist)) { /* empty list */
+ if (Nullpoint(pt = *pplist)) { /* empty list */
*pplist = (POINT *) malloc(sizeof(POINT));
- point = *pplist;
+ pt = *pplist;
} else {
- while (!Nullpoint(point->nextpt))
- point = point->nextpt;
- point->nextpt = (POINT *) malloc(sizeof(POINT));
- point = point->nextpt;
+ while (!Nullpoint(pt->nextpt))
+ pt = pt->nextpt;
+ pt->nextpt = (POINT *) malloc(sizeof(POINT));
+ pt = pt->nextpt;
}
- point->x = x;
- point->y = y;
- point->nextpt = PTInit();
- return (point);
+ pt->x = x;
+ pt->y = y;
+ pt->nextpt = PTInit();
+ return (pt);
} /* end PTMakePoint */
/* EOF */
diff --git a/contrib/groff/src/preproc/grn/main.cpp b/contrib/groff/src/preproc/grn/main.cpp
index 150b78f..c939647 100644
--- a/contrib/groff/src/preproc/grn/main.cpp
+++ b/contrib/groff/src/preproc/grn/main.cpp
@@ -90,7 +90,7 @@ extern void HGPrintElt(ELT *element, int baseline);
extern ELT *DBInit();
extern ELT *DBRead(register FILE *file);
extern POINT *PTInit();
-extern POINT *PTMakePoint(float x, float y, POINT **pplist);
+extern POINT *PTMakePoint(double x, double y, POINT **pplist);
#define SUN_SCALEFACTOR 0.70
@@ -125,7 +125,7 @@ int lastyline; /* A line's vertical position is NOT the */
/* `default' command and are reset each time the */
/* start of a picture (.GS) is found. */
-char *deffont[] =
+const char *deffont[] =
{"R", "I", "B", "S"};
int defsize[] =
{10, 16, 24, 36};
@@ -160,7 +160,7 @@ int style[STYLES] =
double scale = 1.0; /* no scaling, default */
int defpoint = 0; /* flag for pointsize scaling */
char *defstipple = (char *) 0;
-enum {
+enum E {
OUTLINE, FILL, BOTH
} polyfill;
@@ -214,7 +214,7 @@ int compatibility_flag = FALSE; /* TRUE if in compatibility mode */
void getres();
-char *doinput(FILE *fp);
+int doinput(FILE *fp);
void conv(register FILE *fp, int baseline);
void savestate();
int has_polygon(register ELT *elist);
@@ -317,7 +317,7 @@ main(int argc,
} else
fp = stdin;
- while (doinput(fp) != NULL) {
+ while (doinput(fp)) {
if (*c1 == '.' && *c2 == 'G' && *c3 == 'S') {
if (compatibility_flag ||
*c4 == '\n' || *c4 == ' ' || *c4 == '\0')
@@ -328,6 +328,8 @@ main(int argc,
fputs(inputline, stdout);
}
}
+
+ return 0;
}
@@ -389,7 +391,7 @@ getres()
/*----------------------------------------------------------------------------*
- | Routine: char * doinput (file_pointer)
+ | Routine: int doinput (file_pointer)
|
| Results: A line of input is read into `inputline'.
|
@@ -399,16 +401,14 @@ getres()
| updating `linenum'.
*----------------------------------------------------------------------------*/
-char *
+int
doinput(FILE *fp)
{
- char *k;
-
- if ((k = fgets(inputline, MAXINLINE, fp)) == NULL)
- return k;
+ if (fgets(inputline, MAXINLINE, fp) == NULL)
+ return 0;
if (strchr(inputline, '\n')) /* ++ only if it's a complete line */
linenum++;
- return (char *) !NULL;
+ return 1;
}
@@ -430,7 +430,7 @@ initpic()
thick[i] = defthick[i];
}
for (i = 0; i < FONTS; i++) { /* font name defaults */
- tfont[i] = deffont[i];
+ tfont[i] = (char *)deffont[i];
}
for (i = 0; i < SIZES; i++) { /* font size defaults */
tsize[i] = defsize[i];
@@ -488,7 +488,7 @@ conv(register FILE *fp,
strcpy(GScommand, inputline); /* save `.GS' line for later */
do {
- done = (doinput(fp) == NULL); /* test for EOF */
+ done = !doinput(fp); /* test for EOF */
flyback = (*c3 == 'F'); /* and .GE or .GF */
compat = (compatibility_flag ||
*c4 == '\n' || *c4 == ' ' || *c4 == '\0');
@@ -518,7 +518,7 @@ conv(register FILE *fp,
if (stipple == (char *) NULL) /* if user forgot stipple */
if (has_polygon(PICTURE)) /* and picture has a polygon */
- stipple = DEFSTIPPLE; /* then set the default */
+ stipple = (char *)DEFSTIPPLE; /* then set the default */
if ((temp = bottompoint - toppoint) < 0.1)
temp = 0.1;
@@ -686,8 +686,8 @@ savestate()
*----------------------------------------------------------------------------*/
void
-savebounds(float x,
- float y)
+savebounds(double x,
+ double y)
{
if (x < leftpoint)
leftpoint = x;
@@ -781,17 +781,17 @@ interpret(char *line)
case 'l': /* l */
if (isdigit(str1[1])) { /* set stipple index */
- int index = atoi(str1 + 1), val;
+ int idx = atoi(str1 + 1), val;
- if (index < 0 || index > NSTIPPLES) {
- error("bad stipple number %1 at line %2", index, linenum);
+ if (idx < 0 || idx > NSTIPPLES) {
+ error("bad stipple number %1 at line %2", idx, linenum);
break;
}
if (!defstipple_index)
defstipple_index = other_stipple_index;
val = atoi(str2);
if (val >= 0 && val < 256)
- stipple_index[index] = val;
+ stipple_index[idx] = val;
else
error("bad stipple index value at line %1", linenum);
break;
diff --git a/contrib/groff/src/preproc/html/Makefile.sub b/contrib/groff/src/preproc/html/Makefile.sub
index 6a9a757..0763537 100644
--- a/contrib/groff/src/preproc/html/Makefile.sub
+++ b/contrib/groff/src/preproc/html/Makefile.sub
@@ -2,5 +2,6 @@ PROG=pre-grohtml$(EXEEXT)
# MAN1=pre-grohtml.n
MAN1=
XLIBS=$(LIBGROFF)
+MLIB=$(LIBM)
OBJS=pre-html.$(OBJEXT) pushback.$(OBJEXT)
CCSRCS=$(srcdir)/pre-html.cpp $(srcdir)/pushback.cpp
diff --git a/contrib/groff/src/preproc/html/pre-html.cpp b/contrib/groff/src/preproc/html/pre-html.cpp
index 8869136..6f8a46a 100644
--- a/contrib/groff/src/preproc/html/pre-html.cpp
+++ b/contrib/groff/src/preproc/html/pre-html.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk).
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define PREHTMLC
@@ -34,39 +34,124 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "searchpath.h"
#include "paper.h"
+#include "device.h"
#include "font.h"
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
#endif
#ifdef _POSIX_VERSION
-#include <sys/wait.h>
-#define PID_T pid_t
+# include <sys/wait.h>
+# define PID_T pid_t
#else /* not _POSIX_VERSION */
-#define PID_T int
+# define PID_T int
#endif /* not _POSIX_VERSION */
#include <stdarg.h>
#include "nonposix.h"
+/* Establish some definitions to facilitate discrimination between
+ differing runtime environments. */
+
+#undef MAY_FORK_CHILD_PROCESS
+#undef MAY_SPAWN_ASYNCHRONOUS_CHILD
+
+#if defined(__MSDOS__) || defined(_WIN32)
+
+// Most MS-DOS and Win32 environments will be missing the `fork' capability
+// (some like Cygwin have it, but it is best avoided).
+
+# define MAY_FORK_CHILD_PROCESS 0
+
+// On these systems, we use `spawn...', instead of `fork' ... `exec...'.
+# include <process.h> // for `spawn...'
+# include <fcntl.h> // for attributes of pipes
+
+# if defined(__CYGWIN__) || defined(_UWIN) || defined(_WIN32)
+
+// These Win32 implementations allow parent and `spawn...'ed child to
+// multitask asynchronously.
+
+# define MAY_SPAWN_ASYNCHRONOUS_CHILD 1
+
+# else
+
+// Others may adopt MS-DOS behaviour where parent must sleep,
+// from `spawn...' until child terminates.
+
+# define MAY_SPAWN_ASYNCHRONOUS_CHILD 0
+
+# endif /* not defined __CYGWIN__, _UWIN, or _WIN32 */
+
+# if defined(DEBUGGING) && !defined(DEBUG_FILE_DIR)
+/* When we are building a DEBUGGING version we need to tell pre-grohtml
+ where to put intermediate files (the DEBUGGING version will preserve
+ these on exit).
+
+ On a UNIX host, we might simply use `/tmp', but MS-DOS and Win32 will
+ probably not have this on all disk drives, so default to using
+ `c:/temp' instead. (Note that user may choose to override this by
+ supplying a definition such as
+
+ -DDEBUG_FILE_DIR=d:/path/to/debug/files
+
+ in the CPPFLAGS to `make'.) */
+
+# define DEBUG_FILE_DIR c:/temp
+# endif
+
+#else /* not __MSDOS__ or _WIN32 */
+
+// For non-Microsoft environments assume UNIX conventions,
+// so `fork' is required and child processes are asynchronous.
+# define MAY_FORK_CHILD_PROCESS 1
+# define MAY_SPAWN_ASYNCHRONOUS_CHILD 1
+
+# if defined(DEBUGGING) && !defined(DEBUG_FILE_DIR)
+/* For a DEBUGGING version, on the UNIX host, we can also usually rely
+ on being able to use `/tmp' for temporary file storage. (Note that,
+ as in the __MSDOS__ or _WIN32 case above, the user may override this
+ by defining
+
+ -DDEBUG_FILE_DIR=/path/to/debug/files
+
+ in the CPPFLAGS.) */
+
+# define DEBUG_FILE_DIR /tmp
+# endif
+
+#endif /* not __MSDOS__ or _WIN32 */
+
+#ifdef DEBUGGING
+// For a DEBUGGING version, we need some additional macros,
+// to direct the captured debug mode output to appropriately named files
+// in the specified DEBUG_FILE_DIR.
+
+# define DEBUG_TEXT(text) #text
+# define DEBUG_NAME(text) DEBUG_TEXT(text)
+# define DEBUG_FILE(name) DEBUG_NAME(DEBUG_FILE_DIR) "/" name
+#endif
+
extern "C" const char *Version_string;
#include "pre-html.h"
#include "pushback.h"
#include "html-strings.h"
-#define DEFAULT_LINE_LENGTH 7 // inches wide
-#define DEFAULT_IMAGE_RES 100 // number of pixels per inch resolution
-#define IMAGE_BOARDER_PIXELS 0
-#define INLINE_LEADER_CHAR '\\'
+#define DEFAULT_LINE_LENGTH 7 // inches wide
+#define DEFAULT_IMAGE_RES 100 // number of pixels per inch resolution
+#define IMAGE_BOARDER_PIXELS 0
+#define INLINE_LEADER_CHAR '\\'
-#define TRANSPARENT "-background white -transparent white"
-#define MIN_ALPHA_BITS 0
-#define MAX_ALPHA_BITS 4
+// Don't use colour names here! Otherwise there is a dependency on
+// a file called `rgb.txt' which maps names to colours.
+#define TRANSPARENT "-background rgb:f/f/f -transparent rgb:f/f/f"
+#define MIN_ALPHA_BITS 0
+#define MAX_ALPHA_BITS 4
#define PAGE_TEMPLATE_SHORT "pg"
#define PAGE_TEMPLATE_LONG "-page-"
@@ -76,78 +161,87 @@ extern "C" const char *Version_string;
#define REGION_TEMPLATE_LONG "-regions-"
#if 0
-# define DEBUGGING
+# define DEBUGGING
#endif
#if !defined(TRUE)
-# define TRUE (1==1)
+# define TRUE (1==1)
#endif
#if !defined(FALSE)
-# define FALSE (1==0)
+# define FALSE (1==0)
#endif
-typedef enum {CENTERED, LEFT, RIGHT, INLINE} IMAGE_ALIGNMENT;
-
-static int postscriptRes =-1; // postscript resolution, dots per inch
-static int stdoutfd = 1; // output file descriptor - normally 1 but might move
- // -1 means closed
-static int copyofstdoutfd =-1; // a copy of stdout, so we can restore stdout when
- // writing to post-html
-static char *psFileName = NULL; // name of postscript file
-static char *psPageName = NULL; // name of file containing postscript current page
-static char *regionFileName = NULL; // name of file containing all image regions
-static char *imagePageName = NULL; // name of bitmap image containing current page
+typedef enum {
+ CENTERED, LEFT, RIGHT, INLINE
+} IMAGE_ALIGNMENT;
+
+static int postscriptRes = -1; // postscript resolution,
+ // dots per inch
+static int stdoutfd = 1; // output file descriptor -
+ // normally 1 but might move
+ // -1 means closed
+static char *psFileName = NULL; // name of postscript file
+static char *psPageName = NULL; // name of file containing
+ // postscript current page
+static char *regionFileName = NULL; // name of file containing all
+ // image regions
+static char *imagePageName = NULL; // name of bitmap image containing
+ // current page
static const char *image_device = "pnmraw";
-static int image_res = DEFAULT_IMAGE_RES;
-static int vertical_offset = 0;
-static char *image_template = NULL; // image template filename
-static char *macroset_template= NULL; // image template passed to troff by -D
-static int troff_arg = 0; // troff arg index
-static char *image_dir = NULL; // user specified image directory
-static int textAlphaBits = MAX_ALPHA_BITS;
-static int graphicAlphaBits = MAX_ALPHA_BITS;
-static char *antiAlias = NULL; // antialias arguments we pass to gs.
-static int show_progress = FALSE; // should we display page numbers as they are processed?
-static int currentPageNo = -1; // current image page number
+static int image_res = DEFAULT_IMAGE_RES;
+static int vertical_offset = 0;
+static char *image_template = NULL; // image template filename
+static char *macroset_template= NULL; // image template passed to troff
+ // by -D
+static int troff_arg = 0; // troff arg index
+static char *image_dir = NULL; // user specified image directory
+static int textAlphaBits = MAX_ALPHA_BITS;
+static int graphicAlphaBits = MAX_ALPHA_BITS;
+static char *antiAlias = NULL; // antialias arguments we pass to gs
+static int show_progress = FALSE; // should we display page numbers as
+ // they are processed?
+static int currentPageNo = -1; // current image page number
#if defined(DEBUGGING)
-static int debug = FALSE;
-static char *troffFileName = NULL; // output of pre-html output which is sent to troff -Tps
-static char *htmlFileName = NULL; // output of pre-html output which is sent to troff -Thtml
+static int debug = FALSE;
+static char *troffFileName = NULL; // output of pre-html output which
+ // is sent to troff -Tps
+static char *htmlFileName = NULL; // output of pre-html output which
+ // is sent to troff -Thtml
#endif
-static char *linebuf = NULL; // for scanning devps/DESC
+static char *linebuf = NULL; // for scanning devps/DESC
static int linebufsize = 0;
+static const char *image_gen = NULL; // the `gs' program
const char *const FONT_ENV_VAR = "GROFF_FONT_PATH";
static search_path font_path(FONT_ENV_VAR, FONTPATH, 0, 0);
/*
- * Images are generated via postscript, gs and the pnm utilities.
+ * Images are generated via postscript, gs, and the pnm utilities.
*/
+#define IMAGE_DEVICE "-Tps"
-#define IMAGE_DEVICE "-Tps"
-/*
- * prototypes
- */
static int do_file(const char *filename);
+
/*
- * sys_fatal - writes a fatal error message.
- * Taken from src/roff/groff/pipeline.c.
+ * sys_fatal - Write a fatal error message.
+ * Taken from src/roff/groff/pipeline.c.
*/
-void sys_fatal (const char *s)
+void sys_fatal(const char *s)
{
fatal("%1: %2", s, strerror(errno));
}
/*
- * get_line - copies a line (w/o newline) from a file to the global line buffer
+ * get_line - Copy a line (w/o newline) from a file to the
+ * global line buffer.
*/
-int get_line (FILE *f)
+int get_line(FILE *f)
{
if (f == 0)
return 0;
@@ -188,10 +282,10 @@ int get_line (FILE *f)
}
/*
- * get_resolution - returns the postscript resolution from devps/DESC
+ * get_resolution - Return the postscript resolution from devps/DESC.
*/
-static unsigned int get_resolution (void)
+static unsigned int get_resolution(void)
{
char *pathp;
FILE *f;
@@ -212,7 +306,7 @@ static unsigned int get_resolution (void)
}
/*
- * html_system - a wrapper for system()
+ * html_system - A wrapper for system().
*/
void html_system(const char *s, int redirect_stdout)
@@ -242,29 +336,28 @@ void html_system(const char *s, int redirect_stdout)
}
/*
- * make_message - taken from man printf(3), creates a string via malloc
- * and places the result of the va args into string.
- * Finally the new string is returned.
+ * make_message - Create a string via malloc and place the result of the
+ * va args into string. Finally the new string is returned.
+ * Taken from man page of printf(3).
*/
-char *
-make_message (const char *fmt, ...)
+char *make_message(const char *fmt, ...)
{
/* Guess we need no more than 100 bytes. */
int n, size = 100;
char *p;
char *np;
va_list ap;
- if ((p = (char *)malloc (size)) == NULL)
+ if ((p = (char *)malloc(size)) == NULL)
return NULL;
while (1) {
/* Try to print in the allocated space. */
va_start(ap, fmt);
- n = vsnprintf (p, size, fmt, ap);
+ n = vsnprintf(p, size, fmt, ap);
va_end(ap);
/* If that worked, return the string. */
- if (n > -1 && n < size) {
- if (size > n+1) {
+ if (n > -1 && n < size - 1) { /* glibc 2.1 and pre-ANSI C 99 */
+ if (size > n + 1) {
np = strsave(p);
free(p);
return np;
@@ -272,15 +365,13 @@ make_message (const char *fmt, ...)
return p;
}
/* Else try again with more space. */
- if (n > -1) /* glibc 2.1 */
- size = n+1; /* precisely what is needed */
- else /* glibc 2.0 */
- size *= 2; /* twice the old size */
- if ((np = (char *)realloc (p, size)) == NULL) {
- free(p); /* realloc failed, free old, p. */
+ else /* glibc 2.0 */
+ size *= 2; /* twice the old size */
+ if ((np = (char *)realloc(p, size)) == NULL) {
+ free(p); /* realloc failed, free old, p. */
return NULL;
}
- p = np; /* use realloc'ed, p */
+ p = np; /* use realloc'ed, p */
}
}
@@ -290,15 +381,15 @@ make_message (const char *fmt, ...)
struct char_block {
enum { SIZE = 256 };
- char buffer[SIZE];
- int used;
- char_block *next;
+ char buffer[SIZE];
+ int used;
+ char_block *next;
char_block();
};
/*
- * char_block - constructor, sets the, used, and, next, fields to zero.
+ * char_block - Constructor. Set the, used, and, next, fields to zero.
*/
char_block::char_block()
@@ -312,22 +403,22 @@ class char_buffer {
public:
char_buffer();
~char_buffer();
- int read_file(FILE *fp);
- int do_html(int argc, char *argv[]);
- int do_image(int argc, char *argv[]);
- void write_file_html(void);
- void write_file_troff(void);
- void write_upto_newline (char_block **t, int *i, int is_html);
- int can_see(char_block **t, int *i, const char *string);
- int skip_spaces(char_block **t, int *i);
+ int read_file(FILE *fp);
+ int do_html(int argc, char *argv[]);
+ int do_image(int argc, char *argv[]);
+ void emit_troff_output(int device_format_selector);
+ void write_upto_newline(char_block **t, int *i, int is_html);
+ int can_see(char_block **t, int *i, const char *string);
+ int skip_spaces(char_block **t, int *i);
void skip_until_newline(char_block **t, int *i);
private:
char_block *head;
char_block *tail;
+ int run_output_filter(int device_format_selector, int argc, char *argv[]);
};
/*
- * char_buffer - constructor
+ * char_buffer - Constructor.
*/
char_buffer::char_buffer()
@@ -336,7 +427,7 @@ char_buffer::char_buffer()
}
/*
- * char_buffer - deconstructor, throws aways the whole buffer list.
+ * char_buffer - Destructor. Throw away the whole buffer list.
*/
char_buffer::~char_buffer()
@@ -349,70 +440,69 @@ char_buffer::~char_buffer()
}
/*
- * read_file - read in a complete file, fp, placing the contents inside char_blocks.
+ * read_file - Read in a complete file, fp, placing the contents inside
+ * char_blocks.
*/
-int char_buffer::read_file (FILE *fp)
+int char_buffer::read_file(FILE *fp)
{
int n;
-
- while (! feof(fp)) {
+ while (!feof(fp)) {
if (tail == NULL) {
tail = new char_block;
head = tail;
- } else {
+ }
+ else {
if (tail->used == char_block::SIZE) {
tail->next = new char_block;
- tail = tail->next;
+ tail = tail->next;
}
}
- // at this point we have a tail which is ready for the next SIZE bytes of the file
-
+ // at this point we have a tail which is ready for the next SIZE
+ // bytes of the file
n = fread(tail->buffer, sizeof(char), char_block::SIZE-tail->used, fp);
- if (n <= 0) {
+ if (n <= 0)
// error
- return( 0 );
- } else {
- tail->used += n*sizeof(char);
- }
+ return 0;
+ else
+ tail->used += n * sizeof(char);
}
- return( 1 );
+ return 1;
}
/*
- * writeNbytes - writes n bytes to stdout.
+ * writeNbytes - Write n bytes to stdout.
*/
-static void writeNbytes (const char *s, int l)
+static void writeNbytes(const char *s, int l)
{
- int n=0;
+ int n = 0;
int r;
- while (n<l) {
- r = write(stdoutfd, s, l-n);
- if (r<0) {
+ while (n < l) {
+ r = write(stdoutfd, s, l - n);
+ if (r < 0)
sys_fatal("write");
- }
n += r;
s += r;
}
}
/*
- * writeString - writes a string to stdout.
+ * writeString - Write a string to stdout.
*/
-static void writeString (const char *s)
+static void writeString(const char *s)
{
writeNbytes(s, strlen(s));
}
/*
- * makeFileName - creates the image filename template
+ * makeFileName - Create the image filename template
* and the macroset image template.
*/
-static void makeFileName (void)
+static void makeFileName(void)
{
if ((image_dir != NULL) && (strchr(image_dir, '%') != NULL)) {
error("cannot use a `%%' within the image directory name");
@@ -424,23 +514,26 @@ static void makeFileName (void)
exit(1);
}
- if (image_dir == NULL) {
- image_dir = "";
- } else if ((strlen(image_dir)>0) && (image_dir[strlen(image_dir)-1] != '/')) {
+ if (image_dir == NULL)
+ image_dir = (char *)"";
+ else if (strlen(image_dir) > 0
+ && image_dir[strlen(image_dir) - 1] != '/') {
image_dir = make_message("%s/", image_dir);
if (image_dir == NULL)
sys_fatal("make_message");
}
-
+
if (image_template == NULL)
- macroset_template = make_message("%sgrohtml-%d", image_dir, (int)getpid());
+ macroset_template = make_message("%sgrohtml-%d", image_dir,
+ (int)getpid());
else
macroset_template = make_message("%s%s", image_dir, image_template);
if (macroset_template == NULL)
sys_fatal("make_message");
- image_template = (char *)malloc(strlen("-%d")+strlen(macroset_template)+1);
+ image_template =
+ (char *)malloc(strlen("-%d") + strlen(macroset_template) + 1);
if (image_template == NULL)
sys_fatal("malloc");
strcpy(image_template, macroset_template);
@@ -448,10 +541,10 @@ static void makeFileName (void)
}
/*
- * setupAntiAlias - sets up the antialias string, used when we call gs.
+ * setupAntiAlias - Set up the antialias string, used when we call gs.
*/
-static void setupAntiAlias (void)
+static void setupAntiAlias(void)
{
if (textAlphaBits == 0 && graphicAlphaBits == 0)
antiAlias = make_message(" ");
@@ -465,23 +558,24 @@ static void setupAntiAlias (void)
}
/*
- * checkImageDir - checks to see whether the image directory is available.
+ * checkImageDir - Check whether the image directory is available.
*/
-static void checkImageDir (void)
+static void checkImageDir(void)
{
- if ((image_dir != NULL) && (strcmp(image_dir, "") != 0))
- if (! ((mkdir(image_dir, 0777) == 0) || (errno == EEXIST))) {
+ if (image_dir != NULL && strcmp(image_dir, "") != 0)
+ if (!(mkdir(image_dir, 0777) == 0 || errno == EEXIST)) {
error("cannot create directory `%1'", image_dir);
exit(1);
}
}
/*
- * write_end_image - ends the image. It writes out the image extents if we are using -Tps.
+ * write_end_image - End the image. Write out the image extents if we
+ * are using -Tps.
*/
-static void write_end_image (int is_html)
+static void write_end_image(int is_html)
{
/*
* if we are producing html then these
@@ -499,18 +593,17 @@ static void write_end_image (int is_html)
}
/*
- * write_start_image - writes the troff which will:
+ * write_start_image - Write troff code which will:
*
* (i) disable html output for the following image
* (ii) reset the max/min x/y registers during postscript
* rendering.
*/
-static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
+static void write_start_image(IMAGE_ALIGNMENT pos, int is_html)
{
writeString("\\O[5");
switch (pos) {
-
case INLINE:
writeString("i");
break;
@@ -525,7 +618,8 @@ static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
writeString("c");
break;
}
- writeString(image_template); writeString(".png]");
+ writeString(image_template);
+ writeString(".png]");
if (is_html)
writeString("\\O[0]\\O[3]");
else
@@ -534,24 +628,25 @@ static void write_start_image (IMAGE_ALIGNMENT pos, int is_html)
}
/*
- * write_upto_newline - writes the contents of the buffer until a newline is seen.
- * It checks for HTML_IMAGE_INLINE_BEGIN and HTML_IMAGE_INLINE_END
- * and if they are present it processes them.
+ * write_upto_newline - Write the contents of the buffer until a newline
+ * is seen. Check for HTML_IMAGE_INLINE_BEGIN and
+ * HTML_IMAGE_INLINE_END; process them if they are
+ * present.
*/
-void char_buffer::write_upto_newline (char_block **t, int *i, int is_html)
+void char_buffer::write_upto_newline(char_block **t, int *i, int is_html)
{
- int j=*i;
+ int j = *i;
if (*t) {
- while ((j < (*t)->used) && ((*t)->buffer[j] != '\n') &&
- ((*t)->buffer[j] != INLINE_LEADER_CHAR)) {
+ while (j < (*t)->used
+ && (*t)->buffer[j] != '\n'
+ && (*t)->buffer[j] != INLINE_LEADER_CHAR)
j++;
- }
- if ((j < (*t)->used) && ((*t)->buffer[j] == '\n')) {
+ if (j < (*t)->used
+ && (*t)->buffer[j] == '\n')
j++;
- }
- writeNbytes((*t)->buffer+(*i), j-(*i));
+ writeNbytes((*t)->buffer + (*i), j - (*i));
if ((*t)->buffer[j] == INLINE_LEADER_CHAR) {
if (can_see(t, &j, HTML_IMAGE_INLINE_BEGIN))
write_start_image(INLINE, is_html);
@@ -561,208 +656,225 @@ void char_buffer::write_upto_newline (char_block **t, int *i, int is_html)
if (j < (*t)->used) {
*i = j;
j++;
- writeNbytes((*t)->buffer+(*i), j-(*i));
+ writeNbytes((*t)->buffer + (*i), j - (*i));
}
}
}
if (j == (*t)->used) {
*i = 0;
- if ((*t)->buffer[j-1] == '\n') {
- *t = (*t)->next;
- } else {
- *t = (*t)->next;
+ *t = (*t)->next;
+ if (*t && (*t)->buffer[j - 1] != '\n')
write_upto_newline(t, i, is_html);
- }
- } else {
+ }
+ else
// newline was seen
*i = j;
- }
}
}
/*
- * can_see - returns TRUE if we can see string in t->buffer[i] onwards
+ * can_see - Return TRUE if we can see string in t->buffer[i] onwards.
*/
-int char_buffer::can_see (char_block **t, int *i, const char *string)
+int char_buffer::can_see(char_block **t, int *i, const char *str)
{
- int j = 0;
- int l = strlen(string);
- int k = *i;
+ int j = 0;
+ int l = strlen(str);
+ int k = *i;
char_block *s = *t;
while (s) {
- while ((k<s->used) && (j<l) && (s->buffer[k] == string[j])) {
+ while (k < s->used && j < l && s->buffer[k] == str[j]) {
j++;
k++;
}
if (j == l) {
*i = k;
*t = s;
- return( TRUE );
- } else if ((k<s->used) && (s->buffer[k] != string[j])) {
- return( FALSE );
+ return TRUE;
}
+ else if (k < s->used && s->buffer[k] != str[j])
+ return( FALSE );
s = s->next;
k = 0;
}
- return( FALSE );
+ return FALSE;
}
/*
- * skip_spaces - returns TRUE if we have not run out of data.
- * It also consumes spaces.
+ * skip_spaces - Return TRUE if we have not run out of data.
+ * Consume spaces also.
*/
int char_buffer::skip_spaces(char_block **t, int *i)
{
char_block *s = *t;
- int k = *i;
+ int k = *i;
while (s) {
- while ((k<s->used) && (isspace(s->buffer[k]))) {
+ while (k < s->used && isspace(s->buffer[k]))
k++;
- }
if (k == s->used) {
k = 0;
s = s->next;
- } else {
+ }
+ else {
*i = k;
- return( TRUE );
+ return TRUE;
}
}
- return( FALSE );
+ return FALSE;
}
/*
- * skip_until_newline - skips all characters until a newline is seen.
+ * skip_until_newline - Skip all characters until a newline is seen.
* The newline is not consumed.
*/
-void char_buffer::skip_until_newline (char_block **t, int *i)
+void char_buffer::skip_until_newline(char_block **t, int *i)
{
- int j=*i;
+ int j = *i;
if (*t) {
- while ((j < (*t)->used) && ((*t)->buffer[j] != '\n')) {
+ while (j < (*t)->used && (*t)->buffer[j] != '\n')
j++;
- }
if (j == (*t)->used) {
*i = 0;
*t = (*t)->next;
skip_until_newline(t, i);
- } else {
+ }
+ else
// newline was seen
*i = j;
- }
}
}
+#define DEVICE_FORMAT(filter) (filter == HTML_OUTPUT_FILTER)
+#define HTML_OUTPUT_FILTER 0
+#define IMAGE_OUTPUT_FILTER 1
+#define OUTPUT_STREAM(name) creat((name), S_IWUSR | S_IRUSR)
+#define PS_OUTPUT_STREAM OUTPUT_STREAM(psFileName)
+#define REGION_OUTPUT_STREAM OUTPUT_STREAM(regionFileName)
+
/*
- * write_file_troff - writes the buffer to stdout (troff).
+ * emit_troff_output - Write formatted buffer content to the troff
+ * post-processor data pipeline.
*/
-void char_buffer::write_file_troff (void)
+void char_buffer::emit_troff_output(int device_format_selector)
{
- char_block *t=head;
- int i=0;
+ // Handle output for BOTH html and image device formats
+ // if `device_format_selector' is passed as
+ //
+ // HTML_FORMAT(HTML_OUTPUT_FILTER)
+ // Buffer data is written to the output stream
+ // with template image names translated to actual image names.
+ //
+ // HTML_FORMAT(IMAGE_OUTPUT_FILTER)
+ // Buffer data is written to the output stream
+ // with no translation, for image file creation in the post-processor.
+
+ int idx = 0;
+ char_block *element = head;
+
+ while (element != NULL)
+ write_upto_newline(&element, &idx, device_format_selector);
- if (t != NULL) {
- do {
- write_upto_newline(&t, &i, FALSE);
- } while (t != NULL);
- }
+#if 0
if (close(stdoutfd) < 0)
- sys_fatal("close");
+ sys_fatal ("close");
// now we grab fd=1 so that the next pipe cannot use fd=1
if (stdoutfd == 1) {
- if (dup(2) != stdoutfd) {
- sys_fatal("dup failed to use fd=1");
- }
+ if (dup(2) != stdoutfd)
+ sys_fatal ("dup failed to use fd=1");
}
+#endif /* 0 */
}
/*
- * the image class remembers the position of all images in the postscript file
- * and assigns names for each image.
+ * The image class remembers the position of all images in the
+ * postscript file and assigns names for each image.
*/
struct imageItem {
- imageItem *next;
- int X1;
- int Y1;
- int X2;
- int Y2;
- char *imageName;
- int resolution;
- int maxx;
- int pageNo;
-
- imageItem (int x1, int y1, int x2, int y2, int page, int res, int max_width, char *name);
- ~imageItem ();
+ imageItem *next;
+ int X1;
+ int Y1;
+ int X2;
+ int Y2;
+ char *imageName;
+ int resolution;
+ int maxx;
+ int pageNo;
+
+ imageItem(int x1, int y1, int x2, int y2,
+ int page, int res, int max_width, char *name);
+ ~imageItem();
};
/*
- * imageItem - constructor
+ * imageItem - Constructor.
*/
-imageItem::imageItem (int x1, int y1, int x2, int y2, int page, int res, int max_width, char *name)
+imageItem::imageItem(int x1, int y1, int x2, int y2,
+ int page, int res, int max_width, char *name)
{
- X1 = x1;
- Y1 = y1;
- X2 = x2;
- Y2 = y2;
- pageNo = page;
+ X1 = x1;
+ Y1 = y1;
+ X2 = x2;
+ Y2 = y2;
+ pageNo = page;
resolution = res;
- maxx = max_width;
- imageName = name;
- next = NULL;
+ maxx = max_width;
+ imageName = name;
+ next = NULL;
}
/*
- * imageItem - deconstructor
+ * imageItem - Destructor.
*/
-imageItem::~imageItem ()
+imageItem::~imageItem()
{
if (imageName)
free(imageName);
}
/*
- * imageList - class containing a list of imageItems.
+ * imageList - A class containing a list of imageItems.
*/
class imageList {
private:
imageItem *head;
imageItem *tail;
- int count;
+ int count;
public:
imageList();
~imageList();
- void add(int x1, int y1, int x2, int y2, int page, int res, int maxx, char *name);
- void createImages (void);
- int createPage (int pageno);
- void createImage (imageItem *i);
- int getMaxX (int pageno);
+ void add(int x1, int y1, int x2, int y2,
+ int page, int res, int maxx, char *name);
+ void createImages(void);
+ int createPage(int pageno);
+ void createImage(imageItem *i);
+ int getMaxX(int pageno);
};
/*
- * imageList - constructor.
+ * imageList - Constructor.
*/
-imageList::imageList ()
- : head(0), tail(0), count(0)
+imageList::imageList()
+: head(0), tail(0), count(0)
{
}
/*
- * imageList - deconstructor.
+ * imageList - Destructor.
*/
-imageList::~imageList ()
+imageList::~imageList()
{
while (head != NULL) {
imageItem *i = head;
@@ -772,10 +884,10 @@ imageList::~imageList ()
}
/*
- * createPage - creates one image of, page pageno, from the postscript file.
+ * createPage - Create one image of, page pageno, from the postscript file.
*/
-int imageList::createPage (int pageno)
+int imageList::createPage(int pageno)
{
char *s;
@@ -784,8 +896,9 @@ int imageList::createPage (int pageno)
if (currentPageNo >= 1) {
/*
- * we need to unlink the files which change each time a new page is processed.
- * The final unlink is done by xtmpfile when pre-grohtml exits.
+ * We need to unlink the files which change each time a new page is
+ * processed. The final unlink is done by xtmpfile when pre-grohtml
+ * exits.
*/
unlink(imagePageName);
unlink(psPageName);
@@ -813,13 +926,14 @@ int imageList::createPage (int pageno)
}
#endif
html_system(s, 1);
-
+
s = make_message("echo showpage | "
- "gs%s -q -dBATCH -dSAFER "
+ "%s%s -q -dBATCH -dSAFER "
"-dDEVICEHEIGHTPOINTS=792 "
"-dDEVICEWIDTHPOINTS=%d -dFIXEDMEDIA=true "
"-sDEVICE=%s -r%d %s "
"-sOutputFile=%s %s -\n",
+ image_gen,
EXE_EXT,
(getMaxX(pageno) * image_res) / postscriptRes,
image_device,
@@ -842,39 +956,38 @@ int imageList::createPage (int pageno)
}
/*
- * min - returns the minimum of two numbers.
+ * min - Return the minimum of two numbers.
*/
-int min (int x, int y)
+int min(int x, int y)
{
- if (x < y) {
- return( x );
- } else {
- return( y );
- }
+ if (x < y)
+ return x;
+ else
+ return y;
}
/*
- * max - returns the maximum of two numbers.
+ * max - Return the maximum of two numbers.
*/
-int max (int x, int y)
+int max(int x, int y)
{
- if (x > y) {
- return( x );
- } else {
- return( y );
- }
+ if (x > y)
+ return x;
+ else
+ return y;
}
/*
- * getMaxX - returns the largest right hand position for any image on, pageno
+ * getMaxX - Return the largest right-hand position for any image
+ * on, pageno.
*/
-int imageList::getMaxX (int pageno)
+int imageList::getMaxX(int pageno)
{
imageItem *h = head;
- int x = postscriptRes * DEFAULT_LINE_LENGTH;
+ int x = postscriptRes * DEFAULT_LINE_LENGTH;
while (h != NULL) {
if (h->pageNo == pageno)
@@ -885,21 +998,30 @@ int imageList::getMaxX (int pageno)
}
/*
- * createImage - generates a minimal png file from the set of page images.
+ * createImage - Generate a minimal png file from the set of page images.
*/
-void imageList::createImage (imageItem *i)
+void imageList::createImage(imageItem *i)
{
if (i->X1 != -1) {
char *s;
- int x1 = max(min(i->X1, i->X2)*image_res/postscriptRes-1*IMAGE_BOARDER_PIXELS, 0);
- int y1 = max((image_res*vertical_offset/72)+min(i->Y1, i->Y2)*image_res/postscriptRes-IMAGE_BOARDER_PIXELS, 0);
- int x2 = max(i->X1, i->X2)*image_res/postscriptRes+1*IMAGE_BOARDER_PIXELS;
- int y2 = (image_res*vertical_offset/72)+(max(i->Y1, i->Y2)*image_res/postscriptRes)+1+IMAGE_BOARDER_PIXELS;
+ int x1 = max(min(i->X1, i->X2) * image_res / postscriptRes
+ - IMAGE_BOARDER_PIXELS,
+ 0);
+ int y1 = max(image_res * vertical_offset / 72
+ + min(i->Y1, i->Y2) * image_res / postscriptRes
+ - IMAGE_BOARDER_PIXELS,
+ 0);
+ int x2 = max(i->X1, i->X2) * image_res / postscriptRes
+ + IMAGE_BOARDER_PIXELS;
+ int y2 = image_res * vertical_offset / 72
+ + max(i->Y1, i->Y2) * image_res / postscriptRes
+ + 1 + IMAGE_BOARDER_PIXELS;
if (createPage(i->pageNo) == 0) {
- s = make_message("pnmcut%s %d %d %d %d < %s | pnmcrop -quiet | pnmtopng%s %s > %s \n",
+ s = make_message("pnmcut%s %d %d %d %d < %s "
+ "| pnmcrop -quiet | pnmtopng%s %s > %s\n",
EXE_EXT,
- x1, y1, x2-x1+1, y2-y1+1,
+ x1, y1, x2 - x1 + 1, y2 - y1 + 1,
imagePageName,
EXE_EXT,
TRANSPARENT,
@@ -915,12 +1037,14 @@ void imageList::createImage (imageItem *i)
#endif
html_system(s, 0);
free(s);
- } else {
+ }
+ else {
fprintf(stderr, "failed to generate image of page %d\n", i->pageNo);
fflush(stderr);
}
#if defined(DEBUGGING)
- } else {
+ }
+ else {
if (debug) {
fprintf(stderr, "ignoring image as x1 coord is -1\n");
fflush(stderr);
@@ -930,27 +1054,30 @@ void imageList::createImage (imageItem *i)
}
/*
- * add - an image description to the imageList.
+ * add - Add an image description to the imageList.
*/
-void imageList::add (int x1, int y1, int x2, int y2, int page, int res, int maxx, char *name)
+void imageList::add(int x1, int y1, int x2, int y2,
+ int page, int res, int maxx, char *name)
{
imageItem *i = new imageItem(x1, y1, x2, y2, page, res, maxx, name);
if (head == NULL) {
head = i;
tail = i;
- } else {
+ }
+ else {
tail->next = i;
tail = i;
}
}
/*
- * createImages - foreach image descriptor on the imageList, create the actual image.
+ * createImages - For each image descriptor on the imageList,
+ * create the actual image.
*/
-void imageList::createImages (void)
+void imageList::createImages(void)
{
imageItem *h = head;
@@ -960,72 +1087,42 @@ void imageList::createImages (void)
}
}
-static imageList listOfImages; // list of images defined by the region file.
-
-/*
- * write_file_html - writes the buffer to stdout (troff).
- * It writes out the file replacing template image names with
- * actual image names.
- */
-
-void char_buffer::write_file_html (void)
-{
- char_block *t=head;
- int i=0;
-
- if (t != NULL) {
- do {
- write_upto_newline(&t, &i, TRUE);
- } while (t != NULL);
- }
- if (close(stdoutfd) < 0)
- sys_fatal("close");
-
- // now we grab fd=1 so that the next pipe cannot use fd=1
- if (stdoutfd == 1) {
- if (dup(2) != stdoutfd) {
- sys_fatal("dup failed to use fd=1");
- }
- }
-}
+static imageList listOfImages; // List of images defined by the region file.
/*
- * generateImages - parses the region file and generates images
- * from the postscript file. The region file
- * contains the x1,y1 x2,y2 extents of each
+ * generateImages - Parse the region file and generate images
+ * from the postscript file. The region file
+ * contains the x1,y1--x2,y2 extents of each
* image.
*/
-static void generateImages (char *regionFileName)
+static void generateImages(char *region_file_name)
{
- pushBackBuffer *f=new pushBackBuffer(regionFileName);
+ pushBackBuffer *f=new pushBackBuffer(region_file_name);
while (f->putPB(f->getPB()) != eof) {
if (f->isString("grohtml-info:page")) {
- int page = f->readInt();
- int x1 = f->readInt();
- int y1 = f->readInt();
- int x2 = f->readInt();
- int y2 = f->readInt();
- int maxx = f->readInt();
+ int page = f->readInt();
+ int x1 = f->readInt();
+ int y1 = f->readInt();
+ int x2 = f->readInt();
+ int y2 = f->readInt();
+ int maxx = f->readInt();
char *name = f->readString();
- int res = postscriptRes;
+ int res = postscriptRes;
listOfImages.add(x1, y1, x2, y2, page, res, maxx, name);
- while ((f->putPB(f->getPB()) != '\n') &&
- (f->putPB(f->getPB()) != eof)) {
+ while (f->putPB(f->getPB()) != '\n'
+ && f->putPB(f->getPB()) != eof)
(void)f->getPB();
- }
- if (f->putPB(f->getPB()) == '\n') {
+ if (f->putPB(f->getPB()) == '\n')
(void)f->getPB();
- }
- } else {
- /*
- * write any error messages out to the user
- */
+ }
+ else {
+ /* Write any error messages out to the user. */
fputc(f->getPB(), stderr);
}
}
-
+
listOfImages.createImages();
if (show_progress) {
fprintf(stderr, "done\n");
@@ -1035,84 +1132,97 @@ static void generateImages (char *regionFileName)
}
/*
- * replaceFd - replace a file descriptor, was, with, willbe.
+ * set_redirection - Set up I/O Redirection for handle, was, to refer to
+ * stream on handle, willbe.
*/
-static void replaceFd (int was, int willbe)
+static void set_redirection(int was, int willbe)
{
- int dupres;
-
+ // Nothing to do if `was' and `willbe' already have same handle.
if (was != willbe) {
- if (close(was)<0) {
- sys_fatal("close");
+ // Otherwise attempt the specified redirection.
+ if (dup2 (willbe, was) < 0) {
+ // Redirection failed, so issue diagnostic and bail out.
+ fprintf(stderr, "failed to replace fd=%d with %d\n", was, willbe);
+ if (willbe == STDOUT_FILENO)
+ fprintf(stderr,
+ "likely that stdout should be opened before %d\n", was);
+ sys_fatal("dup2");
}
- dupres = dup(willbe);
- if (dupres != was) {
- sys_fatal("dup");
- fprintf(stderr, "trying to replace fd=%d with %d dup used %d\n", was, willbe, dupres);
- if (willbe == 1) {
- fprintf(stderr, "likely that stdout should be opened before %d\n", was);
- }
- exit(1);
- }
- if (close(willbe) < 0) {
+
+ // When redirection has been successfully completed assume redundant
+ // handle `willbe' is no longer required, so close it.
+ if (close(willbe) < 0)
+ // Issue diagnostic if `close' fails.
sys_fatal("close");
- }
}
}
/*
- * waitForChild - waits for child, pid, to exit.
+ * save_and_redirect - Get duplicate handle for stream, was, then
+ * redirect, was, to refer to, willbe.
*/
-static void waitForChild (PID_T pid)
+static int save_and_redirect(int was, int willbe)
{
- PID_T waitpd;
- int status;
+ if (was == willbe)
+ // No redirection specified so don't do anything but silently bailing out.
+ return (was);
+
+ // Proceeding with redirection so first save and verify our duplicate
+ // handle for `was'.
+ int saved = dup(was);
+ if (saved < 0) {
+ fprintf(stderr, "unable to get duplicate handle for %d\n", was);
+ sys_fatal("dup");
+ }
- waitpd = WAIT(&status, pid, _WAIT_CHILD);
- if (waitpd != pid)
- sys_fatal("wait");
+ // Duplicate handle safely established so complete redirection.
+ set_redirection(was, willbe);
+
+ // Finally return the saved duplicate descriptor for the
+ // original `was' stream.
+ return saved;
}
/*
- * alterDeviceTo - if toImage is set then the arg list is altered to include
+ * alterDeviceTo - If, toImage, is set
+ * the argument list is altered to include
* IMAGE_DEVICE and we invoke groff rather than troff.
- * else
- * set -Thtml and groff
+ * Else
+ * set -Thtml and groff.
*/
-static void alterDeviceTo (int argc, char *argv[], int toImage)
+static void alterDeviceTo(int argc, char *argv[], int toImage)
{
- int i=0;
+ int i = 0;
if (toImage) {
while (i < argc) {
- if (strcmp(argv[i], "-Thtml") == 0) {
- argv[i] = IMAGE_DEVICE;
- }
+ if (strcmp(argv[i], "-Thtml") == 0)
+ argv[i] = (char *)IMAGE_DEVICE;
i++;
}
- argv[troff_arg] = "groff"; /* rather than troff */
- } else {
+ argv[troff_arg] = (char *)"groff"; /* rather than troff */
+ }
+ else {
while (i < argc) {
- if (strcmp(argv[i], IMAGE_DEVICE) == 0) {
- argv[i] = "-Thtml";
- }
+ if (strcmp(argv[i], IMAGE_DEVICE) == 0)
+ argv[i] = (char *)"-Thtml";
i++;
}
- argv[troff_arg] = "groff"; /* use groff -Z */
+ argv[troff_arg] = (char *)"groff"; /* use groff -Z */
}
}
/*
- * addZ - appends -Z onto the command list for groff.
+ * addZ - Append -Z onto the command list for groff.
*/
-char **addZ (int argc, char *argv[])
+char **addZ(int argc, char *argv[])
{
- char **new_argv = (char **)malloc((argc+2)*sizeof(char *));
- int i=0;
+ char **new_argv = (char **)malloc((argc + 2) * sizeof(char *));
+ int i = 0;
if (new_argv == NULL)
sys_fatal("malloc");
@@ -1121,9 +1231,9 @@ char **addZ (int argc, char *argv[])
new_argv[i] = argv[i];
i++;
}
- new_argv[i] = "-Z";
- while (i<argc) {
- new_argv[i+1] = argv[i];
+ new_argv[i] = (char *)"-Z";
+ while (i < argc) {
+ new_argv[i + 1] = argv[i];
i++;
}
argc++;
@@ -1132,18 +1242,19 @@ char **addZ (int argc, char *argv[])
}
/*
- * addRegDef - appends a defined register or string onto the command list for troff.
+ * addRegDef - Append a defined register or string onto the command
+ * list for troff.
*/
-char **addRegDef (int argc, char *argv[], const char *numReg)
+char **addRegDef(int argc, char *argv[], const char *numReg)
{
- char **new_argv = (char **)malloc((argc+2)*sizeof(char *));
- int i=0;
+ char **new_argv = (char **)malloc((argc + 2) * sizeof(char *));
+ int i = 0;
if (new_argv == NULL)
sys_fatal("malloc");
- while (i<argc) {
+ while (i < argc) {
new_argv[i] = argv[i];
i++;
}
@@ -1154,94 +1265,213 @@ char **addRegDef (int argc, char *argv[], const char *numReg)
}
/*
- * dump_args - display the argument list.
+ * dump_args - Display the argument list.
*/
-void dump_args (int argc, char *argv[])
+void dump_args(int argc, char *argv[])
{
fprintf(stderr, " %d arguments:", argc);
- for (int i=0; i<argc; i++)
+ for (int i = 0; i < argc; i++)
fprintf(stderr, " %s", argv[i]);
fprintf(stderr, "\n");
}
+int char_buffer::run_output_filter(int filter, int /* argc */, char **argv)
+{
+ int pipedes[2];
+ PID_T child_pid;
+ int status;
+
+ if (pipe(pipedes) < 0)
+ sys_fatal("pipe");
+
+#if MAY_FORK_CHILD_PROCESS
+ // This is the UNIX process model. To invoke our post-processor,
+ // we must `fork' the current process.
+
+ if ((child_pid = fork()) < 0)
+ sys_fatal("fork");
+
+ else if (child_pid == 0) {
+ // This is the child process fork. We redirect its `stdin' stream
+ // to read data emerging from our pipe. There is no point in saving,
+ // since we won't be able to restore later!
+
+ set_redirection(STDIN_FILENO, pipedes[0]);
+
+ // The parent process will be writing this data, so we should release
+ // the child's writeable handle on the pipe, since we have no use for it.
+
+ if (close(pipedes[1]) < 0)
+ sys_fatal("close");
+
+ // The IMAGE_OUTPUT_FILTER needs special output redirection...
+
+ if (filter == IMAGE_OUTPUT_FILTER) {
+ // with BOTH `stdout' AND `stderr' diverted to files.
+
+ set_redirection(STDOUT_FILENO, PS_OUTPUT_STREAM);
+ set_redirection(STDERR_FILENO, REGION_OUTPUT_STREAM);
+ }
+
+ // Now we are ready to launch the output filter.
+
+ execvp(argv[0], argv);
+
+ // If we get to here then the `exec...' request for the output filter
+ // failed. Diagnose it and bail out.
+
+ error("couldn't exec %1: %2", argv[0], strerror(errno), ((char *)0));
+ fflush(stderr); // just in case error() didn't
+ exit(1);
+ }
+
+ else {
+ // This is the parent process fork. We will be writing data to the
+ // filter pipeline, and the child will be reading it. We have no further
+ // use for our read handle on the pipe, and should close it.
+
+ if (close(pipedes[0]) < 0)
+ sys_fatal("close");
+
+ // Now we redirect the `stdout' stream to the inlet end of the pipe,
+ // and push out the appropiately formatted data to the filter.
+
+ pipedes[1] = save_and_redirect(STDOUT_FILENO, pipedes[1]);
+ emit_troff_output(DEVICE_FORMAT(filter));
+
+ // After emitting all the data we close our connection to the inlet
+ // end of the pipe so the child process will detect end of data.
+
+ set_redirection(STDOUT_FILENO, pipedes[1]);
+
+ // Finally, we must wait for the child process to complete.
+
+ if (WAIT(&status, child_pid, _WAIT_CHILD) != child_pid)
+ sys_fatal("wait");
+ }
+
+#elif MAY_SPAWN_ASYNCHRONOUS_CHILD
+
+ // We do not have `fork', (or we prefer not to use it),
+ // but asynchronous processes are allowed, passing data through pipes.
+ // This should be ok for most Win32 systems and is preferred to `fork'
+ // for starting child processes under Cygwin.
+
+ // Before we start the post-processor we bind its inherited `stdin'
+ // stream to the readable end of our pipe, saving our own `stdin' stream
+ // in `pipedes[0]'.
+
+ pipedes[0] = save_and_redirect(STDIN_FILENO, pipedes[0]);
+
+ // for the Win32 model,
+ // we need special provision for saving BOTH `stdout' and `stderr'.
+
+ int saved_stdout = dup(STDOUT_FILENO);
+ int saved_stderr = STDERR_FILENO;
+
+ // The IMAGE_OUTPUT_FILTER needs special output redirection...
+
+ if (filter == IMAGE_OUTPUT_FILTER) {
+ // with BOTH `stdout' AND `stderr' diverted to files while saving a
+ // duplicate handle for `stderr'.
+
+ set_redirection(STDOUT_FILENO, PS_OUTPUT_STREAM);
+ saved_stderr = save_and_redirect(STDERR_FILENO, REGION_OUTPUT_STREAM);
+ }
+
+ // We then use an asynchronous spawn request to start the post-processor.
+
+ if ((child_pid = spawnvp(_P_NOWAIT, argv[0], argv)) < 0) {
+ // Should the spawn request fail we issue a diagnostic and bail out.
+
+ error("cannot spawn %1: %2", argv[0], strerror(errno), ((char *)0));
+ exit(1);
+ }
+
+ // Once the post-processor has been started we revert our `stdin'
+ // to its original saved source, which also closes the readable handle
+ // for the pipe.
+
+ set_redirection(STDIN_FILENO, pipedes[0]);
+
+ // if we redirected `stderr', for use by the image post-processor,
+ // then we also need to reinstate its original assignment.
+
+ if (filter == IMAGE_OUTPUT_FILTER)
+ set_redirection(STDERR_FILENO, saved_stderr);
+
+ // Now we redirect the `stdout' stream to the inlet end of the pipe,
+ // and push out the appropiately formatted data to the filter.
+
+ set_redirection(STDOUT_FILENO, pipedes[1]);
+ emit_troff_output(DEVICE_FORMAT(filter));
+
+ // After emitting all the data we close our connection to the inlet
+ // end of the pipe so the child process will detect end of data.
+
+ set_redirection(STDOUT_FILENO, saved_stdout);
+
+ // And finally, we must wait for the child process to complete.
+
+ if (WAIT(&status, child_pid, _WAIT_CHILD) != child_pid)
+ sys_fatal("wait");
+
+#else /* can't do asynchronous pipes! */
+
+ // TODO: code to support an MS-DOS style process model
+ // should go here
+
+#endif /* MAY_FORK_CHILD_PROCESS or MAY_SPAWN_ASYNCHRONOUS_CHILD */
+
+ return 0;
+}
+
/*
- * do_html - sets the troff number htmlflip and
- * writes out the buffer to troff -Thtml
+ * do_html - Set the troff number htmlflip and
+ * write out the buffer to troff -Thtml.
*/
int char_buffer::do_html(int argc, char *argv[])
{
- int pdes[2];
- PID_T pid;
string s;
alterDeviceTo(argc, argv, 0);
- argv += troff_arg; // skip all arguments up to groff
+ argv += troff_arg; // skip all arguments up to groff
argc -= troff_arg;
argv = addZ(argc, argv);
argc++;
s = "-dwww-image-template=";
- s += macroset_template; // do not combine these statements otherwise they will not work
- s += '\0'; // the trailing '\0' is ignored
+ s += macroset_template; // do not combine these statements,
+ // otherwise they will not work
+ s += '\0'; // the trailing `\0' is ignored
argv = addRegDef(argc, argv, s.contents());
argc++;
- if (pipe(pdes) < 0)
- sys_fatal("pipe");
-
- pid = fork();
- if (pid < 0)
- sys_fatal("fork");
-
- if (pid == 0) {
- // child
- replaceFd(0, pdes[0]);
- // close end we are not using
- if (close(pdes[1])<0)
- sys_fatal("close");
- replaceFd(1, copyofstdoutfd); // and restore stdout
-
- execvp(argv[0], argv);
- error("couldn't exec %1: %2", argv[0], strerror(errno), (char *)0);
- fflush(stderr); /* just in case error() doesn't */
- exit(1);
- } else {
- // parent
-
#if defined(DEBUGGING)
- /*
- * slight security risk so only enabled if compiled with defined(DEBUGGING)
- */
- if (debug) {
- replaceFd(1, creat(htmlFileName, S_IWUSR|S_IRUSR));
- write_file_html();
- }
+# define HTML_DEBUG_STREAM OUTPUT_STREAM(htmlFileName)
+ // slight security risk so only enabled if compiled with defined(DEBUGGING)
+ if (debug) {
+ int saved_stdout = save_and_redirect(STDOUT_FILENO, HTML_DEBUG_STREAM);
+ emit_troff_output(DEVICE_FORMAT(HTML_OUTPUT_FILTER));
+ set_redirection(STDOUT_FILENO, saved_stdout);
+ }
#endif
- replaceFd(1, pdes[1]);
- // close end we are not using
- if (close(pdes[0])<0)
- sys_fatal("close");
- write_file_html();
- waitForChild(pid);
- }
- return 0;
+ return run_output_filter(HTML_OUTPUT_FILTER, argc, argv);
}
/*
- * do_image - writes out the buffer to troff -Tps
+ * do_image - Write out the buffer to troff -Tps.
*/
int char_buffer::do_image(int argc, char *argv[])
{
- PID_T pid;
- int pdes[2];
string s;
alterDeviceTo(argc, argv, 1);
- argv += troff_arg; // skip all arguments up to troff/groff
+ argv += troff_arg; // skip all arguments up to troff/groff
argc -= troff_arg;
argv = addRegDef(argc, argv, "-rps4html=1");
argc++;
@@ -1256,69 +1486,52 @@ int char_buffer::do_image(int argc, char *argv[])
argv = addRegDef(argc, argv, "-P-pletter");
argc++;
- if (pipe(pdes) < 0)
- sys_fatal("pipe");
-
- pid = fork();
- if (pid == 0) {
- // child
-
- int psFd = creat(psFileName, S_IWUSR|S_IRUSR);
- int regionFd = creat(regionFileName, S_IWUSR|S_IRUSR);
-
- replaceFd(1, psFd);
- replaceFd(0, pdes[0]);
- replaceFd(2, regionFd);
-
- // close end we are not using
- if (close(pdes[1])<0)
- sys_fatal("close");
-
- execvp(argv[0], argv);
- error("couldn't exec %1: %2", argv[0], strerror(errno), (char *)0);
- fflush(stderr); /* just in case error() doesn't */
- exit(1);
- } else {
- // parent
-
#if defined(DEBUGGING)
- /*
- * slight security risk so only enabled if compiled with defined(DEBUGGING)
- */
- if (debug) {
- replaceFd(1, creat(troffFileName, S_IWUSR|S_IRUSR));
- write_file_troff();
- }
-#endif
- replaceFd(1, pdes[1]);
- write_file_troff();
- waitForChild(pid);
+# define IMAGE_DEBUG_STREAM OUTPUT_STREAM(troffFileName)
+ // slight security risk so only enabled if compiled with defined(DEBUGGING)
+ if (debug) {
+ int saved_stdout = save_and_redirect(STDOUT_FILENO, IMAGE_DEBUG_STREAM);
+ emit_troff_output(DEVICE_FORMAT(IMAGE_OUTPUT_FILTER));
+ set_redirection(STDOUT_FILENO, saved_stdout);
}
- return 0;
+#endif
+
+ return run_output_filter(IMAGE_OUTPUT_FILTER, argc, argv);
}
static char_buffer inputFile;
-
/*
- * usage - emit usage arguments.
+ * usage - Emit usage arguments.
*/
-void usage(FILE *stream)
+static void usage(FILE *stream)
{
- fprintf(stream, "usage: %s troffname [-Iimage_name] [-Dimage_directory] [-P-o vertical_image_offset] [-P-i image_resolution] [troff flags] [files]\n", program_name);
- fprintf(stream, " vertical_image_offset (default %d/72 of an inch)\n", vertical_offset);
- fprintf(stream, " image_resolution (default %d) pixels per inch\n", image_res);
- fprintf(stream, " image_name is the name of the stem for all images (default is grohtml-<pid>)\n");
- fprintf(stream, " place all png files into image_directory\n");
+ fprintf(stream,
+ "usage: %s troffname [-Iimage_name] [-Dimage_directory]\n"
+ " [-P-o vertical_image_offset] [-P-i image_resolution]\n"
+ " [troff flags]\n",
+ program_name);
+ fprintf(stream,
+ " vertical_image_offset (default %d/72 of an inch)\n",
+ vertical_offset);
+ fprintf(stream,
+ " image_resolution (default %d) pixels per inch\n",
+ image_res);
+ fprintf(stream,
+ " image_name is the name of the stem for all images\n"
+ " (default is grohtml-<pid>)\n");
+ fprintf(stream,
+ " place all png files into image_directory\n");
}
/*
- * scanArguments - scans for all arguments including -P-i, -P-o, -P-D and -P-I. It returns
- * the argument index of the first non option.
+ * scanArguments - Scan for all arguments including -P-i, -P-o, -P-D,
+ * and -P-I. Return the argument index of the first
+ * non-option.
*/
-int scanArguments (int argc, char **argv)
+static int scanArguments(int argc, char **argv)
{
const char *command_prefix = getenv("GROFF_COMMAND_PREFIX");
if (!command_prefix)
@@ -1332,40 +1545,57 @@ int scanArguments (int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "+a:g:o:i:I:D:F:vbdhlrnp", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "+a:bdD:F:g:hi:I:j:lno:prs:S:v",
+ long_options, NULL))
!= EOF)
switch(c) {
- case 'v':
- printf("GNU pre-grohtml (groff) version %s\n", Version_string);
- exit(0);
case 'a':
- textAlphaBits = min(max(MIN_ALPHA_BITS, atoi(optarg)), MAX_ALPHA_BITS);
+ textAlphaBits = min(max(MIN_ALPHA_BITS, atoi(optarg)),
+ MAX_ALPHA_BITS);
if (textAlphaBits == 3) {
error("cannot use 3 bits of antialiasing information");
exit(1);
}
break;
+ case 'b':
+ // handled by post-grohtml (set background color to white)
+ break;
+ case 'd':
+#if defined(DEBUGGING)
+ debug = TRUE;
+#endif
+ break;
+ case 'D':
+ image_dir = optarg;
+ break;
+ case 'F':
+ font_path.command_line_dir(optarg);
+ break;
case 'g':
- graphicAlphaBits = min(max(MIN_ALPHA_BITS, atoi(optarg)), MAX_ALPHA_BITS);
+ graphicAlphaBits = min(max(MIN_ALPHA_BITS, atoi(optarg)),
+ MAX_ALPHA_BITS);
if (graphicAlphaBits == 3) {
error("cannot use 3 bits of antialiasing information");
exit(1);
}
break;
- case 'b':
- // handled by post-grohtml (set background color to white)
+ case 'h':
+ // handled by post-grohtml
break;
- case 'D':
- image_dir = optarg;
+ case 'i':
+ image_res = atoi(optarg);
break;
case 'I':
image_template = optarg;
break;
- case 'i':
- image_res = atoi(optarg);
+ case 'j':
+ // handled by post-grohtml (set job name for multiple file output)
break;
- case 'F':
- font_path.command_line_dir(optarg);
+ case 'l':
+ // handled by post-grohtml (no automatic section links)
+ break;
+ case 'n':
+ // handled by post-grohtml (generate simple heading anchors)
break;
case 'o':
vertical_offset = atoi(optarg);
@@ -1373,14 +1603,18 @@ int scanArguments (int argc, char **argv)
case 'p':
show_progress = TRUE;
break;
- case 'd':
-#if defined(DEBUGGING)
- debug = TRUE;
-#endif
+ case 'r':
+ // handled by post-grohtml (no header and footer lines)
break;
- case 'h':
- // handled by post-grohtml
+ case 's':
+ // handled by post-grohtml (use font size n as the html base font size)
+ break;
+ case 'S':
+ // handled by post-grohtml (set file split level)
break;
+ case 'v':
+ printf("GNU pre-grohtml (groff) version %s\n", Version_string);
+ exit(0);
case CHAR_MAX + 1: // --help
usage(stdout);
exit(0);
@@ -1407,19 +1641,19 @@ int scanArguments (int argc, char **argv)
}
/*
- * makeTempFiles - name the temporary files
+ * makeTempFiles - Name the temporary files.
*/
-static int makeTempFiles (void)
+static int makeTempFiles(void)
{
#if defined(DEBUGGING)
- psFileName = "/tmp/prehtml-ps";
- regionFileName = "/tmp/prehtml-region";
- imagePageName = "/tmp/prehtml-page";
- psPageName = "/tmp/prehtml-psn";
- troffFileName = "/tmp/prehtml-troff";
- htmlFileName = "/tmp/prehtml-html";
-#else
+ psFileName = DEBUG_FILE("prehtml-ps");
+ regionFileName = DEBUG_FILE("prehtml-region");
+ imagePageName = DEBUG_FILE("prehtml-page");
+ psPageName = DEBUG_FILE("prehtml-psn");
+ troffFileName = DEBUG_FILE("prehtml-troff");
+ htmlFileName = DEBUG_FILE("prehtml-html");
+#else /* not DEBUGGING */
FILE *f;
/* psPageName contains a single page of postscript */
@@ -1462,7 +1696,7 @@ static int makeTempFiles (void)
}
fclose(f);
-#endif
+#endif /* not DEBUGGING */
return 0;
}
@@ -1470,9 +1704,27 @@ int main(int argc, char **argv)
{
program_name = argv[0];
int i;
- int found=0;
- int ok=1;
-
+ int found = 0;
+ int ok = 1;
+
+#ifdef CAPTURE_MODE
+ FILE *dump;
+ fprintf(stderr, "%s: invoked with %d arguments ...\n", argv[0], argc);
+ for (i = 0; i < argc; i++)
+ fprintf(stderr, "%2d: %s\n", i, argv[i]);
+ if ((dump = fopen(DEBUG_FILE("pre-html-data"), "wb")) != NULL) {
+ while((i = fgetc(stdin)) >= 0)
+ fputc(i, dump);
+ fclose(dump);
+ }
+ exit(1);
+#endif /* CAPTURE_MODE */
+ device = "html";
+ if (!font::load_desc())
+ fatal("cannot find devhtml/DESC exiting");
+ image_gen = font::image_generator;
+ if (image_gen == NULL || (strcmp(image_gen, "") == 0))
+ fatal("devhtml/DESC must set the image_generator field, exiting");
postscriptRes = get_resolution();
i = scanArguments(argc, argv);
setupAntiAlias();
@@ -1482,19 +1734,15 @@ int main(int argc, char **argv)
if (argv[i][0] != '-') {
/* found source file */
ok = do_file(argv[i]);
- if (! ok) {
- return( 0 );
- }
+ if (!ok)
+ return 0;
found = 1;
}
i++;
}
- copyofstdoutfd=dup(stdoutfd);
-
- if (! found) {
+ if (!found)
do_file("-");
- }
if (makeTempFiles())
return 1;
ok = inputFile.do_image(argc, argv);
@@ -1510,9 +1758,9 @@ static int do_file(const char *filename)
FILE *fp;
current_filename = filename;
- if (strcmp(filename, "-") == 0) {
+ if (strcmp(filename, "-") == 0)
fp = stdin;
- } else {
+ else {
fp = fopen(filename, "r");
if (fp == 0) {
error("can't open `%1': %2", filename, strerror(errno));
@@ -1521,6 +1769,7 @@ static int do_file(const char *filename)
}
if (inputFile.read_file(fp)) {
+ // XXX
}
if (fp != stdin)
diff --git a/contrib/groff/src/preproc/html/pre-html.h b/contrib/groff/src/preproc/html/pre-html.h
index f9a590c..3eedb21 100644
--- a/contrib/groff/src/preproc/html/pre-html.h
+++ b/contrib/groff/src/preproc/html/pre-html.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* defines functions implemented within pre-html.c
diff --git a/contrib/groff/src/preproc/html/pushback.cpp b/contrib/groff/src/preproc/html/pushback.cpp
index 07a15e3..b715587 100644
--- a/contrib/groff/src/preproc/html/pushback.cpp
+++ b/contrib/groff/src/preproc/html/pushback.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk).
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -83,14 +83,12 @@ pushBackBuffer::pushBackBuffer (char *filename)
pushBackBuffer::~pushBackBuffer ()
{
- int old;
-
if (charStack != 0) {
free(charStack);
}
close(0);
/* restore stdin in file descriptor 0 */
- old = dup(stdIn);
+ dup(stdIn);
close(stdIn);
}
@@ -162,10 +160,8 @@ static int isWhite (char ch)
void pushBackBuffer::skipToNewline (void)
{
- char ch;
-
while ((putPB(getPB()) != '\n') && (! eofFound)) {
- ch = getPB();
+ getPB();
}
}
@@ -274,15 +270,15 @@ int pushBackBuffer::readInt (void)
* convertToFloat - converts integers, a and b into a.b
*/
-static float convertToFloat (int a, int b)
+static double convertToFloat (int a, int b)
{
int c=10;
- float f;
+ double f;
while (b>c) {
c *= 10;
}
- f = ((float)a) + (((float)b)/((float)c));
+ f = ((double)a) + (((double)b)/((double)c));
return( f );
}
@@ -290,7 +286,7 @@ static float convertToFloat (int a, int b)
* readNumber - returns a float representing the word just read.
*/
-float pushBackBuffer::readNumber (void)
+double pushBackBuffer::readNumber (void)
{
int i;
char ch;
@@ -300,7 +296,7 @@ float pushBackBuffer::readNumber (void)
return convertToFloat(i, readInt());
}
putPB(ch);
- return (float)i;
+ return (double)i;
}
/*
@@ -312,7 +308,7 @@ float pushBackBuffer::readNumber (void)
char *pushBackBuffer::readString (void)
{
char buffer[MAXPUSHBACKSTACK];
- char *string = 0;
+ char *str = 0;
int i=0;
char ch=getPB();
@@ -326,8 +322,8 @@ char *pushBackBuffer::readString (void)
}
if (i < MAXPUSHBACKSTACK) {
buffer[i] = (char)0;
- string = (char *)malloc(strlen(buffer)+1);
- strcpy(string, buffer);
+ str = (char *)malloc(strlen(buffer)+1);
+ strcpy(str, buffer);
}
- return( string );
+ return( str );
}
diff --git a/contrib/groff/src/preproc/html/pushback.h b/contrib/groff/src/preproc/html/pushback.h
index 608bac5..3fddad6 100644
--- a/contrib/groff/src/preproc/html/pushback.h
+++ b/contrib/groff/src/preproc/html/pushback.h
@@ -1,5 +1,5 @@
// -*- C -*-
-/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Written by Gaius Mulley (gaius@glam.ac.uk).
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define eof (char)-1
@@ -39,16 +39,16 @@ class pushBackBuffer
int stdIn;
public:
- pushBackBuffer (char *);
- ~ pushBackBuffer ();
- char getPB (void);
- char putPB (char ch);
- void skipUntilToken (void);
- void skipToNewline (void);
- float readNumber (void);
- int readInt (void);
- char *readString (void);
- int isString (const char *string);
+ pushBackBuffer (char *);
+ ~ pushBackBuffer ();
+ char getPB (void);
+ char putPB (char ch);
+ void skipUntilToken (void);
+ void skipToNewline (void);
+ double readNumber (void);
+ int readInt (void);
+ char *readString (void);
+ int isString (const char *string);
};
diff --git a/contrib/groff/src/preproc/pic/TODO b/contrib/groff/src/preproc/pic/TODO
index 2346b57..a1d7554 100644
--- a/contrib/groff/src/preproc/pic/TODO
+++ b/contrib/groff/src/preproc/pic/TODO
@@ -1,5 +1,3 @@
-Dotted and dashed ellipses.
-
In troff mode, dotted and dashed splines.
Make DELIMITED have type lstr; this would allow us to give better
diff --git a/contrib/groff/src/preproc/pic/common.cpp b/contrib/groff/src/preproc/pic/common.cpp
index 5075e93..47a23cd 100644
--- a/contrib/groff/src/preproc/pic/common.cpp
+++ b/contrib/groff/src/preproc/pic/common.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
#include "common.h"
@@ -78,6 +78,157 @@ void common_output::dotted_circle(const position &cent, double rad,
dot(cent + position(cos(ang), sin(ang))*rad, lt);
}
+// recursive function for dash drawing, used by dashed_ellipse
+
+void common_output::ellipse_arc(const position &cent,
+ const position &z0, const position &z1,
+ const distance &dim, const line_type &lt)
+{
+ assert(lt.type == line_type::solid);
+ assert(dim.x != 0 && dim.y != 0);
+ double eps = 0.0001;
+ position zml = (z0 + z1) / 2;
+ // apply affine transformation (from ellipse to circle) to compute angle
+ // of new position, then invert transformation to get exact position
+ double psi = atan2(zml.y / dim.y, zml.x / dim.x);
+ position zm = position(dim.x * cos(psi), dim.y * sin(psi));
+ // to approximate the ellipse arc with one or more circle arcs, we
+ // first compute the radius of curvature in zm
+ double a_2 = dim.x * dim.x;
+ double a_4 = a_2 * a_2;
+ double b_2 = dim.y * dim.y;
+ double b_4 = b_2 * b_2;
+ double e_2 = a_2 - b_2;
+ double temp = a_4 * zm.y * zm.y + b_4 * zm.x * zm.x;
+ double rho = sqrt(temp / a_4 / b_4 * temp / a_4 / b_4 * temp);
+ // compute center of curvature circle
+ position M = position(e_2 * zm.x / a_2 * zm.x / a_2 * zm.x,
+ -e_2 * zm.y / b_2 * zm.y / b_2 * zm.y);
+ // compute distance between circle and ellipse arc at start and end
+ double phi0 = atan2(z0.y - M.y, z0.x - M.x);
+ double phi1 = atan2(z1.y - M.y, z1.x - M.x);
+ position M0 = position(rho * cos(phi0), rho * sin(phi0)) + M;
+ position M1 = position(rho * cos(phi1), rho * sin(phi1)) + M;
+ double dist0 = hypot(z0 - M0) / sqrt(z0 * z0);
+ double dist1 = hypot(z1 - M1) / sqrt(z1 * z1);
+ if (dist0 < eps && dist1 < eps)
+ solid_arc(M + cent, rho, phi0, phi1, lt);
+ else {
+ ellipse_arc(cent, z0, zm, dim, lt);
+ ellipse_arc(cent, zm, z1, dim, lt);
+ }
+}
+
+// output a dashed ellipse as a series of arcs
+
+void common_output::dashed_ellipse(const position &cent, const distance &dim,
+ const line_type &lt)
+{
+ assert(lt.type == line_type::dashed);
+ double dim_x = dim.x / 2;
+ double dim_y = dim.y / 2;
+ line_type slt = lt;
+ slt.type = line_type::solid;
+ double dw = lt.dash_width;
+ // we use an approximation to compute the ellipse length (found in:
+ // Bronstein, Semendjajew, Taschenbuch der Mathematik)
+ double lambda = (dim.x - dim.y) / (dim.x + dim.y);
+ double le = M_PI / 2 * (dim.x + dim.y)
+ * ((64 - 3 * lambda * lambda * lambda * lambda )
+ / (64 - 16 * lambda * lambda));
+ // for symmetry we make nmax a multiple of 8
+ int nmax = 8 * int(le / dw / 8 + 0.5);
+ if (nmax < 8) {
+ nmax = 8;
+ dw = le / 8;
+ }
+ int ndash = nmax / 2;
+ double gapwidth = (le - dw * ndash) / ndash;
+ double l = 0;
+ position z = position(dim_x, 0);
+ position zdot = z;
+ int j = 0;
+ int jmax = int(10 / lt.dash_width);
+ for (int i = 0; i <= nmax; i++) {
+ position zold = z;
+ position zpre = zdot;
+ double ld = (int(i / 2) + 0.5) * dw + int((i + 1) / 2) * gapwidth;
+ double lold = 0;
+ double dl = 1;
+ // find next position for fixed arc length
+ while (l < ld) {
+ j++;
+ lold = l;
+ zold = z;
+ double phi = j * 2 * M_PI / jmax;
+ z = position(dim_x * cos(phi), dim_y * sin(phi));
+ dl = hypot(z - zold);
+ l += dl;
+ }
+ // interpolate linearly between the last two points,
+ // using the length difference as the scaling factor
+ double delta = (ld - lold) / dl;
+ zdot = zold + (z - zold) * delta;
+ // compute angle of new position on the affine circle
+ // and use it to get the exact value on the ellipse
+ double psi = atan2(zdot.y / dim_y, zdot.x / dim_x);
+ zdot = position(dim_x * cos(psi), dim_y * sin(psi));
+ if ((i % 2 == 0) && (i > 1))
+ ellipse_arc(cent, zpre, zdot, dim / 2, slt);
+ }
+}
+
+// output a dotted ellipse as a series of dots
+
+void common_output::dotted_ellipse(const position &cent, const distance &dim,
+ const line_type &lt)
+{
+ assert(lt.type == line_type::dotted);
+ double dim_x = dim.x / 2;
+ double dim_y = dim.y / 2;
+ line_type slt = lt;
+ slt.type = line_type::solid;
+ // we use an approximation to compute the ellipse length (found in:
+ // Bronstein, Semendjajew, Taschenbuch der Mathematik)
+ double lambda = (dim.x - dim.y) / (dim.x + dim.y);
+ double le = M_PI / 2 * (dim.x + dim.y)
+ * ((64 - 3 * lambda * lambda * lambda * lambda )
+ / (64 - 16 * lambda * lambda));
+ // for symmetry we make nmax a multiple of 4
+ int ndots = 4 * int(le / lt.dash_width / 4 + 0.5);
+ if (ndots < 4)
+ ndots = 4;
+ double l = 0;
+ position z = position(dim_x, 0);
+ int j = 0;
+ int jmax = int(10 / lt.dash_width);
+ for (int i = 1; i <= ndots; i++) {
+ position zold = z;
+ double lold = l;
+ double ld = i * le / ndots;
+ double dl = 1;
+ // find next position for fixed arc length
+ while (l < ld) {
+ j++;
+ lold = l;
+ zold = z;
+ double phi = j * 2 * M_PI / jmax;
+ z = position(dim_x * cos(phi), dim_y * sin(phi));
+ dl = hypot(z - zold);
+ l += dl;
+ }
+ // interpolate linearly between the last two points,
+ // using the length difference as the scaling factor
+ double delta = (ld - lold) / dl;
+ position zdot = zold + (z - zold) * delta;
+ // compute angle of new position on the affine circle
+ // and use it to get the exact value on the ellipse
+ double psi = atan2(zdot.y / dim_y, zdot.x / dim_x);
+ zdot = position(dim_x * cos(psi), dim_y * sin(psi));
+ dot(cent + zdot, slt);
+ }
+}
+
// return non-zero iff we can compute a center
int compute_arc_center(const position &start, const position &cent,
diff --git a/contrib/groff/src/preproc/pic/common.h b/contrib/groff/src/preproc/pic/common.h
index 90b65fa..5023834 100644
--- a/contrib/groff/src/preproc/pic/common.h
+++ b/contrib/groff/src/preproc/pic/common.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class common_output : public output {
private:
@@ -33,8 +34,13 @@ private:
double gap_width, double *offsetp);
protected:
virtual void dot(const position &, const line_type &) = 0;
+ void ellipse_arc(const position &, const position &,
+ const position &, const distance &,
+ const line_type &);
void dashed_circle(const position &, double rad, const line_type &);
void dotted_circle(const position &, double rad, const line_type &);
+ void dashed_ellipse(const position &, const distance &, const line_type &);
+ void dotted_ellipse(const position &, const distance &, const line_type &);
void dashed_arc(const position &, const position &, const position &,
const line_type &);
void dotted_arc(const position &, const position &, const position &,
diff --git a/contrib/groff/src/preproc/pic/lex.cpp b/contrib/groff/src/preproc/pic/lex.cpp
index b8aa9eb..ceca368 100644
--- a/contrib/groff/src/preproc/pic/lex.cpp
+++ b/contrib/groff/src/preproc/pic/lex.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
#include "ptable.h"
@@ -1329,21 +1329,23 @@ void do_undef()
class for_input : public input {
char *var;
char *body;
+ double from;
double to;
int by_is_multiplicative;
double by;
const char *p;
int done_newline;
public:
- for_input(char *, double, int, double, char *);
+ for_input(char *, double, double, int, double, char *);
~for_input();
int get();
int peek();
};
-for_input::for_input(char *vr, double t, int bim, double b, char *bd)
-: var(vr), body(bd), to(t), by_is_multiplicative(bim), by(b), p(body),
- done_newline(0)
+for_input::for_input(char *vr, double f, double t,
+ int bim, double b, char *bd)
+: var(vr), body(bd), from(f), to(t), by_is_multiplicative(bim), by(b),
+ p(body), done_newline(0)
{
}
@@ -1374,7 +1376,8 @@ int for_input::get()
else
val += by;
define_variable(var, val);
- if (val > to) {
+ if ((from <= to && val > to)
+ || (from >= to && val < to)) {
p = 0;
return EOF;
}
@@ -1399,7 +1402,8 @@ int for_input::peek()
return EOF;
}
else {
- if (val + by > to)
+ if ((from <= to && val + by > to)
+ || (from >= to && val + by < to))
return EOF;
}
if (*body == '\0')
@@ -1411,8 +1415,12 @@ void do_for(char *var, double from, double to, int by_is_multiplicative,
double by, char *body)
{
define_variable(var, from);
- if (from <= to)
- input_stack::push(new for_input(var, to, by_is_multiplicative, by, body));
+ if ((by_is_multiplicative && by <= 0)
+ || (by > 0 && from > to)
+ || (by < 0 && from < to))
+ return;
+ input_stack::push(new for_input(var, from, to,
+ by_is_multiplicative, by, body));
}
diff --git a/contrib/groff/src/preproc/pic/main.cpp b/contrib/groff/src/preproc/pic/main.cpp
index 8788fa6..0e05f77 100644
--- a/contrib/groff/src/preproc/pic/main.cpp
+++ b/contrib/groff/src/preproc/pic/main.cpp
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
diff --git a/contrib/groff/src/preproc/pic/object.cpp b/contrib/groff/src/preproc/pic/object.cpp
index d5c0d6c..aefbd45e 100644
--- a/contrib/groff/src/preproc/pic/object.cpp
+++ b/contrib/groff/src/preproc/pic/object.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
#include "ptable.h"
@@ -202,7 +202,7 @@ double operator*(const position &a, const position &b)
double hypot(const position &a)
{
- return hypot(a.x, a.y);
+ return groff_hypot(a.x, a.y);
}
struct arrow_head_type {
@@ -233,13 +233,14 @@ void draw_arrow(const position &pos, const distance &dir,
v[2] = pos + base - n;
// fill with outline color
out->set_color(outline_color_for_fill, outline_color_for_fill);
+ // make stroke thin to avoid arrow sticking
+ slt.thickness = 0.1;
out->polygon(v, 3, slt, 1);
}
else {
- position v[2];
- v[0] = pos;
- v[1] = pos + base + n;
- out->line(pos + base - n, v, 2, slt);
+ // use two line segments to avoid arrow sticking
+ out->line(pos + base - n, &pos, 1, slt);
+ out->line(pos + base + n, &pos, 1, slt);
}
}
@@ -716,9 +717,9 @@ void closed_object::set_fill(double f)
fill = f;
}
-void closed_object::set_fill_color(char *fill)
+void closed_object::set_fill_color(char *f)
{
- color_fill = strsave(fill);
+ color_fill = strsave(f);
}
class box_object : public closed_object {
@@ -1258,12 +1259,47 @@ void line_object::print()
if (lt.type == line_type::invisible)
return;
out->set_color(0, graphic_object::get_outline_color());
- out->line(strt, v, n, lt);
- if (arrow_at_start)
- draw_arrow(strt, strt-v[0], aht, lt, graphic_object::get_outline_color());
- if (arrow_at_end)
- draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt,
- graphic_object::get_outline_color());
+ // shorten line length to avoid arrow sticking.
+ position sp = strt;
+ if (arrow_at_start) {
+ position base = v[0] - strt;
+ double hyp = hypot(base);
+ if (hyp == 0.0) {
+ error("cannot draw arrow on object with zero length");
+ return;
+ }
+ if (aht.solid && out->supports_filled_polygons()) {
+ base *= aht.height / hyp;
+ draw_arrow(strt, strt - v[0], aht, lt,
+ graphic_object::get_outline_color());
+ sp = strt + base;
+ } else {
+ base *= fabs(lt.thickness) / hyp / 72 / 4;
+ sp = strt + base;
+ draw_arrow(sp, sp - v[0], aht, lt,
+ graphic_object::get_outline_color());
+ }
+ }
+ if (arrow_at_end) {
+ position base = v[n-1] - (n > 1 ? v[n-2] : strt);
+ double hyp = hypot(base);
+ if (hyp == 0.0) {
+ error("cannot draw arrow on object with zero length");
+ return;
+ }
+ if (aht.solid && out->supports_filled_polygons()) {
+ base *= aht.height / hyp;
+ draw_arrow(en, v[n-1] - (n > 1 ? v[n-2] : strt), aht, lt,
+ graphic_object::get_outline_color());
+ v[n-1] = en - base;
+ } else {
+ base *= fabs(lt.thickness) / hyp / 72 / 4;
+ v[n-1] = en - base;
+ draw_arrow(v[n-1], v[n-1] - (n > 1 ? v[n-2] : strt), aht, lt,
+ graphic_object::get_outline_color());
+ }
+ }
+ out->line(sp, v, n, lt);
out->reset_color();
}
@@ -1328,12 +1364,47 @@ void spline_object::print()
if (lt.type == line_type::invisible)
return;
out->set_color(0, graphic_object::get_outline_color());
- out->spline(strt, v, n, lt);
- if (arrow_at_start)
- draw_arrow(strt, strt-v[0], aht, lt, graphic_object::get_outline_color());
- if (arrow_at_end)
- draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt,
- graphic_object::get_outline_color());
+ // shorten line length for spline to avoid arrow sticking
+ position sp = strt;
+ if (arrow_at_start) {
+ position base = v[0] - strt;
+ double hyp = hypot(base);
+ if (hyp == 0.0) {
+ error("cannot draw arrow on object with zero length");
+ return;
+ }
+ if (aht.solid && out->supports_filled_polygons()) {
+ base *= aht.height / hyp;
+ draw_arrow(strt, strt - v[0], aht, lt,
+ graphic_object::get_outline_color());
+ sp = strt + base*0.1; // to reserve spline shape
+ } else {
+ base *= fabs(lt.thickness) / hyp / 72 / 4;
+ sp = strt + base;
+ draw_arrow(sp, sp - v[0], aht, lt,
+ graphic_object::get_outline_color());
+ }
+ }
+ if (arrow_at_end) {
+ position base = v[n-1] - (n > 1 ? v[n-2] : strt);
+ double hyp = hypot(base);
+ if (hyp == 0.0) {
+ error("cannot draw arrow on object with zero length");
+ return;
+ }
+ if (aht.solid && out->supports_filled_polygons()) {
+ base *= aht.height / hyp;
+ draw_arrow(en, v[n-1] - (n > 1 ? v[n-2] : strt), aht, lt,
+ graphic_object::get_outline_color());
+ v[n-1] = en - base*0.1; // to reserve spline shape
+ } else {
+ base *= fabs(lt.thickness) / hyp / 72 / 4;
+ v[n-1] = en - base;
+ draw_arrow(v[n-1], v[n-1] - (n > 1 ? v[n-2] : strt), aht, lt,
+ graphic_object::get_outline_color());
+ }
+ }
+ out->spline(sp, v, n, lt);
out->reset_color();
}
@@ -1542,22 +1613,70 @@ void arc_object::print()
if (lt.type == line_type::invisible)
return;
out->set_color(0, graphic_object::get_outline_color());
- if (clockwise)
- out->arc(en, cent, strt, lt);
- else
- out->arc(strt, cent, en, lt);
+ // handle arrow direction; make shorter line for arc
+ position sp, ep, b;
+ if (clockwise) {
+ sp = en;
+ ep = strt;
+ } else {
+ sp = strt;
+ ep = en;
+ }
if (arrow_at_start) {
- position c = cent - strt;
- draw_arrow(strt,
- (clockwise ? position(c.y, -c.x) : position(-c.y, c.x)),
- aht, lt, graphic_object::get_outline_color());
+ double theta = aht.height / rad;
+ if (clockwise)
+ theta = - theta;
+ b = strt - cent;
+ b = position(b.x*cos(theta) - b.y*sin(theta),
+ b.x*sin(theta) + b.y*cos(theta)) + cent;
+ if (clockwise)
+ ep = b;
+ else
+ sp = b;
+ if (aht.solid && out->supports_filled_polygons()) {
+ draw_arrow(strt, strt - b, aht, lt,
+ graphic_object::get_outline_color());
+ } else {
+ position v = b;
+ theta = fabs(lt.thickness) / 72 / 4 / rad;
+ if (clockwise)
+ theta = - theta;
+ b = strt - cent;
+ b = position(b.x*cos(theta) - b.y*sin(theta),
+ b.x*sin(theta) + b.y*cos(theta)) + cent;
+ draw_arrow(b, b - v, aht, lt,
+ graphic_object::get_outline_color());
+ out->line(b, &v, 1, lt);
+ }
}
if (arrow_at_end) {
- position e = en - cent;
- draw_arrow(en,
- (clockwise ? position(e.y, -e.x) : position(-e.y, e.x)),
- aht, lt, graphic_object::get_outline_color());
+ double theta = aht.height / rad;
+ if (!clockwise)
+ theta = - theta;
+ b = en - cent;
+ b = position(b.x*cos(theta) - b.y*sin(theta),
+ b.x*sin(theta) + b.y*cos(theta)) + cent;
+ if (clockwise)
+ sp = b;
+ else
+ ep = b;
+ if (aht.solid && out->supports_filled_polygons()) {
+ draw_arrow(en, en - b, aht, lt,
+ graphic_object::get_outline_color());
+ } else {
+ position v = b;
+ theta = fabs(lt.thickness) / 72 / 4 / rad;
+ if (!clockwise)
+ theta = - theta;
+ b = en - cent;
+ b = position(b.x*cos(theta) - b.y*sin(theta),
+ b.x*sin(theta) + b.y*cos(theta)) + cent;
+ draw_arrow(b, b - v, aht, lt,
+ graphic_object::get_outline_color());
+ out->line(b, &v, 1, lt);
+ }
}
+ out->arc(sp, cent, ep, lt);
out->reset_color();
}
@@ -1587,21 +1706,21 @@ void arc_object::update_bounding_box(bounding_box *p)
start_quad += 4.0;
while (end_quad <= start_quad)
end_quad += 4.0;
- double radius = max(hypot(start_offset), hypot(end_offset));
+ double r = max(hypot(start_offset), hypot(end_offset));
for (int q = int(start_quad) + 1; q < end_quad; q++) {
position offset;
switch (q % 4) {
case 0:
- offset.x = radius;
+ offset.x = r;
break;
case 1:
- offset.y = radius;
+ offset.y = r;
break;
case 2:
- offset.x = -radius;
+ offset.x = -r;
break;
case 3:
- offset.y = -radius;
+ offset.y = -r;
break;
}
p->encompass(cent + offset);
@@ -1753,7 +1872,7 @@ object *object_spec::make_object(position *curpos, direction *dirp)
obj->set_thickness(th);
if (flags & IS_OUTLINED)
obj->set_outline_color(outlined);
- if (flags & (IS_DEFAULT_FILLED|IS_FILLED)) {
+ if (flags & (IS_DEFAULT_FILLED | IS_FILLED)) {
if (flags & IS_SHADED)
obj->set_fill_color(shaded);
else {
diff --git a/contrib/groff/src/preproc/pic/object.h b/contrib/groff/src/preproc/pic/object.h
index 98937f93..9f7f4bc 100644
--- a/contrib/groff/src/preproc/pic/object.h
+++ b/contrib/groff/src/preproc/pic/object.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct place;
@@ -163,9 +164,9 @@ struct segment {
segment(const position &, int, segment *);
};
-struct rectangle_object;
-struct graphic_object;
-struct linear_object;
+class rectangle_object;
+class graphic_object;
+class linear_object;
struct object_spec {
unsigned long flags;
diff --git a/contrib/groff/src/preproc/pic/output.h b/contrib/groff/src/preproc/pic/output.h
index a0a8331..aa03e77 100644
--- a/contrib/groff/src/preproc/pic/output.h
+++ b/contrib/groff/src/preproc/pic/output.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct line_type {
enum { invisible, solid, dotted, dashed } type;
diff --git a/contrib/groff/src/preproc/pic/pic.h b/contrib/groff/src/preproc/pic/pic.h
index 166e4e7..e3b850a 100644
--- a/contrib/groff/src/preproc/pic/pic.h
+++ b/contrib/groff/src/preproc/pic/pic.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -25,12 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <errno.h>
-#ifdef NEED_DECLARATION_HYPOT
-extern "C" {
- double hypot(double, double);
-}
-#endif /* NEED_DECLARATION_HYPOT */
-
#ifdef NEED_DECLARATION_RAND
#undef rand
extern "C" {
diff --git a/contrib/groff/src/preproc/pic/pic.man b/contrib/groff/src/preproc/pic/pic.man
index c12e93a..c54cfbe 100644
--- a/contrib/groff/src/preproc/pic/pic.man
+++ b/contrib/groff/src/preproc/pic/pic.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -322,6 +322,16 @@ then
.I variable
will instead be multiplied by
.IR expr3 .
+The value of
+.I expr3
+can be negative for the additive case;
+.I variable
+is then tested whether it is greater than or equal to
+.IR expr2 .
+For the multiplicative case,
+.I expr3
+must be greater than zero.
+If the constraints aren't met, the loop isn't executed.
.I X
can be any character not occurring in
.IR body .
@@ -362,6 +372,25 @@ This has a similar effect to a line beginning with
or
.BR \e ,
but allows the values of variables to be passed through.
+For example,
+.RS
+.IP
+.ft B
+.nf
+\&.PS
+x = 14
+command ".ds string x is " x "."
+\&.PE
+\e*[string]
+.ft
+.fi
+.RE
+.IP
+prints
+.RS
+.IP
+.B x is 14.
+.RE
.
.TP
\fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
@@ -522,7 +551,10 @@ print x " " y
.RE
.IP
prints
-.BR 5\ 3 .
+.RS
+.IP
+.B 5 3
+.RE
.
.LP
Arguments of the form
@@ -625,8 +657,10 @@ where
.I dir
is the current direction.
For example
-.IP
+.LP
+.RS
.B line 2i
+.RE
.LP
means draw a line 2\ inches long in the current direction.
The `i' (or `I') character is ignored; to use another measurement unit,
@@ -645,6 +679,7 @@ Initially these have values 8.5 and 11.
Scientific notation is allowed for numbers.
For example
.RS
+.LP
.B
x = 5e\-2
.RE
@@ -653,21 +688,25 @@ x = 5e\-2
Text attributes can be compounded.
For example,
.RS
+.LP
.B
"foo" above ljust
.RE
-is legal.
+.LP
+is valid.
.
.LP
There is no limit to the depth to which blocks can be examined.
For example,
.RS
+.LP
.B
[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
.br
.B
circle at last [\^].A.B.C
.RE
+.LP
is acceptable.
.
.LP
@@ -675,8 +714,8 @@ Arcs now have compass points
determined by the circle of which the arc is a part.
.
.LP
-Circles and arcs can be dotted or dashed.
-In \*(tx mode splines can be dotted or dashed.
+Circles, ellipses, and arcs can be dotted or dashed.
+In \*(tx mode splines can be dotted or dashed also.
.
.LP
Boxes can have rounded corners.
@@ -805,7 +844,7 @@ Three additional modifiers are available to specify colored objects:
sets the color of the outline,
.B shaded
the fill color, and
-.BR colo [ u ] r [ ed ]
+.B colo\fR[\fPu\fR]\fPr\fR[\fPed\fR]
sets both.
All three keywords expect a suffix specifying the color, for example
.RS
@@ -974,6 +1013,7 @@ has built-in graphics conversion devices that are called with the option
.RE
.LP
Call
+.LP
.RS
.B gs --help
.RE
@@ -1052,7 +1092,7 @@ W. Richard Stevens - Examples of picMacros
.
Input characters that are invalid for
.B groff
-(ie those with
+(i.e., those with
.SM ASCII
code 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237
octal) are rejected even in \*(tx mode.
diff --git a/contrib/groff/src/preproc/pic/pic.y b/contrib/groff/src/preproc/pic/pic.y
index 2ee1dec..83d0fe0 100644
--- a/contrib/groff/src/preproc/pic/pic.y
+++ b/contrib/groff/src/preproc/pic/pic.y
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -16,14 +16,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
%{
#include "pic.h"
#include "ptable.h"
#include "object.h"
extern int delim_flag;
-extern void do_copy(const char *);
extern void copy_rest_thru(const char *, const char *);
extern void copy_file_thru(const char *, const char *, const char *);
extern void push_body(const char *);
@@ -1109,8 +1108,16 @@ sprintf_args:
else {
double *oldv = $$.v;
$$.maxv *= 2;
+#if 0
$$.v = new double[$$.maxv];
memcpy($$.v, oldv, $$.nv*sizeof(double));
+#else
+ // workaround for bug in Compaq C++ V6.5-033
+ // for Compaq Tru64 UNIX V5.1A (Rev. 1885)
+ double *foo = new double[$$.maxv];
+ memcpy(foo, oldv, $$.nv*sizeof(double));
+ $$.v = foo;
+#endif
a_delete oldv;
}
}
@@ -1128,6 +1135,12 @@ position:
$$.x = pos.x;
$$.y = pos.y;
}
+ | '(' place ')'
+ {
+ position pos = $2;
+ $$.x = pos.x;
+ $$.y = pos.y;
+ }
;
position_not_place:
@@ -1138,11 +1151,21 @@ position_not_place:
$$.x = $1.x + $3.x;
$$.y = $1.y + $3.y;
}
+ | '(' position '+' expr_pair ')'
+ {
+ $$.x = $2.x + $4.x;
+ $$.y = $2.y + $4.y;
+ }
| position '-' expr_pair
{
$$.x = $1.x - $3.x;
$$.y = $1.y - $3.y;
}
+ | '(' position '-' expr_pair ')'
+ {
+ $$.x = $2.x - $4.x;
+ $$.y = $2.y - $4.y;
+ }
| '(' position ',' position ')'
{
$$.x = $2.x;
@@ -1153,11 +1176,21 @@ position_not_place:
$$.x = (1.0 - $1)*$3.x + $1*$5.x;
$$.y = (1.0 - $1)*$3.y + $1*$5.y;
}
+ | '(' expr between position AND position ')'
+ {
+ $$.x = (1.0 - $2)*$4.x + $2*$6.x;
+ $$.y = (1.0 - $2)*$4.y + $2*$6.y;
+ }
| expr '<' position ',' position '>'
{
$$.x = (1.0 - $1)*$3.x + $1*$5.x;
$$.y = (1.0 - $1)*$3.y + $1*$5.y;
}
+ | '(' expr '<' position ',' position '>' ')'
+ {
+ $$.x = (1.0 - $2)*$4.x + $2*$6.x;
+ $$.y = (1.0 - $2)*$4.y + $2*$6.y;
+ }
;
between:
diff --git a/contrib/groff/src/preproc/pic/position.h b/contrib/groff/src/preproc/pic/position.h
index ab7d546..c62e3e7 100644
--- a/contrib/groff/src/preproc/pic/position.h
+++ b/contrib/groff/src/preproc/pic/position.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct place;
struct position {
diff --git a/contrib/groff/src/preproc/pic/tex.cpp b/contrib/groff/src/preproc/pic/tex.cpp
index dbebe46..f997b86 100644
--- a/contrib/groff/src/preproc/pic/tex.cpp
+++ b/contrib/groff/src/preproc/pic/tex.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
@@ -324,12 +324,25 @@ void tex_output::ellipse(const position &cent, const distance &dim,
printf(" \\special{sh %.3f}%%\n", fill);
}
position c = transform(cent);
- printf(" \\special{%s %d %d %d %d 0 6.28319}%%\n",
- (lt.type == line_type::invisible ? "ia" : "ar"),
- milliinches(c.x),
- milliinches(c.y),
- milliinches(dim.x/(2.0*scale)),
- milliinches(dim.y/(2.0*scale)));
+ switch (lt.type) {
+ case line_type::solid:
+ case line_type::invisible:
+ printf(" \\special{%s %d %d %d %d 0 6.28319}%%\n",
+ (lt.type == line_type::invisible ? "ia" : "ar"),
+ milliinches(c.x),
+ milliinches(c.y),
+ milliinches(dim.x/(2.0*scale)),
+ milliinches(dim.y/(2.0*scale)));
+ break;
+ case line_type::dashed:
+ dashed_ellipse(cent, dim / scale, lt);
+ break;
+ case line_type::dotted:
+ dotted_ellipse(cent, dim / scale, lt);
+ break;
+ default:
+ assert(0);
+ }
}
void tex_output::command(const char *s, const char *, int)
diff --git a/contrib/groff/src/preproc/pic/troff.cpp b/contrib/groff/src/preproc/pic/troff.cpp
index cf8f5ee..688ca47 100644
--- a/contrib/groff/src/preproc/pic/troff.cpp
+++ b/contrib/groff/src/preproc/pic/troff.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "pic.h"
#include "common.h"
@@ -197,7 +197,11 @@ void simple_output::ellipse(const position &cent, const distance &dim,
case line_type::invisible:
break;
case line_type::dotted:
+ dotted_ellipse(cent, dim, lt);
+ break;
case line_type::dashed:
+ dashed_ellipse(cent, dim, lt);
+ break;
case line_type::solid:
simple_ellipse(0, cent, dim);
break;
@@ -320,7 +324,7 @@ void troff_output::simple_circle(int filled, const position &cent, double rad)
position c = transform(cent);
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'%c%.3fi'"
+ "\\D'%c %.3fi'"
"\n.sp -1\n",
c.x - rad/scale,
c.y,
@@ -334,7 +338,7 @@ void troff_output::simple_ellipse(int filled, const position &cent,
position c = transform(cent);
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'%c%.3fi %.3fi'"
+ "\\D'%c %.3fi %.3fi'"
"\n.sp -1\n",
c.x - dim.x/(2.0*scale),
c.y,
@@ -351,7 +355,7 @@ void troff_output::simple_arc(const position &start, const distance &cent,
distance ev = transform(end) - c;
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'a%.3fi %.3fi %.3fi %.3fi'"
+ "\\D'a %.3fi %.3fi %.3fi %.3fi'"
"\n.sp -1\n",
s.x, s.y, cv.x, cv.y, ev.x, ev.y);
}
@@ -362,7 +366,7 @@ void troff_output::simple_line(const position &start, const position &end)
distance ev = transform(end) - s;
printf("\\h'%.3fi'"
"\\v'%.3fi'"
- "\\D'l%.3fi %.3fi'"
+ "\\D'l %.3fi %.3fi'"
"\n.sp -1\n",
s.x, s.y, ev.x, ev.y);
}
@@ -374,7 +378,7 @@ void troff_output::simple_spline(const position &start,
printf("\\h'%.3fi'"
"\\v'%.3fi'",
pos.x, pos.y);
- fputs("\\D'~", stdout);
+ fputs("\\D'~ ", stdout);
for (int i = 0; i < n; i++) {
position temp = transform(v[i]);
distance d = temp - pos;
@@ -394,7 +398,7 @@ void troff_output::simple_polygon(int filled, const position *v, int n)
printf("\\h'%.3fi'"
"\\v'%.3fi'",
pos.x, pos.y);
- printf("\\D'%c", (filled ? 'P' : 'p'));
+ printf("\\D'%c ", (filled ? 'P' : 'p'));
for (int i = 1; i < n; i++) {
position temp = transform(v[i]);
distance d = temp - pos;
@@ -476,13 +480,15 @@ void troff_output::line_thickness(double p)
void troff_output::set_fill(double f)
{
if (driver_extension_flag && f != last_fill) {
- printf("\\D'Fg %.3f'\n.sp -1\n", 1.0 - f);
+ // \D'Fg ...' emits a node only in compatibility mode,
+ // thus we add a dummy node
+ printf("\\&\\D'Fg %.3f'\n.sp -1\n", 1.0 - f);
last_fill = f;
}
if (last_filled) {
free(last_filled);
last_filled = 0;
- printf("\\M[]\n.sp -1\n");
+ printf(".fcolor\n");
}
}
@@ -492,12 +498,14 @@ void troff_output::set_color(char *color_fill, char *color_outlined)
if (last_filled || last_outlined) {
reset_color();
}
+ // .gcolor and .fcolor emit a node in compatibility mode only,
+ // but that won't work anyway
if (color_fill) {
- printf("\\M[%s]\n.sp -1\n", color_fill);
+ printf(".fcolor %s\n", color_fill);
last_filled = strsave(color_fill);
}
if (color_outlined) {
- printf("\\m[%s]\n.sp -1\n", color_outlined);
+ printf(".gcolor %s\n", color_outlined);
last_outlined = strsave(color_outlined);
}
}
@@ -507,12 +515,12 @@ void troff_output::reset_color()
{
if (driver_extension_flag) {
if (last_filled) {
- printf("\\M[]\n.sp -1\n");
+ printf(".fcolor\n");
a_delete last_filled;
last_filled = 0;
}
if (last_outlined) {
- printf("\\m[]\n.sp -1\n");
+ printf(".gcolor\n");
a_delete last_outlined;
last_outlined = 0;
}
diff --git a/contrib/groff/src/preproc/refer/command.cpp b/contrib/groff/src/preproc/refer/command.cpp
index a7c6bfb..441f953 100644
--- a/contrib/groff/src/preproc/refer/command.cpp
+++ b/contrib/groff/src/preproc/refer/command.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "refer.h"
#include "refid.h"
@@ -632,7 +632,7 @@ a single field,
? means that the previous argument is optional, * means that the
previous argument can occur any number of times. */
-struct {
+struct S {
const char *name;
command_t func;
const char *arg_types;
diff --git a/contrib/groff/src/preproc/refer/command.h b/contrib/groff/src/preproc/refer/command.h
index c7085db..f0472ac 100644
--- a/contrib/groff/src/preproc/refer/command.h
+++ b/contrib/groff/src/preproc/refer/command.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
void process_commands(const char *file);
void process_commands(string &s, const char *file, int lineno);
diff --git a/contrib/groff/src/preproc/refer/label.y b/contrib/groff/src/preproc/refer/label.y
index 2648b98..d76f95e 100644
--- a/contrib/groff/src/preproc/refer/label.y
+++ b/contrib/groff/src/preproc/refer/label.y
@@ -1,5 +1,6 @@
/* -*- C++ -*-
- Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1990, 1991, 1992, 2000, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
%{
@@ -406,6 +407,20 @@ const char *spec_ptr;
const char *spec_end;
const char *spec_cur;
+static char uppercase_array[] = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
+ 'Y', 'Z',
+};
+
+static char lowercase_array[] = {
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+ 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z',
+};
+
int yylex()
{
while (spec_ptr < spec_end && csspace(*spec_ptr))
@@ -589,7 +604,8 @@ static const char *format_serial(char c, int n)
d = 26;
n -= d;
n /= 26;
- *p++ = c + d - 1; // ASCII dependent
+ *p++ = c == 'a' ? lowercase_array[d - 1] :
+ uppercase_array[d - 1];
}
*p-- = 0;
// Reverse it.
@@ -970,8 +986,8 @@ label_info *lookup_label(const string &label)
label_table[i] = 0;
for (i = 0; i < old_size; i++)
if (old_table[i]) {
- unsigned h = hash_string(label_pool.contents() + old_table[i]->start,
- old_table[i]->length);
+ h = hash_string(label_pool.contents() + old_table[i]->start,
+ old_table[i]->length);
label_info **p;
for (p = label_table + (h % label_table_size);
*p != 0;
@@ -1073,10 +1089,10 @@ int same_author_last_name(const reference &r1, const reference &r2, int n)
{
const char *ae1;
const char *as1 = r1.get_sort_field(0, n, 0, &ae1);
- assert(as1 != 0);
const char *ae2;
const char *as2 = r2.get_sort_field(0, n, 0, &ae2);
- assert(as2 != 0);
+ if (!as1 && !as2) return 1; // they are the same
+ if (!as1 || !as2) return 0;
return ae1 - as1 == ae2 - as2 && memcmp(as1, as2, ae1 - as1) == 0;
}
@@ -1084,10 +1100,10 @@ int same_author_name(const reference &r1, const reference &r2, int n)
{
const char *ae1;
const char *as1 = r1.get_sort_field(0, n, -1, &ae1);
- assert(as1 != 0);
const char *ae2;
const char *as2 = r2.get_sort_field(0, n, -1, &ae2);
- assert(as2 != 0);
+ if (!as1 && !as2) return 1; // they are the same
+ if (!as1 || !as2) return 0;
return ae1 - as1 == ae2 - as2 && memcmp(as1, as2, ae1 - as1) == 0;
}
diff --git a/contrib/groff/src/preproc/refer/ref.cpp b/contrib/groff/src/preproc/refer/ref.cpp
index 9c04078..59c69d5 100644
--- a/contrib/groff/src/preproc/refer/ref.cpp
+++ b/contrib/groff/src/preproc/refer/ref.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "refer.h"
#include "refid.h"
@@ -420,8 +421,7 @@ void reference::compute_sort_key()
sort_fields += '\0';
const char *sf = sort_fields.contents();
while (*sf != '\0') {
- if (sf > sort_fields)
- sort_key += SORT_SEP;
+ sort_key += SORT_SEP;
char f = *sf++;
int n = 1;
if (*sf == '+') {
diff --git a/contrib/groff/src/preproc/refer/ref.h b/contrib/groff/src/preproc/refer/ref.h
index 13a984a..ffb81ac 100644
--- a/contrib/groff/src/preproc/refer/ref.h
+++ b/contrib/groff/src/preproc/refer/ref.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2005 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,15 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+// declarations to avoid friend name injection problems
+int compare_reference(const reference &, const reference &);
+int same_reference(const reference &, const reference &);
+int same_year(const reference &, const reference &);
+int same_date(const reference &, const reference &);
+int same_author_last_name(const reference &, const reference &, int);
+int same_author_name(const reference &, const reference &, int);
struct label_info;
diff --git a/contrib/groff/src/preproc/refer/refer.cpp b/contrib/groff/src/preproc/refer/refer.cpp
index 33df35c..66afa4b 100644
--- a/contrib/groff/src/preproc/refer/refer.cpp
+++ b/contrib/groff/src/preproc/refer/refer.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "refer.h"
#include "refid.h"
@@ -938,6 +939,12 @@ int rcompare(const void *p1, const void *p2)
void output_references()
{
assert(accumulate);
+ if (!hash_table_size) {
+ error("nothing to reference (probably `bibliography' before `sort')");
+ accumulate = 0;
+ nreferences = 0;
+ return;
+ }
if (nreferences > 0) {
int j = 0;
int i;
diff --git a/contrib/groff/src/preproc/refer/refer.h b/contrib/groff/src/preproc/refer/refer.h
index e1e0c6d..ac871cf 100644
--- a/contrib/groff/src/preproc/refer/refer.h
+++ b/contrib/groff/src/preproc/refer/refer.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -72,6 +73,6 @@ void command_error(const char *,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
-struct reference;
+class reference;
void compute_labels(reference **, int);
diff --git a/contrib/groff/src/preproc/refer/refer.man b/contrib/groff/src/preproc/refer/refer.man
index d39d85d..0881657 100644
--- a/contrib/groff/src/preproc/refer/refer.man
+++ b/contrib/groff/src/preproc/refer/refer.man
@@ -1,5 +1,6 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,23 +17,37 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.
.de TQ
-.br
-.ns
-.TP \\$1
+. br
+. ns
+. TP \\$1
..
+.
+.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
+.
+.
..
.\" The BSD man macros can't handle " in arguments to font change macros,
.\" so use \(ts instead of ".
.tr \(ts"
+.
+.
.TH @G@REFER @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
+.
.SH NAME
@g@refer \- preprocess bibliographic references for groff
+.
+.
+.
.SH SYNOPSIS
.nr a \n(.j
.ad l
@@ -40,10 +55,12 @@ the original English.
.in +\w'\fB@g@refer 'u
.ti \niu
.B @g@refer
+.
.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
+. ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+. el .RB "[\ " "\\$1" "\ ]"
..
+.
.OP \-benvCPRS
.OP \-a n
.OP \-c fields
@@ -51,16 +68,20 @@ the original English.
.OP \-i fields
.OP \-k field
.OP \-l m,n
-.OP \-p filename
+.OP \-p \%filename
.OP \-s fields
.OP \-t n
.OP \-B field.macro
-.RI [\ filename \|.\|.\|.\ ]
+.RI [\ \%filename \|.\|.\|.\ ]
.br
.ad \na
-.PP
+.
+.LP
It is possible to have whitespace between a command line option and its
parameter.
+.
+.
+.
.SH DESCRIPTION
This file documents the GNU version of
.BR refer ,
@@ -72,13 +93,14 @@ to the standard output,
except that lines between
.B .[
and
-.B .]
+.B .]\&
are interpreted as citations,
and lines between
.B .R1
and
.B .R2
are interpreted as commands about how citations are to be processed.
+.
.LP
Each citation specifies a reference.
The citation can specify a reference that is contained in
@@ -87,6 +109,7 @@ that only that reference contains.
Alternatively it can specify a reference by supplying a database
record in the citation.
A combination of these alternatives is also possible.
+.
.LP
For each citation,
.B refer
@@ -111,14 +134,17 @@ or the references may be accumulated,
and the commands output at some later point.
If the references are accumulated, then multiple citations of the same
reference will produce a single formatted reference.
+.
.LP
The interpretation of lines between
.B .R1
and
.B .R2
-as commands is a new feature of GNU refer.
+as commands is a new feature of GNU
+.BR refer .
Documents making use of this feature can still be processed by
Unix refer just by adding the lines
+.
.RS
.LP
.nf
@@ -129,6 +155,7 @@ Unix refer just by adding the lines
.ft
.fi
.RE
+.
to the beginning of the document.
This will cause
.B troff
@@ -139,6 +166,7 @@ and
The effect of some commands can also be achieved by options.
These options are supported mainly for compatibility with Unix refer.
It is usually more convenient to use commands.
+.
.LP
.B refer
generates
@@ -154,110 +182,145 @@ so that filenames and line numbers in the messages and
lines that it produces will be accurate even if the input has been
preprocessed by a command such as
.BR @g@soelim (@MAN1EXT@).
+.
+.
+.
.SH OPTIONS
+.
.LP
Most options are equivalent to commands
(for a description of these commands see the
.B Commands
subsection):
+.
+.nr a \n(.j
+.ad l
.TP
.B \-b
-.B
-no-label-in-text; no-label-in-reference
+.B "no-label-in-text; no-label-in-reference"
+.
.TP
.B \-e
.B accumulate
+.
.TP
.B \-n
.B no-default-database
+.
.TP
.B \-C
.B compatible
+.
.TP
.B \-P
.B move-punctuation
+.
.TP
.B \-S
.B
-label "(A.n|Q) ', ' (D.y|D)"; bracket-label " (" ) "; "
+label\ "(A.n|Q)\ ',\ '\ (D.y|D)"; \%bracket-label\ "\ ("\ )\ ";\ "
+.
.TP
.BI \-a n
.B reverse
.BI A n
+.
.TP
.BI \-c fields
.B capitalize
.I fields
+.
.TP
.BI \-f n
.B label
.BI % n
+.
.TP
.BI \-i fields
.B search-ignore
.I fields
+.
.TP
.B \-k
.B label
.B L\(ti%a
+.
.TP
.BI \-k field
.B label
.IB field \(ti%a
+.
.TP
.B \-l
.B label
.BI A.nD.y%a
+.
.TP
.BI \-l m
.B label
.BI A.n+ m D.y%a
+.
.TP
.BI \-l, n
.B label
.BI A.nD.y\- n %a
+.
.TP
.BI \-l m , n
.B label
.BI A.n+ m D.y\- n %a
+.
.TP
.BI \-p filename
.B database
.I filename
+.
.TP
.BI \-s spec
.B sort
.I spec
+.
.TP
.BI \-t n
.B search-truncate
.I n
+.ad \na
+.
.LP
These options are equivalent to the following commands with the
addition that the filenames specified on the command line are
processed as if they were arguments to the
.B bibliography
command instead of in the normal way:
+.
.TP
.B \-B
-.B
-annotate X AP; no-label-in-reference
+.B "annotate X AP; no-label-in-reference"
+.
.TP
.BI \-B field . macro
.B annotate
.I field
.IB macro ;
.B no-label-in-reference
+.
.LP
The following options have no equivalent commands:
+.
.TP
.B \-v
Print the version number.
+.
.TP
.B \-R
Don't recognize lines beginning with
.BR .R1 / .R2 .
+.
+.
+.
.SH USAGE
+.
+.
.SS Bibliographic databases
The bibliographic database is a text file consisting of records
separated by one or more blank lines.
@@ -272,11 +335,12 @@ The name of the field should be followed by exactly one space,
and then by the contents of the field.
Empty fields are ignored.
The conventional meaning of each field is as follows:
+.
.TP
.B A
The name of an author.
If the name contains a title such as
-.B Jr.
+.B Jr.\&
at the end,
it should be separated from the last name by a comma.
There can be multiple occurrences of the
@@ -285,15 +349,18 @@ field.
The order is significant.
It is a good idea always to supply an
.B A
-field or a
+field or a
.B Q
field.
+.
.TP
.B B
For an article that is part of a book, the title of the book.
+.
.TP
.B C
The place (city) of publication.
+.
.TP
.B D
The date of publication.
@@ -308,6 +375,7 @@ if the date is unknown, a value such as
or
.B unknown
can be used.
+.
.TP
.B E
For an article that is part of a book, the name of an editor of the book.
@@ -319,33 +387,42 @@ fields and
or
.B ,\ (eds)
should be appended to the last author.
+.
.TP
.B G
US Government ordering number.
+.
.TP
.B I
The publisher (issuer).
+.
.TP
.B J
For an article in a journal, the name of the journal.
+.
.TP
.B K
Keywords to be used for searching.
+.
.TP
.B L
Label.
+.
.TP
.B N
Journal issue number.
+.
.TP
.B O
Other information.
This is usually printed at the end of the reference.
+.
.TP
.B P
Page number.
A range of pages can be specified as
.IB m \- n\fR.
+.
.TP
.B Q
The name of the author, if the author is not a person.
@@ -355,23 +432,29 @@ fields.
There can only be one
.B Q
field.
+.
.TP
.B R
Technical report number.
+.
.TP
.B S
Series name.
+.
.TP
.B T
Title.
For an article in a book or journal,
this should be the title of the article.
+.
.TP
.B V
Volume number of the journal or book.
+.
.TP
.B X
Annotation.
+.
.LP
For all fields except
.B A
@@ -379,6 +462,7 @@ and
.BR E ,
if there is more than one occurrence of a particular field in a record,
only the last such field will be used.
+.
.LP
If accent strings are used, they should follow the character to be accented.
This means that the
@@ -390,18 +474,21 @@ Accent strings should not be quoted:
use one
.B \e
rather than two.
+.
+.
.SS Citations
The format of a citation is
+.
.RS
.BI .[ opening-text
.br
-.I
-flags keywords
+.I "flags keywords"
.br
.I fields
.br
.BI .] closing-text
.RE
+.
.LP
The
.IR opening-text ,
@@ -414,6 +501,7 @@ Only one of the
and
.I fields
components need be specified.
+.
.LP
The
.I keywords
@@ -421,6 +509,7 @@ component says to search the bibliographic databases for a reference
that contains all the words in
.IR keywords .
It is an error if more than one reference if found.
+.
.LP
The
.I fields
@@ -432,6 +521,7 @@ component is non-empty,
then additional fields should be specified only on the first
occasion that a particular reference is cited,
and will apply to all citations of that reference.
+.
.LP
The
.I opening-text
@@ -451,6 +541,7 @@ and
.B ]
flags.
Note that leading and trailing spaces are significant for these components.
+.
.LP
The
.I flags
@@ -460,6 +551,7 @@ of this particular citation.
Unix refer will treat these flags as part of the keywords and
so will ignore them since they are non-alphanumeric.
The following flags are currently recognized:
+.
.TP
.B #
This says to use the label specified by the
@@ -474,6 +566,7 @@ and consists of only the date and possibly a disambiguating letter;
the
.B #
is supposed to be suggestive of a numeric type of label.
+.
.TP
.B [
Precede
@@ -481,6 +574,7 @@ Precede
with the first string specified in the
.B bracket-label
command.
+.
.TP
.B ]
Follow
@@ -488,6 +582,7 @@ Follow
with the second string specified in the
.B bracket-label
command.
+.
.LP
One advantages of using the
.B [
@@ -503,6 +598,7 @@ you can change the style of bracket used in the document just by changing the
command.
Another advantage is that sorting and merging of citations
will not necessarily be inhibited if the flags are used.
+.
.LP
If a label is to be inserted into the text,
it will be attached to the line preceding the
@@ -511,6 +607,7 @@ line.
If there is no such line, then an extra line will be inserted before the
.B .[
line and a warning will be given.
+.
.LP
There is no special notation for making a citation to multiple references.
Just use a sequence of citations, one for each reference.
@@ -546,6 +643,8 @@ is non-empty.
(If you wish to prevent this just make the first citation's
.I closing-text
.BR \e& .)
+.
+.
.SS Commands
Commands are contained between lines starting with
.B .R1
@@ -564,8 +663,9 @@ nor
lines,
nor anything between them
is output.
+.
.LP
-Commands are separated by newlines or
+Commands are separated by newlines or
.BR ; s.
.B #
introduces a comment that extends to the end of the line
@@ -597,6 +697,7 @@ A line can be continued by ending it with
.BR \e ;
this works everywhere except after a
.BR # .
+.
.LP
.ds n \fR*
Each command
@@ -609,6 +710,7 @@ For example, the
.B no-sort
command specifies that references should not be sorted.
The negative commands take no arguments.
+.
.LP
In the following description each argument must be a single word;
.I field
@@ -623,6 +725,7 @@ are used for a non-negative numbers;
is used for an arbitrary string;
.I filename
is used for the name of a file.
+.
.Tp \w'\fBabbreviate-label-ranges'u+2n
.BI abbreviate\*n\ fields\ string1\ string2\ string3\ string4
Abbreviate the first names of
@@ -647,6 +750,7 @@ No attempt is made to handle any ambiguities that might
result from abbreviation.
Names are abbreviated before sorting and before
label construction.
+.
.TP
.BI abbreviate-label-ranges\*n\ string
Three or more adjacent labels that refer to consecutive references
@@ -659,12 +763,14 @@ If
.I string
is omitted it defaults to
.BR \- .
+.
.TP
.B accumulate\*n
Accumulate references instead of writing out each reference
as it is encountered.
Accumulated references will be written out whenever a reference
of the form
+.
.RS
.IP
.B .[
@@ -672,6 +778,7 @@ of the form
.B $LIST$
.br
.B .]
+.
.LP
is encountered,
after all input files hve been processed,
@@ -679,14 +786,17 @@ and whenever
.B .R1
line is recognized.
.RE
+.
.TP
.BI annotate\*n\ field\ string
.I field
is an annotation;
print it at the end of the reference as a paragraph preceded by the line
+.
.RS
.IP
.BI . string
+.
.LP
If
.I macro
@@ -698,9 +808,10 @@ is also omitted it will default to
.BR X .
Only one field can be an annotation.
.RE
+.
.TP
-.BI articles\ string \fR\|.\|.\|.
-.IR string \|.\|.\|.
+.BI articles\ string \fR\|.\|.\|.
+.IR string \|.\|.\|.\&
are definite or indefinite articles, and should be ignored at the beginning of
.B T
fields when sorting.
@@ -709,11 +820,16 @@ Initially,
.B a
and
.B an
-are recognized as articles.
+are recognized as articles.
+.
.TP
.BI bibliography\ filename \fR\|.\|.\|.
Write out all the references contained in the bibliographic databases
.IR filename \|.\|.\|.
+This command should come last in a
+.BR .R1 / .R2
+block.
+.
.TP
.BI bracket-label\ string1\ string2\ string3
In the text, bracket each label
@@ -728,16 +844,19 @@ immediately followed by
will be turned into
.IR string3 .
The default behaviour is
+.
.RS
.IP
.B
bracket-label \e*([. \e*(.] ", "
.RE
+.
.TP
.BI capitalize\ fields
Convert
.I fields
to caps and small caps.
+.
.TP
.B compatible\*n
Recognize
@@ -745,6 +864,7 @@ Recognize
and
.B .R2
even when followed by a character other than space or newline.
+.
.TP
.BI database\ filename \fR\|.\|.\|.
Search the bibliographic databases
@@ -757,6 +877,7 @@ created by
.BR @g@indxbib (@MAN1EXT@)
exists, then it will be searched instead;
each index can cover multiple databases.
+.
.TP
.BI date-as-label\*n\ string
.I string
@@ -775,26 +896,30 @@ In most cases you should also use the
.B no-label-in-reference
command.
For example,
+.
.RS
.IP
-.B
-date-as-label D.+yD.y%a*D.-y
+.B "date-as-label D.+yD.y%a*D.-y"
+.
.LP
would attach a disambiguating letter to the year part of the
.B D
field in the reference.
.RE
+.
.TP
.B default-database\*n
The default database should be searched.
This is the default behaviour, so the negative version of
this command is more useful.
-refer determines whether the default database should be searched
+.B refer
+determines whether the default database should be searched
on the first occasion that it needs to do a search.
Thus a
.B no-default-database
command must be given before then,
in order to be effective.
+.
.TP
.BI discard\*n\ fields
When the reference is read,
@@ -807,11 +932,11 @@ Initially,
.I fields
are
.BR XYZ .
+.
.TP
.BI et-al\*n\ string\ m\ n
Control use of
-.B
-et al
+.B "et al"
in the evaluation of
.B @
expressions in label expressions.
@@ -833,16 +958,19 @@ and
is not less than
.IR n .
The default behaviour is
+.
.RS
.IP
.B
et-al " et al" 2 3
.RE
+.
.TP
.BI include\ filename
Include
.I filename
and interpret the contents as commands.
+.
.TP
.BI join-authors\ string1\ string2\ string3
This says how authors should be joined together.
@@ -863,13 +991,16 @@ if
is also omitted it will also default to
.IR string1 .
For example,
+.
.RS
.IP
.B
join-authors " and " ", " ", and "
+.
.LP
will restore the default method for joining authors.
.RE
+.
.TP
.B label-in-reference\*n
When outputting the reference,
@@ -878,6 +1009,7 @@ define the string
to be the reference's label.
This is the default behaviour; so the negative version
of this command is more useful.
+.
.TP
.B label-in-text\*n
For each reference output a label in the text.
@@ -886,10 +1018,12 @@ The label will be separated from the surrounding text as described in the
command.
This is the default behaviour; so the negative version
of this command is more useful.
+.
.TP
.BI label\ string
.I string
is a label expression describing how to label each reference.
+.
.TP
.BI separate-label-second-parts\ string
When merging two-part labels, separate the second part of the second
@@ -898,11 +1032,13 @@ label from the first label with
See the description of the
.B <>
label expression.
+.
.TP
.B move-punctuation\*n
In the text, move any punctuation at the end of line past the label.
It is usually a good idea to give this command unless you are using
superscripted numbers as labels.
+.
.TP
.BI reverse\*n\ string
Reverse the fields whose names
@@ -911,6 +1047,7 @@ are in
Each field name can be followed by a number which says
how many such fields should be reversed.
If no number is given for a field, all such fields will be reversed.
+.
.TP
.BI search-ignore\*n\ fields
While searching for keys in databases for which no index exists,
@@ -919,6 +1056,7 @@ ignore the contents of
Initially, fields
.B XYZ
are ignored.
+.
.TP
.BI search-truncate\*n\ n
Only require the first
@@ -930,7 +1068,8 @@ words in the database are truncated to the maximum of
and the length of the key.
Initially
.I n
-is 6.
+is\ 6.
+.
.TP
.BI short-label\*n\ string
.I string
@@ -946,6 +1085,7 @@ The
.B short-label
command will typically be used to specify a label containing just
a date and possibly a disambiguating letter.
+.
.TP
.BI sort\*n\ string
Sort references according to
@@ -956,14 +1096,14 @@ should be a list of field names, each followed by a number,
indicating how many fields with the name should be used for sorting.
.B +
can be used to indicate that all the fields with the name should be used.
-Also
-.B .
+Also
+.B .\&
can be used to indicate the references should be sorted using the
(tentative) label.
(The
-.B
-Label expressions
+.B "Label expressions"
subsection describes the concept of a tentative label.)
+.
.TP
.B sort-adjacent-labels\*n
Sort labels that are adjacent in the text according to their
@@ -975,13 +1115,15 @@ or if the label expression contains a
.B <>
expression.
This will have no effect unless references are being accumulated.
+.
+.
.SS Label expressions
+.
.LP
-Label expressions can be evaluated both normally and tentatively.
-The result of normal evaluation is used for output.
+Label expressions can be evaluated both normally and tentatively.
+The result of normal evaluation is used for output.
The result of tentative evaluation, called the
-.I
-tentative label,
+.IR "tentative label" ,
is used to gather the information
that normal evaluation needs to disambiguate the label.
Label expressions specified by the
@@ -995,9 +1137,10 @@ of expression other than
.BR * ,
and
.B %
-expressions.
+expressions.
The description below applies to normal evaluation,
-except where otherwise specified.
+except where otherwise specified.
+.
.TP
.I field
.TQ
@@ -1005,15 +1148,17 @@ except where otherwise specified.
The
.IR n -th
part of
-.IR field .
+.IR field .
If
.I n
-is omitted, it defaults to 1.
+is omitted, it defaults to\ 1.
+.
.TP
.BI ' string '
The characters in
.I string
-literally.
+literally.
+.
.TP
.B @
All the authors joined as specified by the
@@ -1056,6 +1201,7 @@ met before an initial subsequence can be used.
tentatively evaluates to a canonical representation of the authors,
such that authors that compare equally for sorting purpose
will have the same representation.
+.
.TP
.BI % n
.TQ
@@ -1068,10 +1214,11 @@ will have the same representation.
.B %I
The serial number of the reference formatted according to the character
following the
-.BR % .
-The serial number of a reference is 1 plus the number of earlier references
+.BR % .
+The serial number of a reference is\ 1 plus the number of earlier references
with same tentative label as this reference.
These expressions tentatively evaluate to an empty string.
+.
.TP
.IB expr *
If there is another reference with the same tentative label as
@@ -1079,6 +1226,7 @@ this reference, then
.IR expr ,
otherwise an empty string.
It tentatively evaluates to an empty string.
+.
.TP
.IB expr + n
.TQ
@@ -1094,22 +1242,27 @@ Troff special characters (such as
.BR \e('a )
count as a single letter.
Accent strings are retained but do not count towards the total.
+.
.TP
.IB expr .l
.I expr
-converted to lowercase.
+converted to lowercase.
+.
.TP
.IB expr .u
.I expr
-converted to uppercase.
+converted to uppercase.
+.
.TP
.IB expr .c
.I expr
-converted to caps and small caps.
+converted to caps and small caps.
+.
.TP
.IB expr .r
.I expr
reversed so that the last name is first.
+.
.TP
.IB expr .a
.I expr
@@ -1121,10 +1274,12 @@ Thus
.B .a
is useful only when you want a field to be abbreviated in a label
but not in a reference.
+.
.TP
.IB expr .y
The year part of
-.IR expr .
+.IR expr .
+.
.TP
.IB expr .+y
The part of
@@ -1132,6 +1287,7 @@ The part of
before the year, or the whole of
.I expr
if it does not contain a year.
+.
.TP
.IB expr .\-y
The part of
@@ -1139,10 +1295,12 @@ The part of
after the year, or an empty string if
.I expr
does not contain a year.
+.
.TP
.IB expr .n
The last name part of
-.IR expr .
+.IR expr .
+.
.TP
.IB expr1 \(ti expr2
.I expr1
@@ -1151,13 +1309,15 @@ except that if the last character of
is
.B \-
then it will be replaced by
-.IR expr2 .
+.IR expr2 .
+.
.TP
.I expr1\ expr2
The concatenation of
.I expr1
and
-.IR expr2 .
+.IR expr2 .
+.
.TP
.IB expr1 | expr2
If
@@ -1165,7 +1325,8 @@ If
is non-empty then
.I expr1
otherwise
-.IR expr2 .
+.IR expr2 .
+.
.TP
.IB expr1 & expr2
If
@@ -1174,6 +1335,7 @@ is non-empty
then
.I expr2
otherwise an empty string.
+.
.TP
.IB expr1 ? expr2 : expr3
If
@@ -1182,7 +1344,8 @@ is non-empty
then
.I expr2
otherwise
-.IR expr3 .
+.IR expr3 .
+.
.TP
.BI < expr >
The label is in two parts, which are separated by
@@ -1198,11 +1361,13 @@ Note that it is permissible for the first part to be empty;
this maybe desirable for expressions used in the
.B short-label
command.
+.
.TP
.BI ( expr )
The same as
.IR expr .
Used for grouping.
+.
.LP
The above expressions are listed in order of precedence
(highest first);
@@ -1210,6 +1375,8 @@ The above expressions are listed in order of precedence
and
.B |
have the same precedence.
+.
+.
.SS Macro interface
Each reference starts with a call to the macro
.BR ]- .
@@ -1227,7 +1394,7 @@ corresponds to field
.IR X .
The number register
.B [P
-is set to 1 if the
+is set to\ 1 if the
.B P
field contains a range of pages.
The
@@ -1235,7 +1402,7 @@ The
.B [A
and
.B [O
-number registers are set to 1 according as the
+number registers are set to\ 1 according as the
.BR T ,
.B A
and
@@ -1244,7 +1411,7 @@ fields end with one of the characters
.BR .?! .
The
.B [E
-number register will be set to 1 if the
+number register will be set to\ 1 if the
.B [E
string contains more than one name.
The reference is followed by a call to the
@@ -1254,19 +1421,19 @@ The first argument to this macro gives a number representing
the type of the reference.
If a reference contains a
.B J
-field, it will be classified as type 1,
+field, it will be classified as type\ 1,
otherwise if it contains a
.B B
-field, it will type 3,
+field, it will type\ 3,
otherwise if it contains a
.B G
or
.B R
-field it will be type 4,
+field it will be type\ 4,
otherwise if contains a
.B I
-field it will be type 2,
-otherwise it will be type 0.
+field it will be type\ 2,
+otherwise it will be type\ 0.
The second argument is a symbolic name for the type:
.BR other ,
.BR journal-article ,
@@ -1282,22 +1449,37 @@ command are preceded by a call to the
macro and followed by a call to the
.B ]>
macro.
+.
+.
+.
.SH FILES
+.
.Tp \w'\fB@DEFAULT_INDEX@'u+2n
.B @DEFAULT_INDEX@
Default database.
+.
.TP
.IB file @INDEX_SUFFIX@
Index files.
+.
+.
+.
.SH ENVIRONMENT
+.
.Tp \w'\fBREFER'u+2n
.B REFER
If set, overrides the default database.
+.
+.
+.
.SH "SEE ALSO"
.BR @g@indxbib (@MAN1EXT@),
.BR @g@lookbib (@MAN1EXT@),
.BR lkbib (@MAN1EXT@)
.br
+.
+.
+.
.SH BUGS
In label expressions,
.B <>
diff --git a/contrib/groff/src/preproc/refer/token.cpp b/contrib/groff/src/preproc/refer/token.cpp
index e9fac5d..1eb3006 100644
--- a/contrib/groff/src/preproc/refer/token.cpp
+++ b/contrib/groff/src/preproc/refer/token.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "refer.h"
#include "token.h"
diff --git a/contrib/groff/src/preproc/refer/token.h b/contrib/groff/src/preproc/refer/token.h
index 6da430d..7d34049 100644
--- a/contrib/groff/src/preproc/refer/token.h
+++ b/contrib/groff/src/preproc/refer/token.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
enum token_type {
TOKEN_OTHER,
diff --git a/contrib/groff/src/preproc/soelim/Makefile.sub b/contrib/groff/src/preproc/soelim/Makefile.sub
index a43dfc2..2e15c00 100644
--- a/contrib/groff/src/preproc/soelim/Makefile.sub
+++ b/contrib/groff/src/preproc/soelim/Makefile.sub
@@ -1,6 +1,7 @@
PROG=soelim$(EXEEXT)
MAN1=soelim.n
XLIBS=$(LIBGROFF)
+MLIB=$(LIBM)
OBJS=soelim.$(OBJEXT)
CCSRCS=$(srcdir)/soelim.cpp
NAMEPREFIX=$(g)
diff --git a/contrib/groff/src/preproc/soelim/soelim.cpp b/contrib/groff/src/preproc/soelim/soelim.cpp
index 96ad6dd..235dfe6 100644
--- a/contrib/groff/src/preproc/soelim/soelim.cpp
+++ b/contrib/groff/src/preproc/soelim/soelim.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-1992, 2000, 2001, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -28,38 +29,20 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "error.h"
#include "stringclass.h"
#include "nonposix.h"
+#include "searchpath.h"
-static size_t include_list_length;
-static const char **include_list;
+// The include search path initially contains only the current directory.
+static search_path include_search_path(0, 0, 0, 1);
int compatible_flag = 0;
int raw_flag = 0;
int tex_flag = 0;
-extern int interpret_lf_args(const char *);
extern "C" const char *Version_string;
int do_file(const char *filename);
-static void
-include_path_append(const char *path)
-{
- ++include_list_length;
- size_t nbytes = include_list_length * sizeof(char *);
- if (include_list)
- include_list = (const char **)realloc((void *)include_list, nbytes);
- else
- include_list = (const char **)malloc(nbytes);
- if (include_list == NULL)
- {
- fprintf(stderr, "%s: out of memory\n", program_name);
- exit(2);
- }
- include_list[include_list_length - 1] = path;
-}
-
-
void usage(FILE *stream)
{
fprintf(stream, "usage: %s [ -Crtv ] [ -I file ] [ files ]\n", program_name);
@@ -68,7 +51,6 @@ void usage(FILE *stream)
int main(int argc, char **argv)
{
program_name = argv[0];
- include_path_append(".");
int opt;
static const struct option long_options[] = {
{ "help", no_argument, 0, CHAR_MAX + 1 },
@@ -87,7 +69,7 @@ int main(int argc, char **argv)
compatible_flag = 1;
break;
case 'I':
- include_path_append(optarg);
+ include_search_path.command_line_dir(optarg);
break;
case 'r':
raw_flag = 1;
@@ -172,49 +154,16 @@ void do_so(const char *line)
int do_file(const char *filename)
{
- FILE *fp;
- string whole_filename;
- if (strcmp(filename, "-") == 0) {
- fp = stdin;
- whole_filename = filename;
- whole_filename += '\0';
- }
- else if (IS_ABSOLUTE(filename)) {
- whole_filename = filename;
- whole_filename += '\0';
- errno = 0;
- fp = fopen(filename, "r");
- if (fp == 0) {
- error("can't open `%1': %2", filename, strerror(errno));
- return 0;
- }
- }
- else {
- size_t j;
- for (j = 0; j < include_list_length; ++j)
- {
- const char *path = include_list[j];
- if (0 == strcmp(path, "."))
- whole_filename = filename;
- else
- whole_filename = string(path) + "/" + filename;
- whole_filename += '\0';
- errno = 0;
- fp = fopen(whole_filename.contents(), "r");
- if (fp != 0)
- break;
- if (errno != ENOENT) {
- error("can't open `%1': %2",
- whole_filename.contents(), strerror(errno));
- return 0;
- }
- }
- if (j >= include_list_length)
- {
- errno = ENOENT;
- error("can't open `%1': %2", filename, strerror(errno));
- return 0;
- }
+ char *file_name_in_path = 0;
+ FILE *fp = include_search_path.open_file_cautious(filename,
+ &file_name_in_path);
+ int err = errno;
+ string whole_filename(file_name_in_path ? file_name_in_path : filename);
+ whole_filename += '\0';
+ a_delete file_name_in_path;
+ if (fp == 0) {
+ error("can't open `%1': %2", whole_filename.contents(), strerror(err));
+ return 0;
}
current_filename = whole_filename.contents();
current_lineno = 1;
diff --git a/contrib/groff/src/preproc/soelim/soelim.man b/contrib/groff/src/preproc/soelim/soelim.man
index 7663e3b..fb17e36 100644
--- a/contrib/groff/src/preproc/soelim/soelim.man
+++ b/contrib/groff/src/preproc/soelim/soelim.man
@@ -1,5 +1,6 @@
+'\" p
.ig
-Copyright (C) 1989-2000, 2001, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,6 +17,9 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.mso pic.tmac
+.
.TH @G@SOELIM @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
.
.SH NAME
@@ -80,7 +84,7 @@ even when followed by a character other than space or newline.
This option may be used to specify a directory to search for
files (both those on the command line and those named in
.B \&.so
-lines).
+requests).
The current directory is always searched first.
This option may be specified more than once,
the directories will be searched in the order specified.
@@ -99,6 +103,111 @@ the current file and line number.
.B \-v
Print the version number.
.
+.SH USAGE
+The normal processing sequence of groff is this:
+.
+.PP
+.ie t \{\
+.PS
+box invisible width 0.5 height 0.4 "input" "file";
+move to last box .bottom;
+down;
+arrow 0.3;
+box invisible width 0.8 height 0.2 "preprocessor";
+move to last box .right
+right;
+arrow 0.3;
+A: box invisible width 0.35 height 0.2 "troff";
+move to last box .top;
+up;
+move 0.3;
+box invisible width 0.6 height 0.4 "sourced" "file";
+line <- up 0.3 from A.top;
+move to A.right;
+right;
+arrow 0.3;
+box invisible width 0.85 height 0.2 "postprocessor";
+move to last box .bottom;
+down;
+arrow 0.3;
+box invisible width 0.5 height 0.4 "output" "file"
+.PE
+.\}
+.el \{\
+.nf
+ input sourced
+ file file
+ | |
+ v v
+ preprocessor -> troff -> postprocessor
+ |
+ v
+ output
+ file
+.fi
+.\}
+.PP
+.
+That is, files sourced with
+.B .so
+are normally read
+.I only
+by
+.B troff
+(the actual formatter).
+.B soelim
+is
+.I not
+required for
+.B troff
+to source files.
+.
+.PP
+If a file to be sourced should also be preprocessed, it must
+already be read
+.I before
+the input file passes through the preprocessor.
+This is handled by
+.BR soelim :
+.
+.PP
+.ie t \{\
+.PS
+box invisible width 0.5 height 0.4 "input" "file";
+move to last box .bottom;
+down;
+arrow 0.3;
+A: box invisible width 0.5 height 0.2 "soelim";
+line <- 0.3;
+box invisible width 0.5 height 0.4 "sourced" "file";
+move to A.right;
+right;
+arrow 0.3;
+box invisible width 0.8 height 0.2 "preprocessor";
+arrow 0.3;
+box invisible width 0.35 height 0.2 "troff";
+arrow 0.3
+box invisible width 0.85 height 0.2 "postprocessor";
+move to last box .bottom;
+down;
+arrow 0.3;
+box invisible width 0.5 height 0.4 "output" "file"
+.PE
+.\}
+.el \{\
+.nf
+ input
+ file
+ |
+ v
+ soelim -> preprocessor -> troff -> postprocessor
+ ^ |
+ | v
+ sourced output
+ file file
+.fi
+.\}
+.
.SH "SEE ALSO"
.BR groff (@MAN1EXT@)
.
diff --git a/contrib/groff/src/preproc/tbl/Makefile.sub b/contrib/groff/src/preproc/tbl/Makefile.sub
index 8decd31..bea28b3 100644
--- a/contrib/groff/src/preproc/tbl/Makefile.sub
+++ b/contrib/groff/src/preproc/tbl/Makefile.sub
@@ -1,6 +1,7 @@
PROG=tbl$(EXEEXT)
MAN1=tbl.n
XLIBS=$(LIBGROFF)
+MLIB=$(LIBM)
OBJS=\
main.$(OBJEXT) \
table.$(OBJEXT)
diff --git a/contrib/groff/src/preproc/tbl/main.cpp b/contrib/groff/src/preproc/tbl/main.cpp
index fe3aabf..d79adb0 100644
--- a/contrib/groff/src/preproc/tbl/main.cpp
+++ b/contrib/groff/src/preproc/tbl/main.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "table.h"
@@ -26,11 +26,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern "C" const char *Version_string;
-static int compatible_flag = 0;
+int compatible_flag = 0;
class table_input {
FILE *fp;
- enum { START, MIDDLE, REREAD_T, REREAD_TE, REREAD_E, END, ERROR } state;
+ enum { START, MIDDLE,
+ REREAD_T, REREAD_TE, REREAD_E,
+ LEADER_1, LEADER_2, LEADER_3, LEADER_4,
+ END, ERROR } state;
string unget_stack;
public:
table_input(FILE *);
@@ -117,11 +120,15 @@ int table_input::get()
}
break;
case MIDDLE:
- // handle line continuation
+ // handle line continuation and uninterpreted leader character
if ((c = getc(fp)) == '\\') {
c = getc(fp);
if (c == '\n')
c = getc(fp); // perhaps state ought to be START now
+ else if (c == 'a' && compatible_flag) {
+ state = LEADER_1;
+ return '\\';
+ }
else {
if (c != EOF)
ungetc(c, fp);
@@ -152,6 +159,18 @@ int table_input::get()
case REREAD_E:
state = MIDDLE;
return 'E';
+ case LEADER_1:
+ state = LEADER_2;
+ return '*';
+ case LEADER_2:
+ state = LEADER_3;
+ return '(';
+ case LEADER_3:
+ state = LEADER_4;
+ return PREFIX_CHAR;
+ case LEADER_4:
+ state = MIDDLE;
+ return LEADER_CHAR;
case END:
case ERROR:
return EOF;
@@ -573,6 +592,11 @@ void entry_format::debug_print() const
put_string(font, stderr);
putc(' ', stderr);
}
+ if (!macro.empty()) {
+ putc('m', stderr);
+ put_string(macro, stderr);
+ putc(' ', stderr);
+ }
switch (vertical_alignment) {
case entry_modifier::CENTER:
break;
@@ -886,6 +910,40 @@ format *process_format(table_input &in, options *opt,
}
}
break;
+ case 'x':
+ case 'X':
+ do {
+ c = in.get();
+ } while (c == ' ' || c == '\t');
+ if (c == EOF) {
+ error("missing macro name");
+ break;
+ }
+ if (c == '(') {
+ for (;;) {
+ c = in.get();
+ if (c == EOF || c == ' ' || c == '\t') {
+ error("missing `)'");
+ break;
+ }
+ if (c == ')') {
+ c = in.get();
+ break;
+ }
+ list->macro += char(c);
+ }
+ }
+ else {
+ list->macro = c;
+ char cc = c;
+ c = in.get();
+ if (!csdigit(cc)
+ && c != EOF && c != ' ' && c != '\t' && c != '.' && c != '\n') {
+ list->macro += char(c);
+ c = in.get();
+ }
+ }
+ break;
case 'v':
case 'V':
c = in.get();
@@ -1184,9 +1242,9 @@ table *process_data(table_input &in, format *f, options *opt)
format_index = f->nrows - 1;
// A format row that is all lines doesn't use up a data line.
while (format_index < f->nrows - 1) {
- int c;
- for (c = 0; c < ncolumns; c++) {
- entry_format *e = f->entry[format_index] + c;
+ int cnt;
+ for (cnt = 0; cnt < ncolumns; cnt++) {
+ entry_format *e = f->entry[format_index] + cnt;
if (e->type != FORMAT_HLINE
&& e->type != FORMAT_DOUBLE_HLINE
// Unfortunately tbl treats a span as needing data.
@@ -1194,11 +1252,11 @@ table *process_data(table_input &in, format *f, options *opt)
)
break;
}
- if (c < ncolumns)
+ if (cnt < ncolumns)
break;
- for (c = 0; c < ncolumns; c++)
- tbl->add_entry(current_row, c, input_entry,
- f->entry[format_index] + c, current_filename,
+ for (cnt = 0; cnt < ncolumns; cnt++)
+ tbl->add_entry(current_row, cnt, input_entry,
+ f->entry[format_index] + cnt, current_filename,
current_lineno);
tbl->add_vlines(current_row, f->vline[format_index]);
format_index++;
@@ -1295,13 +1353,19 @@ table *process_data(table_input &in, format *f, options *opt)
}
break;
case GOT_RIGHT_BRACE:
+ if ((opt->flags & table::NOSPACES)) {
+ while (c == ' ')
+ c = in.get();
+ if (c == EOF)
+ break;
+ }
if (c == '\n' || c == tab_char)
state = END;
else {
input_entry += 'T';
input_entry += '}';
input_entry += c;
- state = c == '\n' ? START : MIDDLE;
+ state = MIDDLE;
}
break;
case MIDDLE:
@@ -1428,7 +1492,6 @@ table *process_data(table_input &in, format *f, options *opt)
void process_table(table_input &in)
{
- int c;
options *opt = 0;
format *form = 0;
table *tbl = 0;
@@ -1440,7 +1503,7 @@ void process_table(table_input &in)
}
else {
error("giving up on this table");
- while ((c = in.get()) != EOF)
+ while (in.get() != EOF)
;
}
delete opt;
@@ -1504,10 +1567,8 @@ int main(int argc, char **argv)
else {
errno = 0;
FILE *fp = fopen(argv[i], "r");
- if (fp == 0) {
- current_lineno = -1;
- error("can't open `%1': %2", argv[i], strerror(errno));
- }
+ if (fp == 0)
+ fatal("can't open `%1': %2", argv[i], strerror(errno));
else {
current_lineno = 1;
current_filename = argv[i];
diff --git a/contrib/groff/src/preproc/tbl/table.cpp b/contrib/groff/src/preproc/tbl/table.cpp
index 32068c3..8312386 100644
--- a/contrib/groff/src/preproc/tbl/table.cpp
+++ b/contrib/groff/src/preproc/tbl/table.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "table.h"
@@ -30,7 +30,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
const int DEFAULT_COLUMN_SEPARATION = 3;
#define DELIMITER_CHAR "\\[tbl]"
-#define PREFIX "3"
#define SEPARATION_FACTOR_REG PREFIX "sep"
#define BOTTOM_REG PREFIX "bot"
#define RESET_MACRO_NAME PREFIX "init"
@@ -64,6 +63,8 @@ const int DEFAULT_COLUMN_SEPARATION = 3;
// this must be one character
#define COMPATIBLE_REG PREFIX "c"
+#define LEADER_REG PREFIX LEADER
+
#define BLOCK_WIDTH_PREFIX PREFIX "tbw"
#define BLOCK_DIVERSION_PREFIX PREFIX "tbd"
#define BLOCK_HEIGHT_PREFIX PREFIX "tbh"
@@ -128,14 +129,14 @@ void prints(const string &s)
struct horizontal_span {
horizontal_span *next;
- short start_col;
- short end_col;
+ int start_col;
+ int end_col;
horizontal_span(int, int, horizontal_span *);
};
-struct single_line_entry;
-struct double_line_entry;
-struct simple_entry;
+class single_line_entry;
+class double_line_entry;
+class simple_entry;
class table_entry {
friend class table;
@@ -145,8 +146,8 @@ friend class table;
protected:
int start_row;
int end_row;
- short start_col;
- short end_col;
+ int start_col;
+ int end_col;
const entry_modifier *mod;
public:
void set_location();
@@ -687,8 +688,8 @@ void block_entry::do_divert(int alphabetic, int ncols, const string *mw,
if (alphabetic)
prints("-2n");
prints("\n");
- set_modifier(mod);
prints(".cp \\n(" COMPATIBLE_REG "\n");
+ set_modifier(mod);
set_location();
prints(contents);
prints(".br\n.di\n.cp 0\n");
@@ -965,6 +966,8 @@ void set_modifier(const entry_modifier *m)
prints('-');
printfs("%1\n", as_string(m->vertical_spacing.val));
}
+ if (!m->macro.empty())
+ printfs(".%1\n", m->macro);
}
void set_inline_modifier(const entry_modifier *m)
@@ -1088,7 +1091,7 @@ struct vertical_rule {
vertical_rule *next;
int start_row;
int end_row;
- short col;
+ int col;
char is_double;
string top_adjust;
string bot_adjust;
@@ -1693,6 +1696,8 @@ void table::init_output()
prints(".nr " LINESIZE_REG " \\n[.s]\n");
if (!(flags & CENTER))
prints(".nr " SAVED_CENTER_REG " \\n[.ce]\n");
+ if (compatible_flag)
+ prints(".ds " LEADER_REG " \\a\n");
prints(".de " RESET_MACRO_NAME "\n"
".ft \\n[.f]\n"
".ps \\n[.s]\n"
@@ -2602,8 +2607,14 @@ void table::do_row(int r)
if (e) {
if (e->end_row == r && e->start_row == i) {
simple_entry *simple = e->to_simple_entry();
- if (simple)
+ if (simple) {
+ if (e->end_row != e->start_row) {
+ prints('\n');
+ simple->position_vertically();
+ prints("\\&");
+ }
simple->simple_print(0);
+ }
}
c = e->end_col;
}
diff --git a/contrib/groff/src/preproc/tbl/table.h b/contrib/groff/src/preproc/tbl/table.h
index 69959b8..4b2497e 100644
--- a/contrib/groff/src/preproc/tbl/table.h
+++ b/contrib/groff/src/preproc/tbl/table.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -32,6 +32,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "errarg.h"
#include "error.h"
+// PREFIX and PREFIX_CHAR must be the same.
+#define PREFIX "3"
+#define PREFIX_CHAR '3'
+
+// LEADER and LEADER_CHAR must be the same.
+#define LEADER "a"
+#define LEADER_CHAR 'a'
+
struct inc_number {
short inc;
short val;
@@ -41,6 +49,7 @@ struct entry_modifier {
inc_number point_size;
inc_number vertical_spacing;
string font;
+ string macro;
enum { CENTER, TOP, BOTTOM } vertical_alignment;
char zero_width;
char stagger;
@@ -69,7 +78,7 @@ struct entry_format : public entry_modifier {
void debug_print() const;
};
-struct table_entry;
+class table_entry;
struct horizontal_span;
struct stuff;
struct vertical_rule;
@@ -152,3 +161,5 @@ public:
};
void set_troff_location(const char *, int);
+
+extern int compatible_flag;
diff --git a/contrib/groff/src/preproc/tbl/tbl.man b/contrib/groff/src/preproc/tbl/tbl.man
index 7f12bf9..00dfe4f 100644
--- a/contrib/groff/src/preproc/tbl/tbl.man
+++ b/contrib/groff/src/preproc/tbl/tbl.man
@@ -1,5 +1,6 @@
.ig
-Copyright (C) 1989-1995, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1989-1995, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -62,11 +63,13 @@ will cause the standard input to be read.
.SH OPTIONS
.TP
.B \-C
-Recognize
+Enable compatibility mode to
+recognize
.B .TS
and
.B .TE
even when followed by a character other than space or newline.
+Leader characters (\[rs]a) are handled as interpreted.
.TP
.B \-v
Print the version number.
@@ -287,6 +290,33 @@ If used multiple times to specify the width for a particular column,
the last entry takes effect.
.
.TP
+x,X
+This is a GNU tbl extension.
+Either of these specifiers may be followed by a macro name
+(either one or two characters long),
+or long name in parentheses.
+A one-letter macro name must be separated by one or more blanks
+from whatever follows.
+The macro which name can be specified here
+must be defined before creating the table.
+It is called just before the table's cell text is output.
+As implemented currently, this macro is only called if block input is used,
+that is, text between `T{' and `T}'.
+The macro should contain only simple
+.B troff
+requests to change the text block formatting, like text adjustment,
+hyphenation, size, or font.
+The macro is called
+.I after
+other cell modifications like
+.BR b ,
+.B f
+or
+.B v
+are output.
+Thus the macro can overwrite other modification specifiers.
+.
+.TP
e,E
Make equally-spaced columns.
.
@@ -339,6 +369,19 @@ too long as a simple string between tabs.
It is started with `T{' and closed with `T}'.
The former must end a line, and the latter must start a line, probably
followed by other data columns (separated with tabs).
+By default, the text block is formatted with the settings which were
+active before entering the table, possibly overridden by the
+.B v
+and
+.B w
+tbl specifiers.
+For example, to make all text blocks ragged-right, insert
+.B .na
+right before the starting
+.B .TS
+(and
+.B .ad
+after the table).
.LP
To change the data format within a table, use the
.B .T&
@@ -415,7 +458,8 @@ and use
instead of
.BR bp .
.LP
-Using \ea directly in a table to get leaders will not work.
+Using \ea directly in a table to get leaders will not work (except in
+compatibility mode).
This is correct behaviour: \ea is an
.B uninterpreted
leader.
diff --git a/contrib/groff/src/roff/groff/groff.cpp b/contrib/groff/src/roff/groff/groff.cpp
index 49104b2..5e18757 100644
--- a/contrib/groff/src/roff/groff/groff.cpp
+++ b/contrib/groff/src/roff/groff/groff.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
// A front end for groff.
@@ -93,7 +94,7 @@ char *predriver = 0;
possible_command commands[NCOMMANDS];
int run_commands(int no_pipe);
-void print_commands();
+void print_commands(FILE *);
void append_arg_to_string(const char *arg, string &str);
void handle_unknown_desc_command(const char *command, const char *arg,
const char *filename, int lineno);
@@ -114,6 +115,7 @@ int main(int argc, char **argv)
int zflag = 0;
int iflag = 0;
int Xflag = 0;
+ int oflag = 0;
int safer_flag = 1;
int opt;
const char *command_prefix = getenv("GROFF_COMMAND_PREFIX");
@@ -140,6 +142,12 @@ int main(int argc, char **argv)
case 'I':
commands[SOELIM_INDEX].set_name(command_prefix, "soelim");
commands[SOELIM_INDEX].append_arg(buf, optarg);
+ // .psbb may need to search for files
+ commands[TROFF_INDEX].append_arg(buf, optarg);
+ // \X'ps:import' may need to search for files
+ Pargs += buf;
+ Pargs += optarg;
+ Pargs += '\0';
break;
case 't':
commands[TBL_INDEX].set_name(command_prefix, "tbl");
@@ -179,7 +187,7 @@ int main(int argc, char **argv)
vflag = 1;
{
printf("GNU groff version %s\n", Version_string);
- printf("Copyright (C) 2002 Free Software Foundation, Inc.\n"
+ printf("Copyright (C) 2004 Free Software Foundation, Inc.\n"
"GNU groff comes with ABSOLUTELY NO WARRANTY.\n"
"You may redistribute copies of groff and its subprograms\n"
"under the terms of the GNU General Public License.\n"
@@ -234,14 +242,15 @@ int main(int argc, char **argv)
case 'F':
font::command_line_font_dir(optarg);
if (Fargs.length() > 0) {
- Fargs += PATH_SEP[0];
+ Fargs += PATH_SEP_CHAR;
Fargs += optarg;
}
else
Fargs = optarg;
break;
- case 'f':
case 'o':
+ oflag = 1;
+ case 'f':
case 'm':
case 'r':
case 'd':
@@ -295,7 +304,7 @@ int main(int argc, char **argv)
const char *real_driver = 0;
if (Xflag) {
real_driver = postdriver;
- postdriver = GXDITVIEW;
+ postdriver = (char *)GXDITVIEW;
commands[TROFF_INDEX].append_arg("-r" XREG "=", "1");
}
if (postdriver)
@@ -334,7 +343,7 @@ int main(int argc, char **argv)
}
if (gxditview_flag)
commands[POST_INDEX].append_arg("-");
- if (lflag && !Xflag && spooler) {
+ if (lflag && !vflag && !Xflag && spooler) {
commands[SPOOL_INDEX].set_name(BSHELL);
commands[SPOOL_INDEX].append_arg(BSHELL_DASH_C);
Largs += '\0';
@@ -347,8 +356,11 @@ int main(int argc, char **argv)
}
commands[TROFF_INDEX].append_arg("-T", device);
// html renders equations as images via ps
- if (strcmp(device, "html") == 0)
+ if (strcmp(device, "html") == 0) {
+ if (oflag)
+ fatal("`-o' option is invalid with device `html'");
commands[EQN_INDEX].append_arg("-Tps:html");
+ }
else
commands[EQN_INDEX].append_arg("-T", device);
@@ -372,7 +384,7 @@ int main(int argc, char **argv)
e += Fargs;
char *fontpath = getenv("GROFF_FONT_PATH");
if (fontpath && *fontpath) {
- e += PATH_SEP[0];
+ e += PATH_SEP_CHAR;
e += fontpath;
}
e += '\0';
@@ -398,17 +410,17 @@ int main(int argc, char **argv)
else
f += BINPATH;
if (path && *path) {
- f += PATH_SEP[0];
+ f += PATH_SEP_CHAR;
f += path;
}
f += '\0';
if (putenv(strsave(f.contents())))
fatal("putenv failed");
}
- if (Vflag) {
- print_commands();
+ if (Vflag)
+ print_commands(Vflag == 1 ? stdout : stderr);
+ if (Vflag == 1)
exit(0);
- }
return run_commands(vflag);
}
@@ -474,7 +486,7 @@ void handle_unknown_desc_command(const char *command, const char *arg,
}
}
-void print_commands()
+void print_commands(FILE *fp)
{
int last;
for (last = SPOOL_INDEX; last >= 0; last--)
@@ -482,7 +494,7 @@ void print_commands()
break;
for (int i = 0; i <= last; i++)
if (commands[i].get_name() != 0)
- commands[i].print(i == last, stdout);
+ commands[i].print(i == last, fp);
}
// Run the commands. Return the code with which to exit.
@@ -724,7 +736,7 @@ void help()
"-N\tdon't allow newlines within eqn delimiters\n"
"-S\tenable safer mode (the default)\n"
"-U\tenable unsafe mode\n"
-"-Idir\tsearch dir for soelim. Implies -s\n"
+"-Idir\tsearch dir for soelim, troff, and grops. Implies -s\n"
"\n",
stdout);
exit(0);
diff --git a/contrib/groff/src/roff/groff/pipeline.c b/contrib/groff/src/roff/groff/pipeline.c
index 985b24f..d067ae9 100644
--- a/contrib/groff/src/roff/groff/pipeline.c
+++ b/contrib/groff/src/roff/groff/pipeline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -39,7 +39,6 @@ extern char *strerror();
#ifdef _POSIX_VERSION
#include <sys/wait.h>
-
#define PID_T pid_t
#else /* not _POSIX_VERSION */
@@ -78,27 +77,23 @@ extern char *strerror();
#include "pipeline.h"
-#ifdef __STDC__
-#define P(parms) parms
-#else
-#define P(parms) ()
-#ifndef _WIN32
-#define const /* as nothing */
-#endif
+#define error c_error
+
+#ifdef __cplusplus
+extern "C" {
#endif
-#define error c_error
-extern void error P((const char *, const char *, const char *, const char *));
-extern void c_fatal P((const char *, const char *, const char *, const char *));
+extern void error(const char *, const char *, const char *, const char *);
+extern void c_fatal(const char *, const char *, const char *, const char *);
+extern const char *i_to_a(int); /* from libgroff */
+
+#ifdef __cplusplus
+}
+#endif
-static void sys_fatal P((const char *));
-static const char *xstrsignal P((int));
-static char *i_to_a P((int));
+static void sys_fatal(const char *);
+static const char *xstrsignal(int);
-/* MSVC can support asynchronous processes, but it's unlikely to have
- fork(). So, until someone writes an emulation, let them at least
- have a workable groff by using the good-ole DOS pipe simulation
- via temporary files... */
#if defined(__MSDOS__) \
|| (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) \
@@ -106,87 +101,120 @@ static char *i_to_a P((int));
#include <process.h>
#include <fcntl.h>
-#include <ctype.h>
#include <string.h>
+#include <stdlib.h>
#include "nonposix.h"
-/* A signal handler that just records that a signal has happened. */
-static int child_interrupted;
+static const char *sh = "sh";
+static const char *cmd = "cmd";
+static const char *command = "command";
-static RETSIGTYPE signal_catcher(int signo)
+extern int strcasecmp(const char *, const char *);
+
+char *sbasename(const char *path)
{
- child_interrupted++;
-}
+ char *base;
+ const char *p1, *p2;
+
+ p1 = path;
+ if ((p2 = strrchr(p1, '\\'))
+ || (p2 = strrchr(p1, '/'))
+ || (p2 = strrchr(p1, ':')))
+ p1 = p2 + 1;
+ if ((p2 = strrchr(p1, '.'))
+ && ((strcasecmp(p2, ".exe") == 0)
+ || (strcasecmp(p2, ".com") == 0)))
+ ;
+ else
+ p2 = p1 + strlen(p1);
-static const char *sh = "sh";
-static const char *command = "command";
+ base = malloc((size_t)(p2 - p1));
+ strncpy(base, p1, p2 - p1);
+ *(base + (p2 - p1)) = '\0';
-const char *
-system_shell_name(void)
+ return(base);
+}
+
+/* Get the name of the system shell */
+char *system_shell_name(void)
{
- static const char *shell_name;
-
- /* We want them to be able to use a Unixy shell if they have it
- installed. Let spawnlp try to find it, but if it fails, default
- to COMMAND.COM. */
- if (shell_name == NULL) {
- int sh_found = spawnlp(P_WAIT, sh, sh, "-c", ":", NULL) == 0;
-
- if (sh_found)
- shell_name = sh;
- else
- shell_name = command;
- }
- return shell_name;
+ const char *shell_name;
+
+ /*
+ Use a Unixy shell if it's installed. Use SHELL if set; otherwise,
+ let spawnlp try to find sh; if that fails, use COMSPEC if set; if
+ not, try cmd.exe; if that fails, default to command.com.
+ */
+
+ if ((shell_name = getenv("SHELL")) != NULL)
+ ;
+ else if (spawnlp(_P_WAIT, sh, sh, "-c", ":", NULL) == 0)
+ shell_name = sh;
+ else if ((shell_name = getenv("COMSPEC")) != NULL)
+ ;
+ else if (spawnlp(_P_WAIT, cmd, cmd, "/c", ";", NULL) == 0)
+ shell_name = cmd;
+ else
+ shell_name = command;
+
+ return sbasename(shell_name);
}
-const char *
-system_shell_dash_c(void)
+const char *system_shell_dash_c(void)
{
- if (strcmp(system_shell_name(), sh) == 0)
- return "-c";
+ char *shell_name;
+ const char *dash_c;
+
+ shell_name = system_shell_name();
+
+ /* Assume that if the shell name ends in "sh", it's Unixy */
+ if (strcasecmp(shell_name + strlen(shell_name) - strlen("sh"), "sh") == 0)
+ dash_c = "-c";
else
- return "/c";
+ dash_c = "/c";
+
+ free(shell_name);
+ return dash_c;
}
-int
-is_system_shell(const char *shell)
+int is_system_shell(const char *prog)
{
- size_t shlen;
- size_t ibase = 0, idot, i;
+ int result;
+ char *this_prog, *system_shell;
- if (!shell) /* paranoia */
+ if (!prog) /* paranoia */
return 0;
- idot = shlen = strlen(shell);
-
- for (i = 0; i < shlen; i++) {
- if (shell[i] == '.')
- idot = i;
- else if (shell[i] == '/' || shell[i] == '\\' || shell[i] == ':') {
- ibase = i + 1;
- idot = shlen;
- }
- }
- /* "sh" and "sh.exe" should compare equal. */
- return (strncasecmp(shell + ibase, system_shell_name(), idot - ibase) == 0
- && (idot == shlen
- || strcasecmp(shell + idot, ".exe") == 0
- || strcasecmp(shell + idot, ".com") == 0));
+ this_prog = sbasename(prog);
+ system_shell = system_shell_name();
+
+ result = strcasecmp(this_prog, system_shell) == 0;
+
+ free(this_prog);
+ free(system_shell);
+
+ return result;
}
#ifdef _WIN32
-/* Win32 doesn't have fork() */
+/*
+ Windows 32 doesn't have fork(), so we need to start asynchronous child
+ processes with spawn() rather than exec(). If there is more than one
+ command, i.e., a pipeline, the parent must set up each child's I/O
+ redirection prior to the spawn. The original stdout must be restored
+ before spawning the last process in the pipeline, and the original
+ stdin must be restored in the parent after spawning the last process
+ and before waiting for any of the children.
+*/
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
- int save_stdin, save_stdout;
int i;
- int last_input = 0;
- int proc_count = ncommands;
+ int last_input = 0; /* pacify some compilers */
+ int save_stdin = 0;
+ int save_stdout = 0;
int ret = 0;
char err_str[BUFSIZ];
PID_T pids[MAX_COMMANDS];
@@ -200,16 +228,22 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
if (ncommands > 1 && !no_pipe) {
/* last command doesn't need a new pipe */
if (i < ncommands - 1) {
- if (_pipe(pdes, BUFSIZ, O_BINARY | O_NOINHERIT) < 0)
- sys_fatal("pipe");
+ if (pipe(pdes) < 0) {
+ sprintf(err_str, "%s: pipe", commands[i][0]);
+ sys_fatal(err_str);
+ }
}
/* 1st command; writer */
if (i == 0) {
+ /* save stdin */
+ if ((save_stdin = dup(STDIN_FILENO)) < 0)
+ sys_fatal("dup stdin");
/* save stdout */
- if ((save_stdout = _dup(1)) < 0)
+ if ((save_stdout = dup(STDOUT_FILENO)) < 0)
sys_fatal("dup stdout");
+
/* connect stdout to write end of pipe */
- if (_dup2(pdes[1], 1) < 0) {
+ if (dup2(pdes[1], STDOUT_FILENO) < 0) {
sprintf(err_str, "%s: dup2(stdout)", commands[i][0]);
sys_fatal(err_str);
}
@@ -217,19 +251,28 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
sprintf(err_str, "%s: close(pipe[WRITE])", commands[i][0]);
sys_fatal(err_str);
}
+ /*
+ Save the read end of the pipe so that it can be connected to
+ stdin of the next program in the pipeline during the next
+ pass through the loop.
+ */
last_input = pdes[0];
}
/* reader and writer */
else if (i < ncommands - 1) {
/* connect stdin to read end of last pipe */
- if (_dup2(last_input, 0) < 0) {
+ if (dup2(last_input, STDIN_FILENO) < 0) {
sprintf(err_str, " %s: dup2(stdin)", commands[i][0]);
- sys_fatal("err_str");
+ sys_fatal(err_str);
+ }
+ if (close(last_input) < 0) {
+ sprintf(err_str, "%s: close(last_input)", commands[i][0]);
+ sys_fatal(err_str);
}
/* connect stdout to write end of new pipe */
- if (_dup2(pdes[1], 1) < 0) {
+ if (dup2(pdes[1], STDOUT_FILENO) < 0) {
sprintf(err_str, "%s: dup2(stdout)", commands[i][0]);
- sys_fatal("err_str");
+ sys_fatal(err_str);
}
if (close(pdes[1]) < 0) {
sprintf(err_str, "%s: close(pipe[WRITE])", commands[i][0]);
@@ -240,22 +283,27 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
/* last command; reader */
else {
/* connect stdin to read end of last pipe */
- if (_dup2(last_input, 0) < 0) {
+ if (dup2(last_input, STDIN_FILENO) < 0) {
sprintf(err_str, "%s: dup2(stdin)", commands[i][0]);
- sys_fatal("err_str");
+ sys_fatal(err_str);
}
if (close(last_input) < 0) {
- sprintf(err_str, "%s: close(pipe[READ])", commands[i][0]);
+ sprintf(err_str, "%s: close(last_input)", commands[i][0]);
sys_fatal(err_str);
}
/* restore original stdout */
- if (_dup2(save_stdout, 1) < 0) {
- sprintf(err_str, "%s: dup2(stdout))", "groff");
+ if (dup2(save_stdout, STDOUT_FILENO) < 0) {
+ sprintf(err_str, "%s: dup2(save_stdout))", commands[i][0]);
sys_fatal(err_str);
}
+ /* close stdout copy */
+ if (close(save_stdout) < 0) {
+ sprintf(err_str, "%s: close(save_stdout)", commands[i][0]);
+ sys_fatal(err_str);
+ }
}
}
- if ((pid = _spawnvp(_P_NOWAIT, commands[i][0], commands[i])) < 0) {
+ if ((pid = spawnvp(_P_NOWAIT, commands[i][0], commands[i])) < 0) {
error("couldn't exec %1: %2",
commands[i][0], strerror(errno), (char *)0);
fflush(stderr); /* just in case error() doesn't */
@@ -263,65 +311,81 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
}
pids[i] = pid;
}
+
+ if (ncommands > 1 && !no_pipe) {
+ /* restore original stdin if it was redirected */
+ if (dup2(save_stdin, STDIN_FILENO) < 0) {
+ sprintf(err_str, "dup2(save_stdin))");
+ sys_fatal(err_str);
+ }
+ /* close stdin copy */
+ if (close(save_stdin) < 0) {
+ sprintf(err_str, "close(save_stdin)");
+ sys_fatal(err_str);
+ }
+ }
+
for (i = 0; i < ncommands; i++) {
int status;
- int pid;
+ PID_T pid;
pid = pids[i];
- if ((pid = _cwait(&status, pid, _WAIT_CHILD)) < 0) {
- perror(NULL);
- sys_fatal("wait");
- if (WIFSIGNALED(status)) {
- int sig = WTERMSIG(status);
-
- error("%1: %2%3",
- commands[i][0],
- xstrsignal(sig),
- WCOREDUMP(status) ? " (core dumped)" : "");
- ret |= 2;
- }
- else if (WIFEXITED(status)) {
- int exit_status = WEXITSTATUS(status);
-
- if (exit_status == EXEC_FAILED_EXIT_STATUS)
- ret |= 4;
- else if (exit_status != 0)
- ret |= 1;
- }
- else
- error("unexpected status %1", itoa(status), (char *)0, (char *)0);
- break;
+ if ((pid = WAIT(&status, pid, _WAIT_CHILD)) < 0) {
+ sprintf(err_str, "%s: wait", commands[i][0]);
+ sys_fatal(err_str);
}
+ else if (status != 0)
+ ret |= 1;
}
return ret;
}
-#else /* _WIN32 */
+#else /* not _WIN32 */
/* MSDOS doesn't have `fork', so we need to simulate the pipe by running
- the programs in sequence with standard streams redirected fot and
+ the programs in sequence with standard streams redirected to and
from temporary files.
*/
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+
+/* A signal handler that just records that a signal has happened. */
+static int child_interrupted;
+
+static RETSIGTYPE signal_catcher(int signo)
+{
+ child_interrupted++;
+}
+
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
int save_stdin = dup(0);
int save_stdout = dup(1);
char *tmpfiles[2];
- char tem1[L_tmpnam], tem2[L_tmpnam];
int infile = 0;
int outfile = 1;
int i, f, ret = 0;
- tmpfiles[0] = tmpnam(tem1);
- tmpfiles[1] = tmpnam(tem2);
+ /* Choose names for a pair of temporary files to implement the pipeline.
+ Microsoft's `tempnam' uses the directory specified by `getenv("TMP")'
+ if it exists; in case it doesn't, try the GROFF alternatives, or
+ `getenv("TEMP")' as last resort -- at least one of these had better
+ be set, since Microsoft's default has a high probability of failure. */
+ char *tmpdir;
+ if ((tmpdir = getenv("GROFF_TMPDIR")) == NULL
+ && (tmpdir = getenv("TMPDIR")) == NULL)
+ tmpdir = getenv("TEMP");
+
+ /* Don't use `tmpnam' here: Microsoft's implementation yields unusable
+ file names if current directory is on network share with read-only
+ root. */
+ tmpfiles[0] = tempnam(tmpdir, NULL);
+ tmpfiles[1] = tempnam(tmpdir, NULL);
for (i = 0; i < ncommands; i++) {
int exit_status;
RETSIGTYPE (*prev_handler)(int);
- if (i) {
+ if (i && !no_pipe) {
/* redirect stdin from temp file */
f = open(tmpfiles[infile], O_RDONLY|O_BINARY, 0666);
if (f < 0)
@@ -376,12 +440,11 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
return ret;
}
-#endif /* MS-DOS */
+#endif /* not _WIN32 */
#else /* not __MSDOS__, not _WIN32 */
-int
-run_pipeline(int ncommands, char ***commands, int no_pipe)
+int run_pipeline(int ncommands, char ***commands, int no_pipe)
{
int i;
int last_input = 0;
@@ -496,30 +559,20 @@ run_pipeline(int ncommands, char ***commands, int no_pipe)
#endif /* not __MSDOS__, not _WIN32 */
-static void
-sys_fatal(const char *s)
+static void sys_fatal(const char *s)
{
c_fatal("%1: %2", s, strerror(errno), (char *)0);
}
-static char *
-i_to_a(int n)
-{
- static char buf[12];
- sprintf(buf, "%d", n);
- return buf;
-}
-
-static const char *
-xstrsignal(int n)
+static const char *xstrsignal(int n)
{
static char buf[sizeof("Signal ") + 1 + sizeof(int) * 3];
#ifdef NSIG
-#ifdef SYS_SIGLIST_DECLARED
+#if HAVE_DECL_SYS_SIGLIST
if (n >= 0 && n < NSIG && sys_siglist[n] != 0)
return sys_siglist[n];
-#endif /* SYS_SIGLIST_DECLARED */
+#endif /* HAVE_DECL_SYS_SIGLIST */
#endif /* NSIG */
sprintf(buf, "Signal %d", n);
return buf;
diff --git a/contrib/groff/src/roff/groff/pipeline.h b/contrib/groff/src/roff/groff/pipeline.h
index 52bff85..77bb11a 100644
--- a/contrib/groff/src/roff/groff/pipeline.h
+++ b/contrib/groff/src/roff/groff/pipeline.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef __cplusplus
extern "C" {
diff --git a/contrib/groff/src/roff/grog/grog.pl b/contrib/groff/src/roff/grog/grog.pl
index 07fa7a4..b802fd5 100644
--- a/contrib/groff/src/roff/grog/grog.pl
+++ b/contrib/groff/src/roff/grog/grog.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/perl
# grog -- guess options for groff command
# Inspired by doctype script in Kernighan & Pike, Unix Programming
# Environment, pp 306-8.
diff --git a/contrib/groff/src/roff/grog/grog.sh b/contrib/groff/src/roff/grog/grog.sh
index 3999d77..1a937cb 100644
--- a/contrib/groff/src/roff/grog/grog.sh
+++ b/contrib/groff/src/roff/grog/grog.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
# grog -- guess options for groff command
# Like doctype in Kernighan & Pike, Unix Programming Environment, pp 306-8.
diff --git a/contrib/groff/src/roff/nroff/Makefile.sub b/contrib/groff/src/roff/nroff/Makefile.sub
index 138c870..ffd2ccd 100644
--- a/contrib/groff/src/roff/nroff/Makefile.sub
+++ b/contrib/groff/src/roff/nroff/Makefile.sub
@@ -4,10 +4,9 @@ CLEANADD=nroff
all: nroff
-nroff: nroff.sh
+nroff: nroff.sh $(SH_DEPS_SED_SCRIPT)
rm -f $@
- sed -e "s|@BINDIR@|$(bindir)|g" \
- -e "s|@SEP@|$(SEP)|g" \
+ sed -f $(SH_DEPS_SED_SCRIPT) \
-e $(SH_SCRIPT_SED_CMD) \
-e "s|@VERSION@|$(version)$(revision)|" $(srcdir)/nroff.sh >$@
chmod +x $@
diff --git a/contrib/groff/src/roff/troff/Makefile.sub b/contrib/groff/src/roff/troff/Makefile.sub
index 7fa8024..82c727d 100644
--- a/contrib/groff/src/roff/troff/Makefile.sub
+++ b/contrib/groff/src/roff/troff/Makefile.sub
@@ -6,30 +6,22 @@ OBJS=\
dictionary.$(OBJEXT) \
div.$(OBJEXT) \
env.$(OBJEXT) \
- glyphuni.$(OBJEXT) \
input.$(OBJEXT) \
majorminor.$(OBJEXT) \
+ mtsm.$(OBJEXT) \
node.$(OBJEXT) \
number.$(OBJEXT) \
- reg.$(OBJEXT) \
- symbol.$(OBJEXT) \
- unicode.$(OBJEXT) \
- uniglyph.$(OBJEXT) \
- uniuni.$(OBJEXT)
+ reg.$(OBJEXT)
CCSRCS=\
$(srcdir)/dictionary.cpp \
$(srcdir)/div.cpp \
$(srcdir)/env.cpp \
- $(srcdir)/glyphuni.cpp \
$(srcdir)/input.cpp \
majorminor.cpp \
+ $(srcdir)/mtsm.cpp \
$(srcdir)/node.cpp \
$(srcdir)/number.cpp \
- $(srcdir)/reg.cpp \
- $(srcdir)/symbol.cpp \
- $(srcdir)/unicode.cpp \
- $(srcdir)/uniglyph.cpp \
- $(srcdir)/uniuni.cpp
+ $(srcdir)/reg.cpp
HDRS=\
$(srcdir)/charinfo.h \
$(srcdir)/dictionary.h \
@@ -37,13 +29,12 @@ HDRS=\
$(srcdir)/env.h \
$(srcdir)/hvunits.h \
$(srcdir)/input.h \
+ $(srcdir)/mtsm.h \
$(srcdir)/node.h \
$(srcdir)/reg.h \
$(srcdir)/request.h \
- $(srcdir)/symbol.h \
$(srcdir)/token.h \
- $(srcdir)/troff.h \
- $(srcdir)/unicode.h
+ $(srcdir)/troff.h
GENSRCS=majorminor.cpp
NAMEPREFIX=$(g)
diff --git a/contrib/groff/src/roff/troff/charinfo.h b/contrib/groff/src/roff/troff/charinfo.h
index 4123fba..42190fd 100644
--- a/contrib/groff/src/roff/troff/charinfo.h
+++ b/contrib/groff/src/roff/troff/charinfo.h
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class macro;
diff --git a/contrib/groff/src/roff/troff/column.cpp b/contrib/groff/src/roff/troff/column.cpp
index 8d6a6eb..060b088 100644
--- a/contrib/groff/src/roff/troff/column.cpp
+++ b/contrib/groff/src/roff/troff/column.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef COLUMN
@@ -666,7 +666,7 @@ vjustify_node::vjustify_node(symbol t)
node *vjustify_node::copy()
{
- return new vjustify_node(typ);
+ return new vjustify_node(typ, div_nest_level);
}
const char *vjustify_node::type()
diff --git a/contrib/groff/src/roff/troff/dictionary.cpp b/contrib/groff/src/roff/troff/dictionary.cpp
index a70ebb0..37084b6 100644
--- a/contrib/groff/src/roff/troff/dictionary.cpp
+++ b/contrib/groff/src/roff/troff/dictionary.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,11 +17,10 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
// is `p' a good size for a hash table
@@ -209,4 +209,3 @@ int object_dictionary::alias(symbol newnm, symbol oldnm)
}
return 0;
}
-
diff --git a/contrib/groff/src/roff/troff/dictionary.h b/contrib/groff/src/roff/troff/dictionary.h
index 4f319be..2baab0a 100644
--- a/contrib/groff/src/roff/troff/dictionary.h
+++ b/contrib/groff/src/roff/troff/dictionary.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
diff --git a/contrib/groff/src/roff/troff/div.cpp b/contrib/groff/src/roff/troff/div.cpp
index 1bbbe45..4cacd8d 100644
--- a/contrib/groff/src/roff/troff/div.cpp
+++ b/contrib/groff/src/roff/troff/div.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,15 +17,16 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
// diversions
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
@@ -33,6 +34,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "div.h"
#include "reg.h"
+#include "nonposix.h"
+
int exit_started = 0; // the exit process has started
int done_end_macro = 0; // the end macro (if any) has finished
int seen_last_page_ejector = 0; // seen the LAST_PAGE_EJECTOR cookie
@@ -50,7 +53,9 @@ static vunits needed_space;
diversion::diversion(symbol s)
: prev(0), nm(s), vertical_position(V0), high_water_mark(V0),
- no_space_mode(0), marked_place(V0)
+ any_chars_added(0), no_space_mode(0), needs_push(0), saved_seen_break(0),
+ saved_seen_space(0), saved_seen_eol(0), saved_suppress_next_eol(0),
+ marked_place(V0)
{
}
@@ -96,6 +101,10 @@ void do_divert(int append, int boxing)
symbol nm = get_name();
if (nm.is_null()) {
if (curdiv->prev) {
+ curenv->seen_break = curdiv->saved_seen_break;
+ curenv->seen_space = curdiv->saved_seen_space;
+ curenv->seen_eol = curdiv->saved_seen_eol;
+ curenv->suppress_next_eol = curdiv->saved_suppress_next_eol;
if (boxing) {
curenv->line = curdiv->saved_line;
curenv->width_total = curdiv->saved_width_total;
@@ -115,6 +124,13 @@ void do_divert(int append, int boxing)
macro_diversion *md = new macro_diversion(nm, append);
md->prev = curdiv;
curdiv = md;
+ curdiv->saved_seen_break = curenv->seen_break;
+ curdiv->saved_seen_space = curenv->seen_space;
+ curdiv->saved_seen_eol = curenv->seen_eol;
+ curdiv->saved_suppress_next_eol = curenv->suppress_next_eol;
+ curenv->seen_break = 0;
+ curenv->seen_space = 0;
+ curenv->seen_eol = 0;
if (boxing) {
curdiv->saved_line = curenv->line;
curdiv->saved_width_total = curenv->width_total;
@@ -201,7 +217,7 @@ macro_diversion::macro_diversion(symbol s, int append)
// We can now catch the situation described above by comparing
// the length of the charlist in the macro_header with the length
// stored in the macro. When we detect this, we copy the contents.
- mac = new macro;
+ mac = new macro(1);
if (append) {
request_or_macro *rm
= (request_or_macro *)request_dictionary.lookup(s);
@@ -256,9 +272,8 @@ void macro_diversion::output(node *nd, int retain_size,
nd->set_vertical_size(&v);
node *temp = nd;
nd = nd->next;
- if (temp->interpret(mac)) {
+ if (temp->interpret(mac))
delete temp;
- }
else {
#if 1
temp->freeze_space();
@@ -444,6 +459,9 @@ void top_level_diversion::space(vunits n, int forced)
vunits next_trap_pos;
trap *next_trap = find_next_trap(&next_trap_pos);
vunits y = vertical_position + n;
+ if (curenv->get_vertical_spacing().to_units())
+ curenv->seen_space += n.to_units()
+ / curenv->get_vertical_spacing().to_units();
if (vertical_position_traps_flag && next_trap != 0 && y >= next_trap_pos) {
vertical_position = next_trap_pos;
nl_reg_contents = vertical_position.to_units();
@@ -467,7 +485,7 @@ trap::trap(symbol s, vunits n, trap *p)
{
}
-void top_level_diversion::add_trap(symbol nm, vunits pos)
+void top_level_diversion::add_trap(symbol nam, vunits pos)
{
trap *first_free_slot = 0;
trap **p;
@@ -477,22 +495,22 @@ void top_level_diversion::add_trap(symbol nm, vunits pos)
first_free_slot = *p;
}
else if ((*p)->position == pos) {
- (*p)->nm = nm;
+ (*p)->nm = nam;
return;
}
}
if (first_free_slot) {
- first_free_slot->nm = nm;
+ first_free_slot->nm = nam;
first_free_slot->position = pos;
}
else
- *p = new trap(nm, pos, 0);
+ *p = new trap(nam, pos, 0);
}
-void top_level_diversion::remove_trap(symbol nm)
+void top_level_diversion::remove_trap(symbol nam)
{
for (trap *p = page_trap_list; p; p = p->next)
- if (p->nm == nm) {
+ if (p->nm == nam) {
p->nm = NULL_SYMBOL;
return;
}
@@ -507,10 +525,10 @@ void top_level_diversion::remove_trap_at(vunits pos)
}
}
-void top_level_diversion::change_trap(symbol nm, vunits pos)
+void top_level_diversion::change_trap(symbol nam, vunits pos)
{
for (trap *p = page_trap_list; p; p = p->next)
- if (p->nm == nm) {
+ if (p->nm == nam) {
p->position = pos;
return;
}
@@ -543,6 +561,7 @@ void cleanup_and_exit(int exit_code)
the_output->trailer(topdiv->get_page_length());
delete the_output;
}
+ FLUSH_INPUT_PIPE(STDIN_FILENO);
exit(exit_code);
}
@@ -637,7 +656,7 @@ void page_offset()
n = topdiv->prev_page_offset;
topdiv->prev_page_offset = topdiv->page_offset;
topdiv->page_offset = n;
- curenv->add_html_tag(0, ".po", n.to_units());
+ topdiv->modified_tag.incl(MTSM_PO);
skip_line();
}
@@ -667,7 +686,7 @@ void when_request()
void begin_page()
{
int got_arg = 0;
- int n;
+ int n = 0; /* pacify compiler */
if (has_arg() && get_integer(&n, topdiv->get_page_number()))
got_arg = 1;
while (!tok.newline() && !tok.eof())
@@ -730,11 +749,11 @@ void restore_spacing()
skip_line();
}
-/* It is necessary to generate a break before before reading the argument,
-because otherwise arguments using | will be wrong. But if we just
+/* It is necessary to generate a break before reading the argument,
+because otherwise arguments using | will be wrong. But if we just
generate a break as usual, then the line forced out may spring a trap
and thus push a macro onto the input stack before we have had a chance
-to read the argument to the sp request. We resolve this dilemma by
+to read the argument to the sp request. We resolve this dilemma by
setting, before generating the break, a flag which will postpone the
actual pushing of the macro associated with the trap sprung by the
outputting of the line forced out by the break till after we have read
@@ -756,17 +775,15 @@ void space_request()
else
// The line might have had line spacing that was truncated.
truncated_space += n;
- curenv->add_html_tag(1, ".sp", n.to_units());
+
tok.next();
}
void blank_line()
{
curenv->do_break();
- if (!trap_sprung_flag && !curdiv->no_space_mode) {
+ if (!trap_sprung_flag && !curdiv->no_space_mode)
curdiv->space(curenv->get_vertical_spacing());
- curenv->add_html_tag(1, ".sp", 1);
- }
else
truncated_space += curenv->get_vertical_spacing();
}
@@ -830,7 +847,6 @@ void flush_output()
curenv->do_break();
if (the_output)
the_output->flush();
- curenv->add_html_tag(1, ".fl");
tok.next();
}
diff --git a/contrib/groff/src/roff/troff/div.h b/contrib/groff/src/roff/troff/div.h
index bde41a8..c9ff9b4 100644
--- a/contrib/groff/src/roff/troff/div.h
+++ b/contrib/groff/src/roff/troff/div.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,11 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+void do_divert(int append, int boxing);
+void end_diversions();
+void page_offset();
class diversion {
friend void do_divert(int append, int boxing);
@@ -34,7 +38,14 @@ protected:
vunits vertical_position;
vunits high_water_mark;
public:
+ int any_chars_added;
int no_space_mode;
+ int needs_push;
+ int saved_seen_break;
+ int saved_seen_space;
+ int saved_seen_eol;
+ int saved_suppress_next_eol;
+ state_set modified_tag;
vunits marked_place;
diversion(symbol s = NULL_SYMBOL);
virtual ~diversion();
@@ -54,6 +65,7 @@ public:
virtual void set_diversion_trap(symbol, vunits) = 0;
virtual void clear_diversion_trap() = 0;
virtual void copy_file(const char *filename) = 0;
+ virtual int is_diversion() = 0;
};
class macro;
@@ -78,6 +90,7 @@ public:
void set_diversion_trap(symbol, vunits);
void clear_diversion_trap();
void copy_file(const char *filename);
+ int is_diversion() { return 1; }
};
struct trap {
@@ -87,7 +100,7 @@ struct trap {
trap(symbol, vunits, trap *);
};
-struct output_file;
+class output_file;
class top_level_diversion : public diversion {
int page_number;
@@ -134,6 +147,7 @@ public:
void set_diversion_trap(symbol, vunits);
void clear_diversion_trap();
void set_last_page() { last_page_count = page_count; }
+ int is_diversion() { return 0; }
};
extern top_level_diversion *topdiv;
@@ -154,6 +168,5 @@ void continue_page_eject();
void handle_first_page_transition();
void blank_line();
void begin_page();
-void end_diversions();
extern void cleanup_and_exit(int);
diff --git a/contrib/groff/src/roff/troff/env.cpp b/contrib/groff/src/roff/troff/env.cpp
index 264b441..9de9a46 100644
--- a/contrib/groff/src/roff/troff/env.cpp
+++ b/contrib/groff/src/roff/troff/env.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,12 +17,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
@@ -52,6 +53,8 @@ environment *env_table[NENVIRONMENTS];
dictionary env_dictionary(10);
environment *curenv;
static int next_line_number = 0;
+extern int suppress_push;
+extern statem *get_diversion_state();
charinfo *field_delimiter_char;
charinfo *padding_indicator_char;
@@ -61,6 +64,7 @@ int translate_space_to_dummy = 0;
class pending_output_line {
node *nd;
int no_fill;
+ int was_centered;
vunits vs;
vunits post_vs;
hunits width;
@@ -70,20 +74,21 @@ class pending_output_line {
public:
pending_output_line *next;
- pending_output_line(node *, int, vunits, vunits, hunits,
+ pending_output_line(node *, int, vunits, vunits, hunits, int,
pending_output_line * = 0);
~pending_output_line();
int output();
#ifdef WIDOW_CONTROL
friend void environment::mark_last_line();
- friend void environment::output(node *, int, vunits, vunits, hunits);
+ friend void environment::output(node *, int, vunits, vunits, hunits, int);
#endif /* WIDOW_CONTROL */
};
pending_output_line::pending_output_line(node *n, int nf, vunits v, vunits pv,
- hunits w, pending_output_line *p)
-: nd(n), no_fill(nf), vs(v), post_vs(pv), width(w),
+ hunits w, int ce,
+ pending_output_line *p)
+: nd(n), no_fill(nf), was_centered(ce), vs(v), post_vs(pv), width(w),
#ifdef WIDOW_CONTROL
last_line(0),
#endif /* WIDOW_CONTROL */
@@ -109,13 +114,15 @@ int pending_output_line::output()
}
}
#endif
+ curenv->construct_format_state(nd, was_centered, !no_fill);
curdiv->output(nd, no_fill, vs, post_vs, width);
nd = 0;
return 1;
}
-void environment::output(node *nd, int no_fill, vunits vs, vunits post_vs,
- hunits width)
+void environment::output(node *nd, int no_fill_flag,
+ vunits vs, vunits post_vs,
+ hunits width, int was_centered)
{
#ifdef WIDOW_CONTROL
while (pending_lines) {
@@ -132,29 +139,31 @@ void environment::output(node *nd, int no_fill, vunits vs, vunits post_vs,
#endif /* WIDOW_CONTROL */
if (!trap_sprung_flag && !pending_lines
#ifdef WIDOW_CONTROL
- && (!widow_control || no_fill)
+ && (!widow_control || no_fill_flag)
#endif /* WIDOW_CONTROL */
) {
- curdiv->output(nd, no_fill, vs, post_vs, width);
- emitted_node = 1;
+ curenv->construct_format_state(nd, was_centered, !no_fill_flag);
+ curdiv->output(nd, no_fill_flag, vs, post_vs, width);
} else {
pending_output_line **p;
for (p = &pending_lines; *p; p = &(*p)->next)
;
- *p = new pending_output_line(nd, no_fill, vs, post_vs, width);
+ *p = new pending_output_line(nd, no_fill_flag, vs, post_vs, width,
+ was_centered);
}
}
// a line from .tl goes at the head of the queue
-void environment::output_title(node *nd, int no_fill, vunits vs,
- vunits post_vs, hunits width)
+void environment::output_title(node *nd, int no_fill_flag,
+ vunits vs, vunits post_vs,
+ hunits width)
{
if (!trap_sprung_flag)
- curdiv->output(nd, no_fill, vs, post_vs, width);
+ curdiv->output(nd, no_fill_flag, vs, post_vs, width);
else
- pending_lines = new pending_output_line(nd, no_fill, vs, post_vs, width,
- pending_lines);
+ pending_lines = new pending_output_line(nd, no_fill_flag, vs, post_vs,
+ width, 0, pending_lines);
}
void environment::output_pending_lines()
@@ -172,7 +181,8 @@ void environment::mark_last_line()
{
if (!widow_control || !pending_lines)
return;
- for (pending_output_line *p = pending_lines; p->next; p = p->next)
+ pending_output_line *p;
+ for (p = pending_lines; p->next; p = p->next)
;
if (!p->no_fill)
p->last_line = 1;
@@ -264,6 +274,7 @@ void leader_character()
void environment::add_char(charinfo *ci)
{
int s;
+ node *gc_np = 0;
if (interrupted)
;
// don't allow fields in dummy environments
@@ -279,18 +290,40 @@ void environment::add_char(charinfo *ci)
if (tab_contents == 0)
tab_contents = new line_start_node;
if (ci != hyphen_indicator_char)
- tab_contents = tab_contents->add_char(ci, this, &tab_width, &s);
+ tab_contents = tab_contents->add_char(ci, this, &tab_width, &s, &gc_np);
else
tab_contents = tab_contents->add_discretionary_hyphen();
}
else {
if (line == 0)
start_line();
+#if 0
+ fprintf(stderr, "current line is\n");
+ line->debug_node_list();
+#endif
if (ci != hyphen_indicator_char)
- line = line->add_char(ci, this, &width_total, &space_total);
+ line = line->add_char(ci, this, &width_total, &space_total, &gc_np);
else
line = line->add_discretionary_hyphen();
}
+#if 0
+ fprintf(stderr, "now after we have added character the line is\n");
+ line->debug_node_list();
+#endif
+ if ((!suppress_push) && gc_np) {
+ if (gc_np && (gc_np->state == 0)) {
+ gc_np->state = construct_state(0);
+ gc_np->push_state = get_diversion_state();
+ }
+ else if (line && (line->state == 0)) {
+ line->state = construct_state(0);
+ line->push_state = get_diversion_state();
+ }
+ }
+#if 0
+ fprintf(stderr, "now we have possibly added the state the line is\n");
+ line->debug_node_list();
+#endif
}
node *environment::make_char_node(charinfo *ci)
@@ -302,6 +335,12 @@ void environment::add_node(node *n)
{
if (n == 0)
return;
+ if (!suppress_push) {
+ if (n->is_special && n->state == NULL)
+ n->state = construct_state(0);
+ n->push_state = get_diversion_state();
+ }
+
if (current_tab || current_field)
n->freeze_space();
if (interrupted) {
@@ -325,10 +364,10 @@ void environment::add_node(node *n)
space_total += n->nspaces();
n->next = line;
line = n;
+ construct_new_line_state(line);
}
}
-
void environment::add_hyphen_indicator()
{
if (current_tab || interrupted || current_field
@@ -612,7 +651,6 @@ environment::environment(symbol nm)
width_total(0),
space_total(0),
input_line_start(0),
- tabs(units_per_inch/2, TAB_LEFT),
line_tabs(0),
current_tab(TAB_NONE),
leader_node(0),
@@ -639,12 +677,15 @@ environment::environment(symbol nm)
#ifdef WIDOW_CONTROL
widow_control(0),
#endif /* WIDOW_CONTROL */
- ignore_next_eol(0),
- emitted_node(0),
glyph_color(&default_color),
prev_glyph_color(&default_color),
fill_color(&default_color),
prev_fill_color(&default_color),
+ seen_space(0),
+ seen_eol(0),
+ suppress_next_eol(0),
+ seen_break(0),
+ tabs(units_per_inch/2, TAB_LEFT),
name(nm),
control_char('.'),
no_break_control_char('\''),
@@ -702,7 +743,6 @@ environment::environment(const environment *e)
width_total(0),
space_total(0),
input_line_start(0),
- tabs(e->tabs),
line_tabs(e->line_tabs),
current_tab(TAB_NONE),
leader_node(0),
@@ -729,12 +769,15 @@ environment::environment(const environment *e)
#ifdef WIDOW_CONTROL
widow_control(e->widow_control),
#endif /* WIDOW_CONTROL */
- ignore_next_eol(0),
- emitted_node(0),
glyph_color(e->glyph_color),
prev_glyph_color(e->prev_glyph_color),
fill_color(e->fill_color),
prev_fill_color(e->prev_fill_color),
+ seen_space(e->seen_space),
+ seen_eol(e->seen_eol),
+ suppress_next_eol(e->suppress_next_eol),
+ seen_break(e->seen_break),
+ tabs(e->tabs),
name(e->name), // so that eg `.if "\n[.ev]"0"' works
control_char(e->control_char),
no_break_control_char(e->no_break_control_char),
@@ -816,8 +859,6 @@ void environment::copy(const environment *e)
hyphenation_space = e->hyphenation_space;
hyphenation_margin = e->hyphenation_margin;
composite = 0;
- ignore_next_eol = e->ignore_next_eol;
- emitted_node = e->emitted_node;
glyph_color= e->glyph_color;
prev_glyph_color = e->prev_glyph_color;
fill_color = e->fill_color;
@@ -1089,7 +1130,13 @@ void environment_switch()
error("environment stack underflow");
}
else {
+ int seen_space = curenv->seen_space;
+ int seen_eol = curenv->seen_eol;
+ int suppress_next_eol = curenv->suppress_next_eol;
curenv = env_stack->env;
+ curenv->seen_space = seen_space;
+ curenv->seen_eol = seen_eol;
+ curenv->suppress_next_eol = suppress_next_eol;
env_list *tem = env_stack;
env_stack = env_stack->next;
delete tem;
@@ -1126,6 +1173,26 @@ void environment_copy()
skip_line();
}
+void fill_color_change()
+{
+ symbol s = get_name();
+ if (s.is_null())
+ curenv->set_fill_color(curenv->get_prev_fill_color());
+ else
+ do_fill_color(s);
+ skip_line();
+}
+
+void glyph_color_change()
+{
+ symbol s = get_name();
+ if (s.is_null())
+ curenv->set_glyph_color(curenv->get_prev_glyph_color());
+ else
+ do_glyph_color(s);
+ skip_line();
+}
+
static symbol P_symbol("P");
void font_change()
@@ -1164,7 +1231,6 @@ void point_size()
if (n <= 0)
n = 1;
curenv->set_size(n);
- curenv->add_html_tag(0, ".ps", n);
}
else
curenv->set_size(0);
@@ -1232,8 +1298,6 @@ void fill()
if (break_flag)
curenv->do_break();
curenv->fill = 1;
- curenv->add_html_tag(1, ".fi");
- curenv->add_html_tag(0, ".br");
tok.next();
}
@@ -1244,9 +1308,7 @@ void no_fill()
if (break_flag)
curenv->do_break();
curenv->fill = 0;
- curenv->add_html_tag(1, ".nf");
- curenv->add_html_tag(0, ".br");
- curenv->add_html_tag(0, ".po", topdiv->get_page_offset().to_units());
+ curenv->suppress_next_eol = 1;
tok.next();
}
@@ -1263,7 +1325,7 @@ void center()
curenv->do_break();
curenv->right_justify_lines = 0;
curenv->center_lines = n;
- curenv->add_html_tag(1, ".ce", n);
+ curdiv->modified_tag.incl(MTSM_CE);
tok.next();
}
@@ -1280,7 +1342,7 @@ void right_justify()
curenv->do_break();
curenv->center_lines = 0;
curenv->right_justify_lines = n;
- curenv->add_html_tag(1, ".rj", n);
+ curdiv->modified_tag.incl(MTSM_RJ);
tok.next();
}
@@ -1297,7 +1359,7 @@ void line_length()
temp = curenv->prev_line_length;
curenv->prev_line_length = curenv->line_length;
curenv->line_length = temp;
- curenv->add_html_tag(1, ".ll", temp.to_units());
+ curdiv->modified_tag.incl(MTSM_LL);
skip_line();
}
@@ -1384,8 +1446,7 @@ void indent()
curenv->have_temporary_indent = 0;
curenv->prev_indent = curenv->indent;
curenv->indent = temp;
- if (break_flag)
- curenv->add_html_tag(1, ".in", temp.to_units());
+ curdiv->modified_tag.incl(MTSM_IN);
tok.next();
}
@@ -1406,7 +1467,7 @@ void temporary_indent()
if (!err) {
curenv->temporary_indent = temp;
curenv->have_temporary_indent = 1;
- curenv->add_html_tag(1, ".ti", temp.to_units());
+ curdiv->modified_tag.incl(MTSM_TI);
}
tok.next();
}
@@ -1623,6 +1684,7 @@ void environment::interrupt()
void environment::newline()
{
+ int was_centered = 0;
if (underline_lines > 0) {
if (--underline_lines == 0) {
prev_fontno = fontno;
@@ -1661,11 +1723,7 @@ void environment::newline()
if (x > H0)
saved_indent += x/2;
to_be_output = line;
- if (is_html) {
- node *n = make_html_tag("eol.ce");
- n->next = to_be_output;
- to_be_output = n;
- }
+ was_centered = 1;
to_be_output_width = width_total;
line = 0;
}
@@ -1688,14 +1746,14 @@ void environment::newline()
input_line_start = line == 0 ? H0 : width_total;
if (to_be_output) {
if (is_html && !fill) {
- if (curdiv == topdiv) {
- node *n = make_html_tag("eol");
-
- n->next = to_be_output;
- to_be_output = n;
- }
+ curdiv->modified_tag.incl(MTSM_EOL);
+ if (suppress_next_eol)
+ suppress_next_eol = 0;
+ else
+ seen_eol = 1;
}
- output_line(to_be_output, to_be_output_width);
+
+ output_line(to_be_output, to_be_output_width, was_centered);
hyphen_line_count = 0;
}
if (input_trap_count > 0) {
@@ -1705,7 +1763,7 @@ void environment::newline()
}
}
-void environment::output_line(node *n, hunits width)
+void environment::output_line(node *n, hunits width, int was_centered)
{
prev_text_length = width;
if (margin_character_flags) {
@@ -1764,7 +1822,8 @@ void environment::output_line(node *n, hunits width)
width += w;
++next_line_number;
}
- output(nn, !fill, vertical_spacing, total_post_vertical_spacing(), width);
+ output(nn, !fill, vertical_spacing, total_post_vertical_spacing(), width,
+ was_centered);
}
void environment::start_line()
@@ -2012,6 +2071,7 @@ static void distribute_space(node *n, int nspaces, hunits desired_space,
void environment::possibly_break_line(int start_here, int forced)
{
+ int was_centered = center_lines > 0;
if (!fill || current_tab || current_field || dummy)
return;
while (line != 0
@@ -2041,6 +2101,7 @@ void environment::possibly_break_line(int start_here, int forced)
break;
case ADJUST_CENTER:
saved_indent += (target_text_length - bp->width)/2;
+ was_centered = 1;
break;
case ADJUST_RIGHT:
saved_indent += target_text_length - bp->width;
@@ -2078,7 +2139,7 @@ void environment::possibly_break_line(int start_here, int forced)
}
// Do output_line() here so that line will be 0 iff the
// the environment will be empty.
- output_line(pre, output_width);
+ output_line(pre, output_width, was_centered);
while (to_be_discarded != 0) {
tem = to_be_discarded;
to_be_discarded = to_be_discarded->next;
@@ -2141,16 +2202,8 @@ void environment::final_break()
do_break();
}
-/*
- * add_html_tag - emits a special html-tag: to help post-grohtml understand
- * the key troff commands
- */
-
-void environment::add_html_tag(int force, const char *name)
+node *environment::make_tag(const char *nm, int i)
{
- if (!force && (curdiv != topdiv))
- return;
-
if (is_html) {
/*
* need to emit tag for post-grohtml
@@ -2159,132 +2212,119 @@ void environment::add_html_tag(int force, const char *name)
if (curdiv == topdiv && topdiv->before_first_page)
topdiv->begin_page();
macro *m = new macro;
- m->append_str("html-tag:");
- for (const char *p = name; *p; p++)
- if (!invalid_input_char((unsigned char)*p))
- m->append(*p);
- curdiv->output(new special_node(*m), 1, 0, 0, 0);
- if (strcmp(name, ".nf") == 0)
- curenv->ignore_next_eol = 1;
- }
-}
-
-/*
- * add_html_tag - emits a special html-tag: to help post-grohtml understand
- * the key troff commands, it appends a string representation
- * of i.
- */
-
-void environment::add_html_tag(int force, const char *name, int i)
-{
- if (!force && (curdiv != topdiv))
- return;
-
- if (is_html) {
- /*
- * need to emit tag for post-grohtml
- * but we check to see whether we can emit specials
- */
- if (curdiv == topdiv && topdiv->before_first_page)
- topdiv->begin_page();
- macro *m = new macro;
- m->append_str("html-tag:");
- for (const char *p = name; *p; p++)
+ m->append_str("devtag:");
+ for (const char *p = nm; *p; p++)
if (!invalid_input_char((unsigned char)*p))
m->append(*p);
m->append(' ');
m->append_int(i);
- node *n = new special_node(*m);
- curdiv->output(n, 1, 0, 0, 0);
+ return new special_node(*m);
}
+ return 0;
}
-/*
- * add_html_tag_tabs - emits the tab settings for post-grohtml
- */
-
-void environment::add_html_tag_tabs(int force)
+void environment::dump_troff_state()
{
- if (!force && (curdiv != topdiv))
- return;
+#define SPACES " "
+ fprintf(stderr, SPACES "register `in' = %d\n", curenv->indent.to_units());
+ if (curenv->have_temporary_indent)
+ fprintf(stderr, SPACES "register `ti' = %d\n",
+ curenv->temporary_indent.to_units());
+ fprintf(stderr, SPACES "centered lines `ce' = %d\n", curenv->center_lines);
+ fprintf(stderr, SPACES "register `ll' = %d\n",
+ curenv->line_length.to_units());
+ fprintf(stderr, SPACES "fill `fi=1/nf=0' = %d\n", curenv->fill);
+ fprintf(stderr, SPACES "page offset `po' = %d\n",
+ topdiv->get_page_offset().to_units());
+ fprintf(stderr, SPACES "seen_break = %d\n", curenv->seen_break);
+ fprintf(stderr, SPACES "seen_space = %d\n", curenv->seen_space);
+ fflush(stderr);
+#undef SPACES
+}
+statem *environment::construct_state(int only_eol)
+{
if (is_html) {
- /*
- * need to emit tag for post-grohtml
- * but we check to see whether we can emit specials
- */
- if (curdiv == topdiv && topdiv->before_first_page)
- topdiv->begin_page();
- macro *m = new macro;
- hunits d, l;
- enum tab_type t;
- m->append_str("html-tag:.ta ");
- do {
- t = curenv->tabs.distance_to_next_tab(l, &d);
- l += d;
- switch (t) {
- case TAB_LEFT:
- m->append_str(" L ");
- m->append_int(l.to_units());
- break;
- case TAB_CENTER:
- m->append_str(" C ");
- m->append_int(l.to_units());
- break;
- case TAB_RIGHT:
- m->append_str(" R ");
- m->append_int(l.to_units());
- break;
- case TAB_NONE:
- break;
- }
- } while ((t != TAB_NONE) && (l < get_line_length()));
- curdiv->output(new special_node(*m), 1, 0, 0, 0);
+ statem *s = new statem();
+ if (!only_eol) {
+ s->add_tag(MTSM_IN, indent);
+ s->add_tag(MTSM_LL, line_length);
+ s->add_tag(MTSM_PO, topdiv->get_page_offset().to_units());
+ s->add_tag(MTSM_RJ, right_justify_lines);
+ if (have_temporary_indent)
+ s->add_tag(MTSM_TI, temporary_indent);
+ s->add_tag_ta();
+ if (seen_break)
+ s->add_tag(MTSM_BR);
+ if (seen_space != 0)
+ s->add_tag(MTSM_SP, seen_space);
+ seen_break = 0;
+ seen_space = 0;
+ }
+ if (seen_eol) {
+ s->add_tag(MTSM_EOL);
+ s->add_tag(MTSM_CE, center_lines);
+ }
+ seen_eol = 0;
+ return s;
}
+ else
+ return NULL;
}
-node *environment::make_html_tag(const char *name, int i)
+void environment::construct_format_state(node *n, int was_centered,
+ int filling)
{
if (is_html) {
- /*
- * need to emit tag for post-grohtml
- * but we check to see whether we can emit specials
- */
- if (curdiv == topdiv && topdiv->before_first_page)
- topdiv->begin_page();
- macro *m = new macro;
- m->append_str("html-tag:");
- for (const char *p = name; *p; p++)
- if (!invalid_input_char((unsigned char)*p))
- m->append(*p);
- m->append(' ');
- m->append_int(i);
- return new special_node(*m);
+ // find first glyph node which has a state.
+ while (n != 0 && n->state == 0)
+ n = n->next;
+ if (n == 0 || (n->state == 0))
+ return;
+ if (seen_space != 0)
+ n->state->add_tag(MTSM_SP, seen_space);
+ if (seen_eol && topdiv == curdiv)
+ n->state->add_tag(MTSM_EOL);
+ seen_space = 0;
+ seen_eol = 0;
+ if (was_centered)
+ n->state->add_tag(MTSM_CE, center_lines+1);
+ else
+ n->state->add_tag_if_unknown(MTSM_CE, 0);
+ n->state->add_tag_if_unknown(MTSM_FI, filling);
+ n = n->next;
+ while (n != 0) {
+ if (n->state != 0) {
+ n->state->sub_tag_ce();
+ n->state->add_tag_if_unknown(MTSM_FI, filling);
+ }
+ n = n->next;
+ }
}
- return 0;
}
-node *environment::make_html_tag(const char *name)
+void environment::construct_new_line_state(node *n)
{
if (is_html) {
- /*
- * need to emit tag for post-grohtml
- * but we check to see whether we can emit specials
- */
- if (curdiv == topdiv && topdiv->before_first_page)
- topdiv->begin_page();
- macro *m = new macro;
- m->append_str("html-tag:");
- for (const char *p = name; *p; p++)
- if (!invalid_input_char((unsigned char)*p))
- m->append(*p);
- return new special_node(*m);
+ // find first glyph node which has a state.
+ while (n != 0 && n->state == 0)
+ n = n->next;
+ if (n == 0 || n->state == 0)
+ return;
+ if (seen_space != 0)
+ n->state->add_tag(MTSM_SP, seen_space);
+ if (seen_eol && topdiv == curdiv)
+ n->state->add_tag(MTSM_EOL);
+ seen_space = 0;
+ seen_eol = 0;
}
- return 0;
}
-void environment::do_break(int spread)
+extern int global_diverted_space;
+
+void environment::do_break(int do_spread)
{
+ int was_centered = 0;
if (curdiv == topdiv && topdiv->before_first_page) {
topdiv->begin_page();
return;
@@ -2295,7 +2335,7 @@ void environment::do_break(int spread)
// this is so that hyphenation works
line = new space_node(H0, get_fill_color(), line);
space_total++;
- possibly_break_line(0, spread);
+ possibly_break_line(0, do_spread);
}
while (line != 0 && line->discardable()) {
width_total -= line->width();
@@ -2311,6 +2351,7 @@ void environment::do_break(int spread)
switch (adjust_mode) {
case ADJUST_CENTER:
saved_indent += (target_text_length - width_total)/2;
+ was_centered = 1;
break;
case ADJUST_RIGHT:
saved_indent += target_text_length - width_total;
@@ -2319,7 +2360,7 @@ void environment::do_break(int spread)
}
node *tem = line;
line = 0;
- output_line(tem, width_total);
+ output_line(tem, width_total, was_centered);
hyphen_line_count = 0;
}
prev_line_interrupted = 0;
@@ -2327,6 +2368,10 @@ void environment::do_break(int spread)
mark_last_line();
output_pending_lines();
#endif /* WIDOW_CONTROL */
+ if (!global_diverted_space) {
+ curdiv->modified_tag.incl(MTSM_BR);
+ seen_break = 1;
+ }
}
int environment::is_empty()
@@ -2338,10 +2383,8 @@ void do_break_request(int spread)
{
while (!tok.newline() && !tok.eof())
tok.next();
- if (break_flag) {
+ if (break_flag)
curenv->do_break(spread);
- curenv->add_html_tag(0, ".br");
- }
tok.next();
}
@@ -2389,8 +2432,8 @@ void title()
tem->next = n;
n = tem;
}
- hunits title_length(curenv->title_length);
- hunits f = title_length - part_width[1];
+ hunits length_title(curenv->title_length);
+ hunits f = length_title - part_width[1];
hunits f2 = f/2;
n = new hmotion_node(f2 - part_width[2], curenv->get_fill_color(), n);
p = part[1];
@@ -2409,7 +2452,7 @@ void title()
n = tem;
}
curenv->output_title(n, !curenv->fill, curenv->vertical_spacing,
- curenv->total_post_vertical_spacing(), title_length);
+ curenv->total_post_vertical_spacing(), length_title);
curenv->hyphen_line_count = 0;
tok.next();
}
@@ -2748,7 +2791,7 @@ void set_tabs()
}
}
curenv->tabs = tabs;
- curenv->add_html_tag_tabs(1);
+ curdiv->modified_tag.incl(MTSM_TA);
skip_line();
}
@@ -2859,25 +2902,25 @@ node *environment::make_tab_node(hunits d, node *next)
void environment::handle_tab(int is_leader)
{
hunits d;
- hunits abs;
+ hunits absolute;
if (current_tab)
wrap_up_tab();
charinfo *ci = is_leader ? leader_char : tab_char;
delete leader_node;
leader_node = ci ? make_char_node(ci) : 0;
- tab_type t = distance_to_next_tab(&d, &abs);
+ tab_type t = distance_to_next_tab(&d, &absolute);
switch (t) {
case TAB_NONE:
return;
case TAB_LEFT:
+ add_node(make_tag("tab L", absolute.to_units()));
add_node(make_tab_node(d));
- add_node(make_html_tag("tab L", abs.to_units()));
return;
case TAB_RIGHT:
- add_node(make_html_tag("tab R", abs.to_units()));
+ add_node(make_tag("tab R", absolute.to_units()));
break;
case TAB_CENTER:
- add_node(make_html_tag("tab C", abs.to_units()));
+ add_node(make_tag("tab C", absolute.to_units()));
break;
default:
assert(0);
@@ -3091,12 +3134,28 @@ const char *environment::get_font_family_string()
return family->nm.contents();
}
+const char *environment::get_glyph_color_string()
+{
+ return glyph_color->nm.contents();
+}
+
+const char *environment::get_fill_color_string()
+{
+ return fill_color->nm.contents();
+}
+
const char *environment::get_font_name_string()
{
symbol f = get_font_name(fontno, this);
return f.contents();
}
+const char *environment::get_style_name_string()
+{
+ symbol f = get_style_name(fontno);
+ return f.contents();
+}
+
const char *environment::get_name_string()
{
return name.contents();
@@ -3188,7 +3247,9 @@ void init_env_requests()
init_request("fam", family_change);
init_request("fc", field_characters);
init_request("fi", fill);
+ init_request("fcolor", fill_color_change);
init_request("ft", font_change);
+ init_request("gcolor", glyph_color_change);
init_request("hc", hyphen_char);
init_request("hlm", hyphen_line_max_request);
init_request("hy", hyphenate_request);
@@ -3247,6 +3308,8 @@ void init_env_requests()
init_int_env_reg(".L", get_line_spacing);
init_hunits_env_reg(".l", get_line_length);
init_hunits_env_reg(".ll", get_saved_line_length);
+ init_string_env_reg(".M", get_fill_color_string);
+ init_string_env_reg(".m", get_glyph_color_string);
init_hunits_env_reg(".n", get_prev_text_length);
init_int_env_reg(".ps", get_point_size);
init_int_env_reg(".psr", get_requested_point_size);
@@ -3257,6 +3320,7 @@ void init_env_requests()
init_int_env_reg(".ss", get_space_size);
init_int_env_reg(".sss", get_sentence_space_size);
init_string_env_reg(".sr", get_requested_point_size_string);
+ init_string_env_reg(".sty", get_style_name_string);
init_string_env_reg(".tabs", get_tabs);
init_int_env_reg(".u", get_fill);
init_vunits_env_reg(".v", get_vertical_spacing);
@@ -3358,7 +3422,7 @@ static void hyphen_word()
pos[npos++] = i;
}
else {
- int c = ci->get_hyphenation_code();
+ unsigned char c = ci->get_hyphenation_code();
if (c == 0)
break;
buf[i++] = c;
@@ -3661,7 +3725,8 @@ void hyphen_trie::read_patterns_file(const char *name, int append,
c = hpf_getc(fp);
if (c == '{') {
if (have_patterns || have_hyphenation)
- error("`{' not allowed inside of \\patterns or \\hyphenation");
+ error("\\patterns not allowed inside of %1 group",
+ have_patterns ? "\\patterns" : "\\hyphenation");
else {
have_patterns = 1;
have_keyword = 1;
@@ -3675,7 +3740,8 @@ void hyphen_trie::read_patterns_file(const char *name, int append,
c = hpf_getc(fp);
if (c == '{') {
if (have_patterns || have_hyphenation)
- error("`{' not allowed inside of \\patterns or \\hyphenation");
+ error("\\hyphenation not allowed inside of %1 group",
+ have_patterns ? "\\patterns" : "\\hyphenation");
else {
have_hyphenation = 1;
have_keyword = 1;
@@ -3703,8 +3769,17 @@ void hyphen_trie::read_patterns_file(const char *name, int append,
}
c = hpf_getc(fp);
}
- else if (c == '{') // skipped if not starting \patterns
- c = hpf_getc(fp); // or \hyphenation
+ else if (c == '{') {
+ if (have_patterns || have_hyphenation)
+ error("`{' not allowed within %1 group",
+ have_patterns ? "\\patterns" : "\\hyphenation");
+ c = hpf_getc(fp); // skipped if not starting \patterns
+ // or \hyphenation
+ }
+ }
+ else {
+ if (c == '{' || c == '}')
+ c = hpf_getc(fp);
}
if (i > 0) {
if (have_patterns || final_pattern || traditional) {
diff --git a/contrib/groff/src/roff/troff/env.h b/contrib/groff/src/roff/troff/env.h
index 43a4c97..2ee7bdc 100644
--- a/contrib/groff/src/roff/troff/env.h
+++ b/contrib/groff/src/roff/troff/env.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+class statem;
struct size_range {
int min;
@@ -63,7 +65,7 @@ inline int font_size::to_points()
return p/sizescale;
}
-struct environment;
+class environment;
hunits env_digit_width(environment *);
hunits env_space_width(environment *);
@@ -94,11 +96,52 @@ public:
const unsigned MARGIN_CHARACTER_ON = 1;
const unsigned MARGIN_CHARACTER_NEXT = 2;
-struct charinfo;
+class charinfo;
struct node;
struct breakpoint;
-struct font_family;
-struct pending_output_line;
+class font_family;
+class pending_output_line;
+
+// declarations to avoid friend name injection problems
+void title_length();
+void space_size();
+void fill();
+void no_fill();
+void adjust();
+void no_adjust();
+void center();
+void right_justify();
+void vertical_spacing();
+void post_vertical_spacing();
+void line_spacing();
+void line_length();
+void indent();
+void temporary_indent();
+void do_underline(int);
+void do_input_trap(int);
+void set_tabs();
+void margin_character();
+void no_number();
+void number_lines();
+void leader_character();
+void tab_character();
+void hyphenate_request();
+void no_hyphenate();
+void hyphen_line_max_request();
+void hyphenation_space_request();
+void hyphenation_margin_request();
+void line_width();
+#if 0
+void tabs_save();
+void tabs_restore();
+#endif
+void line_tabs_request();
+void title();
+#ifdef WIDOW_CONTROL
+void widow_control_request();
+#endif /* WIDOW_CONTROL */
+
+void do_divert(int append, int boxing);
class environment {
int dummy; // dummy environment used for \w
@@ -147,7 +190,6 @@ class environment {
hunits width_total;
int space_total;
hunits input_line_start;
- tab_stops tabs;
node *tab_contents;
hunits tab_width;
hunits tab_distance;
@@ -183,8 +225,6 @@ class environment {
#ifdef WIDOW_CONTROL
int widow_control;
#endif /* WIDOW_CONTROL */
- int ignore_next_eol;
- int emitted_node; // have we emitted a node since the last html eol tag?
color *glyph_color;
color *prev_glyph_color;
color *fill_color;
@@ -193,9 +233,9 @@ class environment {
tab_type distance_to_next_tab(hunits *);
tab_type distance_to_next_tab(hunits *distance, hunits *leftpos);
void start_line();
- void output_line(node *, hunits);
+ void output_line(node *, hunits, int);
void output(node *nd, int retain_size, vunits vs, vunits post_vs,
- hunits width);
+ hunits width, int was_centered);
void output_title(node *nd, int retain_size, vunits vs, vunits post_vs,
hunits width);
#ifdef WIDOW_CONTROL
@@ -209,6 +249,11 @@ class environment {
node *make_tab_node(hunits d, node *next = 0);
node *get_prev_char();
public:
+ int seen_space;
+ int seen_eol;
+ int suppress_next_eol;
+ int seen_break;
+ tab_stops tabs;
const symbol name;
unsigned char control_char;
unsigned char no_break_control_char;
@@ -217,14 +262,15 @@ public:
environment(symbol);
environment(const environment *); // for temporary environment
~environment();
+ statem *construct_state(int only_eol);
void copy(const environment *);
int is_dummy() { return dummy; }
int is_empty();
int is_composite() { return composite; }
void set_composite() { composite = 1; }
- vunits get_vertical_spacing(); // .v
- vunits get_post_vertical_spacing(); // .pvs
- int get_line_spacing(); // .L
+ vunits get_vertical_spacing(); // .v
+ vunits get_post_vertical_spacing(); // .pvs
+ int get_line_spacing(); // .L
vunits total_post_vertical_spacing();
int get_point_size() { return size.to_scaled_points(); }
font_size get_font_size() { return size; }
@@ -233,23 +279,23 @@ public:
int get_char_height() { return char_height; }
int get_char_slant() { return char_slant; }
hunits get_digit_width();
- int get_font() { return fontno; }; // .f
+ int get_font() { return fontno; }; // .f
font_family *get_family() { return family; }
- int get_bold(); // .b
- int get_adjust_mode(); // .j
- int get_fill(); // .u
- hunits get_indent(); // .i
+ int get_bold(); // .b
+ int get_adjust_mode(); // .j
+ int get_fill(); // .u
+ hunits get_indent(); // .i
hunits get_temporary_indent();
- hunits get_line_length(); // .l
- hunits get_saved_line_length(); // .ll
- hunits get_saved_indent(); // .in
+ hunits get_line_length(); // .l
+ hunits get_saved_line_length(); // .ll
+ hunits get_saved_indent(); // .in
hunits get_title_length();
- hunits get_prev_char_width(); // .w
+ hunits get_prev_char_width(); // .w
hunits get_prev_char_skew();
vunits get_prev_char_height();
vunits get_prev_char_depth();
- hunits get_text_length(); // .k
- hunits get_prev_text_length(); // .n
+ hunits get_text_length(); // .k
+ hunits get_prev_text_length(); // .n
hunits get_space_width() { return env_space_width(this); }
int get_space_size() { return space_size; } // in ems/36
int get_sentence_space_size() { return sentence_space_size; }
@@ -289,13 +335,9 @@ public:
void possibly_break_line(int start_here = 0, int forced = 0);
void do_break(int spread = 0); // .br
void final_break();
- void add_html_tag(int, const char *);
- void add_html_tag(int, const char *, int);
- void add_html_tag_tabs(int);
- node *make_html_tag(const char *name, int i);
- node *make_html_tag(const char *);
+ node *make_tag(const char *name, int i);
void newline();
- void handle_tab(int is_leader = 0); // do a tab or leader
+ void handle_tab(int is_leader = 0); // do a tab or leader
void add_node(node *);
void add_char(charinfo *);
void add_hyphen_indicator();
@@ -303,12 +345,18 @@ public:
void space();
void space(hunits, hunits);
void space_newline();
+ const char *get_glyph_color_string();
+ const char *get_fill_color_string();
const char *get_font_family_string();
const char *get_font_name_string();
+ const char *get_style_name_string();
const char *get_name_string();
const char *get_point_size_string();
const char *get_requested_point_size_string();
void output_pending_lines();
+ void construct_format_state(node *n, int was_centered, int fill);
+ void construct_new_line_state(node *n);
+ void dump_troff_state();
friend void title_length();
friend void space_size();
@@ -357,7 +405,6 @@ extern void push_env(int);
void init_environments();
void read_hyphen_file(const char *name);
-void title();
extern double spread_limit;
diff --git a/contrib/groff/src/roff/troff/hvunits.h b/contrib/groff/src/roff/troff/hvunits.h
index 8efb5ab..99e6692 100644
--- a/contrib/groff/src/roff/troff/hvunits.h
+++ b/contrib/groff/src/roff/troff/hvunits.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class vunits {
diff --git a/contrib/groff/src/roff/troff/input.cpp b/contrib/groff/src/roff/troff/input.cpp
index 55178a2..15077e9 100644
--- a/contrib/groff/src/roff/troff/input.cpp
+++ b/contrib/groff/src/roff/troff/input.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,24 +17,26 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define DEBUGGING
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
-#include "reg.h"
#include "token.h"
#include "div.h"
+#include "reg.h"
#include "charinfo.h"
-#include "stringclass.h"
-#include "font.h"
#include "macropath.h"
-#include "defs.h"
#include "input.h"
+#include "defs.h"
+#include "font.h"
#include "unicode.h"
// Needed for getpid() and isatty()
@@ -63,6 +65,7 @@ extern "C" {
// initial size of buffer for reading names; expanded as necessary
#define ABUF_SIZE 16
+extern "C" const char *program_name;
extern "C" const char *Version_string;
#ifdef COLUMN
@@ -71,16 +74,13 @@ void init_column_requests();
static node *read_draw_node();
static void read_color_draw_node(token &);
-void handle_first_page_transition();
static void push_token(const token &);
void copy_file();
#ifdef COLUMN
void vjustify();
#endif /* COLUMN */
void transparent_file();
-void process_input_stack();
-const char *program_name = 0;
token tok;
int break_flag = 0;
int color_flag = 1; // colors are on by default
@@ -105,11 +105,12 @@ static int compatible_flag = 0;
int ascii_output_flag = 0;
int suppress_output_flag = 0;
int is_html = 0;
-int begin_level = 0; // number of nested .begin requests
+int begin_level = 0; // number of nested \O escapes
int have_input = 0; // whether \f, \F, \D'F...', \H, \m, \M,
// \R, \s, or \S has been processed in
// token::next()
+int old_have_input = 0; // value of have_input right before \n
int tcommand_flag = 0;
int safer_flag = 1; // safer by default
@@ -119,9 +120,13 @@ double spread_limit = -3.0 - 1.0; // negative means deactivated
double warn_scale;
char warn_scaling_indicator;
+int debug_state = 0; // turns on debugging of the html troff state
search_path *mac_path = &safer_macro_path;
+// Defaults to the current directory.
+search_path include_search_path(0, 0, 0, 1);
+
static int get_copy(node**, int = 0);
static void copy_mode_error(const char *,
const errarg & = empty_errarg,
@@ -140,19 +145,22 @@ static void interpolate_environment_variable(symbol);
static symbol composite_glyph_name(symbol);
static void interpolate_arg(symbol);
static request_or_macro *lookup_request(symbol);
-static int get_delim_number(units *, int);
-static int get_delim_number(units *, int, units);
+static int get_delim_number(units *, unsigned char);
+static int get_delim_number(units *, unsigned char, units);
static symbol do_get_long_name(int, char);
-static int get_line_arg(units *res, int si, charinfo **cp);
+static int get_line_arg(units *res, unsigned char si, charinfo **cp);
static int read_size(int *);
static symbol get_delim_name();
static void init_registers();
static void trapping_blank_line();
-struct input_iterator;
+class input_iterator;
input_iterator *make_temp_iterator(const char *);
const char *input_char_description(int);
+void process_input_stack();
+void chop_macro(); // declare to avoid friend name injection
+
void set_escape_char()
{
@@ -192,9 +200,12 @@ void restore_escape_char()
class input_iterator {
public:
input_iterator();
+ input_iterator(int is_div);
virtual ~input_iterator() {}
int get(node **);
friend class input_stack;
+ int is_diversion;
+ statem *diversion_state;
protected:
const unsigned char *ptr;
const unsigned char *eptr;
@@ -211,7 +222,6 @@ private:
virtual int next_file(FILE *, const char *) { return 0; }
virtual void shift(int) {}
virtual int is_boundary() {return 0; }
- virtual int internal_level() { return 0; }
virtual int is_file() { return 0; }
virtual int is_macro() { return 0; }
virtual void save_compatible_flag(int) {}
@@ -219,7 +229,12 @@ private:
};
input_iterator::input_iterator()
-: ptr(0), eptr(0)
+: is_diversion(0), ptr(0), eptr(0)
+{
+}
+
+input_iterator::input_iterator(int is_div)
+: is_diversion(is_div), ptr(0), eptr(0)
{
}
@@ -413,16 +428,21 @@ public:
static int is_return_boundary();
static void remove_boundary();
static int get_level();
+ static int get_div_level();
+ static void increase_level();
+ static void decrease_level();
static void clear();
static void pop_macro();
static void save_compatible_flag(int);
static int get_compatible_flag();
-
+ static statem *get_diversion_state();
+ static void check_end_diversion(input_iterator *t);
static int limit;
+ static int div_level;
+ static statem *diversion_state;
private:
static input_iterator *top;
static int level;
-
static int finish_get(node **);
static int finish_peek();
};
@@ -430,17 +450,38 @@ private:
input_iterator *input_stack::top = &nil_iterator;
int input_stack::level = 0;
int input_stack::limit = DEFAULT_INPUT_STACK_LIMIT;
+int input_stack::div_level = 0;
+statem *input_stack::diversion_state = NULL;
+int suppress_push=0;
+
inline int input_stack::get_level()
{
- return level + top->internal_level();
+ return level;
+}
+
+inline void input_stack::increase_level()
+{
+ level++;
+}
+
+inline void input_stack::decrease_level()
+{
+ level--;
+}
+
+inline int input_stack::get_div_level()
+{
+ return div_level;
}
inline int input_stack::get(node **np)
{
int res = (top->ptr < top->eptr) ? *top->ptr++ : finish_get(np);
- if (res == '\n')
+ if (res == '\n') {
+ old_have_input = have_input;
have_input = 0;
+ }
return res;
}
@@ -453,6 +494,13 @@ int input_stack::finish_get(node **np)
if (top == &nil_iterator)
break;
input_iterator *tem = top;
+ check_end_diversion(tem);
+#if defined(DEBUGGING)
+ if (debug_state)
+ if (tem->is_diversion)
+ fprintf(stderr,
+ "in diversion level = %d\n", input_stack::get_div_level());
+#endif
top = top->next;
level--;
delete tem;
@@ -468,6 +516,14 @@ inline int input_stack::peek()
return (top->ptr < top->eptr) ? *top->ptr : finish_peek();
}
+void input_stack::check_end_diversion(input_iterator *t)
+{
+ if (t->is_diversion) {
+ div_level--;
+ diversion_state = t->diversion_state;
+ }
+}
+
int input_stack::finish_peek()
{
for (;;) {
@@ -477,6 +533,7 @@ int input_stack::finish_peek()
if (top == &nil_iterator)
break;
input_iterator *tem = top;
+ check_end_diversion(tem);
top = top->next;
level--;
delete tem;
@@ -506,6 +563,8 @@ void input_stack::remove_boundary()
{
assert(top->is_boundary());
input_iterator *temp = top->next;
+ check_end_diversion(top);
+
delete top;
top = temp;
level--;
@@ -519,6 +578,38 @@ void input_stack::push(input_iterator *in)
fatal("input stack limit exceeded (probable infinite loop)");
in->next = top;
top = in;
+ if (top->is_diversion) {
+ div_level++;
+ in->diversion_state = diversion_state;
+ diversion_state = curenv->construct_state(0);
+#if defined(DEBUGGING)
+ if (debug_state) {
+ curenv->dump_troff_state();
+ fflush(stderr);
+ }
+#endif
+ }
+#if defined(DEBUGGING)
+ if (debug_state)
+ if (top->is_diversion) {
+ fprintf(stderr,
+ "in diversion level = %d\n", input_stack::get_div_level());
+ fflush(stderr);
+ }
+#endif
+}
+
+statem *get_diversion_state()
+{
+ return input_stack::get_diversion_state();
+}
+
+statem *input_stack::get_diversion_state()
+{
+ if (diversion_state == NULL)
+ return NULL;
+ else
+ return new statem(diversion_state);
}
input_iterator *input_stack::get_arg(int i)
@@ -597,6 +688,7 @@ void input_stack::end_file()
for (input_iterator **pp = &top; *pp != &nil_iterator; pp = &(*pp)->next)
if ((*pp)->is_file()) {
input_iterator *tem = *pp;
+ check_end_diversion(tem);
*pp = (*pp)->next;
delete tem;
level--;
@@ -611,6 +703,7 @@ void input_stack::clear()
if (top->is_boundary())
nboundaries++;
input_iterator *tem = top;
+ check_end_diversion(tem);
top = top->next;
level--;
delete tem;
@@ -631,6 +724,7 @@ void input_stack::pop_macro()
nboundaries++;
is_macro = top->is_macro();
input_iterator *tem = top;
+ check_end_diversion(tem);
top = top->next;
level--;
delete tem;
@@ -666,7 +760,7 @@ void next_file()
input_stack::end_file();
else {
errno = 0;
- FILE *fp = fopen(nm.contents(), "r");
+ FILE *fp = include_search_path.open_file_cautious(nm.contents());
if (!fp)
error("can't open `%1': %2", nm.contents(), strerror(errno));
else
@@ -684,7 +778,7 @@ void shift()
skip_line();
}
-static int get_char_for_escape_name(int allow_space = 0)
+static char get_char_for_escape_name(int allow_space = 0)
{
int c = get_copy(0);
switch (c) {
@@ -734,7 +828,7 @@ static symbol read_long_escape_name(read_mode mode)
char *buf = abuf;
int buf_size = ABUF_SIZE;
int i = 0;
- int c;
+ char c;
int have_char = 0;
for (;;) {
c = get_char_for_escape_name(have_char && mode == WITH_ARGS);
@@ -784,7 +878,7 @@ static symbol read_long_escape_name(read_mode mode)
static symbol read_escape_name(read_mode mode)
{
- int c = get_char_for_escape_name();
+ char c = get_char_for_escape_name();
if (c == 0)
return NULL_SYMBOL;
if (c == '(')
@@ -799,7 +893,7 @@ static symbol read_escape_name(read_mode mode)
static symbol read_increment_and_escape_name(int *incp)
{
- int c = get_char_for_escape_name();
+ char c = get_char_for_escape_name();
switch (c) {
case 0:
*incp = 0;
@@ -831,6 +925,28 @@ static int get_copy(node **nd, int defining)
{
for (;;) {
int c = input_stack::get(nd);
+ if (c == PUSH_GROFF_MODE) {
+ input_stack::save_compatible_flag(compatible_flag);
+ compatible_flag = 0;
+ continue;
+ }
+ if (c == PUSH_COMP_MODE) {
+ input_stack::save_compatible_flag(compatible_flag);
+ compatible_flag = 1;
+ continue;
+ }
+ if (c == POP_GROFFCOMP_MODE) {
+ compatible_flag = input_stack::get_compatible_flag();
+ continue;
+ }
+ if (c == BEGIN_QUOTE) {
+ input_stack::increase_level();
+ continue;
+ }
+ if (c == END_QUOTE) {
+ input_stack::decrease_level();
+ continue;
+ }
if (c == ESCAPE_NEWLINE) {
if (defining)
return c;
@@ -993,6 +1109,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
int non_interpreted_char_node::same(node *nd)
@@ -1010,6 +1127,11 @@ int non_interpreted_char_node::force_tprint()
return 0;
}
+int non_interpreted_char_node::is_tag()
+{
+ return 0;
+}
+
non_interpreted_char_node::non_interpreted_char_node(unsigned char n) : c(n)
{
assert(n != 0);
@@ -1033,7 +1155,6 @@ static node *do_suppress(symbol nm);
static void do_register();
dictionary color_dictionary(501);
-static symbol default_symbol("default");
static color *lookup_color(symbol nm)
{
@@ -1057,7 +1178,7 @@ void do_glyph_color(symbol nm)
if (tem)
curenv->set_glyph_color(tem);
else
- (void)color_dictionary.lookup(nm, new color);
+ (void)color_dictionary.lookup(nm, new color(nm));
}
}
@@ -1072,7 +1193,7 @@ void do_fill_color(symbol nm)
if (tem)
curenv->set_fill_color(tem);
else
- (void)color_dictionary.lookup(nm, new color);
+ (void)color_dictionary.lookup(nm, new color(nm));
}
}
@@ -1256,8 +1377,10 @@ static void define_color()
skip_line();
return;
}
- if (col)
+ if (col) {
+ col->nm = color_name;
(void)color_dictionary.lookup(color_name, col);
+ }
skip_line();
}
@@ -1456,6 +1579,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
token_node::token_node(const token &t) : tk(t)
@@ -1487,6 +1611,11 @@ int token_node::force_tprint()
return 0;
}
+int token_node::is_tag()
+{
+ return 0;
+}
+
token::token() : nd(0), type(TOKEN_EMPTY)
{
}
@@ -1548,18 +1677,28 @@ void token::next()
}
units x;
for (;;) {
- node *n;
+ node *n = 0;
int cc = input_stack::get(&n);
if (cc != escape_char || escape_char == 0) {
handle_normal_char:
switch(cc) {
- case COMPATIBLE_SAVE:
+ case PUSH_GROFF_MODE:
input_stack::save_compatible_flag(compatible_flag);
compatible_flag = 0;
continue;
- case COMPATIBLE_RESTORE:
+ case PUSH_COMP_MODE:
+ input_stack::save_compatible_flag(compatible_flag);
+ compatible_flag = 1;
+ continue;
+ case POP_GROFFCOMP_MODE:
compatible_flag = input_stack::get_compatible_flag();
continue;
+ case BEGIN_QUOTE:
+ input_stack::increase_level();
+ continue;
+ case END_QUOTE:
+ input_stack::decrease_level();
+ continue;
case EOF:
type = TOKEN_EOF;
return;
@@ -1710,7 +1849,7 @@ void token::next()
}
else {
handle_escape_char:
- cc = input_stack::get(0);
+ cc = input_stack::get(&n);
switch(cc) {
case '(':
nm = read_two_char_escape_name();
@@ -1904,11 +2043,11 @@ void token::next()
if (s == 0)
s = get_charinfo(cc == 'l' ? "ru" : "br");
type = TOKEN_NODE;
- node *n = curenv->make_char_node(s);
+ node *char_node = curenv->make_char_node(s);
if (cc == 'l')
- nd = new hline_node(x, n);
+ nd = new hline_node(x, char_node);
else
- nd = new vline_node(x, n);
+ nd = new vline_node(x, char_node);
return;
}
case 'm':
@@ -2398,6 +2537,8 @@ void exit_request()
void return_macro_request()
{
+ if (has_arg() && tok.ch())
+ input_stack::pop_macro();
input_stack::pop_macro();
tok.next();
}
@@ -2528,12 +2669,16 @@ int node::reread(int *)
return 0;
}
+int global_diverted_space = 0;
+
int diverted_space_node::reread(int *bolp)
{
+ global_diverted_space = 1;
if (curenv->get_fill())
trapping_blank_line();
else
curdiv->space(n);
+ global_diverted_space = 0;
*bolp = 1;
return 1;
}
@@ -2590,10 +2735,33 @@ void process_input_stack()
tok.next();
} while (tok.white_space());
symbol nm = get_name();
+#if defined(DEBUGGING)
+ if (debug_state) {
+ if (! nm.is_null()) {
+ if (strcmp(nm.contents(), "test") == 0) {
+ fprintf(stderr, "found it!\n");
+ fflush(stderr);
+ }
+ fprintf(stderr, "interpreting [%s]", nm.contents());
+ if (strcmp(nm.contents(), "di") == 0 && topdiv != curdiv)
+ fprintf(stderr, " currently in diversion: %s",
+ curdiv->get_diversion_name());
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
+ }
+#endif
if (nm.is_null())
skip_line();
- else
+ else {
interpolate_macro(nm);
+#if defined(DEBUGGING)
+ if (debug_state) {
+ fprintf(stderr, "finished interpreting [%s] and environment state is\n", nm.contents());
+ curenv->dump_troff_state();
+ }
+#endif
+ }
suppress_next = 1;
}
else {
@@ -2601,6 +2769,11 @@ void process_input_stack()
;
else {
for (;;) {
+#if defined(DEBUGGING)
+ if (debug_state) {
+ fprintf(stderr, "found [%c]\n", ch); fflush(stderr);
+ }
+#endif
curenv->add_char(charset_table[ch]);
tok.next();
if (tok.type != token::TOKEN_CHAR)
@@ -2637,7 +2810,7 @@ void process_input_stack()
}
case token::TOKEN_NEWLINE:
{
- if (bol && !have_input
+ if (bol && !old_have_input
&& !curenv->get_prev_line_interrupted())
trapping_blank_line();
else {
@@ -2962,7 +3135,7 @@ node_list::~node_list()
delete_node_list(head);
}
-struct macro_header {
+class macro_header {
public:
int count;
char_list cl;
@@ -2978,6 +3151,7 @@ macro::~macro()
}
macro::macro()
+: is_a_diversion(0)
{
if (!input_stack::get_location(1, &filename, &lineno)) {
filename = 0;
@@ -2989,13 +3163,30 @@ macro::macro()
}
macro::macro(const macro &m)
-: p(m.p), filename(m.filename), lineno(m.lineno), len(m.len),
- empty_macro(m.empty_macro)
+: filename(m.filename), lineno(m.lineno), len(m.len),
+ empty_macro(m.empty_macro), is_a_diversion(m.is_a_diversion), p(m.p)
{
if (p != 0)
p->count++;
}
+macro::macro(int is_div)
+ : is_a_diversion(is_div)
+{
+ if (!input_stack::get_location(1, &filename, &lineno)) {
+ filename = 0;
+ lineno = 0;
+ }
+ len = 0;
+ empty_macro = 1;
+ p = 0;
+}
+
+int macro::is_diversion()
+{
+ return is_a_diversion;
+}
+
macro &macro::operator=(const macro &m)
{
// don't assign object
@@ -3008,6 +3199,7 @@ macro &macro::operator=(const macro &m)
lineno = m.lineno;
len = m.len;
empty_macro = m.empty_macro;
+ is_a_diversion = m.is_a_diversion;
return *this;
}
@@ -3024,7 +3216,7 @@ void macro::append(unsigned char c)
}
p->cl.append(c);
++len;
- if (c != COMPATIBLE_SAVE && c != COMPATIBLE_RESTORE)
+ if (c != PUSH_GROFF_MODE && c != PUSH_COMP_MODE && c != POP_GROFFCOMP_MODE)
empty_macro = 0;
}
@@ -3110,7 +3302,7 @@ macro_header *macro_header::copy(int n)
bp = bp->next;
ptr = bp->s;
}
- int c = *ptr++;
+ unsigned char c = *ptr++;
p->cl.append(c);
if (c == 0) {
p->nl.append(nd->copy());
@@ -3158,11 +3350,12 @@ public:
void backtrace();
void save_compatible_flag(int f) { saved_compatible_flag = f; }
int get_compatible_flag() { return saved_compatible_flag; }
+ int is_diversion();
};
string_iterator::string_iterator(const macro &m, const char *p, symbol s)
-: mac(m), how_invoked(p),
- newline_flag(0), lineno(1), nm(s)
+: input_iterator(m.is_a_diversion), mac(m), how_invoked(p), newline_flag(0),
+ lineno(1), nm(s)
{
count = mac.len;
if (count != 0) {
@@ -3188,6 +3381,11 @@ string_iterator::string_iterator()
count = 0;
}
+int string_iterator::is_diversion()
+{
+ return mac.is_diversion();
+}
+
int string_iterator::fill(node **np)
{
if (newline_flag)
@@ -3201,8 +3399,13 @@ int string_iterator::fill(node **np)
p = bp->s;
}
if (*p == '\0') {
- if (np)
+ if (np) {
*np = nd->copy();
+ if (is_diversion())
+ (*np)->div_nest_level = input_stack::get_div_level();
+ else
+ (*np)->div_nest_level = 0;
+ }
nd = nd->next;
eptr = ptr = p + 1;
count--;
@@ -3390,6 +3593,7 @@ public:
void add_arg(const macro &m);
void shift(int n);
int is_macro() { return 1; }
+ int is_diversion();
};
input_iterator *macro_iterator::get_arg(int i)
@@ -3513,12 +3717,13 @@ static void decode_args(macro_iterator *mi)
macro arg;
int quote_input_level = 0;
int done_tab_warning = 0;
- if (c == '\"') {
+ if (c == '"') {
quote_input_level = input_stack::get_level();
c = get_copy(&n);
}
+ arg.append(compatible_flag ? PUSH_COMP_MODE : PUSH_GROFF_MODE);
while (c != EOF && c != '\n' && !(c == ' ' && quote_input_level == 0)) {
- if (quote_input_level > 0 && c == '\"'
+ if (quote_input_level > 0 && c == '"'
&& (compatible_flag
|| input_stack::get_level() == quote_input_level)) {
c = get_copy(&n);
@@ -3542,6 +3747,7 @@ static void decode_args(macro_iterator *mi)
c = get_copy(&n);
}
}
+ arg.append(POP_GROFFCOMP_MODE);
mi->add_arg(arg);
}
}
@@ -3563,14 +3769,14 @@ static void decode_string_args(macro_iterator *mi)
macro arg;
int quote_input_level = 0;
int done_tab_warning = 0;
- if (c == '\"') {
+ if (c == '"') {
quote_input_level = input_stack::get_level();
c = get_copy(&n);
}
while (c != EOF && c != '\n'
&& !(c == ']' && quote_input_level == 0)
&& !(c == ' ' && quote_input_level == 0)) {
- if (quote_input_level > 0 && c == '\"'
+ if (quote_input_level > 0 && c == '"'
&& input_stack::get_level() == quote_input_level) {
c = get_copy(&n);
if (c == '"') {
@@ -3615,8 +3821,8 @@ int macro::empty()
return empty_macro == 1;
}
-macro_iterator::macro_iterator(symbol s, macro &m, const char *how_invoked)
-: string_iterator(m, how_invoked, s), args(0), argc(0)
+macro_iterator::macro_iterator(symbol s, macro &m, const char *how_called)
+: string_iterator(m, how_called, s), args(0), argc(0)
{
}
@@ -3821,12 +4027,13 @@ void read_request()
}
enum define_mode { DEFINE_NORMAL, DEFINE_APPEND, DEFINE_IGNORE };
-enum calling_mode { CALLING_NORMAL, CALLING_INDIRECT, CALLING_DISABLE_COMP };
+enum calling_mode { CALLING_NORMAL, CALLING_INDIRECT };
+enum comp_mode { COMP_IGNORE, COMP_DISABLE, COMP_ENABLE };
-void do_define_string(define_mode mode, calling_mode calling)
+void do_define_string(define_mode mode, comp_mode comp)
{
symbol nm;
- node *n;
+ node *n = 0; // pacify compiler
int c;
nm = get_name(1);
if (nm.is_null()) {
@@ -3853,8 +4060,10 @@ void do_define_string(define_mode mode, calling_mode calling)
macro *mm = rm ? rm->to_macro() : 0;
if (mode == DEFINE_APPEND && mm)
mac = *mm;
- if (calling == CALLING_DISABLE_COMP)
- mac.append(COMPATIBLE_SAVE);
+ if (comp == COMP_DISABLE)
+ mac.append(PUSH_GROFF_MODE);
+ else if (comp == COMP_ENABLE)
+ mac.append(PUSH_COMP_MODE);
while (c != '\n' && c != EOF) {
if (c == 0)
mac.append(n);
@@ -3866,35 +4075,37 @@ void do_define_string(define_mode mode, calling_mode calling)
mm = new macro;
request_dictionary.define(nm, mm);
}
- if (calling == CALLING_DISABLE_COMP)
- mac.append(COMPATIBLE_RESTORE);
+ if (comp == COMP_DISABLE || comp == COMP_ENABLE)
+ mac.append(POP_GROFFCOMP_MODE);
*mm = mac;
tok.next();
}
void define_string()
{
- do_define_string(DEFINE_NORMAL, CALLING_NORMAL);
+ do_define_string(DEFINE_NORMAL,
+ compatible_flag ? COMP_ENABLE: COMP_IGNORE);
}
void define_nocomp_string()
{
- do_define_string(DEFINE_NORMAL, CALLING_DISABLE_COMP);
+ do_define_string(DEFINE_NORMAL, COMP_DISABLE);
}
void append_string()
{
- do_define_string(DEFINE_APPEND, CALLING_NORMAL);
+ do_define_string(DEFINE_APPEND,
+ compatible_flag ? COMP_ENABLE : COMP_IGNORE);
}
void append_nocomp_string()
{
- do_define_string(DEFINE_APPEND, CALLING_DISABLE_COMP);
+ do_define_string(DEFINE_APPEND, COMP_DISABLE);
}
void do_define_character(char_mode mode, const char *font_name)
{
- node *n;
+ node *n = 0; // pacify compiler
int c;
tok.skip();
charinfo *ci = tok.get_char(1);
@@ -3996,26 +4207,6 @@ static void interpolate_string_with_args(symbol s)
}
}
-/* This class is used for the implementation of \$@. It is used for
-each of the closing double quotes. It artificially increases the
-input level by 2, so that the closing double quote will appear to have
-the same input level as the opening quote. */
-
-class end_quote_iterator : public input_iterator {
- unsigned char buf[1];
-public:
- end_quote_iterator();
- ~end_quote_iterator() { }
- int internal_level() { return 2; }
-};
-
-end_quote_iterator::end_quote_iterator()
-{
- buf[0] = '"';
- ptr = buf;
- eptr = buf + 1;
-}
-
static void interpolate_arg(symbol nm)
{
const char *s = nm.contents();
@@ -4024,17 +4215,39 @@ static void interpolate_arg(symbol nm)
else if (s[1] == 0 && csdigit(s[0]))
input_stack::push(input_stack::get_arg(s[0] - '0'));
else if (s[0] == '*' && s[1] == '\0') {
- for (int i = input_stack::nargs(); i > 0; i--) {
- input_stack::push(input_stack::get_arg(i));
- if (i != 1)
- input_stack::push(make_temp_iterator(" "));
+ int limit = input_stack::nargs();
+ string args;
+ for (int i = 1; i <= limit; i++) {
+ input_iterator *p = input_stack::get_arg(i);
+ int c;
+ while ((c = p->get(0)) != EOF)
+ args += c;
+ if (i != limit)
+ args += ' ';
+ }
+ if (limit > 0) {
+ args += '\0';
+ input_stack::push(make_temp_iterator(args.contents()));
}
}
else if (s[0] == '@' && s[1] == '\0') {
- for (int i = input_stack::nargs(); i > 0; i--) {
- input_stack::push(new end_quote_iterator);
- input_stack::push(input_stack::get_arg(i));
- input_stack::push(make_temp_iterator(i == 1 ? "\"" : " \""));
+ int limit = input_stack::nargs();
+ string args;
+ for (int i = 1; i <= limit; i++) {
+ args += '"';
+ args += BEGIN_QUOTE;
+ input_iterator *p = input_stack::get_arg(i);
+ int c;
+ while ((c = p->get(0)) != EOF)
+ args += c;
+ args += END_QUOTE;
+ args += '"';
+ if (i != limit)
+ args += ' ';
+ }
+ if (limit > 0) {
+ args += '\0';
+ input_stack::push(make_temp_iterator(args.contents()));
}
}
else {
@@ -4091,7 +4304,7 @@ void handle_initial_title()
// this should be local to define_macro, but cfront 1.2 doesn't support that
static symbol dot_symbol(".");
-void do_define_macro(define_mode mode, calling_mode calling)
+void do_define_macro(define_mode mode, calling_mode calling, comp_mode comp)
{
symbol nm, term;
if (calling == CALLING_INDIRECT) {
@@ -4140,8 +4353,10 @@ void do_define_macro(define_mode mode, calling_mode calling)
mac = *mm;
}
int bol = 1;
- if (calling == CALLING_DISABLE_COMP)
- mac.append(COMPATIBLE_SAVE);
+ if (comp == COMP_DISABLE)
+ mac.append(PUSH_GROFF_MODE);
+ else if (comp == COMP_ENABLE)
+ mac.append(PUSH_COMP_MODE);
for (;;) {
while (c == ESCAPE_NEWLINE) {
if (mode == DEFINE_NORMAL || mode == DEFINE_APPEND)
@@ -4177,8 +4392,8 @@ void do_define_macro(define_mode mode, calling_mode calling)
mm = new macro;
request_dictionary.define(nm, mm);
}
- if (calling == CALLING_DISABLE_COMP)
- mac.append(COMPATIBLE_RESTORE);
+ if (comp == COMP_DISABLE || comp == COMP_ENABLE)
+ mac.append(POP_GROFFCOMP_MODE);
*mm = mac;
}
if (term != dot_symbol) {
@@ -4228,38 +4443,52 @@ void do_define_macro(define_mode mode, calling_mode calling)
void define_macro()
{
- do_define_macro(DEFINE_NORMAL, CALLING_NORMAL);
+ do_define_macro(DEFINE_NORMAL, CALLING_NORMAL,
+ compatible_flag ? COMP_ENABLE : COMP_IGNORE);
}
void define_nocomp_macro()
{
- do_define_macro(DEFINE_NORMAL, CALLING_DISABLE_COMP);
+ do_define_macro(DEFINE_NORMAL, CALLING_NORMAL, COMP_DISABLE);
}
void define_indirect_macro()
{
- do_define_macro(DEFINE_NORMAL, CALLING_INDIRECT);
+ do_define_macro(DEFINE_NORMAL, CALLING_INDIRECT,
+ compatible_flag ? COMP_ENABLE : COMP_IGNORE);
+}
+
+void define_indirect_nocomp_macro()
+{
+ do_define_macro(DEFINE_NORMAL, CALLING_INDIRECT, COMP_DISABLE);
}
void append_macro()
{
- do_define_macro(DEFINE_APPEND, CALLING_NORMAL);
+ do_define_macro(DEFINE_APPEND, CALLING_NORMAL,
+ compatible_flag ? COMP_ENABLE : COMP_IGNORE);
+}
+
+void append_nocomp_macro()
+{
+ do_define_macro(DEFINE_APPEND, CALLING_NORMAL, COMP_DISABLE);
}
void append_indirect_macro()
{
- do_define_macro(DEFINE_APPEND, CALLING_INDIRECT);
+ do_define_macro(DEFINE_APPEND, CALLING_INDIRECT,
+ compatible_flag ? COMP_ENABLE : COMP_IGNORE);
}
-void append_nocomp_macro()
+void append_indirect_nocomp_macro()
{
- do_define_macro(DEFINE_APPEND, CALLING_DISABLE_COMP);
+ do_define_macro(DEFINE_APPEND, CALLING_INDIRECT, COMP_DISABLE);
}
void ignore()
{
ignoring = 1;
- do_define_macro(DEFINE_IGNORE, CALLING_NORMAL);
+ do_define_macro(DEFINE_IGNORE, CALLING_NORMAL, COMP_IGNORE);
ignoring = 0;
}
@@ -4313,11 +4542,12 @@ void chop_macro()
// we have to check for additional save/restore pairs which could be
// there due to empty am1 requests.
for (;;) {
- if (m->get(m->len - 1) != COMPATIBLE_RESTORE)
+ if (m->get(m->len - 1) != POP_GROFFCOMP_MODE)
break;
have_restore = 1;
m->len -= 1;
- if (m->get(m->len - 1) != COMPATIBLE_SAVE)
+ if (m->get(m->len - 1) != PUSH_GROFF_MODE
+ && m->get(m->len - 1) != PUSH_COMP_MODE)
break;
have_restore = 0;
m->len -= 1;
@@ -4328,7 +4558,7 @@ void chop_macro()
error("cannot chop empty macro");
else {
if (have_restore)
- m->set(COMPATIBLE_RESTORE, m->len - 1);
+ m->set(POP_GROFFCOMP_MODE, m->len - 1);
else
m->len -= 1;
}
@@ -4353,7 +4583,9 @@ void substring_request()
string_iterator iter1(*m);
for (int l = 0; l < m->len; l++) {
int c = iter1.get(0);
- if (c == COMPATIBLE_SAVE || c == COMPATIBLE_RESTORE)
+ if (c == PUSH_GROFF_MODE
+ || c == PUSH_COMP_MODE
+ || c == POP_GROFFCOMP_MODE)
continue;
if (c == EOF)
break;
@@ -4395,16 +4627,20 @@ void substring_request()
int i;
for (i = 0; i < start; i++) {
int c = iter.get(0);
- while (c == COMPATIBLE_SAVE || c == COMPATIBLE_RESTORE)
+ while (c == PUSH_GROFF_MODE
+ || c == PUSH_COMP_MODE
+ || c == POP_GROFFCOMP_MODE)
c = iter.get(0);
if (c == EOF)
break;
}
macro mac;
for (; i <= end; i++) {
- node *nd;
+ node *nd = 0; // pacify compiler
int c = iter.get(&nd);
- while (c == COMPATIBLE_SAVE || c == COMPATIBLE_RESTORE)
+ while (c == PUSH_GROFF_MODE
+ || c == PUSH_COMP_MODE
+ || c == POP_GROFFCOMP_MODE)
c = iter.get(0);
if (c == EOF)
break;
@@ -4470,7 +4706,7 @@ void asciify_macro()
macro am;
string_iterator iter(*m);
for (;;) {
- node *nd;
+ node *nd = 0; // pacify compiler
int c = iter.get(&nd);
if (c == EOF)
break;
@@ -4497,7 +4733,7 @@ void unformat_macro()
macro am;
string_iterator iter(*m);
for (;;) {
- node *nd;
+ node *nd = 0; // pacify compiler
int c = iter.get(&nd);
if (c == EOF)
break;
@@ -4538,7 +4774,7 @@ static void interpolate_number_format(symbol nm)
input_stack::push(make_temp_iterator(r->get_format()));
}
-static int get_delim_number(units *n, int si, int prev_value)
+static int get_delim_number(units *n, unsigned char si, int prev_value)
{
token start;
start.next();
@@ -4553,7 +4789,7 @@ static int get_delim_number(units *n, int si, int prev_value)
return 0;
}
-static int get_delim_number(units *n, int si)
+static int get_delim_number(units *n, unsigned char si)
{
token start;
start.next();
@@ -4568,7 +4804,7 @@ static int get_delim_number(units *n, int si)
return 0;
}
-static int get_line_arg(units *n, int si, charinfo **cp)
+static int get_line_arg(units *n, unsigned char si, charinfo **cp)
{
token start;
start.next();
@@ -4605,7 +4841,7 @@ static int read_size(int *x)
tok.next();
c = tok.ch();
}
- int val;
+ int val = 0; // pacify compiler
int bad = 0;
if (c == '(') {
tok.next();
@@ -4866,15 +5102,22 @@ public:
non_interpreted_node(const macro &);
int interpret(macro *);
node *copy();
+ int ends_sentence();
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
non_interpreted_node::non_interpreted_node(const macro &m) : mac(m)
{
}
+int non_interpreted_node::ends_sentence()
+{
+ return 2;
+}
+
int non_interpreted_node::same(node *nd)
{
return mac == ((non_interpreted_node *)nd)->mac;
@@ -4890,6 +5133,11 @@ int non_interpreted_node::force_tprint()
return 0;
}
+int non_interpreted_node::is_tag()
+{
+ return 0;
+}
+
node *non_interpreted_node::copy()
{
return new non_interpreted_node(mac);
@@ -4898,7 +5146,7 @@ node *non_interpreted_node::copy()
int non_interpreted_node::interpret(macro *m)
{
string_iterator si(mac);
- node *n;
+ node *n = 0; // pacify compiler
for (;;) {
int c = si.get(&n);
if (c == EOF)
@@ -5247,6 +5495,24 @@ int do_if_request()
result = character_exists(ci, curenv);
tok.next();
}
+ else if (c == 'F') {
+ tok.next();
+ symbol nm = get_long_name(1);
+ if (nm.is_null()) {
+ skip_alternative();
+ return 0;
+ }
+ result = check_font(curenv->get_family()->nm, nm);
+ }
+ else if (c == 'S') {
+ tok.next();
+ symbol nm = get_long_name(1);
+ if (nm.is_null()) {
+ skip_alternative();
+ return 0;
+ }
+ result = check_style(nm);
+ }
else if (tok.space())
result = 0;
else if (tok.delimiter()) {
@@ -5256,6 +5522,7 @@ int do_if_request()
environment env2(curenv);
environment *oldenv = curenv;
curenv = &env1;
+ suppress_push = 1;
for (int i = 0; i < 2; i++) {
for (;;) {
tok.next();
@@ -5279,6 +5546,7 @@ int do_if_request()
delete_node_list(n2);
curenv = oldenv;
have_input = 0;
+ suppress_push = 0;
tok.next();
}
else {
@@ -5333,7 +5601,7 @@ void while_request()
int level = 0;
mac.append(new token_node(tok));
for (;;) {
- node *n;
+ node *n = 0; // pacify compiler
int c = input_stack::get(&n);
if (c == EOF)
break;
@@ -5424,7 +5692,7 @@ void source()
while (!tok.newline() && !tok.eof())
tok.next();
errno = 0;
- FILE *fp = fopen(nm.contents(), "r");
+ FILE *fp = include_search_path.open_file_cautious(nm.contents());
if (fp)
input_stack::push(new file_iterator(fp, nm.contents()));
else
@@ -5663,7 +5931,8 @@ void ps_bbox_request()
errno = 0;
// PS files might contain non-printable characters, such as ^Z
// and CRs not followed by an LF, so open them in binary mode.
- FILE *fp = fopen(nm.contents(), FOPEN_RB);
+ FILE *fp = include_search_path.open_file_cautious(nm.contents(),
+ 0, FOPEN_RB);
if (fp) {
do_ps_file(fp, nm.contents());
fclose(fp);
@@ -5737,8 +6006,9 @@ const char *asciify(int c)
case ESCAPE_COLON:
buf[1] = ':';
break;
- case COMPATIBLE_SAVE:
- case COMPATIBLE_RESTORE:
+ case PUSH_GROFF_MODE:
+ case PUSH_COMP_MODE:
+ case POP_GROFFCOMP_MODE:
buf[0] = '\0';
break;
default:
@@ -5789,6 +6059,52 @@ const char *input_char_description(int c)
return buf;
}
+void tag()
+{
+ if (!tok.newline() && !tok.eof()) {
+ string s;
+ int c;
+ for (;;) {
+ c = get_copy(0);
+ if (c == '"') {
+ c = get_copy(0);
+ break;
+ }
+ if (c != ' ' && c != '\t')
+ break;
+ }
+ s = "x X ";
+ for (; c != '\n' && c != EOF; c = get_copy(0))
+ s += (char)c;
+ s += '\n';
+ curenv->add_node(new tag_node(s, 0));
+ }
+ tok.next();
+}
+
+void taga()
+{
+ if (!tok.newline() && !tok.eof()) {
+ string s;
+ int c;
+ for (;;) {
+ c = get_copy(0);
+ if (c == '"') {
+ c = get_copy(0);
+ break;
+ }
+ if (c != ' ' && c != '\t')
+ break;
+ }
+ s = "x X ";
+ for (; c != '\n' && c != EOF; c = get_copy(0))
+ s += (char)c;
+ s += '\n';
+ curenv->add_node(new tag_node(s, 1));
+ }
+ tok.next();
+}
+
// .tm, .tm1, and .tmc
void do_terminal(int newline, int string_like)
@@ -6630,7 +6946,7 @@ void transparent_file()
curenv->do_break();
if (!filename.is_null()) {
errno = 0;
- FILE *fp = fopen(filename.contents(), "r");
+ FILE *fp = include_search_path.open_file_cautious(filename.contents());
if (!fp)
error("can't open `%1': %2", filename.contents(), strerror(errno));
else {
@@ -6824,7 +7140,7 @@ static void process_input_file(const char *name)
}
else {
errno = 0;
- fp = fopen(name, "r");
+ fp = include_search_path.open_file_cautious(name);
if (!fp)
fatal("can't open `%1': %2", name, strerror(errno));
}
@@ -6920,7 +7236,7 @@ void usage(FILE *stream, const char *prog)
{
fprintf(stream,
"usage: %s -abcivzCERU -wname -Wname -dcs -ffam -mname -nnum -olist\n"
-" -rcn -Tname -Fdir -Mdir [files...]\n",
+" -rcn -Tname -Fdir -Idir -Mdir [files...]\n",
prog);
}
@@ -6938,7 +7254,7 @@ int main(int argc, char **argv)
int fflag = 0;
int nflag = 0;
int no_rc = 0; // don't process troffrc and troffrc-end
- int next_page_number;
+ int next_page_number = 0; // pacify compiler
opterr = 0;
hresolution = vresolution = 1;
// restore $PATH if called from groff
@@ -6957,8 +7273,12 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ 0, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "abcivw:W:zCEf:m:n:o:r:d:F:M:T:tqs:RU",
- long_options, 0))
+#if defined(DEBUGGING)
+#define DEBUG_OPTION "D"
+#endif
+ while ((c = getopt_long(argc, argv,
+ "abciI:vw:W:zCEf:m:n:o:r:d:F:M:T:tqs:RU"
+ DEBUG_OPTION, long_options, 0))
!= EOF)
switch(c) {
case 'v':
@@ -6967,6 +7287,11 @@ int main(int argc, char **argv)
exit(0);
break;
}
+ case 'I':
+ // Search path for .psbb files
+ // and most other non-system input files.
+ include_search_path.command_line_dir(optarg);
+ break;
case 'T':
device = optarg;
tflag = 1;
@@ -7046,6 +7371,11 @@ int main(int argc, char **argv)
case 'U':
safer_flag = 0; // unsafe behaviour
break;
+#if defined(DEBUGGING)
+ case 'D':
+ debug_state = 1;
+ break;
+#endif
case CHAR_MAX + 1: // --help
usage(stdout, argv[0]);
exit(0);
@@ -7214,6 +7544,7 @@ void init_input_requests()
init_request("am", append_macro);
init_request("am1", append_nocomp_macro);
init_request("ami", append_indirect_macro);
+ init_request("ami1", append_indirect_nocomp_macro);
init_request("as", append_string);
init_request("as1", append_nocomp_string);
init_request("asciify", asciify_macro);
@@ -7233,6 +7564,7 @@ void init_input_requests()
init_request("de1", define_nocomp_macro);
init_request("defcolor", define_color);
init_request("dei", define_indirect_macro);
+ init_request("dei1", define_indirect_nocomp_macro);
init_request("do", do_request);
init_request("ds", define_string);
init_request("ds1", define_nocomp_string);
@@ -7279,6 +7611,8 @@ void init_input_requests()
init_request("spreadwarn", spreadwarn_request);
init_request("substring", substring_request);
init_request("sy", system_request);
+ init_request("tag", tag);
+ init_request("taga", taga);
init_request("tm", terminal);
init_request("tm1", terminal1);
init_request("tmc", terminal_continue);
@@ -7305,6 +7639,7 @@ void init_input_requests()
number_reg_dictionary.define(".g", new constant_reg("1"));
number_reg_dictionary.define(".H", new constant_int_reg(&hresolution));
number_reg_dictionary.define(".R", new constant_reg("10000"));
+ number_reg_dictionary.define(".U", new constant_int_reg(&safer_flag));
number_reg_dictionary.define(".V", new constant_int_reg(&vresolution));
number_reg_dictionary.define(".warn", new constant_int_reg(&warning_mask));
extern const char *major_version;
@@ -7514,7 +7849,7 @@ static void read_color_draw_node(token &start)
}
unsigned char scheme = tok.ch();
tok.next();
- color *col;
+ color *col = 0;
char end = start.ch();
switch (scheme) {
case 'c':
diff --git a/contrib/groff/src/roff/troff/input.h b/contrib/groff/src/roff/troff/input.h
index 8d06574..ba6e2e1 100644
--- a/contrib/groff/src/roff/troff/input.h
+++ b/contrib/groff/src/roff/troff/input.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* special character codes */
@@ -54,8 +54,11 @@ const int LAST_PAGE_EJECTOR = 0205;
const int ESCAPE_RIGHT_PARENTHESIS = 0206;
const int ESCAPE_TILDE = 0207;
const int ESCAPE_COLON = 0210;
-const int COMPATIBLE_SAVE = 0211;
-const int COMPATIBLE_RESTORE = 0212;
+const int PUSH_GROFF_MODE = 0211;
+const int PUSH_COMP_MODE = 0212;
+const int POP_GROFFCOMP_MODE = 0213;
+const int BEGIN_QUOTE = 0214;
+const int END_QUOTE = 0215;
#else /* IS_EBCDIC_HOST */
@@ -90,7 +93,13 @@ const int LAST_PAGE_EJECTOR = 065;
const int ESCAPE_RIGHT_PARENTHESIS = 066;
const int ESCAPE_TILDE = 067;
const int ESCAPE_COLON = 070;
-const int COMPATIBLE_SAVE = 071;
-const int COMPATIBLE_RESTORE = 072;
+const int PUSH_GROFF_MODE = 071;
+const int PUSH_COMP_MODE = 072;
+const int POP_GROFFCOMP_MODE = 073;
+const int BEGIN_QUOTE = 074;
+const int END_QUOTE = 075;
#endif /* IS_EBCDIC_HOST */
+
+extern void do_glyph_color(symbol);
+extern void do_fill_color(symbol);
diff --git a/contrib/groff/src/roff/troff/mtsm.cpp b/contrib/groff/src/roff/troff/mtsm.cpp
new file mode 100644
index 0000000..630e973
--- /dev/null
+++ b/contrib/groff/src/roff/troff/mtsm.cpp
@@ -0,0 +1,632 @@
+// -*- C++ -*-
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Written by Gaius Mulley (gaius@glam.ac.uk)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define DEBUGGING
+
+extern int debug_state;
+
+#include "troff.h"
+#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
+#include "env.h"
+
+static int no_of_statems = 0; // debugging aid
+
+int_value::int_value()
+: value(0), is_known(0)
+{
+}
+
+int_value::~int_value()
+{
+}
+
+void int_value::diff(FILE *fp, const char *s, int_value compare)
+{
+ if (differs(compare)) {
+ fputs("x X ", fp);
+ fputs(s, fp);
+ fputs(" ", fp);
+ fputs(i_to_a(compare.value), fp);
+ fputs("\n", fp);
+ value = compare.value;
+ is_known = 1;
+ if (debug_state)
+ fflush(fp);
+ }
+}
+
+void int_value::set(int v)
+{
+ is_known = 1;
+ value = v;
+}
+
+void int_value::unset()
+{
+ is_known = 0;
+}
+
+void int_value::set_if_unknown(int v)
+{
+ if (!is_known)
+ set(v);
+}
+
+int int_value::differs(int_value compare)
+{
+ return compare.is_known
+ && (!is_known || value != compare.value);
+}
+
+bool_value::bool_value()
+{
+}
+
+bool_value::~bool_value()
+{
+}
+
+void bool_value::diff(FILE *fp, const char *s, bool_value compare)
+{
+ if (differs(compare)) {
+ fputs("x X ", fp);
+ fputs(s, fp);
+ fputs("\n", fp);
+ value = compare.value;
+ is_known = 1;
+ if (debug_state)
+ fflush(fp);
+ }
+}
+
+units_value::units_value()
+{
+}
+
+units_value::~units_value()
+{
+}
+
+void units_value::diff(FILE *fp, const char *s, units_value compare)
+{
+ if (differs(compare)) {
+ fputs("x X ", fp);
+ fputs(s, fp);
+ fputs(" ", fp);
+ fputs(i_to_a(compare.value), fp);
+ fputs("\n", fp);
+ value = compare.value;
+ is_known = 1;
+ if (debug_state)
+ fflush(fp);
+ }
+}
+
+void units_value::set(hunits v)
+{
+ is_known = 1;
+ value = v.to_units();
+}
+
+int units_value::differs(units_value compare)
+{
+ return compare.is_known
+ && (!is_known || value != compare.value);
+}
+
+string_value::string_value()
+: value(string("")), is_known(0)
+{
+}
+
+string_value::~string_value()
+{
+}
+
+void string_value::diff(FILE *fp, const char *s, string_value compare)
+{
+ if (differs(compare)) {
+ fputs("x X ", fp);
+ fputs(s, fp);
+ fputs(" ", fp);
+ fputs(compare.value.contents(), fp);
+ fputs("\n", fp);
+ value = compare.value;
+ is_known = 1;
+ }
+}
+
+void string_value::set(string v)
+{
+ is_known = 1;
+ value = v;
+}
+
+void string_value::unset()
+{
+ is_known = 0;
+}
+
+int string_value::differs(string_value compare)
+{
+ return compare.is_known
+ && (!is_known || value != compare.value);
+}
+
+statem::statem()
+{
+ issue_no = no_of_statems;
+ no_of_statems++;
+}
+
+statem::statem(statem *copy)
+{
+ int i;
+ for (i = 0; i < LAST_BOOL; i++)
+ bool_values[i] = copy->bool_values[i];
+ for (i = 0; i < LAST_INT; i++)
+ int_values[i] = copy->int_values[i];
+ for (i = 0; i < LAST_UNITS; i++)
+ units_values[i] = copy->units_values[i];
+ for (i = 0; i < LAST_STRING; i++)
+ string_values[i] = copy->string_values[i];
+ issue_no = copy->issue_no;
+}
+
+statem::~statem()
+{
+}
+
+void statem::flush(FILE *fp, statem *compare)
+{
+ int_values[MTSM_FI].diff(fp, "devtag:.fi",
+ compare->int_values[MTSM_FI]);
+ int_values[MTSM_RJ].diff(fp, "devtag:.rj",
+ compare->int_values[MTSM_RJ]);
+ int_values[MTSM_SP].diff(fp, "devtag:.sp",
+ compare->int_values[MTSM_SP]);
+ units_values[MTSM_IN].diff(fp, "devtag:.in",
+ compare->units_values[MTSM_IN]);
+ units_values[MTSM_LL].diff(fp, "devtag:.ll",
+ compare->units_values[MTSM_LL]);
+ units_values[MTSM_PO].diff(fp, "devtag:.po",
+ compare->units_values[MTSM_PO]);
+ string_values[MTSM_TA].diff(fp, "devtag:.ta",
+ compare->string_values[MTSM_TA]);
+ units_values[MTSM_TI].diff(fp, "devtag:.ti",
+ compare->units_values[MTSM_TI]);
+ int_values[MTSM_CE].diff(fp, "devtag:.ce",
+ compare->int_values[MTSM_CE]);
+ bool_values[MTSM_EOL].diff(fp, "devtag:.eol",
+ compare->bool_values[MTSM_EOL]);
+ bool_values[MTSM_BR].diff(fp, "devtag:.br",
+ compare->bool_values[MTSM_BR]);
+ if (debug_state) {
+ fprintf(stderr, "compared state %d\n", compare->issue_no);
+ fflush(stderr);
+ }
+}
+
+void statem::add_tag(int_value_state t, int v)
+{
+ int_values[t].set(v);
+}
+
+void statem::add_tag(units_value_state t, hunits v)
+{
+ units_values[t].set(v);
+}
+
+void statem::add_tag(bool_value_state t)
+{
+ bool_values[t].set(1);
+}
+
+void statem::add_tag(string_value_state t, string v)
+{
+ string_values[t].set(v);
+}
+
+void statem::add_tag_if_unknown(int_value_state t, int v)
+{
+ int_values[t].set_if_unknown(v);
+}
+
+void statem::sub_tag_ce()
+{
+ int_values[MTSM_CE].unset();
+}
+
+/*
+ * add_tag_ta - add the tab settings to the minimum troff state machine
+ */
+
+void statem::add_tag_ta()
+{
+ if (is_html) {
+ string s = string("");
+ hunits d, l;
+ enum tab_type t;
+ do {
+ t = curenv->tabs.distance_to_next_tab(l, &d);
+ l += d;
+ switch (t) {
+ case TAB_LEFT:
+ s += " L ";
+ s += as_string(l.to_units());
+ break;
+ case TAB_CENTER:
+ s += " C ";
+ s += as_string(l.to_units());
+ break;
+ case TAB_RIGHT:
+ s += " R ";
+ s += as_string(l.to_units());
+ break;
+ case TAB_NONE:
+ break;
+ }
+ } while (t != TAB_NONE && l < curenv->get_line_length());
+ s += '\0';
+ string_values[MTSM_TA].set(s);
+ }
+}
+
+void statem::update(statem *older, statem *newer, int_value_state t)
+{
+ if (newer->int_values[t].differs(older->int_values[t])
+ && !newer->int_values[t].is_known)
+ newer->int_values[t].set(older->int_values[t].value);
+}
+
+void statem::update(statem *older, statem *newer, units_value_state t)
+{
+ if (newer->units_values[t].differs(older->units_values[t])
+ && !newer->units_values[t].is_known)
+ newer->units_values[t].set(older->units_values[t].value);
+}
+
+void statem::update(statem *older, statem *newer, bool_value_state t)
+{
+ if (newer->bool_values[t].differs(older->bool_values[t])
+ && !newer->bool_values[t].is_known)
+ newer->bool_values[t].set(older->bool_values[t].value);
+}
+
+void statem::update(statem *older, statem *newer, string_value_state t)
+{
+ if (newer->string_values[t].differs(older->string_values[t])
+ && !newer->string_values[t].is_known)
+ newer->string_values[t].set(older->string_values[t].value);
+}
+
+void statem::merge(statem *newer, statem *older)
+{
+ if (newer == 0 || older == 0)
+ return;
+ update(older, newer, MTSM_EOL);
+ update(older, newer, MTSM_BR);
+ update(older, newer, MTSM_FI);
+ update(older, newer, MTSM_LL);
+ update(older, newer, MTSM_PO);
+ update(older, newer, MTSM_RJ);
+ update(older, newer, MTSM_SP);
+ update(older, newer, MTSM_TA);
+ update(older, newer, MTSM_TI);
+ update(older, newer, MTSM_CE);
+}
+
+stack::stack()
+: next(0), state(0)
+{
+}
+
+stack::stack(statem *s, stack *n)
+: next(n), state(s)
+{
+}
+
+stack::~stack()
+{
+ if (state)
+ delete state;
+ if (next)
+ delete next;
+}
+
+mtsm::mtsm()
+: sp(0)
+{
+ driver = new statem();
+}
+
+mtsm::~mtsm()
+{
+ delete driver;
+ if (sp)
+ delete sp;
+}
+
+/*
+ * push_state - push the current troff state and use `n' as
+ * the new troff state.
+ */
+
+void mtsm::push_state(statem *n)
+{
+ if (is_html) {
+#if defined(DEBUGGING)
+ if (debug_state)
+ fprintf(stderr, "--> state %d pushed\n", n->issue_no) ; fflush(stderr);
+#endif
+ sp = new stack(n, sp);
+ }
+}
+
+void mtsm::pop_state()
+{
+ if (is_html) {
+#if defined(DEBUGGING)
+ if (debug_state)
+ fprintf(stderr, "--> state popped\n") ; fflush(stderr);
+#endif
+ if (sp == 0)
+ fatal("empty state machine stack");
+ if (sp->state)
+ delete sp->state;
+ sp->state = 0;
+ stack *t = sp;
+ sp = sp->next;
+ t->next = 0;
+ delete t;
+ }
+}
+
+/*
+ * inherit - scan the stack and collects inherited values.
+ */
+
+void mtsm::inherit(statem *s, int reset_bool)
+{
+ if (sp && sp->state) {
+ if (s->units_values[MTSM_IN].is_known
+ && sp->state->units_values[MTSM_IN].is_known)
+ s->units_values[MTSM_IN].value += sp->state->units_values[MTSM_IN].value;
+ s->update(sp->state, s, MTSM_FI);
+ s->update(sp->state, s, MTSM_LL);
+ s->update(sp->state, s, MTSM_PO);
+ s->update(sp->state, s, MTSM_RJ);
+ s->update(sp->state, s, MTSM_TA);
+ s->update(sp->state, s, MTSM_TI);
+ s->update(sp->state, s, MTSM_CE);
+ if (sp->state->bool_values[MTSM_BR].is_known
+ && sp->state->bool_values[MTSM_BR].value) {
+ if (reset_bool)
+ sp->state->bool_values[MTSM_BR].set(0);
+ s->bool_values[MTSM_BR].set(1);
+ if (debug_state)
+ fprintf(stderr, "inherited br from pushed state %d\n",
+ sp->state->issue_no);
+ }
+ else if (s->bool_values[MTSM_BR].is_known
+ && s->bool_values[MTSM_BR].value)
+ if (! s->int_values[MTSM_CE].is_known)
+ s->bool_values[MTSM_BR].unset();
+ if (sp->state->bool_values[MTSM_EOL].is_known
+ && sp->state->bool_values[MTSM_EOL].value) {
+ if (reset_bool)
+ sp->state->bool_values[MTSM_EOL].set(0);
+ s->bool_values[MTSM_EOL].set(1);
+ }
+ }
+}
+
+void mtsm::flush(FILE *fp, statem *s, string tag_list)
+{
+ if (is_html && s) {
+ inherit(s, 1);
+ driver->flush(fp, s);
+ // Set rj, ce, ti to unknown if they were known and
+ // we have seen an eol or br. This ensures that these values
+ // are emitted during the next glyph (as they step from n..0
+ // at each newline).
+ if ((driver->bool_values[MTSM_EOL].is_known
+ && driver->bool_values[MTSM_EOL].value)
+ || (driver->bool_values[MTSM_BR].is_known
+ && driver->bool_values[MTSM_BR].value)) {
+ if (driver->units_values[MTSM_TI].is_known)
+ driver->units_values[MTSM_TI].is_known = 0;
+ if (driver->int_values[MTSM_RJ].is_known
+ && driver->int_values[MTSM_RJ].value > 0)
+ driver->int_values[MTSM_RJ].is_known = 0;
+ if (driver->int_values[MTSM_CE].is_known
+ && driver->int_values[MTSM_CE].value > 0)
+ driver->int_values[MTSM_CE].is_known = 0;
+ }
+ // reset the boolean values
+ driver->bool_values[MTSM_BR].set(0);
+ driver->bool_values[MTSM_EOL].set(0);
+ // reset space value
+ driver->int_values[MTSM_SP].set(0);
+ // lastly write out any direct tag entries
+ if (tag_list != string("")) {
+ string t = tag_list + '\0';
+ fputs(t.contents(), fp);
+ }
+ }
+}
+
+/*
+ * display_state - dump out a synopsis of the state to stderr.
+ */
+
+void statem::display_state()
+{
+ fprintf(stderr, " <state ");
+ if (bool_values[MTSM_BR].is_known)
+ if (bool_values[MTSM_BR].value)
+ fprintf(stderr, "[br]");
+ else
+ fprintf(stderr, "[!br]");
+ if (bool_values[MTSM_EOL].is_known)
+ if (bool_values[MTSM_EOL].value)
+ fprintf(stderr, "[eol]");
+ else
+ fprintf(stderr, "[!eol]");
+ if (int_values[MTSM_SP].is_known)
+ if (int_values[MTSM_SP].value)
+ fprintf(stderr, "[sp %d]", int_values[MTSM_SP].value);
+ else
+ fprintf(stderr, "[!sp]");
+ fprintf(stderr, ">");
+ fflush(stderr);
+}
+
+int mtsm::has_changed(int_value_state t, statem *s)
+{
+ return driver->int_values[t].differs(s->int_values[t]);
+}
+
+int mtsm::has_changed(units_value_state t, statem *s)
+{
+ return driver->units_values[t].differs(s->units_values[t]);
+}
+
+int mtsm::has_changed(bool_value_state t, statem *s)
+{
+ return driver->bool_values[t].differs(s->bool_values[t]);
+}
+
+int mtsm::has_changed(string_value_state t, statem *s)
+{
+ return driver->string_values[t].differs(s->string_values[t]);
+}
+
+int mtsm::changed(statem *s)
+{
+ if (s == 0 || !is_html)
+ return 0;
+ s = new statem(s);
+ inherit(s, 0);
+ int result = has_changed(MTSM_EOL, s)
+ || has_changed(MTSM_BR, s)
+ || has_changed(MTSM_FI, s)
+ || has_changed(MTSM_IN, s)
+ || has_changed(MTSM_LL, s)
+ || has_changed(MTSM_PO, s)
+ || has_changed(MTSM_RJ, s)
+ || has_changed(MTSM_SP, s)
+ || has_changed(MTSM_TA, s)
+ || has_changed(MTSM_CE, s);
+ delete s;
+ return result;
+}
+
+void mtsm::add_tag(FILE *fp, string s)
+{
+ fflush(fp);
+ s += '\0';
+ fputs(s.contents(), fp);
+}
+
+/*
+ * state_set class
+ */
+
+state_set::state_set()
+: boolset(0), intset(0), unitsset(0), stringset(0)
+{
+}
+
+state_set::~state_set()
+{
+}
+
+void state_set::incl(bool_value_state b)
+{
+ boolset |= 1 << (int)b;
+}
+
+void state_set::incl(int_value_state i)
+{
+ intset |= 1 << (int)i;
+}
+
+void state_set::incl(units_value_state u)
+{
+ unitsset |= 1 << (int)u;
+}
+
+void state_set::incl(string_value_state s)
+{
+ stringset |= 1 << (int)s;
+}
+
+void state_set::excl(bool_value_state b)
+{
+ boolset &= ~(1 << (int)b);
+}
+
+void state_set::excl(int_value_state i)
+{
+ intset &= ~(1 << (int)i);
+}
+
+void state_set::excl(units_value_state u)
+{
+ unitsset &= ~(1 << (int)u);
+}
+
+void state_set::excl(string_value_state s)
+{
+ stringset &= ~(1 << (int)s);
+}
+
+int state_set::is_in(bool_value_state b)
+{
+ return (boolset & (1 << (int)b)) != 0;
+}
+
+int state_set::is_in(int_value_state i)
+{
+ return (intset & (1 << (int)i)) != 0;
+}
+
+int state_set::is_in(units_value_state u)
+{
+ return (unitsset & (1 << (int)u) != 0);
+}
+
+int state_set::is_in(string_value_state s)
+{
+ return (stringset & (1 << (int)s) != 0);
+}
+
+void state_set::add(units_value_state, int n)
+{
+ unitsset += n;
+}
+
+units state_set::val(units_value_state)
+{
+ return unitsset;
+}
diff --git a/contrib/groff/src/roff/troff/mtsm.h b/contrib/groff/src/roff/troff/mtsm.h
new file mode 100644
index 0000000..9ef909c
--- /dev/null
+++ b/contrib/groff/src/roff/troff/mtsm.h
@@ -0,0 +1,164 @@
+// -*- C++ -*-
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ *
+ * mtsm.h
+ *
+ * written by Gaius Mulley (gaius@glam.ac.uk)
+ *
+ * provides a minimal troff state machine which is necessary to
+ * emit meta tags for the post-grohtml device driver.
+ */
+
+/*
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+struct int_value {
+ int value;
+ int is_known;
+ int_value();
+ ~int_value();
+ void diff(FILE *, const char *, int_value);
+ int differs(int_value);
+ void set(int);
+ void unset();
+ void set_if_unknown(int);
+};
+
+struct bool_value : public int_value {
+ bool_value();
+ ~bool_value();
+ void diff(FILE *, const char *, bool_value);
+};
+
+struct units_value : public int_value {
+ units_value();
+ ~units_value();
+ void diff(FILE *, const char *, units_value);
+ int differs(units_value);
+ void set(hunits);
+};
+
+struct string_value {
+ string value;
+ int is_known;
+ string_value();
+ ~string_value();
+ void diff(FILE *, const char *, string_value);
+ int differs(string_value);
+ void set(string);
+ void unset();
+};
+
+enum bool_value_state {
+ MTSM_EOL,
+ MTSM_BR,
+ LAST_BOOL
+};
+enum int_value_state {
+ MTSM_FI,
+ MTSM_RJ,
+ MTSM_CE,
+ MTSM_SP,
+ LAST_INT
+};
+enum units_value_state {
+ MTSM_IN,
+ MTSM_LL,
+ MTSM_PO,
+ MTSM_TI,
+ LAST_UNITS
+};
+enum string_value_state {
+ MTSM_TA,
+ LAST_STRING
+};
+
+struct statem {
+ int issue_no;
+ bool_value bool_values[LAST_BOOL];
+ int_value int_values[LAST_INT];
+ units_value units_values[LAST_UNITS];
+ string_value string_values[LAST_STRING];
+ statem();
+ statem(statem *);
+ ~statem();
+ void flush(FILE *, statem *);
+ int changed(statem *);
+ void merge(statem *, statem *);
+ void add_tag(int_value_state, int);
+ void add_tag(bool_value_state);
+ void add_tag(units_value_state, hunits);
+ void add_tag(string_value_state, string);
+ void sub_tag_ce();
+ void add_tag_if_unknown(int_value_state, int);
+ void add_tag_ta();
+ void display_state();
+ void update(statem *, statem *, int_value_state);
+ void update(statem *, statem *, bool_value_state);
+ void update(statem *, statem *, units_value_state);
+ void update(statem *, statem *, string_value_state);
+};
+
+struct stack {
+ stack *next;
+ statem *state;
+ stack();
+ stack(statem *, stack *);
+ ~stack();
+};
+
+class mtsm {
+ statem *driver;
+ stack *sp;
+ int has_changed(int_value_state, statem *);
+ int has_changed(bool_value_state, statem *);
+ int has_changed(units_value_state, statem *);
+ int has_changed(string_value_state, statem *);
+ void inherit(statem *, int);
+public:
+ mtsm();
+ ~mtsm();
+ void push_state(statem *);
+ void pop_state();
+ void flush(FILE *, statem *, string);
+ int changed(statem *);
+ void add_tag(FILE *, string);
+};
+
+class state_set {
+ int boolset;
+ int intset;
+ int unitsset;
+ int stringset;
+public:
+ state_set();
+ ~state_set();
+ void incl(bool_value_state);
+ void incl(int_value_state);
+ void incl(units_value_state);
+ void incl(string_value_state);
+ void excl(bool_value_state);
+ void excl(int_value_state);
+ void excl(units_value_state);
+ void excl(string_value_state);
+ int is_in(bool_value_state);
+ int is_in(int_value_state);
+ int is_in(units_value_state);
+ int is_in(string_value_state);
+ void add(units_value_state, int);
+ units val(units_value_state);
+};
diff --git a/contrib/groff/src/roff/troff/node.cpp b/contrib/groff/src/roff/troff/node.cpp
index 73776b1..0d874d3 100644
--- a/contrib/groff/src/roff/troff/node.cpp
+++ b/contrib/groff/src/roff/troff/node.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+extern int debug_state;
#include "troff.h"
@@ -25,20 +27,20 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <unistd.h>
#endif
-#include "symbol.h"
#include "dictionary.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "request.h"
#include "node.h"
#include "token.h"
+#include "div.h"
+#include "reg.h"
#include "charinfo.h"
#include "font.h"
-#include "reg.h"
#include "input.h"
-#include "div.h"
#include "geometry.h"
-#include "stringclass.h"
#include "nonposix.h"
@@ -59,6 +61,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif /* not _POSIX_VERSION */
+// declarations to avoid friend name injections
+class tfont;
+class tfont_spec;
+tfont *make_tfont(tfont_spec &);
+
+
/*
* how many boundaries of images have been written? Useful for
* debugging grohtml
@@ -112,8 +120,6 @@ struct conditional_bold {
conditional_bold(int, hunits, conditional_bold * = 0);
};
-struct tfont;
-
class font_info {
tfont *last_tfont;
int number;
@@ -134,7 +140,7 @@ class font_info {
void flush();
public:
special_font_list *sf;
- font_info(symbol nm, int n, symbol enm, font *f);
+ font_info(symbol, int, symbol, font *);
int contains(charinfo *);
void set_bold(hunits);
void unbold();
@@ -152,6 +158,7 @@ public:
int is_special();
int is_style();
friend symbol get_font_name(int, environment *);
+ friend symbol get_style_name(int);
};
class tfont_spec {
@@ -170,7 +177,7 @@ protected:
int height;
int slant;
public:
- tfont_spec(symbol nm, int pos, font *, font_size, int, int);
+ tfont_spec(symbol, int, font *, font_size, int, int);
tfont_spec(const tfont_spec &spec) { *this = spec; }
tfont_spec plain();
int operator==(const tfont_spec &);
@@ -400,11 +407,19 @@ symbol get_font_name(int fontno, environment *env)
return f;
}
-hunits font_info::get_space_width(font_size fs, int space_size)
+symbol get_style_name(int fontno)
+{
+ if (font_table[fontno]->is_style())
+ return font_table[fontno]->get_name();
+ else
+ return EMPTY_SYMBOL;
+}
+
+hunits font_info::get_space_width(font_size fs, int space_sz)
{
if (is_constant_spaced == CONSTANT_SPACE_NONE)
return scale(hunits(fm->get_space_width(fs.to_scaled_points())),
- space_size, 12);
+ space_sz, 12);
else if (is_constant_spaced == CONSTANT_SPACE_ABSOLUTE)
return constant_space;
else
@@ -681,9 +696,8 @@ class real_output_file : public output_file {
virtual void really_put_filename(const char *filename);
virtual void really_on();
virtual void really_off();
-protected:
- FILE *fp;
public:
+ FILE *fp;
real_output_file();
~real_output_file();
void flush();
@@ -751,6 +765,8 @@ class troff_output_file : public real_output_file {
int tbuf_len;
int tbuf_kern;
int begun_page;
+ int cur_div_level;
+ string tag_list;
void do_motion();
void put(char c);
void put(unsigned char c);
@@ -787,6 +803,7 @@ public:
void fill_color(color *c);
int get_hpos() { return hpos; }
int get_vpos() { return vpos; }
+ void add_to_tag_list(string s);
friend void space_char_hmotion_node::tprint(troff_output_file *);
friend void unbreakable_space_node::tprint(troff_output_file *);
};
@@ -864,6 +881,29 @@ void troff_output_file::really_print_line(hunits x, vunits y, node *n,
{
moveto(x, y);
while (n != 0) {
+ // Check whether we should push the current troff state and use
+ // the state at the start of the invocation of this diversion.
+ if (n->div_nest_level > cur_div_level && n->push_state) {
+ state.push_state(n->push_state);
+ cur_div_level = n->div_nest_level;
+ }
+ // Has the current diversion level decreased? Then we must pop the
+ // troff state.
+ while (n->div_nest_level < cur_div_level) {
+ state.pop_state();
+ cur_div_level = n->div_nest_level;
+ }
+ // Now check whether the state has changed.
+ if ((is_on() || n->force_tprint())
+ && (state.changed(n->state) || n->is_tag() || n->is_special)) {
+ flush_tbuf();
+ do_motion();
+ force_motion = 1;
+ flush();
+ state.flush(fp, n->state, tag_list);
+ tag_list = string("");
+ flush();
+ }
n->tprint(this);
n = n->next;
}
@@ -987,7 +1027,7 @@ void troff_output_file::put_char_width(charinfo *ci, tfont *tf,
return;
}
set_font(tf);
- char c = ci->get_ascii_code();
+ unsigned char c = ci->get_ascii_code();
if (c == '\0') {
glyph_color(gcol);
fill_color(fcol);
@@ -1065,7 +1105,7 @@ void troff_output_file::put_char(charinfo *ci, tfont *tf,
if (!is_on())
return;
set_font(tf);
- char c = ci->get_ascii_code();
+ unsigned char c = ci->get_ascii_code();
if (c == '\0') {
glyph_color(gcol);
fill_color(fcol);
@@ -1275,6 +1315,16 @@ void troff_output_file::glyph_color(color *col)
put('\n');
}
+void troff_output_file::add_to_tag_list(string s)
+{
+ if (tag_list == string(""))
+ tag_list = s;
+ else {
+ tag_list += string("\n");
+ tag_list += s;
+ }
+}
+
// determine_line_limits - works out the smallest box which will contain
// the entity, code, built from the point array.
void troff_output_file::determine_line_limits(char code, hvpair *point,
@@ -1456,13 +1506,14 @@ void troff_output_file::really_begin_page(int pageno, vunits page_length)
put('\n');
}
-void troff_output_file::really_copy_file(hunits x, vunits y, const char *filename)
+void troff_output_file::really_copy_file(hunits x, vunits y,
+ const char *filename)
{
moveto(x, y);
flush_tbuf();
do_motion();
errno = 0;
- FILE *ifp = fopen(filename, "r");
+ FILE *ifp = include_search_path.open_file_cautious(filename);
if (ifp == 0)
error("can't open `%1': %2", filename, strerror(errno));
else {
@@ -1503,7 +1554,8 @@ void troff_output_file::trailer(vunits page_length)
troff_output_file::troff_output_file()
: current_slant(0), current_height(0), current_fill_color(0),
- current_glyph_color(0), nfont_positions(10), tbuf_len(0), begun_page(0)
+ current_glyph_color(0), nfont_positions(10), tbuf_len(0), begun_page(0),
+ cur_div_level(0)
{
font_position = new symbol[nfont_positions];
put("x T ");
@@ -1726,14 +1778,14 @@ class charinfo_node : public node {
protected:
charinfo *ci;
public:
- charinfo_node(charinfo *, node * = 0);
+ charinfo_node(charinfo *, statem *, int, node * = 0);
int ends_sentence();
int overlaps_vertically();
int overlaps_horizontally();
};
-charinfo_node::charinfo_node(charinfo *c, node *x)
-: node(x), ci(c)
+charinfo_node::charinfo_node(charinfo *c, statem *s, int pop, node *x)
+: node(x, s, pop), ci(c)
{
}
@@ -1765,12 +1817,14 @@ protected:
color *fcol; /* this is needed for grotty */
#ifdef STORE_WIDTH
hunits wid;
- glyph_node(charinfo *, tfont *, color *, color *, hunits, node * = 0);
+ glyph_node(charinfo *, tfont *, color *, color *, hunits,
+ statem *, int, node * = 0);
#endif
public:
void *operator new(size_t);
void operator delete(void *);
- glyph_node(charinfo *, tfont *, color *, color *, node * = 0);
+ glyph_node(charinfo *, tfont *, color *, color *,
+ statem *, int, node * = 0);
~glyph_node() {}
node *copy();
node *merge_glyph_node(glyph_node *);
@@ -1797,6 +1851,8 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
+ void debug_node();
};
glyph_node *glyph_node::free_list = 0;
@@ -1806,13 +1862,13 @@ class ligature_node : public glyph_node {
node *n2;
#ifdef STORE_WIDTH
ligature_node(charinfo *, tfont *, color *, color *, hunits,
- node *, node *, node * = 0);
+ node *, node *, statem *, int, node * = 0);
#endif
public:
void *operator new(size_t);
void operator delete(void *);
ligature_node(charinfo *, tfont *, color *, color *,
- node *, node *, node * = 0);
+ node *, node *, statem *, int, node * = 0);
~ligature_node();
node *copy();
node *add_self(node *, hyphen_list **);
@@ -1822,6 +1878,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class kern_pair_node : public node {
@@ -1829,7 +1886,7 @@ class kern_pair_node : public node {
node *n1;
node *n2;
public:
- kern_pair_node(hunits n, node *first, node *second, node *x = 0);
+ kern_pair_node(hunits, node *, node *, statem *, int, node * = 0);
~kern_pair_node();
node *copy();
node *merge_glyph_node(glyph_node *);
@@ -1848,6 +1905,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
void vertical_extent(vunits *, vunits *);
};
@@ -1856,7 +1914,7 @@ class dbreak_node : public node {
node *pre;
node *post;
public:
- dbreak_node(node *n, node *p, node *x = 0);
+ dbreak_node(node *, node *, statem *, int, node * = 0);
~dbreak_node();
node *copy();
node *merge_glyph_node(glyph_node *);
@@ -1877,6 +1935,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
void *glyph_node::operator new(size_t n)
@@ -1913,8 +1972,9 @@ void ligature_node::operator delete(void *p)
delete[] (char *)p;
}
-glyph_node::glyph_node(charinfo *c, tfont *t, color *gc, color *fc, node *x)
-: charinfo_node(c, x), tf(t), gcol(gc), fcol(fc)
+glyph_node::glyph_node(charinfo *c, tfont *t, color *gc, color *fc,
+ statem *s, int pop, node *x)
+: charinfo_node(c, s, pop, x), tf(t), gcol(gc), fcol(fc)
{
#ifdef STORE_WIDTH
wid = tf->get_width(ci);
@@ -1923,8 +1983,9 @@ glyph_node::glyph_node(charinfo *c, tfont *t, color *gc, color *fc, node *x)
#ifdef STORE_WIDTH
glyph_node::glyph_node(charinfo *c, tfont *t,
- color *gc, color *fc, hunits w, node *x)
-: charinfo_node(c, x), tf(t), gcol(gc), fcol(fc), wid(w)
+ color *gc, color *fc, hunits w,
+ statem *s, int pop, node *x)
+: charinfo_node(c, s, pop, x), tf(t), gcol(gc), fcol(fc), wid(w)
{
}
#endif
@@ -1932,9 +1993,9 @@ glyph_node::glyph_node(charinfo *c, tfont *t,
node *glyph_node::copy()
{
#ifdef STORE_WIDTH
- return new glyph_node(ci, tf, gcol, fcol, wid);
+ return new glyph_node(ci, tf, gcol, fcol, wid, state, div_nest_level);
#else
- return new glyph_node(ci, tf, gcol, fcol);
+ return new glyph_node(ci, tf, gcol, fcol, state, div_nest_level);
#endif
}
@@ -2018,13 +2079,15 @@ node *glyph_node::merge_glyph_node(glyph_node *gn)
if ((lig = tf->get_lig(ci, gn->ci)) != 0) {
node *next1 = next;
next = 0;
- return new ligature_node(lig, tf, gcol, fcol, this, gn, next1);
+ return new ligature_node(lig, tf, gcol, fcol, this, gn, state,
+ gn->div_nest_level, next1);
}
hunits kern;
if (tf->get_kern(ci, gn->ci, &kern)) {
node *next1 = next;
next = 0;
- return new kern_pair_node(kern, this, gn, next1);
+ return new kern_pair_node(kern, this, gn, state,
+ gn->div_nest_level, next1);
}
}
return 0;
@@ -2087,16 +2150,35 @@ void glyph_node::ascii_print(ascii_output_file *ascii)
ascii->outs(ci->nm.contents());
}
+void glyph_node::debug_node()
+{
+ unsigned char c = ci->get_ascii_code();
+ fprintf(stderr, "{ %s [", type());
+ if (c)
+ fprintf(stderr, "%c", c);
+ else
+ fprintf(stderr, ci->nm.contents());
+ if (push_state)
+ fprintf(stderr, " <push_state>");
+ if (state)
+ state->display_state();
+ fprintf(stderr, " nest level %d", div_nest_level);
+ fprintf(stderr, "]}\n");
+ fflush(stderr);
+}
+
ligature_node::ligature_node(charinfo *c, tfont *t, color *gc, color *fc,
- node *gn1, node *gn2, node *x)
-: glyph_node(c, t, gc, fc, x), n1(gn1), n2(gn2)
+ node *gn1, node *gn2, statem *s,
+ int pop, node *x)
+: glyph_node(c, t, gc, fc, s, pop, x), n1(gn1), n2(gn2)
{
}
#ifdef STORE_WIDTH
ligature_node::ligature_node(charinfo *c, tfont *t, color *gc, color *fc,
- hunits w, node *gn1, node *gn2, node *x)
-: glyph_node(c, t, gc, fc, w, x), n1(gn1), n2(gn2)
+ hunits w, node *gn1, node *gn2, statem *s,
+ int pop, node *x)
+: glyph_node(c, t, gc, fc, w, s, pop, x), n1(gn1), n2(gn2)
{
}
#endif
@@ -2110,9 +2192,11 @@ ligature_node::~ligature_node()
node *ligature_node::copy()
{
#ifdef STORE_WIDTH
- return new ligature_node(ci, tf, gcol, fcol, wid, n1->copy(), n2->copy());
+ return new ligature_node(ci, tf, gcol, fcol, wid, n1->copy(), n2->copy(),
+ state, div_nest_level);
#else
- return new ligature_node(ci, tf, gcol, fcol, n1->copy(), n2->copy());
+ return new ligature_node(ci, tf, gcol, fcol, n1->copy(), n2->copy(),
+ state, div_nest_level);
#endif
}
@@ -2137,13 +2221,14 @@ node *ligature_node::add_self(node *n, hyphen_list **p)
return n;
}
-kern_pair_node::kern_pair_node(hunits n, node *first, node *second, node *x)
-: node(x), amount(n), n1(first), n2(second)
+kern_pair_node::kern_pair_node(hunits n, node *first, node *second,
+ statem* s, int pop, node *x)
+: node(x, s, pop), amount(n), n1(first), n2(second)
{
}
-dbreak_node::dbreak_node(node *n, node *p, node *x)
-: node(x), none(n), pre(p), post(0)
+dbreak_node::dbreak_node(node *n, node *p, statem *s, int pop, node *x)
+: node(x, s, pop), none(n), pre(p), post(0)
{
}
@@ -2219,13 +2304,14 @@ node *kern_pair_node::add_discretionary_hyphen()
node *next1 = next;
next = 0;
node *n = copy();
- glyph_node *gn = new glyph_node(soft_hyphen_char, tf, gcol, fcol);
+ glyph_node *gn = new glyph_node(soft_hyphen_char, tf, gcol, fcol,
+ state, div_nest_level);
node *nn = n->merge_glyph_node(gn);
if (nn == 0) {
gn->next = n;
nn = gn;
}
- return new dbreak_node(this, nn, next1);
+ return new dbreak_node(this, nn, state, div_nest_level, next1);
}
}
return this;
@@ -2248,7 +2334,8 @@ dbreak_node::~dbreak_node()
node *kern_pair_node::copy()
{
- return new kern_pair_node(amount, n1->copy(), n2->copy());
+ return new kern_pair_node(amount, n1->copy(), n2->copy(), state,
+ div_nest_level);
}
node *copy_node_list(node *n)
@@ -2280,7 +2367,8 @@ void delete_node_list(node *n)
node *dbreak_node::copy()
{
- dbreak_node *p = new dbreak_node(copy_node_list(none), copy_node_list(pre));
+ dbreak_node *p = new dbreak_node(copy_node_list(none), copy_node_list(pre),
+ state, div_nest_level);
p->post = copy_node_list(post);
return p;
}
@@ -2298,11 +2386,12 @@ hyphen_list *kern_pair_node::get_hyphen_list(hyphen_list *tail, int *count)
class hyphen_inhibitor_node : public node {
public:
- hyphen_inhibitor_node(node *nd = 0);
+ hyphen_inhibitor_node(node * = 0);
node *copy();
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
hyphenation_type get_hyphenation_type();
};
@@ -2330,6 +2419,11 @@ int hyphen_inhibitor_node::force_tprint()
return 0;
}
+int hyphen_inhibitor_node::is_tag()
+{
+ return 0;
+}
+
hyphenation_type hyphen_inhibitor_node::get_hyphenation_type()
{
return HYPHEN_INHIBIT;
@@ -2357,13 +2451,14 @@ node *node::add_discretionary_hyphen()
node *next1 = next;
next = 0;
node *n = copy();
- glyph_node *gn = new glyph_node(soft_hyphen_char, tf, gcol, fcol);
+ glyph_node *gn = new glyph_node(soft_hyphen_char, tf, gcol, fcol,
+ state, div_nest_level);
node *n1 = n->merge_glyph_node(gn);
if (n1 == 0) {
gn->next = n;
n1 = gn;
}
- return new dbreak_node(this, n1, next1);
+ return new dbreak_node(this, n1, state, div_nest_level, next1);
}
return this;
}
@@ -2403,6 +2498,11 @@ int node::force_tprint()
return 0;
}
+int node::is_tag()
+{
+ return 0;
+}
+
hunits hmotion_node::width()
{
return n;
@@ -2413,6 +2513,29 @@ units node::size()
return points_to_units(10);
}
+void node::debug_node()
+{
+ fprintf(stderr, "{ %s ", type());
+ if (push_state)
+ fprintf(stderr, " <push_state>");
+ if (state)
+ fprintf(stderr, " <state>");
+ fprintf(stderr, " nest level %d", div_nest_level);
+ fprintf(stderr, " }\n");
+ fflush(stderr);
+}
+
+void node::debug_node_list()
+{
+ node *n = next;
+
+ debug_node();
+ while (n != 0) {
+ n->debug_node();
+ n = n->next;
+ }
+}
+
hunits kern_pair_node::width()
{
return n1->width() + n2->width() + amount;
@@ -2437,9 +2560,9 @@ hunits dbreak_node::width()
node *dbreak_node::last_char_node()
{
for (node *n = none; n; n = n->next) {
- node *last = n->last_char_node();
- if (last)
- return last;
+ node *last_node = n->last_char_node();
+ if (last_node)
+ return last_node;
}
return 0;
}
@@ -2458,7 +2581,7 @@ class italic_corrected_node : public node {
node *n;
hunits x;
public:
- italic_corrected_node(node *, hunits, node * = 0);
+ italic_corrected_node(node *, hunits, statem *, int, node * = 0);
~italic_corrected_node();
node *copy();
void ascii_print(ascii_output_file *);
@@ -2480,9 +2603,10 @@ public:
node *add_self(node *, hyphen_list **);
const char *type();
int force_tprint();
+ int is_tag();
};
-node *node::add_italic_correction(hunits *width)
+node *node::add_italic_correction(hunits *wd)
{
hunits ic = italic_correction();
if (ic.is_zero())
@@ -2490,13 +2614,14 @@ node *node::add_italic_correction(hunits *width)
else {
node *next1 = next;
next = 0;
- *width += ic;
- return new italic_corrected_node(this, ic, next1);
+ *wd += ic;
+ return new italic_corrected_node(this, ic, state, div_nest_level, next1);
}
}
-italic_corrected_node::italic_corrected_node(node *nn, hunits xx, node *p)
-: node(p), n(nn), x(xx)
+italic_corrected_node::italic_corrected_node(node *nn, hunits xx, statem *s,
+ int pop, node *p)
+: node(p, s, pop), n(nn), x(xx)
{
assert(n != 0);
}
@@ -2508,7 +2633,7 @@ italic_corrected_node::~italic_corrected_node()
node *italic_corrected_node::copy()
{
- return new italic_corrected_node(n->copy(), x);
+ return new italic_corrected_node(n->copy(), x, state, div_nest_level);
}
hunits italic_corrected_node::width()
@@ -2599,6 +2724,7 @@ class break_char_node : public node {
color *col;
public:
break_char_node(node *, int, color *, node * = 0);
+ break_char_node(node *, int, color *, statem *, int, node * = 0);
~break_char_node();
node *copy();
hunits width();
@@ -2620,6 +2746,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
break_char_node::break_char_node(node *n, int bc, color *c, node *x)
@@ -2627,6 +2754,12 @@ break_char_node::break_char_node(node *n, int bc, color *c, node *x)
{
}
+break_char_node::break_char_node(node *n, int bc, color *c, statem *s,
+ int pop, node *x)
+: node(x, s, pop), ch(n), break_code(bc), col(c)
+{
+}
+
break_char_node::~break_char_node()
{
delete ch;
@@ -2634,7 +2767,8 @@ break_char_node::~break_char_node()
node *break_char_node::copy()
{
- return new break_char_node(ch->copy(), break_code, col);
+ return new break_char_node(ch->copy(), break_code, col, state,
+ div_nest_level);
}
hunits break_char_node::width()
@@ -2718,27 +2852,57 @@ tfont *break_char_node::get_tfont()
node *extra_size_node::copy()
{
- return new extra_size_node(n);
+ return new extra_size_node(n, state, div_nest_level);
+}
+
+extra_size_node::extra_size_node(vunits i, statem *s, int pop)
+: node(0, s, pop), n(i)
+{
+}
+
+extra_size_node::extra_size_node(vunits i)
+: n(i)
+{
}
node *vertical_size_node::copy()
{
- return new vertical_size_node(n);
+ return new vertical_size_node(n, state, div_nest_level);
+}
+
+vertical_size_node::vertical_size_node(vunits i, statem *s, int pop)
+: node(0, s, pop), n(i)
+{
+}
+
+vertical_size_node::vertical_size_node(vunits i)
+: n(i)
+{
}
node *hmotion_node::copy()
{
- return new hmotion_node(n, was_tab, unformat, col);
+ return new hmotion_node(n, was_tab, unformat, col, state, div_nest_level);
}
node *space_char_hmotion_node::copy()
{
- return new space_char_hmotion_node(n, col);
+ return new space_char_hmotion_node(n, col, state, div_nest_level);
+}
+
+vmotion_node::vmotion_node(vunits i, color *c)
+: n(i), col(c)
+{
+}
+
+vmotion_node::vmotion_node(vunits i, color *c, statem *s, int pop)
+: node(0, s, pop), n(i), col(c)
+{
}
node *vmotion_node::copy()
{
- return new vmotion_node(n, col);
+ return new vmotion_node(n, col, state, div_nest_level);
}
node *dummy_node::copy()
@@ -2757,9 +2921,19 @@ hline_node::~hline_node()
delete n;
}
+hline_node::hline_node(hunits i, node *c, node *nxt)
+: node(nxt), x(i), n(c)
+{
+}
+
+hline_node::hline_node(hunits i, node *c, statem *s, int pop, node *nxt)
+: node(nxt, s, pop), x(i), n(c)
+{
+}
+
node *hline_node::copy()
{
- return new hline_node(x, n ? n->copy() : 0);
+ return new hline_node(x, n ? n->copy() : 0, state, div_nest_level);
}
hunits hline_node::width()
@@ -2767,6 +2941,16 @@ hunits hline_node::width()
return x < H0 ? H0 : x;
}
+vline_node::vline_node(vunits i, node *c, node *nxt)
+: node(nxt), x(i), n(c)
+{
+}
+
+vline_node::vline_node(vunits i, node *c, statem *s, int pop, node *nxt)
+: node(nxt, s, pop), x(i), n(c)
+{
+}
+
vline_node::~vline_node()
{
if (n)
@@ -2775,7 +2959,7 @@ vline_node::~vline_node()
node *vline_node::copy()
{
- return new vline_node(x, n ? n->copy() : 0);
+ return new vline_node(x, n ? n->copy() : 0, state, div_nest_level);
}
hunits vline_node::width()
@@ -2783,7 +2967,13 @@ hunits vline_node::width()
return n == 0 ? H0 : n->width();
}
-zero_width_node::zero_width_node(node *nd) : n(nd)
+zero_width_node::zero_width_node(node *nd, statem *s, int pop)
+: node(0, s, pop), n(nd)
+{
+}
+
+zero_width_node::zero_width_node(node *nd)
+: n(nd)
{
}
@@ -2794,7 +2984,7 @@ zero_width_node::~zero_width_node()
node *zero_width_node::copy()
{
- return new zero_width_node(copy_node_list(n));
+ return new zero_width_node(copy_node_list(n), state, div_nest_level);
}
int node_list_character_type(node *p)
@@ -2833,7 +3023,13 @@ void zero_width_node::vertical_extent(vunits *min, vunits *max)
node_list_vertical_extent(n, min, max);
}
-overstrike_node::overstrike_node() : list(0), max_width(H0)
+overstrike_node::overstrike_node()
+: list(0), max_width(H0)
+{
+}
+
+overstrike_node::overstrike_node(statem *s, int pop)
+: node(0, s, pop), list(0), max_width(H0)
{
}
@@ -2844,7 +3040,7 @@ overstrike_node::~overstrike_node()
node *overstrike_node::copy()
{
- overstrike_node *on = new overstrike_node;
+ overstrike_node *on = new overstrike_node(state, div_nest_level);
for (node *tem = list; tem; tem = tem->next)
on->overstrike(tem->copy());
return on;
@@ -2869,7 +3065,13 @@ hunits overstrike_node::width()
return max_width;
}
-bracket_node::bracket_node() : list(0), max_width(H0)
+bracket_node::bracket_node()
+: list(0), max_width(H0)
+{
+}
+
+bracket_node::bracket_node(statem *s, int pop)
+: node(0, s, pop), list(0), max_width(H0)
{
}
@@ -2880,17 +3082,17 @@ bracket_node::~bracket_node()
node *bracket_node::copy()
{
- bracket_node *on = new bracket_node;
- node *last = 0;
+ bracket_node *on = new bracket_node(state, div_nest_level);
+ node *last_node = 0;
node *tem;
if (list)
list->last = 0;
for (tem = list; tem; tem = tem->next) {
if (tem->next)
tem->next->last = tem;
- last = tem;
+ last_node = tem;
}
- for (tem = last; tem; tem = tem->last)
+ for (tem = last_node; tem; tem = tem->last)
on->bracket(tem->copy());
return on;
}
@@ -2949,12 +3151,18 @@ inline void space_node::operator delete(void *p)
#endif
space_node::space_node(hunits nn, color *c, node *p)
-: node(p), n(nn), set(0), was_escape_colon(0), col(c)
+: node(p, 0, 0), n(nn), set(0), was_escape_colon(0), col(c)
+{
+}
+
+space_node::space_node(hunits nn, color *c, statem *s, int pop, node *p)
+: node(p, s, pop), n(nn), set(0), was_escape_colon(0), col(c)
{
}
-space_node::space_node(hunits nn, int s, int flag, color *c, node *p)
-: node(p), n(nn), set(s), was_escape_colon(flag), col(c)
+space_node::space_node(hunits nn, int s, int flag, color *c, statem *st,
+ int pop, node *p)
+: node(p, st, pop), n(nn), set(s), was_escape_colon(flag), col(c)
{
}
@@ -2966,7 +3174,7 @@ space_node::~space_node()
node *space_node::copy()
{
- return new space_node(n, set, was_escape_colon, col);
+ return new space_node(n, set, was_escape_colon, col, state, div_nest_level);
}
int space_node::force_tprint()
@@ -2974,6 +3182,11 @@ int space_node::force_tprint()
return 0;
}
+int space_node::is_tag()
+{
+ return 0;
+}
+
int space_node::nspaces()
{
return set ? 0 : 1;
@@ -2994,20 +3207,20 @@ void node::spread_space(int*, hunits*)
{
}
-void space_node::spread_space(int *nspaces, hunits *desired_space)
+void space_node::spread_space(int *n_spaces, hunits *desired_space)
{
if (!set) {
- assert(*nspaces > 0);
- if (*nspaces == 1) {
+ assert(*n_spaces > 0);
+ if (*n_spaces == 1) {
n += *desired_space;
*desired_space = H0;
}
else {
- hunits extra = *desired_space / *nspaces;
+ hunits extra = *desired_space / *n_spaces;
*desired_space -= extra;
n += extra;
}
- *nspaces -= 1;
+ *n_spaces -= 1;
set = 1;
}
}
@@ -3030,6 +3243,12 @@ void space_node::is_escape_colon()
was_escape_colon = 1;
}
+diverted_space_node::diverted_space_node(vunits d, statem *s, int pop,
+ node *p)
+: node(p, s, pop), n(d)
+{
+}
+
diverted_space_node::diverted_space_node(vunits d, node *p)
: node(p), n(d)
{
@@ -3037,7 +3256,13 @@ diverted_space_node::diverted_space_node(vunits d, node *p)
node *diverted_space_node::copy()
{
- return new diverted_space_node(n);
+ return new diverted_space_node(n, state, div_nest_level);
+}
+
+diverted_copy_file_node::diverted_copy_file_node(symbol s, statem *st,
+ int pop, node *p)
+: node(p, st, pop), filename(s)
+{
}
diverted_copy_file_node::diverted_copy_file_node(symbol s, node *p)
@@ -3047,7 +3272,7 @@ diverted_copy_file_node::diverted_copy_file_node(symbol s, node *p)
node *diverted_copy_file_node::copy()
{
- return new diverted_copy_file_node(filename);
+ return new diverted_copy_file_node(filename, state, div_nest_level);
}
int node::ends_sentence()
@@ -3338,8 +3563,15 @@ void hmotion_node::asciify(macro *m)
}
space_char_hmotion_node::space_char_hmotion_node(hunits i, color *c,
- node *next)
-: hmotion_node(i, c, next)
+ statem *s, int pop,
+ node *nxt)
+: hmotion_node(i, c, s, pop, nxt)
+{
+}
+
+space_char_hmotion_node::space_char_hmotion_node(hunits i, color *c,
+ node *nxt)
+: hmotion_node(i, c, 0, 0, nxt)
{
}
@@ -3393,14 +3625,14 @@ int node::nbreaks()
return 0;
}
-breakpoint *space_node::get_breakpoints(hunits width, int ns,
+breakpoint *space_node::get_breakpoints(hunits wd, int ns,
breakpoint *rest, int is_inner)
{
- if (next->discardable())
+ if (next && next->discardable())
return rest;
breakpoint *bp = new breakpoint;
bp->next = rest;
- bp->width = width;
+ bp->width = wd;
bp->nspaces = ns;
bp->hyphenated = 0;
if (is_inner) {
@@ -3417,7 +3649,7 @@ breakpoint *space_node::get_breakpoints(hunits width, int ns,
int space_node::nbreaks()
{
- if (next->discardable())
+ if (next && next->discardable())
return 0;
else
return 1;
@@ -3437,12 +3669,12 @@ static breakpoint *node_list_get_breakpoints(node *p, hunits *widthp,
return rest;
}
-breakpoint *dbreak_node::get_breakpoints(hunits width, int ns,
+breakpoint *dbreak_node::get_breakpoints(hunits wd, int ns,
breakpoint *rest, int is_inner)
{
breakpoint *bp = new breakpoint;
bp->next = rest;
- bp->width = width;
+ bp->width = wd;
for (node *tem = pre; tem != 0; tem = tem->next)
bp->width += tem->width();
bp->nspaces = ns;
@@ -3456,7 +3688,7 @@ breakpoint *dbreak_node::get_breakpoints(hunits width, int ns,
bp->nd = this;
bp->index = 0;
}
- return node_list_get_breakpoints(none, &width, ns, bp);
+ return node_list_get_breakpoints(none, &wd, ns, bp);
}
int dbreak_node::nbreaks()
@@ -3597,12 +3829,16 @@ special_node::special_node(const macro &m, int n)
tf = tf->get_plain();
gcol = curenv->get_glyph_color();
fcol = curenv->get_fill_color();
+ is_special = 1;
}
special_node::special_node(const macro &m, tfont *t,
- color *gc, color *fc, int n)
-: mac(m), tf(t), gcol(gc), fcol(fc), no_init_string(n)
+ color *gc, color *fc,
+ statem *s, int pop,
+ int n)
+: node(0, s, pop), mac(m), tf(t), gcol(gc), fcol(fc), no_init_string(n)
{
+ is_special = 1;
}
int special_node::same(node *n)
@@ -3629,9 +3865,15 @@ int special_node::force_tprint()
return 0;
}
+int special_node::is_tag()
+{
+ return 0;
+}
+
node *special_node::copy()
{
- return new special_node(mac, tf, gcol, fcol, no_init_string);
+ return new special_node(mac, tf, gcol, fcol, state, div_nest_level,
+ no_init_string);
}
void special_node::tprint_start(troff_output_file *out)
@@ -3657,20 +3899,22 @@ tfont *special_node::get_tfont()
/* suppress_node */
suppress_node::suppress_node(int on_or_off, int issue_limits)
-: is_on(on_or_off), emit_limits(issue_limits),
- filename(0), position(0), image_id(0)
+: is_on(on_or_off), emit_limits(issue_limits), filename(0), position(0),
+ image_id(0)
{
}
suppress_node::suppress_node(symbol f, char p, int id)
: is_on(2), emit_limits(0), filename(f), position(p), image_id(id)
{
+ is_special = 1;
}
suppress_node::suppress_node(int issue_limits, int on_or_off,
- symbol f, char p, int id)
-: is_on(on_or_off), emit_limits(issue_limits),
- filename(f), position(p), image_id(id)
+ symbol f, char p, int id,
+ statem *s, int pop)
+: node(0, s, pop), is_on(on_or_off), emit_limits(issue_limits), filename(f),
+ position(p), image_id(id)
{
}
@@ -3690,7 +3934,67 @@ const char *suppress_node::type()
node *suppress_node::copy()
{
- return new suppress_node(emit_limits, is_on, filename, position, image_id);
+ return new suppress_node(emit_limits, is_on, filename, position, image_id,
+ state, div_nest_level);
+}
+
+/* tag_node */
+
+tag_node::tag_node()
+: delayed(0)
+{
+ is_special = 1;
+}
+
+tag_node::tag_node(string s, int delay)
+: tag_string(s), delayed(delay)
+{
+ is_special = !delay;
+}
+
+tag_node::tag_node(string s, statem *st, int pop, int delay)
+: node(0, st, pop), tag_string(s), delayed(delay)
+{
+ is_special = !delay;
+}
+
+node *tag_node::copy()
+{
+ return new tag_node(tag_string, state, div_nest_level, delayed);
+}
+
+void tag_node::tprint(troff_output_file *out)
+{
+ if (delayed)
+ out->add_to_tag_list(tag_string);
+ else
+ out->state.add_tag(out->fp, tag_string);
+}
+
+int tag_node::same(node *nd)
+{
+ return tag_string == ((tag_node *)nd)->tag_string
+ && delayed == ((tag_node *)nd)->delayed;
+}
+
+const char *tag_node::type()
+{
+ return "tag_node";
+}
+
+int tag_node::force_tprint()
+{
+ return !delayed;
+}
+
+int tag_node::is_tag()
+{
+ return !delayed;
+}
+
+int tag_node::ends_sentence()
+{
+ return 2;
}
int get_reg_int(const char *p)
@@ -3761,10 +4065,10 @@ void suppress_node::tprint(troff_output_file *out)
if (is_on == 2) {
// remember position and filename
last_position = position;
- const char *tem = last_image_filename;
+ char *tem = (char *)last_image_filename;
last_image_filename = strsave(filename.contents());
if (tem)
- a_delete(tem);
+ a_delete tem;
last_image_id = image_id;
// printf("start of image and page = %d\n", current_page);
}
@@ -3774,20 +4078,23 @@ void suppress_node::tprint(troff_output_file *out)
char name[8192];
// remember that the filename will contain a %d in which the
// last_image_id is placed
- sprintf(name, last_image_filename, last_image_id);
+ if (last_image_filename == (char *) 0)
+ *name = '\0';
+ else
+ sprintf(name, last_image_filename, last_image_id);
if (is_html) {
switch (last_position) {
case 'c':
out->start_special();
- put(out, "html-tag:.centered-image");
+ put(out, "devtag:.centered-image");
break;
case 'r':
out->start_special();
- put(out, "html-tag:.right-image");
+ put(out, "devtag:.right-image");
break;
case 'l':
out->start_special();
- put(out, "html-tag:.left-image");
+ put(out, "devtag:.left-image");
break;
case 'i':
;
@@ -3796,7 +4103,7 @@ void suppress_node::tprint(troff_output_file *out)
}
out->end_special();
out->start_special();
- put(out, "html-tag:.auto-image ");
+ put(out, "devtag:.auto-image ");
put(out, name);
out->end_special();
}
@@ -3840,6 +4147,11 @@ int suppress_node::force_tprint()
return is_on;
}
+int suppress_node::is_tag()
+{
+ return is_on;
+}
+
hunits suppress_node::width()
{
return H0;
@@ -3851,7 +4163,7 @@ class composite_node : public charinfo_node {
node *n;
tfont *tf;
public:
- composite_node(node *, charinfo *, tfont *, node * = 0);
+ composite_node(node *, charinfo *, tfont *, statem *, int, node * = 0);
~composite_node();
node *copy();
hunits width();
@@ -3867,12 +4179,14 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
void vertical_extent(vunits *, vunits *);
vunits vertical_width();
};
-composite_node::composite_node(node *p, charinfo *c, tfont *t, node *x)
-: charinfo_node(c, x), n(p), tf(t)
+composite_node::composite_node(node *p, charinfo *c, tfont *t, statem *s,
+ int pop, node *x)
+: charinfo_node(c, s, pop, x), n(p), tf(t)
{
}
@@ -3883,7 +4197,7 @@ composite_node::~composite_node()
node *composite_node::copy()
{
- return new composite_node(copy_node_list(n), ci, tf);
+ return new composite_node(copy_node_list(n), ci, tf, state, div_nest_level);
}
hunits composite_node::width()
@@ -3983,10 +4297,10 @@ node *reverse_node_list(node *n)
return r;
}
-void composite_node::vertical_extent(vunits *min, vunits *max)
+void composite_node::vertical_extent(vunits *minimum, vunits *maximum)
{
n = reverse_node_list(n);
- node_list_vertical_extent(n, min, max);
+ node_list_vertical_extent(n, minimum, maximum);
n = reverse_node_list(n);
}
@@ -4006,8 +4320,8 @@ word_space_node::word_space_node(hunits d, color *c, width_list *w, node *x)
}
word_space_node::word_space_node(hunits d, int s, color *c, width_list *w,
- int flag, node *x)
-: space_node(d, s, 0, c, x), orig_width(w), unformat(flag)
+ int flag, statem *st, int pop, node *x)
+: space_node(d, s, 0, c, st, pop, x), orig_width(w), unformat(flag)
{
}
@@ -4033,7 +4347,8 @@ node *word_space_node::copy()
w_new_curr = w_new_curr->next;
w_old_curr = w_old_curr->next;
}
- return new word_space_node(n, set, col, w_new, unformat);
+ return new word_space_node(n, set, col, w_new, unformat, state,
+ div_nest_level);
}
int word_space_node::set_unformat_flag()
@@ -4066,14 +4381,15 @@ unbreakable_space_node::unbreakable_space_node(hunits d, color *c, node *x)
}
unbreakable_space_node::unbreakable_space_node(hunits d, int s,
- color *c, node *x)
-: word_space_node(d, s, c, 0, 0, x)
+ color *c, statem *st, int pop,
+ node *x)
+: word_space_node(d, s, c, 0, 0, st, pop, x)
{
}
node *unbreakable_space_node::copy()
{
- return new unbreakable_space_node(n, set, col);
+ return new unbreakable_space_node(n, set, col, state, div_nest_level);
}
int unbreakable_space_node::force_tprint()
@@ -4081,6 +4397,11 @@ int unbreakable_space_node::force_tprint()
return 0;
}
+int unbreakable_space_node::is_tag()
+{
+ return 0;
+}
+
breakpoint *unbreakable_space_node::get_breakpoints(hunits, int,
breakpoint *rest, int)
{
@@ -4115,6 +4436,15 @@ draw_node::draw_node(char c, hvpair *p, int np, font_size s,
point[i] = p[i];
}
+draw_node::draw_node(char c, hvpair *p, int np, font_size s,
+ color *gc, color *fc, statem *st, int pop)
+: node(0, st, pop), npoints(np), sz(s), gcol(gc), fcol(fc), code(c)
+{
+ point = new hvpair[npoints];
+ for (int i = 0; i < npoints; i++)
+ point[i] = p[i];
+}
+
int draw_node::same(node *n)
{
draw_node *nd = (draw_node *)n;
@@ -4137,6 +4467,11 @@ int draw_node::force_tprint()
return 0;
}
+int draw_node::is_tag()
+{
+ return 0;
+}
+
draw_node::~draw_node()
{
if (point)
@@ -4163,7 +4498,8 @@ vunits draw_node::vertical_width()
node *draw_node::copy()
{
- return new draw_node(code, point, npoints, sz, gcol, fcol);
+ return new draw_node(code, point, npoints, sz, gcol, fcol, state,
+ div_nest_level);
}
void draw_node::tprint(troff_output_file *out)
@@ -4498,7 +4834,7 @@ node *make_composite_node(charinfo *s, environment *env)
fontno);
if (env->is_composite())
tf = tf->get_plain();
- return new composite_node(n, s, tf);
+ return new composite_node(n, s, tf, 0, 0, 0);
}
node *make_glyph_node(charinfo *s, environment *env, int no_error_message = 0)
@@ -4584,7 +4920,7 @@ node *make_glyph_node(charinfo *s, environment *env, int no_error_message = 0)
tf = tf->get_plain();
color *gcol = env->get_glyph_color();
color *fcol = env->get_fill_color();
- return new glyph_node(s, tf, gcol, fcol);
+ return new glyph_node(s, tf, gcol, fcol, 0, 0);
}
node *make_node(charinfo *ci, environment *env)
@@ -4630,7 +4966,7 @@ int character_exists(charinfo *ci, environment *env)
}
node *node::add_char(charinfo *ci, environment *env,
- hunits *widthp, int *spacep)
+ hunits *widthp, int *spacep, node **glyph_comp_np)
{
node *res;
switch (ci->get_special_translation()) {
@@ -4660,9 +4996,14 @@ node *node::add_char(charinfo *ci, environment *env,
if (res) {
res->next = this;
*widthp += res->width();
+ if (glyph_comp_np)
+ *glyph_comp_np = res;
}
- else
+ else {
+ if (glyph_comp_np)
+ *glyph_comp_np = res;
return this;
+ }
}
else {
node *gn = make_glyph_node(ci, env);
@@ -4680,6 +5021,8 @@ node *node::add_char(charinfo *ci, environment *env,
*widthp += p->width() - old_width;
res = p;
}
+ if (glyph_comp_np)
+ *glyph_comp_np = res;
}
}
int break_code = 0;
@@ -4736,6 +5079,11 @@ int extra_size_node::force_tprint()
return 0;
}
+int extra_size_node::is_tag()
+{
+ return 0;
+}
+
int vertical_size_node::same(node *nd)
{
return n == ((vertical_size_node *)nd)->n;
@@ -4756,6 +5104,11 @@ int vertical_size_node::force_tprint()
return 0;
}
+int vertical_size_node::is_tag()
+{
+ return 0;
+}
+
int hmotion_node::same(node *nd)
{
return n == ((hmotion_node *)nd)->n
@@ -4778,9 +5131,14 @@ int hmotion_node::force_tprint()
return 0;
}
-node *hmotion_node::add_self(node *n, hyphen_list **p)
+int hmotion_node::is_tag()
{
- next = n;
+ return 0;
+}
+
+node *hmotion_node::add_self(node *nd, hyphen_list **p)
+{
+ next = nd;
hyphen_list *pp = *p;
*p = (*p)->next;
delete pp;
@@ -4808,9 +5166,14 @@ int space_char_hmotion_node::force_tprint()
return 0;
}
-node *space_char_hmotion_node::add_self(node *n, hyphen_list **p)
+int space_char_hmotion_node::is_tag()
{
- next = n;
+ return 0;
+}
+
+node *space_char_hmotion_node::add_self(node *nd, hyphen_list **p)
+{
+ next = nd;
hyphen_list *pp = *p;
*p = (*p)->next;
delete pp;
@@ -4839,6 +5202,11 @@ int vmotion_node::force_tprint()
return 0;
}
+int vmotion_node::is_tag()
+{
+ return 0;
+}
+
int hline_node::same(node *nd)
{
return x == ((hline_node *)nd)->x && same_node(n, ((hline_node *)nd)->n);
@@ -4854,6 +5222,11 @@ int hline_node::force_tprint()
return 0;
}
+int hline_node::is_tag()
+{
+ return 0;
+}
+
int vline_node::same(node *nd)
{
return x == ((vline_node *)nd)->x && same_node(n, ((vline_node *)nd)->n);
@@ -4869,6 +5242,11 @@ int vline_node::force_tprint()
return 0;
}
+int vline_node::is_tag()
+{
+ return 0;
+}
+
int dummy_node::same(node * /*nd*/)
{
return 1;
@@ -4884,6 +5262,11 @@ int dummy_node::force_tprint()
return 0;
}
+int dummy_node::is_tag()
+{
+ return 0;
+}
+
int transparent_dummy_node::same(node * /*nd*/)
{
return 1;
@@ -4899,6 +5282,11 @@ int transparent_dummy_node::force_tprint()
return 0;
}
+int transparent_dummy_node::is_tag()
+{
+ return 0;
+}
+
int transparent_dummy_node::ends_sentence()
{
return 2;
@@ -4919,6 +5307,11 @@ int zero_width_node::force_tprint()
return 0;
}
+int zero_width_node::is_tag()
+{
+ return 0;
+}
+
int italic_corrected_node::same(node *nd)
{
return (x == ((italic_corrected_node *)nd)->x
@@ -4935,8 +5328,19 @@ int italic_corrected_node::force_tprint()
return 0;
}
-left_italic_corrected_node::left_italic_corrected_node(node *x)
-: node(x), n(0)
+int italic_corrected_node::is_tag()
+{
+ return 0;
+}
+
+left_italic_corrected_node::left_italic_corrected_node(node *xx)
+: node(xx), n(0)
+{
+}
+
+left_italic_corrected_node::left_italic_corrected_node(statem *s, int pop,
+ node *xx)
+: node(xx, s, pop), n(0)
{
}
@@ -4968,7 +5372,8 @@ node *left_italic_corrected_node::merge_glyph_node(glyph_node *gn)
node *left_italic_corrected_node::copy()
{
- left_italic_corrected_node *nd = new left_italic_corrected_node;
+ left_italic_corrected_node *nd =
+ new left_italic_corrected_node(state, div_nest_level);
if (n) {
nd->n = n->copy();
nd->x = x;
@@ -4994,6 +5399,11 @@ int left_italic_corrected_node::force_tprint()
return 0;
}
+int left_italic_corrected_node::is_tag()
+{
+ return 0;
+}
+
int left_italic_corrected_node::same(node *nd)
{
return (x == ((left_italic_corrected_node *)nd)->x
@@ -5011,12 +5421,13 @@ hunits left_italic_corrected_node::width()
return n ? n->width() + x : H0;
}
-void left_italic_corrected_node::vertical_extent(vunits *min, vunits *max)
+void left_italic_corrected_node::vertical_extent(vunits *minimum,
+ vunits *maximum)
{
if (n)
- n->vertical_extent(min, max);
+ n->vertical_extent(minimum, maximum);
else
- node::vertical_extent(min, max);
+ node::vertical_extent(minimum, maximum);
}
hunits left_italic_corrected_node::skew()
@@ -5076,7 +5487,7 @@ hyphen_list *left_italic_corrected_node::get_hyphen_list(hyphen_list *tail,
node *left_italic_corrected_node::add_self(node *nd, hyphen_list **p)
{
if (n) {
- nd = new left_italic_corrected_node(nd);
+ nd = new left_italic_corrected_node(state, div_nest_level, nd);
nd = n->add_self(nd, p);
n = 0;
delete this;
@@ -5104,6 +5515,11 @@ int overstrike_node::force_tprint()
return 0;
}
+int overstrike_node::is_tag()
+{
+ return 0;
+}
+
node *overstrike_node::add_self(node *n, hyphen_list **p)
{
next = n;
@@ -5133,6 +5549,11 @@ int bracket_node::force_tprint()
return 0;
}
+int bracket_node::is_tag()
+{
+ return 0;
+}
+
int composite_node::same(node *nd)
{
return ci == ((composite_node *)nd)->ci
@@ -5149,6 +5570,11 @@ int composite_node::force_tprint()
return 0;
}
+int composite_node::is_tag()
+{
+ return 0;
+}
+
int glyph_node::same(node *nd)
{
return ci == ((glyph_node *)nd)->ci
@@ -5167,6 +5593,11 @@ int glyph_node::force_tprint()
return 0;
}
+int glyph_node::is_tag()
+{
+ return 0;
+}
+
int ligature_node::same(node *nd)
{
return (same_node(n1, ((ligature_node *)nd)->n1)
@@ -5184,6 +5615,11 @@ int ligature_node::force_tprint()
return 0;
}
+int ligature_node::is_tag()
+{
+ return 0;
+}
+
int kern_pair_node::same(node *nd)
{
return (amount == ((kern_pair_node *)nd)->amount
@@ -5201,6 +5637,11 @@ int kern_pair_node::force_tprint()
return 0;
}
+int kern_pair_node::is_tag()
+{
+ return 0;
+}
+
int dbreak_node::same(node *nd)
{
return (same_node_list(none, ((dbreak_node *)nd)->none)
@@ -5218,6 +5659,11 @@ int dbreak_node::force_tprint()
return 0;
}
+int dbreak_node::is_tag()
+{
+ return 0;
+}
+
int break_char_node::same(node *nd)
{
return break_code == ((break_char_node *)nd)->break_code
@@ -5235,6 +5681,11 @@ int break_char_node::force_tprint()
return 0;
}
+int break_char_node::is_tag()
+{
+ return 0;
+}
+
int line_start_node::same(node * /*nd*/)
{
return 1;
@@ -5250,6 +5701,11 @@ int line_start_node::force_tprint()
return 0;
}
+int line_start_node::is_tag()
+{
+ return 0;
+}
+
int space_node::same(node *nd)
{
return n == ((space_node *)nd)->n
@@ -5279,6 +5735,11 @@ int word_space_node::force_tprint()
return 0;
}
+int word_space_node::is_tag()
+{
+ return 0;
+}
+
void unbreakable_space_node::tprint(troff_output_file *out)
{
out->fill_color(col);
@@ -5305,9 +5766,9 @@ const char *unbreakable_space_node::type()
return "unbreakable_space_node";
}
-node *unbreakable_space_node::add_self(node *n, hyphen_list **p)
+node *unbreakable_space_node::add_self(node *nd, hyphen_list **p)
{
- next = n;
+ next = nd;
hyphen_list *pp = *p;
*p = (*p)->next;
delete pp;
@@ -5334,6 +5795,11 @@ int diverted_space_node::force_tprint()
return 0;
}
+int diverted_space_node::is_tag()
+{
+ return 0;
+}
+
int diverted_copy_file_node::same(node *nd)
{
return filename == ((diverted_copy_file_node *)nd)->filename;
@@ -5349,6 +5815,11 @@ int diverted_copy_file_node::force_tprint()
return 0;
}
+int diverted_copy_file_node::is_tag()
+{
+ return 0;
+}
+
// Grow the font_table so that its size is > n.
static void grow_font_table(int n)
@@ -5378,7 +5849,8 @@ static symbol get_font_translation(symbol nm)
dictionary font_dictionary(50);
-static int mount_font_no_translate(int n, symbol name, symbol external_name)
+static int mount_font_no_translate(int n, symbol name, symbol external_name,
+ int check_only = 0)
{
assert(n >= 0);
// We store the address of this char in font_dictionary to indicate
@@ -5388,7 +5860,9 @@ static int mount_font_no_translate(int n, symbol name, symbol external_name)
void *p = font_dictionary.lookup(external_name);
if (p == 0) {
int not_found;
- fm = font::load_font(external_name.contents(), &not_found);
+ fm = font::load_font(external_name.contents(), &not_found, check_only);
+ if (check_only)
+ return fm != 0;
if (!fm) {
if (not_found)
warning(WARN_FONT, "can't find font `%1'", external_name.contents());
@@ -5405,6 +5879,8 @@ static int mount_font_no_translate(int n, symbol name, symbol external_name)
}
else
fm = (font*)p;
+ if (check_only)
+ return 1;
if (n >= font_table_size) {
if (n - font_table_size > 1000) {
error("font position too much larger than first unused position");
@@ -5430,6 +5906,19 @@ int mount_font(int n, symbol name, symbol external_name)
return mount_font_no_translate(n, name, external_name);
}
+int check_font(symbol fam, symbol name)
+{
+ if (check_style(name))
+ name = concat(fam, name);
+ return mount_font_no_translate(0, name, name, 1);
+}
+
+int check_style(symbol s)
+{
+ int i = symbol_fontno(s);
+ return i < 0 ? 0 : font_table[i]->is_style();
+}
+
void mount_style(int n, symbol name)
{
assert(n >= 0);
@@ -5555,13 +6044,13 @@ void font_family::invalidate_fontno(int n)
{
assert(n >= 0 && n < font_table_size);
dictionary_iterator iter(family_dictionary);
- symbol nm;
+ symbol nam;
font_family *fam;
- while (iter.get(&nm, (void **)&fam)) {
- int map_size = fam->map_size;
- if (n < map_size)
+ while (iter.get(&nam, (void **)&fam)) {
+ int mapsize = fam->map_size;
+ if (n < mapsize)
fam->map[n] = -1;
- for (int i = 0; i < map_size; i++)
+ for (int i = 0; i < mapsize; i++)
if (fam->map[i] == n)
fam->map[i] = -1;
}
diff --git a/contrib/groff/src/roff/troff/node.h b/contrib/groff/src/roff/troff/node.h
index 54f8822..c7c8b41 100644
--- a/contrib/groff/src/roff/troff/node.h
+++ b/contrib/groff/src/roff/troff/node.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,8 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct hyphen_list {
unsigned char hyphen;
@@ -36,7 +35,7 @@ class ascii_output_file;
struct breakpoint;
struct vertical_size;
-struct charinfo;
+class charinfo;
class macro;
@@ -51,14 +50,20 @@ class token_node;
struct node {
node *next;
node *last;
+ statem *state;
+ statem *push_state;
+ int div_nest_level;
+ int is_special;
node();
- node(node *n);
- node *add_char(charinfo *c, environment *, hunits *widthp, int *spacep);
+ node(node *);
+ node(node *, statem *, int);
+ node *add_char(charinfo *, environment *, hunits *, int *, node ** = 0);
virtual ~node();
virtual node *copy() = 0;
virtual int set_unformat_flag();
virtual int force_tprint() = 0;
+ virtual int is_tag() = 0;
virtual hunits width();
virtual hunits subscript_correction();
virtual hunits italic_correction();
@@ -68,7 +73,7 @@ struct node {
virtual int merge_space(hunits, hunits, hunits);
virtual vunits vertical_width();
virtual node *last_char_node();
- virtual void vertical_extent(vunits *min, vunits *max);
+ virtual void vertical_extent(vunits *, vunits *);
virtual int character_type();
virtual void set_vertical_size(vertical_size *);
virtual int ends_sentence();
@@ -82,9 +87,7 @@ struct node {
virtual void spread_space(int *, hunits *);
virtual void freeze_space();
virtual void is_escape_colon();
- virtual breakpoint *get_breakpoints(hunits width, int nspaces,
- breakpoint *rest = 0,
- int is_inner = 0);
+ virtual breakpoint *get_breakpoints(hunits, int, breakpoint * = 0, int = 0);
virtual int nbreaks();
virtual void split(int, node **, node **);
virtual hyphenation_type get_hyphenation_type();
@@ -106,16 +109,27 @@ struct node {
virtual int same(node *) = 0;
virtual const char *type() = 0;
+ virtual void debug_node();
+ virtual void debug_node_list();
};
inline node::node()
-: next(0), last(0)
+: next(0), last(0), state(0), push_state(0), div_nest_level(0), is_special(0)
{
}
inline node::node(node *n)
-: next(n), last(0)
+: next(n), last(0), state(0), push_state(0), div_nest_level(0), is_special(0)
+{
+}
+
+inline node::node(node *n, statem *s, int divlevel)
+: next(n), last(0), push_state(0), div_nest_level(divlevel), is_special(0)
{
+ if (s)
+ state = new statem(s);
+ else
+ state = 0;
}
inline node::~node()
@@ -141,6 +155,7 @@ public:
node *copy() { return new line_start_node; }
int same(node *);
int force_tprint();
+ int is_tag();
const char *type();
void asciify(macro *);
};
@@ -157,8 +172,9 @@ protected:
char set;
char was_escape_colon;
color *col; /* for grotty */
- space_node(hunits, int, int, color *, node * = 0);
+ space_node(hunits, int, int, color *, statem *, int, node * = 0);
public:
+ space_node(hunits, color *, statem *, int, node * = 0);
space_node(hunits, color *, node * = 0);
#if 0
~space_node();
@@ -173,8 +189,7 @@ public:
void is_escape_colon();
void spread_space(int *, hunits *);
void tprint(troff_output_file *);
- breakpoint *get_breakpoints(hunits width, int nspaces, breakpoint *rest = 0,
- int is_inner = 0);
+ breakpoint *get_breakpoints(hunits, int, breakpoint * = 0, int = 0);
int nbreaks();
void split(int, node **, node **);
void ascii_print(ascii_output_file *);
@@ -182,6 +197,7 @@ public:
void asciify(macro *);
const char *type();
int force_tprint();
+ int is_tag();
hyphenation_type get_hyphenation_type();
};
@@ -197,7 +213,8 @@ class word_space_node : public space_node {
protected:
width_list *orig_width;
unsigned char unformat;
- word_space_node(hunits, int, color *, width_list *, int, node * = 0);
+ word_space_node(hunits, int, color *, width_list *, int, statem *, int,
+ node * = 0);
public:
word_space_node(hunits, color *, width_list *, node * = 0);
~word_space_node();
@@ -210,10 +227,11 @@ public:
const char *type();
int merge_space(hunits, hunits, hunits);
int force_tprint();
+ int is_tag();
};
class unbreakable_space_node : public word_space_node {
- unbreakable_space_node(hunits, int, color *, node * = 0);
+ unbreakable_space_node(hunits, int, color *, statem *, int, node * = 0);
public:
unbreakable_space_node(hunits, color *, node * = 0);
node *copy();
@@ -223,8 +241,8 @@ public:
void asciify(macro *);
const char *type();
int force_tprint();
- breakpoint *get_breakpoints(hunits width, int nspaces, breakpoint *rest = 0,
- int is_inner = 0);
+ int is_tag();
+ breakpoint *get_breakpoints(hunits, int, breakpoint * = 0, int = 0);
int nbreaks();
void split(int, node **, node **);
int merge_space(hunits, hunits, hunits);
@@ -236,41 +254,48 @@ public:
class diverted_space_node : public node {
public:
vunits n;
- diverted_space_node(vunits d, node *p = 0);
+ diverted_space_node(vunits, node * = 0);
+ diverted_space_node(vunits, statem *, int, node * = 0);
node *copy();
int reread(int *);
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class diverted_copy_file_node : public node {
symbol filename;
public:
vunits n;
- diverted_copy_file_node(symbol s, node *p = 0);
+ diverted_copy_file_node(symbol, node * = 0);
+ diverted_copy_file_node(symbol, statem *, int, node * = 0);
node *copy();
int reread(int *);
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class extra_size_node : public node {
vunits n;
public:
- extra_size_node(vunits i) : n(i) {}
+ extra_size_node(vunits);
+ extra_size_node(vunits, statem *, int);
void set_vertical_size(vertical_size *);
node *copy();
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class vertical_size_node : public node {
vunits n;
public:
- vertical_size_node(vunits i) : n(i) {}
+ vertical_size_node(vunits, statem *, int);
+ vertical_size_node(vunits);
void set_vertical_size(vertical_size *);
void asciify(macro *);
node *copy();
@@ -278,6 +303,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class hmotion_node : public node {
@@ -287,10 +313,16 @@ protected:
unsigned char unformat;
color *col; /* for grotty */
public:
- hmotion_node(hunits i, color *c, node *next = 0)
- : node(next), n(i), was_tab(0), unformat(0), col(c) {}
- hmotion_node(hunits i, int flag1, int flag2, color *c, node *next = 0)
- : node(next), n(i), was_tab(flag1), unformat(flag2), col(c) {}
+ hmotion_node(hunits i, color *c, node *nxt = 0)
+ : node(nxt), n(i), was_tab(0), unformat(0), col(c) {}
+ hmotion_node(hunits i, color *c, statem *s, int divlevel, node *nxt = 0)
+ : node(nxt, s, divlevel), n(i), was_tab(0), unformat(0), col(c) {}
+ hmotion_node(hunits i, int flag1, int flag2, color *c, statem *s,
+ int divlevel, node *nxt = 0)
+ : node(nxt, s, divlevel), n(i), was_tab(flag1), unformat(flag2),
+ col(c) {}
+ hmotion_node(hunits i, int flag1, int flag2, color *c, node *nxt = 0)
+ : node(nxt), n(i), was_tab(flag1), unformat(flag2), col(c) {}
node *copy();
int reread(int *);
int set_unformat_flag();
@@ -301,6 +333,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
node *add_self(node *, hyphen_list **);
hyphen_list *get_hyphen_list(hyphen_list *, int *);
hyphenation_type get_hyphenation_type();
@@ -309,6 +342,7 @@ public:
class space_char_hmotion_node : public hmotion_node {
public:
space_char_hmotion_node(hunits, color *, node * = 0);
+ space_char_hmotion_node(hunits, color *, statem *, int, node * = 0);
node *copy();
void ascii_print(ascii_output_file *);
void asciify(macro *);
@@ -316,6 +350,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
node *add_self(node *, hyphen_list **);
hyphen_list *get_hyphen_list(hyphen_list *, int *);
hyphenation_type get_hyphenation_type();
@@ -325,20 +360,23 @@ class vmotion_node : public node {
vunits n;
color *col; /* for grotty */
public:
- vmotion_node(vunits i, color *c) : n(i), col(c) {}
+ vmotion_node(vunits, color *);
+ vmotion_node(vunits, color *, statem *, int);
void tprint(troff_output_file *);
node *copy();
vunits vertical_width();
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class hline_node : public node {
hunits x;
node *n;
public:
- hline_node(hunits i, node *c, node *next = 0) : node(next), x(i), n(c) {}
+ hline_node(hunits, node *, node * = 0);
+ hline_node(hunits, node *, statem *, int, node * = 0);
~hline_node();
node *copy();
hunits width();
@@ -346,13 +384,15 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class vline_node : public node {
vunits x;
node *n;
public:
- vline_node(vunits i, node *c, node *next= 0) : node(next), x(i), n(c) {}
+ vline_node(vunits, node *, node * = 0);
+ vline_node(vunits, node *, statem *, int, node * = 0);
~vline_node();
node *copy();
void tprint(troff_output_file *);
@@ -362,9 +402,9 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
-
class dummy_node : public node {
public:
dummy_node(node *nd = 0) : node(nd) {}
@@ -372,6 +412,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
hyphenation_type get_hyphenation_type();
};
@@ -382,6 +423,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
int ends_sentence();
hyphenation_type get_hyphenation_type();
};
@@ -389,16 +431,18 @@ public:
class zero_width_node : public node {
node *n;
public:
- zero_width_node(node *gn);
+ zero_width_node(node *);
+ zero_width_node(node *, statem *, int);
~zero_width_node();
node *copy();
void tprint(troff_output_file *);
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
void append(node *);
int character_type();
- void vertical_extent(vunits *min, vunits *max);
+ void vertical_extent(vunits *, vunits *);
};
class left_italic_corrected_node : public node {
@@ -406,6 +450,7 @@ class left_italic_corrected_node : public node {
hunits x;
public:
left_italic_corrected_node(node * = 0);
+ left_italic_corrected_node(statem *, int, node * = 0);
~left_italic_corrected_node();
void tprint(troff_output_file *);
void ascii_print(ascii_output_file *);
@@ -414,6 +459,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
hunits width();
node *last_char_node();
void vertical_extent(vunits *, vunits *);
@@ -436,6 +482,7 @@ class overstrike_node : public node {
hunits max_width;
public:
overstrike_node();
+ overstrike_node(statem *, int);
~overstrike_node();
node *copy();
void tprint(troff_output_file *);
@@ -444,6 +491,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
node *add_self(node *, hyphen_list **);
hyphen_list *get_hyphen_list(hyphen_list *, int *);
hyphenation_type get_hyphenation_type();
@@ -454,6 +502,7 @@ class bracket_node : public node {
hunits max_width;
public:
bracket_node();
+ bracket_node(statem *, int);
~bracket_node();
node *copy();
void tprint(troff_output_file *);
@@ -462,6 +511,7 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class special_node : public node {
@@ -475,12 +525,14 @@ class special_node : public node {
void tprint_end(troff_output_file *);
public:
special_node(const macro &, int = 0);
- special_node(const macro &, tfont *, color *, color *, int = 0);
+ special_node(const macro &, tfont *, color *, color *, statem *, int,
+ int = 0);
node *copy();
void tprint(troff_output_file *);
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
int ends_sentence();
tfont *get_tfont();
};
@@ -493,16 +545,34 @@ class suppress_node : public node {
int image_id;
public:
suppress_node(int, int);
- suppress_node(symbol f, char p, int id);
- suppress_node(int, int, symbol f, char p, int id);
+ suppress_node(symbol, char, int);
+ suppress_node(int, int, symbol, char, int, statem *, int);
+ suppress_node(int, int, symbol, char, int);
node *copy();
void tprint(troff_output_file *);
hunits width();
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
private:
- void put(troff_output_file *out, const char *s);
+ void put(troff_output_file *, const char *);
+};
+
+class tag_node : public node {
+public:
+ string tag_string;
+ int delayed;
+ tag_node();
+ tag_node(string, int);
+ tag_node(string, statem *, int, int);
+ node *copy();
+ void tprint(troff_output_file *);
+ int same(node *);
+ const char *type();
+ int force_tprint();
+ int is_tag();
+ int ends_sentence();
};
struct hvpair {
@@ -520,6 +590,7 @@ class draw_node : public node {
hvpair *point;
public:
draw_node(char, hvpair *, int, font_size, color *, color *);
+ draw_node(char, hvpair *, int, font_size, color *, color *, statem *, int);
~draw_node();
hunits width();
vunits vertical_width();
@@ -528,18 +599,19 @@ public:
int same(node *);
const char *type();
int force_tprint();
+ int is_tag();
};
class charinfo;
-node *make_node(charinfo *ci, environment *);
+node *make_node(charinfo *, environment *);
int character_exists(charinfo *, environment *);
-int same_node_list(node *n1, node *n2);
-node *reverse_node_list(node *n);
+int same_node_list(node *, node *);
+node *reverse_node_list(node *);
void delete_node_list(node *);
node *copy_node_list(node *);
-int get_bold_fontno(int f);
+int get_bold_fontno(int);
inline hyphen_list::hyphen_list(unsigned char code, hyphen_list *p)
: hyphen(0), breakable(0), hyphenation_code(code), next(p)
@@ -547,9 +619,11 @@ inline hyphen_list::hyphen_list(unsigned char code, hyphen_list *p)
}
extern void read_desc();
-extern int mount_font(int n, symbol, symbol = NULL_SYMBOL);
-extern void mount_style(int n, symbol);
-extern int is_good_fontno(int n);
+extern int mount_font(int, symbol, symbol = NULL_SYMBOL);
+extern int check_font(symbol, symbol);
+extern int check_style(symbol);
+extern void mount_style(int, symbol);
+extern int is_good_fontno(int);
extern int symbol_fontno(symbol);
extern int next_available_font_position();
extern void init_size_table(int *);
@@ -560,7 +634,7 @@ class output_file {
public:
output_file();
virtual ~output_file();
- virtual void trailer(vunits page_length);
+ virtual void trailer(vunits);
virtual void flush() = 0;
virtual void transparent_char(unsigned char) = 0;
virtual void print_line(hunits x, vunits y, node *n,
@@ -568,12 +642,13 @@ public:
virtual void begin_page(int pageno, vunits page_length) = 0;
virtual void copy_file(hunits x, vunits y, const char *filename) = 0;
virtual int is_printing() = 0;
- virtual void put_filename(const char *filename);
+ virtual void put_filename(const char *);
virtual void on();
virtual void off();
#ifdef COLUMN
virtual void vjustify(vunits, symbol);
#endif /* COLUMN */
+ mtsm state;
};
#ifndef POPEN_MISSING
@@ -582,7 +657,7 @@ extern char *pipe_command;
extern output_file *the_output;
extern void init_output();
-int in_output_page_list(int n);
+int in_output_page_list(int);
class font_family {
int *map;
@@ -597,3 +672,5 @@ public:
font_family *lookup_family(symbol);
symbol get_font_name(int, environment *);
+symbol get_style_name(int);
+extern search_path include_search_path;
diff --git a/contrib/groff/src/roff/troff/number.cpp b/contrib/groff/src/roff/troff/number.cpp
index 8fed342..0a4563e 100644
--- a/contrib/groff/src/roff/troff/number.cpp
+++ b/contrib/groff/src/roff/troff/number.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,12 +17,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "troff.h"
-#include "symbol.h"
#include "hvunits.h"
+#include "stringclass.h"
+#include "mtsm.h"
#include "env.h"
#include "token.h"
#include "div.h"
diff --git a/contrib/groff/src/roff/troff/reg.cpp b/contrib/groff/src/roff/troff/reg.cpp
index 8ac20c9..4501090 100644
--- a/contrib/groff/src/roff/troff/reg.cpp
+++ b/contrib/groff/src/roff/troff/reg.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,10 +17,9 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "troff.h"
-#include "symbol.h"
#include "dictionary.h"
#include "token.h"
#include "request.h"
diff --git a/contrib/groff/src/roff/troff/reg.h b/contrib/groff/src/roff/troff/reg.h
index 950be4f..bc2c3f2 100644
--- a/contrib/groff/src/roff/troff/reg.h
+++ b/contrib/groff/src/roff/troff/reg.h
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class reg : public object {
diff --git a/contrib/groff/src/roff/troff/request.h b/contrib/groff/src/roff/troff/request.h
index 0433ac1..24d2589 100644
--- a/contrib/groff/src/roff/troff/request.h
+++ b/contrib/groff/src/roff/troff/request.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
typedef void (*REQUEST_FUNCP)();
@@ -41,19 +41,21 @@ void delete_request_or_macro(request_or_macro *);
extern object_dictionary request_dictionary;
-struct macro_header;
+class macro_header;
struct node;
class macro : public request_or_macro {
- macro_header *p;
const char *filename; // where was it defined?
int lineno;
int len;
int empty_macro;
+ int is_a_diversion;
public:
+ macro_header *p;
macro();
~macro();
macro(const macro &);
+ macro(int);
macro &operator=(const macro &);
void append(unsigned char);
void append(node *);
@@ -67,6 +69,7 @@ public:
macro *to_macro();
void print_size();
int empty();
+ int is_diversion();
friend class string_iterator;
friend void chop_macro();
friend void substring_request();
diff --git a/contrib/groff/src/roff/troff/token.h b/contrib/groff/src/roff/troff/token.h
index 9f5b069..6493976 100644
--- a/contrib/groff/src/roff/troff/token.h
+++ b/contrib/groff/src/roff/troff/token.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,12 +17,12 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
-struct charinfo;
+class charinfo;
struct node;
-struct vunits;
+class vunits;
class token {
symbol nm;
@@ -121,7 +121,7 @@ enum char_mode {
extern void do_define_character(char_mode, const char * = 0);
-struct hunits;
+class hunits;
extern void read_title_parts(node **part, hunits *part_width);
extern int get_number_rigidly(units *result, unsigned char si);
diff --git a/contrib/groff/src/roff/troff/troff.h b/contrib/groff/src/roff/troff/troff.h
index 80d9f0b..661b3ed 100644
--- a/contrib/groff/src/roff/troff/troff.h
+++ b/contrib/groff/src/roff/troff/troff.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -33,8 +33,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "device.h"
#include "searchpath.h"
-void cleanup_and_exit(int n);
-
typedef int units;
extern units scale(units n, units x, units y); // scale n by x/y
@@ -82,7 +80,7 @@ enum warning_type {
// change WARN_TOTAL if you add more warning types
};
-const int WARN_TOTAL = 02777777;
+const int WARN_TOTAL = 03777777;
int warning(warning_type, const char *,
const errarg & = empty_errarg,
diff --git a/contrib/groff/src/roff/troff/troff.man b/contrib/groff/src/roff/troff/troff.man
index dce81dd..064a03f 100644
--- a/contrib/groff/src/roff/troff/troff.man
+++ b/contrib/groff/src/roff/troff/troff.man
@@ -2,11 +2,11 @@
.ig
troff.man
-Last update : 09 Dec 2002
+Last update : 12 Oct 2003
This file is part of groff, the GNU roff type-setting system.
-Copyright (C) 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1989, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
written by James Clark
@@ -28,6 +28,9 @@ FDL in the main directory of the groff source package.
.\" Setup
.\" --------------------------------------------------------------------
.
+.do nr troff_C \n[.C]
+.cp 0
+.
.mso www.tmac
.
.if n \{\
@@ -81,6 +84,7 @@ FDL in the main directory of the groff source package.
.OP \-d cs
.OP \-f fam
.OP \-F dir
+.OP \-I dir
.OP \-m name
.OP \-M dir
.OP \-n num
@@ -195,6 +199,17 @@ Read the standard input after all the named input files have been
processed.
.
.TP
+.BI \-I dir
+This option may be used to specify a directory to search for
+files (both those on the command line and those named in
+.B \&.psbb
+requests).
+The current directory is always searched first.
+This option may be specified more than once;
+the directories will be searched in the order specified.
+No directory search is performed for files specified using an absolute path.
+.
+.TP
.BI \-m name
Read in the file
.IB name .tmac\fR.
@@ -607,7 +622,7 @@ necessary.
.SH AUTHOR
.\" --------------------------------------------------------------------
.
-Copyright (C) 1989, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1989, 2001, 2002, 2003 Free Software Foundation, Inc.
.
.P
This document is distributed under the terms of the FDL (GNU Free
@@ -679,6 +694,7 @@ cf.\&
.BR info (@MAN1EXT@),
presents all groff documentation within a single document.
.
+.cp \n[troff_C]
.
.\" --------------------------------------------------------------------
.\" Emacs variables
diff --git a/contrib/groff/src/utils/addftinfo/addftinfo.cpp b/contrib/groff/src/utils/addftinfo/addftinfo.cpp
index 931d836..b2fd15d 100644
--- a/contrib/groff/src/utils/addftinfo/addftinfo.cpp
+++ b/contrib/groff/src/utils/addftinfo/addftinfo.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/utils/addftinfo/guess.cpp b/contrib/groff/src/utils/addftinfo/guess.cpp
index dcfd4c9..7ae36dc 100644
--- a/contrib/groff/src/utils/addftinfo/guess.cpp
+++ b/contrib/groff/src/utils/addftinfo/guess.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "guess.h"
diff --git a/contrib/groff/src/utils/addftinfo/guess.h b/contrib/groff/src/utils/addftinfo/guess.h
index 4471dda..26f0883 100644
--- a/contrib/groff/src/utils/addftinfo/guess.h
+++ b/contrib/groff/src/utils/addftinfo/guess.h
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct font_params {
int italic;
diff --git a/contrib/groff/src/utils/afmtodit/Makefile.sub b/contrib/groff/src/utils/afmtodit/Makefile.sub
index c1de91b..53afc74 100644
--- a/contrib/groff/src/utils/afmtodit/Makefile.sub
+++ b/contrib/groff/src/utils/afmtodit/Makefile.sub
@@ -12,7 +12,7 @@ afmtodit: afmtodit.pl
else \
sed -e "s|@VERSION@|$(version)$(revision)|" \
-e "s|@FONTDIR@|$(fontdir)|" \
- $(srcdir)/afmtodit.pl afmtodit; \
+ $(srcdir)/afmtodit.pl >afmtodit; \
fi
chmod +x afmtodit
diff --git a/contrib/groff/src/utils/afmtodit/afmtodit.man b/contrib/groff/src/utils/afmtodit/afmtodit.man
index 88198c9..978de34 100644
--- a/contrib/groff/src/utils/afmtodit/afmtodit.man
+++ b/contrib/groff/src/utils/afmtodit/afmtodit.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -21,8 +21,13 @@ the original English.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
+..
+.
+.de OP
+. ie \\n(.$-1 .RI "[\ \fB\\$1\fP\ " "\\$2" "\ ]"
+. el .RB "[\ " "\\$1" "\ ]"
..
.
.
@@ -40,12 +45,7 @@ afmtodit \- create font files for use with groff \-Tps
.in +\w'\fBafmtodit 'u
.ti \niu
.B afmtodit
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP\ " "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.
-.OP \-mnsv
+.OP \-mnsvx
.OP \-a n
.OP \-d desc_file
.OP \-e enc_file
@@ -66,7 +66,7 @@ creates a font file for use with groff and
.
.B afmtodit
is written in perl;
-you must have perl version 3 or newer installed in order to run
+you must have perl version 5.004 or newer installed in order to run
.BR afmtodit .
.
.LP
@@ -104,24 +104,26 @@ If the file isn't found in the current directory, it is searched in
the `devps/generate' subdirectory of the default font directory.
.
.LP
-If a PostScript character is in the encoding to be used for the font
-but is not mentioned in
+If a PostScript character is not named as
+.BI uni XXXX
+.RI ( XXXX
+are four uppercase hexadecimal digits), and is not mentioned in
.IR map_file ,
-or if a generic groff glyph name can't be deduced using the Adobe Glyph
-List (built into
-.BR afmtodit )
+and a generic groff glyph name can't be deduced using the
+Adobe Glyph List (AGL, built into
+.BR afmtodit ),
then
.B afmtodit
-will put it in the groff font file as an unnamed character,
-which can be accessed by the
+puts the PostScript character into the groff font file as an unnamed
+character which can only be accessed by the
.B \eN
escape sequence in
.BR troff .
.
If option
.B \-e
-is not specified, the encoding defined in the AFM file (i.e., entries with
-non-negative character codes) is used.
+is not specified, the encoding defined in the AFM file (i.e., entries
+with non-negative character codes) is used.
.
Please refer to section `Using Symbols' in the groff info file which
describes how groff glyph names are constructed.
@@ -293,6 +295,10 @@ command to the font file.
.B \-v
Print version.
.
+.TP
+.B \-x
+Don't use the built-in Adobe Glyph List.
+.
.
.SH FILES
.Tp \w'\fB@FONTDIR@/devps/download'u+2n
diff --git a/contrib/groff/src/utils/afmtodit/afmtodit.pl b/contrib/groff/src/utils/afmtodit/afmtodit.pl
index 72a486b..0ff85de 100644
--- a/contrib/groff/src/utils/afmtodit/afmtodit.pl
+++ b/contrib/groff/src/utils/afmtodit/afmtodit.pl
@@ -1,6 +1,7 @@
-#! /usr/bin/perl
+#! /usr/bin/perl -w
# -*- Perl -*-
-# Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
#
# This file is part of groff.
@@ -17,6036 +18,6041 @@
#
# You should have received a copy of the GNU General Public License along
# with groff; see the file COPYING. If not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
-%unicode_decomposed = (
- "u00C0", "u0041_0300",
- "u00C1", "u0041_0301",
- "u00C2", "u0041_0302",
- "u00C3", "u0041_0303",
- "u00C4", "u0041_0308",
- "u00C5", "u0041_030A",
- "u00C7", "u0043_0327",
- "u00C8", "u0045_0300",
- "u00C9", "u0045_0301",
- "u00CA", "u0045_0302",
- "u00CB", "u0045_0308",
- "u00CC", "u0049_0300",
- "u00CD", "u0049_0301",
- "u00CE", "u0049_0302",
- "u00CF", "u0049_0308",
- "u00D1", "u004E_0303",
- "u00D2", "u004F_0300",
- "u00D3", "u004F_0301",
- "u00D4", "u004F_0302",
- "u00D5", "u004F_0303",
- "u00D6", "u004F_0308",
- "u00D9", "u0055_0300",
- "u00DA", "u0055_0301",
- "u00DB", "u0055_0302",
- "u00DC", "u0055_0308",
- "u00DD", "u0059_0301",
- "u00E0", "u0061_0300",
- "u00E1", "u0061_0301",
- "u00E2", "u0061_0302",
- "u00E3", "u0061_0303",
- "u00E4", "u0061_0308",
- "u00E5", "u0061_030A",
- "u00E7", "u0063_0327",
- "u00E8", "u0065_0300",
- "u00E9", "u0065_0301",
- "u00EA", "u0065_0302",
- "u00EB", "u0065_0308",
- "u00EC", "u0069_0300",
- "u00ED", "u0069_0301",
- "u00EE", "u0069_0302",
- "u00EF", "u0069_0308",
- "u00F1", "u006E_0303",
- "u00F2", "u006F_0300",
- "u00F3", "u006F_0301",
- "u00F4", "u006F_0302",
- "u00F5", "u006F_0303",
- "u00F6", "u006F_0308",
- "u00F9", "u0075_0300",
- "u00FA", "u0075_0301",
- "u00FB", "u0075_0302",
- "u00FC", "u0075_0308",
- "u00FD", "u0079_0301",
- "u00FF", "u0079_0308",
- "u0100", "u0041_0304",
- "u0101", "u0061_0304",
- "u0102", "u0041_0306",
- "u0103", "u0061_0306",
- "u0104", "u0041_0328",
- "u0105", "u0061_0328",
- "u0106", "u0043_0301",
- "u0107", "u0063_0301",
- "u0108", "u0043_0302",
- "u0109", "u0063_0302",
- "u010A", "u0043_0307",
- "u010B", "u0063_0307",
- "u010C", "u0043_030C",
- "u010D", "u0063_030C",
- "u010E", "u0044_030C",
- "u010F", "u0064_030C",
- "u0112", "u0045_0304",
- "u0113", "u0065_0304",
- "u0114", "u0045_0306",
- "u0115", "u0065_0306",
- "u0116", "u0045_0307",
- "u0117", "u0065_0307",
- "u0118", "u0045_0328",
- "u0119", "u0065_0328",
- "u011A", "u0045_030C",
- "u011B", "u0065_030C",
- "u011C", "u0047_0302",
- "u011D", "u0067_0302",
- "u011E", "u0047_0306",
- "u011F", "u0067_0306",
- "u0120", "u0047_0307",
- "u0121", "u0067_0307",
- "u0122", "u0047_0327",
- "u0123", "u0067_0327",
- "u0124", "u0048_0302",
- "u0125", "u0068_0302",
- "u0128", "u0049_0303",
- "u0129", "u0069_0303",
- "u012A", "u0049_0304",
- "u012B", "u0069_0304",
- "u012C", "u0049_0306",
- "u012D", "u0069_0306",
- "u012E", "u0049_0328",
- "u012F", "u0069_0328",
- "u0130", "u0049_0307",
- "u0134", "u004A_0302",
- "u0135", "u006A_0302",
- "u0136", "u004B_0327",
- "u0137", "u006B_0327",
- "u0139", "u004C_0301",
- "u013A", "u006C_0301",
- "u013B", "u004C_0327",
- "u013C", "u006C_0327",
- "u013D", "u004C_030C",
- "u013E", "u006C_030C",
- "u0143", "u004E_0301",
- "u0144", "u006E_0301",
- "u0145", "u004E_0327",
- "u0146", "u006E_0327",
- "u0147", "u004E_030C",
- "u0148", "u006E_030C",
- "u014C", "u004F_0304",
- "u014D", "u006F_0304",
- "u014E", "u004F_0306",
- "u014F", "u006F_0306",
- "u0150", "u004F_030B",
- "u0151", "u006F_030B",
- "u0154", "u0052_0301",
- "u0155", "u0072_0301",
- "u0156", "u0052_0327",
- "u0157", "u0072_0327",
- "u0158", "u0052_030C",
- "u0159", "u0072_030C",
- "u015A", "u0053_0301",
- "u015B", "u0073_0301",
- "u015C", "u0053_0302",
- "u015D", "u0073_0302",
- "u015E", "u0053_0327",
- "u015F", "u0073_0327",
- "u0160", "u0053_030C",
- "u0161", "u0073_030C",
- "u0162", "u0054_0327",
- "u0163", "u0074_0327",
- "u0164", "u0054_030C",
- "u0165", "u0074_030C",
- "u0168", "u0055_0303",
- "u0169", "u0075_0303",
- "u016A", "u0055_0304",
- "u016B", "u0075_0304",
- "u016C", "u0055_0306",
- "u016D", "u0075_0306",
- "u016E", "u0055_030A",
- "u016F", "u0075_030A",
- "u0170", "u0055_030B",
- "u0171", "u0075_030B",
- "u0172", "u0055_0328",
- "u0173", "u0075_0328",
- "u0174", "u0057_0302",
- "u0175", "u0077_0302",
- "u0176", "u0059_0302",
- "u0177", "u0079_0302",
- "u0178", "u0059_0308",
- "u0179", "u005A_0301",
- "u017A", "u007A_0301",
- "u017B", "u005A_0307",
- "u017C", "u007A_0307",
- "u017D", "u005A_030C",
- "u017E", "u007A_030C",
- "u01A0", "u004F_031B",
- "u01A1", "u006F_031B",
- "u01AF", "u0055_031B",
- "u01B0", "u0075_031B",
- "u01CD", "u0041_030C",
- "u01CE", "u0061_030C",
- "u01CF", "u0049_030C",
- "u01D0", "u0069_030C",
- "u01D1", "u004F_030C",
- "u01D2", "u006F_030C",
- "u01D3", "u0055_030C",
- "u01D4", "u0075_030C",
- "u01D5", "u0055_0308_0304",
- "u01D6", "u0075_0308_0304",
- "u01D7", "u0055_0308_0301",
- "u01D8", "u0075_0308_0301",
- "u01D9", "u0055_0308_030C",
- "u01DA", "u0075_0308_030C",
- "u01DB", "u0055_0308_0300",
- "u01DC", "u0075_0308_0300",
- "u01DE", "u0041_0308_0304",
- "u01DF", "u0061_0308_0304",
- "u01E0", "u0041_0307_0304",
- "u01E1", "u0061_0307_0304",
- "u01E2", "u00C6_0304",
- "u01E3", "u00E6_0304",
- "u01E6", "u0047_030C",
- "u01E7", "u0067_030C",
- "u01E8", "u004B_030C",
- "u01E9", "u006B_030C",
- "u01EA", "u004F_0328",
- "u01EB", "u006F_0328",
- "u01EC", "u004F_0328_0304",
- "u01ED", "u006F_0328_0304",
- "u01EE", "u01B7_030C",
- "u01EF", "u0292_030C",
- "u01F0", "u006A_030C",
- "u01F4", "u0047_0301",
- "u01F5", "u0067_0301",
- "u01F8", "u004E_0300",
- "u01F9", "u006E_0300",
- "u01FA", "u0041_030A_0301",
- "u01FB", "u0061_030A_0301",
- "u01FC", "u00C6_0301",
- "u01FD", "u00E6_0301",
- "u01FE", "u00D8_0301",
- "u01FF", "u00F8_0301",
- "u0200", "u0041_030F",
- "u0201", "u0061_030F",
- "u0202", "u0041_0311",
- "u0203", "u0061_0311",
- "u0204", "u0045_030F",
- "u0205", "u0065_030F",
- "u0206", "u0045_0311",
- "u0207", "u0065_0311",
- "u0208", "u0049_030F",
- "u0209", "u0069_030F",
- "u020A", "u0049_0311",
- "u020B", "u0069_0311",
- "u020C", "u004F_030F",
- "u020D", "u006F_030F",
- "u020E", "u004F_0311",
- "u020F", "u006F_0311",
- "u0210", "u0052_030F",
- "u0211", "u0072_030F",
- "u0212", "u0052_0311",
- "u0213", "u0072_0311",
- "u0214", "u0055_030F",
- "u0215", "u0075_030F",
- "u0216", "u0055_0311",
- "u0217", "u0075_0311",
- "u0218", "u0053_0326",
- "u0219", "u0073_0326",
- "u021A", "u0054_0326",
- "u021B", "u0074_0326",
- "u021E", "u0048_030C",
- "u021F", "u0068_030C",
- "u0226", "u0041_0307",
- "u0227", "u0061_0307",
- "u0228", "u0045_0327",
- "u0229", "u0065_0327",
- "u022A", "u004F_0308_0304",
- "u022B", "u006F_0308_0304",
- "u022C", "u004F_0303_0304",
- "u022D", "u006F_0303_0304",
- "u022E", "u004F_0307",
- "u022F", "u006F_0307",
- "u0230", "u004F_0307_0304",
- "u0231", "u006F_0307_0304",
- "u0232", "u0059_0304",
- "u0233", "u0079_0304",
- "u0340", "u0300",
- "u0341", "u0301",
- "u0343", "u0313",
- "u0344", "u0308_0301",
- "u0374", "u02B9",
- "u037E", "u003B",
- "u0385", "u00A8_0301",
- "u0386", "u0391_0301",
- "u0387", "u00B7",
- "u0388", "u0395_0301",
- "u0389", "u0397_0301",
- "u038A", "u0399_0301",
- "u038C", "u039F_0301",
- "u038E", "u03A5_0301",
- "u038F", "u03A9_0301",
- "u0390", "u03B9_0308_0301",
- "u03AA", "u0399_0308",
- "u03AB", "u03A5_0308",
- "u03AC", "u03B1_0301",
- "u03AD", "u03B5_0301",
- "u03AE", "u03B7_0301",
- "u03AF", "u03B9_0301",
- "u03B0", "u03C5_0308_0301",
- "u03CA", "u03B9_0308",
- "u03CB", "u03C5_0308",
- "u03CC", "u03BF_0301",
- "u03CD", "u03C5_0301",
- "u03CE", "u03C9_0301",
- "u03D3", "u03D2_0301",
- "u03D4", "u03D2_0308",
- "u0400", "u0415_0300",
- "u0401", "u0415_0308",
- "u0403", "u0413_0301",
- "u0407", "u0406_0308",
- "u040C", "u041A_0301",
- "u040D", "u0418_0300",
- "u040E", "u0423_0306",
- "u0419", "u0418_0306",
- "u0439", "u0438_0306",
- "u0450", "u0435_0300",
- "u0451", "u0435_0308",
- "u0453", "u0433_0301",
- "u0457", "u0456_0308",
- "u045C", "u043A_0301",
- "u045D", "u0438_0300",
- "u045E", "u0443_0306",
- "u0476", "u0474_030F",
- "u0477", "u0475_030F",
- "u04C1", "u0416_0306",
- "u04C2", "u0436_0306",
- "u04D0", "u0410_0306",
- "u04D1", "u0430_0306",
- "u04D2", "u0410_0308",
- "u04D3", "u0430_0308",
- "u04D6", "u0415_0306",
- "u04D7", "u0435_0306",
- "u04DA", "u04D8_0308",
- "u04DB", "u04D9_0308",
- "u04DC", "u0416_0308",
- "u04DD", "u0436_0308",
- "u04DE", "u0417_0308",
- "u04DF", "u0437_0308",
- "u04E2", "u0418_0304",
- "u04E3", "u0438_0304",
- "u04E4", "u0418_0308",
- "u04E5", "u0438_0308",
- "u04E6", "u041E_0308",
- "u04E7", "u043E_0308",
- "u04EA", "u04E8_0308",
- "u04EB", "u04E9_0308",
- "u04EC", "u042D_0308",
- "u04ED", "u044D_0308",
- "u04EE", "u0423_0304",
- "u04EF", "u0443_0304",
- "u04F0", "u0423_0308",
- "u04F1", "u0443_0308",
- "u04F2", "u0423_030B",
- "u04F3", "u0443_030B",
- "u04F4", "u0427_0308",
- "u04F5", "u0447_0308",
- "u04F8", "u042B_0308",
- "u04F9", "u044B_0308",
- "u0622", "u0627_0653",
- "u0623", "u0627_0654",
- "u0624", "u0648_0654",
- "u0625", "u0627_0655",
- "u0626", "u064A_0654",
- "u06C0", "u06D5_0654",
- "u06C2", "u06C1_0654",
- "u06D3", "u06D2_0654",
- "u0929", "u0928_093C",
- "u0931", "u0930_093C",
- "u0934", "u0933_093C",
- "u0958", "u0915_093C",
- "u0959", "u0916_093C",
- "u095A", "u0917_093C",
- "u095B", "u091C_093C",
- "u095C", "u0921_093C",
- "u095D", "u0922_093C",
- "u095E", "u092B_093C",
- "u095F", "u092F_093C",
- "u09CB", "u09C7_09BE",
- "u09CC", "u09C7_09D7",
- "u09DC", "u09A1_09BC",
- "u09DD", "u09A2_09BC",
- "u09DF", "u09AF_09BC",
- "u0A33", "u0A32_0A3C",
- "u0A36", "u0A38_0A3C",
- "u0A59", "u0A16_0A3C",
- "u0A5A", "u0A17_0A3C",
- "u0A5B", "u0A1C_0A3C",
- "u0A5E", "u0A2B_0A3C",
- "u0B48", "u0B47_0B56",
- "u0B4B", "u0B47_0B3E",
- "u0B4C", "u0B47_0B57",
- "u0B5C", "u0B21_0B3C",
- "u0B5D", "u0B22_0B3C",
- "u0B94", "u0B92_0BD7",
- "u0BCA", "u0BC6_0BBE",
- "u0BCB", "u0BC7_0BBE",
- "u0BCC", "u0BC6_0BD7",
- "u0C48", "u0C46_0C56",
- "u0CC0", "u0CBF_0CD5",
- "u0CC7", "u0CC6_0CD5",
- "u0CC8", "u0CC6_0CD6",
- "u0CCA", "u0CC6_0CC2",
- "u0CCB", "u0CC6_0CC2_0CD5",
- "u0D4A", "u0D46_0D3E",
- "u0D4B", "u0D47_0D3E",
- "u0D4C", "u0D46_0D57",
- "u0DDA", "u0DD9_0DCA",
- "u0DDC", "u0DD9_0DCF",
- "u0DDD", "u0DD9_0DCF_0DCA",
- "u0DDE", "u0DD9_0DDF",
- "u0F43", "u0F42_0FB7",
- "u0F4D", "u0F4C_0FB7",
- "u0F52", "u0F51_0FB7",
- "u0F57", "u0F56_0FB7",
- "u0F5C", "u0F5B_0FB7",
- "u0F69", "u0F40_0FB5",
- "u0F73", "u0F71_0F72",
- "u0F75", "u0F71_0F74",
- "u0F76", "u0FB2_0F80",
- "u0F78", "u0FB3_0F80",
- "u0F81", "u0F71_0F80",
- "u0F93", "u0F92_0FB7",
- "u0F9D", "u0F9C_0FB7",
- "u0FA2", "u0FA1_0FB7",
- "u0FA7", "u0FA6_0FB7",
- "u0FAC", "u0FAB_0FB7",
- "u0FB9", "u0F90_0FB5",
- "u1026", "u1025_102E",
- "u1E00", "u0041_0325",
- "u1E01", "u0061_0325",
- "u1E02", "u0042_0307",
- "u1E03", "u0062_0307",
- "u1E04", "u0042_0323",
- "u1E05", "u0062_0323",
- "u1E06", "u0042_0331",
- "u1E07", "u0062_0331",
- "u1E08", "u0043_0327_0301",
- "u1E09", "u0063_0327_0301",
- "u1E0A", "u0044_0307",
- "u1E0B", "u0064_0307",
- "u1E0C", "u0044_0323",
- "u1E0D", "u0064_0323",
- "u1E0E", "u0044_0331",
- "u1E0F", "u0064_0331",
- "u1E10", "u0044_0327",
- "u1E11", "u0064_0327",
- "u1E12", "u0044_032D",
- "u1E13", "u0064_032D",
- "u1E14", "u0045_0304_0300",
- "u1E15", "u0065_0304_0300",
- "u1E16", "u0045_0304_0301",
- "u1E17", "u0065_0304_0301",
- "u1E18", "u0045_032D",
- "u1E19", "u0065_032D",
- "u1E1A", "u0045_0330",
- "u1E1B", "u0065_0330",
- "u1E1C", "u0045_0327_0306",
- "u1E1D", "u0065_0327_0306",
- "u1E1E", "u0046_0307",
- "u1E1F", "u0066_0307",
- "u1E20", "u0047_0304",
- "u1E21", "u0067_0304",
- "u1E22", "u0048_0307",
- "u1E23", "u0068_0307",
- "u1E24", "u0048_0323",
- "u1E25", "u0068_0323",
- "u1E26", "u0048_0308",
- "u1E27", "u0068_0308",
- "u1E28", "u0048_0327",
- "u1E29", "u0068_0327",
- "u1E2A", "u0048_032E",
- "u1E2B", "u0068_032E",
- "u1E2C", "u0049_0330",
- "u1E2D", "u0069_0330",
- "u1E2E", "u0049_0308_0301",
- "u1E2F", "u0069_0308_0301",
- "u1E30", "u004B_0301",
- "u1E31", "u006B_0301",
- "u1E32", "u004B_0323",
- "u1E33", "u006B_0323",
- "u1E34", "u004B_0331",
- "u1E35", "u006B_0331",
- "u1E36", "u004C_0323",
- "u1E37", "u006C_0323",
- "u1E38", "u004C_0323_0304",
- "u1E39", "u006C_0323_0304",
- "u1E3A", "u004C_0331",
- "u1E3B", "u006C_0331",
- "u1E3C", "u004C_032D",
- "u1E3D", "u006C_032D",
- "u1E3E", "u004D_0301",
- "u1E3F", "u006D_0301",
- "u1E40", "u004D_0307",
- "u1E41", "u006D_0307",
- "u1E42", "u004D_0323",
- "u1E43", "u006D_0323",
- "u1E44", "u004E_0307",
- "u1E45", "u006E_0307",
- "u1E46", "u004E_0323",
- "u1E47", "u006E_0323",
- "u1E48", "u004E_0331",
- "u1E49", "u006E_0331",
- "u1E4A", "u004E_032D",
- "u1E4B", "u006E_032D",
- "u1E4C", "u004F_0303_0301",
- "u1E4D", "u006F_0303_0301",
- "u1E4E", "u004F_0303_0308",
- "u1E4F", "u006F_0303_0308",
- "u1E50", "u004F_0304_0300",
- "u1E51", "u006F_0304_0300",
- "u1E52", "u004F_0304_0301",
- "u1E53", "u006F_0304_0301",
- "u1E54", "u0050_0301",
- "u1E55", "u0070_0301",
- "u1E56", "u0050_0307",
- "u1E57", "u0070_0307",
- "u1E58", "u0052_0307",
- "u1E59", "u0072_0307",
- "u1E5A", "u0052_0323",
- "u1E5B", "u0072_0323",
- "u1E5C", "u0052_0323_0304",
- "u1E5D", "u0072_0323_0304",
- "u1E5E", "u0052_0331",
- "u1E5F", "u0072_0331",
- "u1E60", "u0053_0307",
- "u1E61", "u0073_0307",
- "u1E62", "u0053_0323",
- "u1E63", "u0073_0323",
- "u1E64", "u0053_0301_0307",
- "u1E65", "u0073_0301_0307",
- "u1E66", "u0053_030C_0307",
- "u1E67", "u0073_030C_0307",
- "u1E68", "u0053_0323_0307",
- "u1E69", "u0073_0323_0307",
- "u1E6A", "u0054_0307",
- "u1E6B", "u0074_0307",
- "u1E6C", "u0054_0323",
- "u1E6D", "u0074_0323",
- "u1E6E", "u0054_0331",
- "u1E6F", "u0074_0331",
- "u1E70", "u0054_032D",
- "u1E71", "u0074_032D",
- "u1E72", "u0055_0324",
- "u1E73", "u0075_0324",
- "u1E74", "u0055_0330",
- "u1E75", "u0075_0330",
- "u1E76", "u0055_032D",
- "u1E77", "u0075_032D",
- "u1E78", "u0055_0303_0301",
- "u1E79", "u0075_0303_0301",
- "u1E7A", "u0055_0304_0308",
- "u1E7B", "u0075_0304_0308",
- "u1E7C", "u0056_0303",
- "u1E7D", "u0076_0303",
- "u1E7E", "u0056_0323",
- "u1E7F", "u0076_0323",
- "u1E80", "u0057_0300",
- "u1E81", "u0077_0300",
- "u1E82", "u0057_0301",
- "u1E83", "u0077_0301",
- "u1E84", "u0057_0308",
- "u1E85", "u0077_0308",
- "u1E86", "u0057_0307",
- "u1E87", "u0077_0307",
- "u1E88", "u0057_0323",
- "u1E89", "u0077_0323",
- "u1E8A", "u0058_0307",
- "u1E8B", "u0078_0307",
- "u1E8C", "u0058_0308",
- "u1E8D", "u0078_0308",
- "u1E8E", "u0059_0307",
- "u1E8F", "u0079_0307",
- "u1E90", "u005A_0302",
- "u1E91", "u007A_0302",
- "u1E92", "u005A_0323",
- "u1E93", "u007A_0323",
- "u1E94", "u005A_0331",
- "u1E95", "u007A_0331",
- "u1E96", "u0068_0331",
- "u1E97", "u0074_0308",
- "u1E98", "u0077_030A",
- "u1E99", "u0079_030A",
- "u1E9B", "u017F_0307",
- "u1EA0", "u0041_0323",
- "u1EA1", "u0061_0323",
- "u1EA2", "u0041_0309",
- "u1EA3", "u0061_0309",
- "u1EA4", "u0041_0302_0301",
- "u1EA5", "u0061_0302_0301",
- "u1EA6", "u0041_0302_0300",
- "u1EA7", "u0061_0302_0300",
- "u1EA8", "u0041_0302_0309",
- "u1EA9", "u0061_0302_0309",
- "u1EAA", "u0041_0302_0303",
- "u1EAB", "u0061_0302_0303",
- "u1EAC", "u0041_0323_0302",
- "u1EAD", "u0061_0323_0302",
- "u1EAE", "u0041_0306_0301",
- "u1EAF", "u0061_0306_0301",
- "u1EB0", "u0041_0306_0300",
- "u1EB1", "u0061_0306_0300",
- "u1EB2", "u0041_0306_0309",
- "u1EB3", "u0061_0306_0309",
- "u1EB4", "u0041_0306_0303",
- "u1EB5", "u0061_0306_0303",
- "u1EB6", "u0041_0323_0306",
- "u1EB7", "u0061_0323_0306",
- "u1EB8", "u0045_0323",
- "u1EB9", "u0065_0323",
- "u1EBA", "u0045_0309",
- "u1EBB", "u0065_0309",
- "u1EBC", "u0045_0303",
- "u1EBD", "u0065_0303",
- "u1EBE", "u0045_0302_0301",
- "u1EBF", "u0065_0302_0301",
- "u1EC0", "u0045_0302_0300",
- "u1EC1", "u0065_0302_0300",
- "u1EC2", "u0045_0302_0309",
- "u1EC3", "u0065_0302_0309",
- "u1EC4", "u0045_0302_0303",
- "u1EC5", "u0065_0302_0303",
- "u1EC6", "u0045_0323_0302",
- "u1EC7", "u0065_0323_0302",
- "u1EC8", "u0049_0309",
- "u1EC9", "u0069_0309",
- "u1ECA", "u0049_0323",
- "u1ECB", "u0069_0323",
- "u1ECC", "u004F_0323",
- "u1ECD", "u006F_0323",
- "u1ECE", "u004F_0309",
- "u1ECF", "u006F_0309",
- "u1ED0", "u004F_0302_0301",
- "u1ED1", "u006F_0302_0301",
- "u1ED2", "u004F_0302_0300",
- "u1ED3", "u006F_0302_0300",
- "u1ED4", "u004F_0302_0309",
- "u1ED5", "u006F_0302_0309",
- "u1ED6", "u004F_0302_0303",
- "u1ED7", "u006F_0302_0303",
- "u1ED8", "u004F_0323_0302",
- "u1ED9", "u006F_0323_0302",
- "u1EDA", "u004F_031B_0301",
- "u1EDB", "u006F_031B_0301",
- "u1EDC", "u004F_031B_0300",
- "u1EDD", "u006F_031B_0300",
- "u1EDE", "u004F_031B_0309",
- "u1EDF", "u006F_031B_0309",
- "u1EE0", "u004F_031B_0303",
- "u1EE1", "u006F_031B_0303",
- "u1EE2", "u004F_031B_0323",
- "u1EE3", "u006F_031B_0323",
- "u1EE4", "u0055_0323",
- "u1EE5", "u0075_0323",
- "u1EE6", "u0055_0309",
- "u1EE7", "u0075_0309",
- "u1EE8", "u0055_031B_0301",
- "u1EE9", "u0075_031B_0301",
- "u1EEA", "u0055_031B_0300",
- "u1EEB", "u0075_031B_0300",
- "u1EEC", "u0055_031B_0309",
- "u1EED", "u0075_031B_0309",
- "u1EEE", "u0055_031B_0303",
- "u1EEF", "u0075_031B_0303",
- "u1EF0", "u0055_031B_0323",
- "u1EF1", "u0075_031B_0323",
- "u1EF2", "u0059_0300",
- "u1EF3", "u0079_0300",
- "u1EF4", "u0059_0323",
- "u1EF5", "u0079_0323",
- "u1EF6", "u0059_0309",
- "u1EF7", "u0079_0309",
- "u1EF8", "u0059_0303",
- "u1EF9", "u0079_0303",
- "u1F00", "u03B1_0313",
- "u1F01", "u03B1_0314",
- "u1F02", "u03B1_0313_0300",
- "u1F03", "u03B1_0314_0300",
- "u1F04", "u03B1_0313_0301",
- "u1F05", "u03B1_0314_0301",
- "u1F06", "u03B1_0313_0342",
- "u1F07", "u03B1_0314_0342",
- "u1F08", "u0391_0313",
- "u1F09", "u0391_0314",
- "u1F0A", "u0391_0313_0300",
- "u1F0B", "u0391_0314_0300",
- "u1F0C", "u0391_0313_0301",
- "u1F0D", "u0391_0314_0301",
- "u1F0E", "u0391_0313_0342",
- "u1F0F", "u0391_0314_0342",
- "u1F10", "u03B5_0313",
- "u1F11", "u03B5_0314",
- "u1F12", "u03B5_0313_0300",
- "u1F13", "u03B5_0314_0300",
- "u1F14", "u03B5_0313_0301",
- "u1F15", "u03B5_0314_0301",
- "u1F18", "u0395_0313",
- "u1F19", "u0395_0314",
- "u1F1A", "u0395_0313_0300",
- "u1F1B", "u0395_0314_0300",
- "u1F1C", "u0395_0313_0301",
- "u1F1D", "u0395_0314_0301",
- "u1F20", "u03B7_0313",
- "u1F21", "u03B7_0314",
- "u1F22", "u03B7_0313_0300",
- "u1F23", "u03B7_0314_0300",
- "u1F24", "u03B7_0313_0301",
- "u1F25", "u03B7_0314_0301",
- "u1F26", "u03B7_0313_0342",
- "u1F27", "u03B7_0314_0342",
- "u1F28", "u0397_0313",
- "u1F29", "u0397_0314",
- "u1F2A", "u0397_0313_0300",
- "u1F2B", "u0397_0314_0300",
- "u1F2C", "u0397_0313_0301",
- "u1F2D", "u0397_0314_0301",
- "u1F2E", "u0397_0313_0342",
- "u1F2F", "u0397_0314_0342",
- "u1F30", "u03B9_0313",
- "u1F31", "u03B9_0314",
- "u1F32", "u03B9_0313_0300",
- "u1F33", "u03B9_0314_0300",
- "u1F34", "u03B9_0313_0301",
- "u1F35", "u03B9_0314_0301",
- "u1F36", "u03B9_0313_0342",
- "u1F37", "u03B9_0314_0342",
- "u1F38", "u0399_0313",
- "u1F39", "u0399_0314",
- "u1F3A", "u0399_0313_0300",
- "u1F3B", "u0399_0314_0300",
- "u1F3C", "u0399_0313_0301",
- "u1F3D", "u0399_0314_0301",
- "u1F3E", "u0399_0313_0342",
- "u1F3F", "u0399_0314_0342",
- "u1F40", "u03BF_0313",
- "u1F41", "u03BF_0314",
- "u1F42", "u03BF_0313_0300",
- "u1F43", "u03BF_0314_0300",
- "u1F44", "u03BF_0313_0301",
- "u1F45", "u03BF_0314_0301",
- "u1F48", "u039F_0313",
- "u1F49", "u039F_0314",
- "u1F4A", "u039F_0313_0300",
- "u1F4B", "u039F_0314_0300",
- "u1F4C", "u039F_0313_0301",
- "u1F4D", "u039F_0314_0301",
- "u1F50", "u03C5_0313",
- "u1F51", "u03C5_0314",
- "u1F52", "u03C5_0313_0300",
- "u1F53", "u03C5_0314_0300",
- "u1F54", "u03C5_0313_0301",
- "u1F55", "u03C5_0314_0301",
- "u1F56", "u03C5_0313_0342",
- "u1F57", "u03C5_0314_0342",
- "u1F59", "u03A5_0314",
- "u1F5B", "u03A5_0314_0300",
- "u1F5D", "u03A5_0314_0301",
- "u1F5F", "u03A5_0314_0342",
- "u1F60", "u03C9_0313",
- "u1F61", "u03C9_0314",
- "u1F62", "u03C9_0313_0300",
- "u1F63", "u03C9_0314_0300",
- "u1F64", "u03C9_0313_0301",
- "u1F65", "u03C9_0314_0301",
- "u1F66", "u03C9_0313_0342",
- "u1F67", "u03C9_0314_0342",
- "u1F68", "u03A9_0313",
- "u1F69", "u03A9_0314",
- "u1F6A", "u03A9_0313_0300",
- "u1F6B", "u03A9_0314_0300",
- "u1F6C", "u03A9_0313_0301",
- "u1F6D", "u03A9_0314_0301",
- "u1F6E", "u03A9_0313_0342",
- "u1F6F", "u03A9_0314_0342",
- "u1F70", "u03B1_0300",
- "u1F71", "u03B1_0301",
- "u1F72", "u03B5_0300",
- "u1F73", "u03B5_0301",
- "u1F74", "u03B7_0300",
- "u1F75", "u03B7_0301",
- "u1F76", "u03B9_0300",
- "u1F77", "u03B9_0301",
- "u1F78", "u03BF_0300",
- "u1F79", "u03BF_0301",
- "u1F7A", "u03C5_0300",
- "u1F7B", "u03C5_0301",
- "u1F7C", "u03C9_0300",
- "u1F7D", "u03C9_0301",
- "u1F80", "u03B1_0313_0345",
- "u1F81", "u03B1_0314_0345",
- "u1F82", "u03B1_0313_0300_0345",
- "u1F83", "u03B1_0314_0300_0345",
- "u1F84", "u03B1_0313_0301_0345",
- "u1F85", "u03B1_0314_0301_0345",
- "u1F86", "u03B1_0313_0342_0345",
- "u1F87", "u03B1_0314_0342_0345",
- "u1F88", "u0391_0313_0345",
- "u1F89", "u0391_0314_0345",
- "u1F8A", "u0391_0313_0300_0345",
- "u1F8B", "u0391_0314_0300_0345",
- "u1F8C", "u0391_0313_0301_0345",
- "u1F8D", "u0391_0314_0301_0345",
- "u1F8E", "u0391_0313_0342_0345",
- "u1F8F", "u0391_0314_0342_0345",
- "u1F90", "u03B7_0313_0345",
- "u1F91", "u03B7_0314_0345",
- "u1F92", "u03B7_0313_0300_0345",
- "u1F93", "u03B7_0314_0300_0345",
- "u1F94", "u03B7_0313_0301_0345",
- "u1F95", "u03B7_0314_0301_0345",
- "u1F96", "u03B7_0313_0342_0345",
- "u1F97", "u03B7_0314_0342_0345",
- "u1F98", "u0397_0313_0345",
- "u1F99", "u0397_0314_0345",
- "u1F9A", "u0397_0313_0300_0345",
- "u1F9B", "u0397_0314_0300_0345",
- "u1F9C", "u0397_0313_0301_0345",
- "u1F9D", "u0397_0314_0301_0345",
- "u1F9E", "u0397_0313_0342_0345",
- "u1F9F", "u0397_0314_0342_0345",
- "u1FA0", "u03C9_0313_0345",
- "u1FA1", "u03C9_0314_0345",
- "u1FA2", "u03C9_0313_0300_0345",
- "u1FA3", "u03C9_0314_0300_0345",
- "u1FA4", "u03C9_0313_0301_0345",
- "u1FA5", "u03C9_0314_0301_0345",
- "u1FA6", "u03C9_0313_0342_0345",
- "u1FA7", "u03C9_0314_0342_0345",
- "u1FA8", "u03A9_0313_0345",
- "u1FA9", "u03A9_0314_0345",
- "u1FAA", "u03A9_0313_0300_0345",
- "u1FAB", "u03A9_0314_0300_0345",
- "u1FAC", "u03A9_0313_0301_0345",
- "u1FAD", "u03A9_0314_0301_0345",
- "u1FAE", "u03A9_0313_0342_0345",
- "u1FAF", "u03A9_0314_0342_0345",
- "u1FB0", "u03B1_0306",
- "u1FB1", "u03B1_0304",
- "u1FB2", "u03B1_0300_0345",
- "u1FB3", "u03B1_0345",
- "u1FB4", "u03B1_0301_0345",
- "u1FB6", "u03B1_0342",
- "u1FB7", "u03B1_0342_0345",
- "u1FB8", "u0391_0306",
- "u1FB9", "u0391_0304",
- "u1FBA", "u0391_0300",
- "u1FBB", "u0391_0301",
- "u1FBC", "u0391_0345",
- "u1FBE", "u03B9",
- "u1FC1", "u00A8_0342",
- "u1FC2", "u03B7_0300_0345",
- "u1FC3", "u03B7_0345",
- "u1FC4", "u03B7_0301_0345",
- "u1FC6", "u03B7_0342",
- "u1FC7", "u03B7_0342_0345",
- "u1FC8", "u0395_0300",
- "u1FC9", "u0395_0301",
- "u1FCA", "u0397_0300",
- "u1FCB", "u0397_0301",
- "u1FCC", "u0397_0345",
- "u1FCD", "u1FBF_0300",
- "u1FCE", "u1FBF_0301",
- "u1FCF", "u1FBF_0342",
- "u1FD0", "u03B9_0306",
- "u1FD1", "u03B9_0304",
- "u1FD2", "u03B9_0308_0300",
- "u1FD3", "u03B9_0308_0301",
- "u1FD6", "u03B9_0342",
- "u1FD7", "u03B9_0308_0342",
- "u1FD8", "u0399_0306",
- "u1FD9", "u0399_0304",
- "u1FDA", "u0399_0300",
- "u1FDB", "u0399_0301",
- "u1FDD", "u1FFE_0300",
- "u1FDE", "u1FFE_0301",
- "u1FDF", "u1FFE_0342",
- "u1FE0", "u03C5_0306",
- "u1FE1", "u03C5_0304",
- "u1FE2", "u03C5_0308_0300",
- "u1FE3", "u03C5_0308_0301",
- "u1FE4", "u03C1_0313",
- "u1FE5", "u03C1_0314",
- "u1FE6", "u03C5_0342",
- "u1FE7", "u03C5_0308_0342",
- "u1FE8", "u03A5_0306",
- "u1FE9", "u03A5_0304",
- "u1FEA", "u03A5_0300",
- "u1FEB", "u03A5_0301",
- "u1FEC", "u03A1_0314",
- "u1FED", "u00A8_0300",
- "u1FEE", "u00A8_0301",
- "u1FEF", "u0060",
- "u1FF2", "u03C9_0300_0345",
- "u1FF3", "u03C9_0345",
- "u1FF4", "u03C9_0301_0345",
- "u1FF6", "u03C9_0342",
- "u1FF7", "u03C9_0342_0345",
- "u1FF8", "u039F_0300",
- "u1FF9", "u039F_0301",
- "u1FFA", "u03A9_0300",
- "u1FFB", "u03A9_0301",
- "u1FFC", "u03A9_0345",
- "u1FFD", "u00B4",
- "u2000", "u2002",
- "u2001", "u2003",
- "u2126", "u03A9",
- "u212A", "u004B",
- "u212B", "u0041_030A",
- "u219A", "u2190_0338",
- "u219B", "u2192_0338",
- "u21AE", "u2194_0338",
- "u21CD", "u21D0_0338",
- "u21CE", "u21D4_0338",
- "u21CF", "u21D2_0338",
- "u2204", "u2203_0338",
- "u2209", "u2208_0338",
- "u220C", "u220B_0338",
- "u2224", "u2223_0338",
- "u2226", "u2225_0338",
- "u2241", "u223C_0338",
- "u2244", "u2243_0338",
- "u2247", "u2245_0338",
- "u2249", "u2248_0338",
- "u2260", "u003D_0338",
- "u2262", "u2261_0338",
- "u226D", "u224D_0338",
- "u226E", "u003C_0338",
- "u226F", "u003E_0338",
- "u2270", "u2264_0338",
- "u2271", "u2265_0338",
- "u2274", "u2272_0338",
- "u2275", "u2273_0338",
- "u2278", "u2276_0338",
- "u2279", "u2277_0338",
- "u2280", "u227A_0338",
- "u2281", "u227B_0338",
- "u2284", "u2282_0338",
- "u2285", "u2283_0338",
- "u2288", "u2286_0338",
- "u2289", "u2287_0338",
- "u22AC", "u22A2_0338",
- "u22AD", "u22A8_0338",
- "u22AE", "u22A9_0338",
- "u22AF", "u22AB_0338",
- "u22E0", "u227C_0338",
- "u22E1", "u227D_0338",
- "u22E2", "u2291_0338",
- "u22E3", "u2292_0338",
- "u22EA", "u22B2_0338",
- "u22EB", "u22B3_0338",
- "u22EC", "u22B4_0338",
- "u22ED", "u22B5_0338",
- "u2329", "u3008",
- "u232A", "u3009",
- "u2ADC", "u2ADD_0338",
- "u304C", "u304B_3099",
- "u304E", "u304D_3099",
- "u3050", "u304F_3099",
- "u3052", "u3051_3099",
- "u3054", "u3053_3099",
- "u3056", "u3055_3099",
- "u3058", "u3057_3099",
- "u305A", "u3059_3099",
- "u305C", "u305B_3099",
- "u305E", "u305D_3099",
- "u3060", "u305F_3099",
- "u3062", "u3061_3099",
- "u3065", "u3064_3099",
- "u3067", "u3066_3099",
- "u3069", "u3068_3099",
- "u3070", "u306F_3099",
- "u3071", "u306F_309A",
- "u3073", "u3072_3099",
- "u3074", "u3072_309A",
- "u3076", "u3075_3099",
- "u3077", "u3075_309A",
- "u3079", "u3078_3099",
- "u307A", "u3078_309A",
- "u307C", "u307B_3099",
- "u307D", "u307B_309A",
- "u3094", "u3046_3099",
- "u309E", "u309D_3099",
- "u30AC", "u30AB_3099",
- "u30AE", "u30AD_3099",
- "u30B0", "u30AF_3099",
- "u30B2", "u30B1_3099",
- "u30B4", "u30B3_3099",
- "u30B6", "u30B5_3099",
- "u30B8", "u30B7_3099",
- "u30BA", "u30B9_3099",
- "u30BC", "u30BB_3099",
- "u30BE", "u30BD_3099",
- "u30C0", "u30BF_3099",
- "u30C2", "u30C1_3099",
- "u30C5", "u30C4_3099",
- "u30C7", "u30C6_3099",
- "u30C9", "u30C8_3099",
- "u30D0", "u30CF_3099",
- "u30D1", "u30CF_309A",
- "u30D3", "u30D2_3099",
- "u30D4", "u30D2_309A",
- "u30D6", "u30D5_3099",
- "u30D7", "u30D5_309A",
- "u30D9", "u30D8_3099",
- "u30DA", "u30D8_309A",
- "u30DC", "u30DB_3099",
- "u30DD", "u30DB_309A",
- "u30F4", "u30A6_3099",
- "u30F7", "u30EF_3099",
- "u30F8", "u30F0_3099",
- "u30F9", "u30F1_3099",
- "u30FA", "u30F2_3099",
- "u30FE", "u30FD_3099",
- "uF900", "u8C48",
- "uF901", "u66F4",
- "uF902", "u8ECA",
- "uF903", "u8CC8",
- "uF904", "u6ED1",
- "uF905", "u4E32",
- "uF906", "u53E5",
- "uF907", "u9F9C",
- "uF908", "u9F9C",
- "uF909", "u5951",
- "uF90A", "u91D1",
- "uF90B", "u5587",
- "uF90C", "u5948",
- "uF90D", "u61F6",
- "uF90E", "u7669",
- "uF90F", "u7F85",
- "uF910", "u863F",
- "uF911", "u87BA",
- "uF912", "u88F8",
- "uF913", "u908F",
- "uF914", "u6A02",
- "uF915", "u6D1B",
- "uF916", "u70D9",
- "uF917", "u73DE",
- "uF918", "u843D",
- "uF919", "u916A",
- "uF91A", "u99F1",
- "uF91B", "u4E82",
- "uF91C", "u5375",
- "uF91D", "u6B04",
- "uF91E", "u721B",
- "uF91F", "u862D",
- "uF920", "u9E1E",
- "uF921", "u5D50",
- "uF922", "u6FEB",
- "uF923", "u85CD",
- "uF924", "u8964",
- "uF925", "u62C9",
- "uF926", "u81D8",
- "uF927", "u881F",
- "uF928", "u5ECA",
- "uF929", "u6717",
- "uF92A", "u6D6A",
- "uF92B", "u72FC",
- "uF92C", "u90CE",
- "uF92D", "u4F86",
- "uF92E", "u51B7",
- "uF92F", "u52DE",
- "uF930", "u64C4",
- "uF931", "u6AD3",
- "uF932", "u7210",
- "uF933", "u76E7",
- "uF934", "u8001",
- "uF935", "u8606",
- "uF936", "u865C",
- "uF937", "u8DEF",
- "uF938", "u9732",
- "uF939", "u9B6F",
- "uF93A", "u9DFA",
- "uF93B", "u788C",
- "uF93C", "u797F",
- "uF93D", "u7DA0",
- "uF93E", "u83C9",
- "uF93F", "u9304",
- "uF940", "u9E7F",
- "uF941", "u8AD6",
- "uF942", "u58DF",
- "uF943", "u5F04",
- "uF944", "u7C60",
- "uF945", "u807E",
- "uF946", "u7262",
- "uF947", "u78CA",
- "uF948", "u8CC2",
- "uF949", "u96F7",
- "uF94A", "u58D8",
- "uF94B", "u5C62",
- "uF94C", "u6A13",
- "uF94D", "u6DDA",
- "uF94E", "u6F0F",
- "uF94F", "u7D2F",
- "uF950", "u7E37",
- "uF951", "u964B",
- "uF952", "u52D2",
- "uF953", "u808B",
- "uF954", "u51DC",
- "uF955", "u51CC",
- "uF956", "u7A1C",
- "uF957", "u7DBE",
- "uF958", "u83F1",
- "uF959", "u9675",
- "uF95A", "u8B80",
- "uF95B", "u62CF",
- "uF95C", "u6A02",
- "uF95D", "u8AFE",
- "uF95E", "u4E39",
- "uF95F", "u5BE7",
- "uF960", "u6012",
- "uF961", "u7387",
- "uF962", "u7570",
- "uF963", "u5317",
- "uF964", "u78FB",
- "uF965", "u4FBF",
- "uF966", "u5FA9",
- "uF967", "u4E0D",
- "uF968", "u6CCC",
- "uF969", "u6578",
- "uF96A", "u7D22",
- "uF96B", "u53C3",
- "uF96C", "u585E",
- "uF96D", "u7701",
- "uF96E", "u8449",
- "uF96F", "u8AAA",
- "uF970", "u6BBA",
- "uF971", "u8FB0",
- "uF972", "u6C88",
- "uF973", "u62FE",
- "uF974", "u82E5",
- "uF975", "u63A0",
- "uF976", "u7565",
- "uF977", "u4EAE",
- "uF978", "u5169",
- "uF979", "u51C9",
- "uF97A", "u6881",
- "uF97B", "u7CE7",
- "uF97C", "u826F",
- "uF97D", "u8AD2",
- "uF97E", "u91CF",
- "uF97F", "u52F5",
- "uF980", "u5442",
- "uF981", "u5973",
- "uF982", "u5EEC",
- "uF983", "u65C5",
- "uF984", "u6FFE",
- "uF985", "u792A",
- "uF986", "u95AD",
- "uF987", "u9A6A",
- "uF988", "u9E97",
- "uF989", "u9ECE",
- "uF98A", "u529B",
- "uF98B", "u66C6",
- "uF98C", "u6B77",
- "uF98D", "u8F62",
- "uF98E", "u5E74",
- "uF98F", "u6190",
- "uF990", "u6200",
- "uF991", "u649A",
- "uF992", "u6F23",
- "uF993", "u7149",
- "uF994", "u7489",
- "uF995", "u79CA",
- "uF996", "u7DF4",
- "uF997", "u806F",
- "uF998", "u8F26",
- "uF999", "u84EE",
- "uF99A", "u9023",
- "uF99B", "u934A",
- "uF99C", "u5217",
- "uF99D", "u52A3",
- "uF99E", "u54BD",
- "uF99F", "u70C8",
- "uF9A0", "u88C2",
- "uF9A1", "u8AAA",
- "uF9A2", "u5EC9",
- "uF9A3", "u5FF5",
- "uF9A4", "u637B",
- "uF9A5", "u6BAE",
- "uF9A6", "u7C3E",
- "uF9A7", "u7375",
- "uF9A8", "u4EE4",
- "uF9A9", "u56F9",
- "uF9AA", "u5BE7",
- "uF9AB", "u5DBA",
- "uF9AC", "u601C",
- "uF9AD", "u73B2",
- "uF9AE", "u7469",
- "uF9AF", "u7F9A",
- "uF9B0", "u8046",
- "uF9B1", "u9234",
- "uF9B2", "u96F6",
- "uF9B3", "u9748",
- "uF9B4", "u9818",
- "uF9B5", "u4F8B",
- "uF9B6", "u79AE",
- "uF9B7", "u91B4",
- "uF9B8", "u96B8",
- "uF9B9", "u60E1",
- "uF9BA", "u4E86",
- "uF9BB", "u50DA",
- "uF9BC", "u5BEE",
- "uF9BD", "u5C3F",
- "uF9BE", "u6599",
- "uF9BF", "u6A02",
- "uF9C0", "u71CE",
- "uF9C1", "u7642",
- "uF9C2", "u84FC",
- "uF9C3", "u907C",
- "uF9C4", "u9F8D",
- "uF9C5", "u6688",
- "uF9C6", "u962E",
- "uF9C7", "u5289",
- "uF9C8", "u677B",
- "uF9C9", "u67F3",
- "uF9CA", "u6D41",
- "uF9CB", "u6E9C",
- "uF9CC", "u7409",
- "uF9CD", "u7559",
- "uF9CE", "u786B",
- "uF9CF", "u7D10",
- "uF9D0", "u985E",
- "uF9D1", "u516D",
- "uF9D2", "u622E",
- "uF9D3", "u9678",
- "uF9D4", "u502B",
- "uF9D5", "u5D19",
- "uF9D6", "u6DEA",
- "uF9D7", "u8F2A",
- "uF9D8", "u5F8B",
- "uF9D9", "u6144",
- "uF9DA", "u6817",
- "uF9DB", "u7387",
- "uF9DC", "u9686",
- "uF9DD", "u5229",
- "uF9DE", "u540F",
- "uF9DF", "u5C65",
- "uF9E0", "u6613",
- "uF9E1", "u674E",
- "uF9E2", "u68A8",
- "uF9E3", "u6CE5",
- "uF9E4", "u7406",
- "uF9E5", "u75E2",
- "uF9E6", "u7F79",
- "uF9E7", "u88CF",
- "uF9E8", "u88E1",
- "uF9E9", "u91CC",
- "uF9EA", "u96E2",
- "uF9EB", "u533F",
- "uF9EC", "u6EBA",
- "uF9ED", "u541D",
- "uF9EE", "u71D0",
- "uF9EF", "u7498",
- "uF9F0", "u85FA",
- "uF9F1", "u96A3",
- "uF9F2", "u9C57",
- "uF9F3", "u9E9F",
- "uF9F4", "u6797",
- "uF9F5", "u6DCB",
- "uF9F6", "u81E8",
- "uF9F7", "u7ACB",
- "uF9F8", "u7B20",
- "uF9F9", "u7C92",
- "uF9FA", "u72C0",
- "uF9FB", "u7099",
- "uF9FC", "u8B58",
- "uF9FD", "u4EC0",
- "uF9FE", "u8336",
- "uF9FF", "u523A",
- "uFA00", "u5207",
- "uFA01", "u5EA6",
- "uFA02", "u62D3",
- "uFA03", "u7CD6",
- "uFA04", "u5B85",
- "uFA05", "u6D1E",
- "uFA06", "u66B4",
- "uFA07", "u8F3B",
- "uFA08", "u884C",
- "uFA09", "u964D",
- "uFA0A", "u898B",
- "uFA0B", "u5ED3",
- "uFA0C", "u5140",
- "uFA0D", "u55C0",
- "uFA10", "u585A",
- "uFA12", "u6674",
- "uFA15", "u51DE",
- "uFA16", "u732A",
- "uFA17", "u76CA",
- "uFA18", "u793C",
- "uFA19", "u795E",
- "uFA1A", "u7965",
- "uFA1B", "u798F",
- "uFA1C", "u9756",
- "uFA1D", "u7CBE",
- "uFA1E", "u7FBD",
- "uFA20", "u8612",
- "uFA22", "u8AF8",
- "uFA25", "u9038",
- "uFA26", "u90FD",
- "uFA2A", "u98EF",
- "uFA2B", "u98FC",
- "uFA2C", "u9928",
- "uFA2D", "u9DB4",
- "uFA30", "u4FAE",
- "uFA31", "u50E7",
- "uFA32", "u514D",
- "uFA33", "u52C9",
- "uFA34", "u52E4",
- "uFA35", "u5351",
- "uFA36", "u559D",
- "uFA37", "u5606",
- "uFA38", "u5668",
- "uFA39", "u5840",
- "uFA3A", "u58A8",
- "uFA3B", "u5C64",
- "uFA3C", "u5C6E",
- "uFA3D", "u6094",
- "uFA3E", "u6168",
- "uFA3F", "u618E",
- "uFA40", "u61F2",
- "uFA41", "u654F",
- "uFA42", "u65E2",
- "uFA43", "u6691",
- "uFA44", "u6885",
- "uFA45", "u6D77",
- "uFA46", "u6E1A",
- "uFA47", "u6F22",
- "uFA48", "u716E",
- "uFA49", "u722B",
- "uFA4A", "u7422",
- "uFA4B", "u7891",
- "uFA4C", "u793E",
- "uFA4D", "u7949",
- "uFA4E", "u7948",
- "uFA4F", "u7950",
- "uFA50", "u7956",
- "uFA51", "u795D",
- "uFA52", "u798D",
- "uFA53", "u798E",
- "uFA54", "u7A40",
- "uFA55", "u7A81",
- "uFA56", "u7BC0",
- "uFA57", "u7DF4",
- "uFA58", "u7E09",
- "uFA59", "u7E41",
- "uFA5A", "u7F72",
- "uFA5B", "u8005",
- "uFA5C", "u81ED",
- "uFA5D", "u8279",
- "uFA5E", "u8279",
- "uFA5F", "u8457",
- "uFA60", "u8910",
- "uFA61", "u8996",
- "uFA62", "u8B01",
- "uFA63", "u8B39",
- "uFA64", "u8CD3",
- "uFA65", "u8D08",
- "uFA66", "u8FB6",
- "uFA67", "u9038",
- "uFA68", "u96E3",
- "uFA69", "u97FF",
- "uFA6A", "u983B",
- "uFB1D", "u05D9_05B4",
- "uFB1F", "u05F2_05B7",
- "uFB2A", "u05E9_05C1",
- "uFB2B", "u05E9_05C2",
- "uFB2C", "u05E9_05BC_05C1",
- "uFB2D", "u05E9_05BC_05C2",
- "uFB2E", "u05D0_05B7",
- "uFB2F", "u05D0_05B8",
- "uFB30", "u05D0_05BC",
- "uFB31", "u05D1_05BC",
- "uFB32", "u05D2_05BC",
- "uFB33", "u05D3_05BC",
- "uFB34", "u05D4_05BC",
- "uFB35", "u05D5_05BC",
- "uFB36", "u05D6_05BC",
- "uFB38", "u05D8_05BC",
- "uFB39", "u05D9_05BC",
- "uFB3A", "u05DA_05BC",
- "uFB3B", "u05DB_05BC",
- "uFB3C", "u05DC_05BC",
- "uFB3E", "u05DE_05BC",
- "uFB40", "u05E0_05BC",
- "uFB41", "u05E1_05BC",
- "uFB43", "u05E3_05BC",
- "uFB44", "u05E4_05BC",
- "uFB46", "u05E6_05BC",
- "uFB47", "u05E7_05BC",
- "uFB48", "u05E8_05BC",
- "uFB49", "u05E9_05BC",
- "uFB4A", "u05EA_05BC",
- "uFB4B", "u05D5_05B9",
- "uFB4C", "u05D1_05BF",
- "uFB4D", "u05DB_05BF",
- "uFB4E", "u05E4_05BF",
- "u1D15E", "u1D157_1D165",
- "u1D15F", "u1D158_1D165",
- "u1D160", "u1D158_1D165_1D16E",
- "u1D161", "u1D158_1D165_1D16F",
- "u1D162", "u1D158_1D165_1D170",
- "u1D163", "u1D158_1D165_1D171",
- "u1D164", "u1D158_1D165_1D172",
- "u1D1BB", "u1D1B9_1D165",
- "u1D1BC", "u1D1BA_1D165",
- "u1D1BD", "u1D1B9_1D165_1D16E",
- "u1D1BE", "u1D1BA_1D165_1D16E",
- "u1D1BF", "u1D1B9_1D165_1D16F",
- "u1D1C0", "u1D1BA_1D165_1D16F",
- "u2F800", "u4E3D",
- "u2F801", "u4E38",
- "u2F802", "u4E41",
- "u2F803", "u20122",
- "u2F804", "u4F60",
- "u2F805", "u4FAE",
- "u2F806", "u4FBB",
- "u2F807", "u5002",
- "u2F808", "u507A",
- "u2F809", "u5099",
- "u2F80A", "u50E7",
- "u2F80B", "u50CF",
- "u2F80C", "u349E",
- "u2F80D", "u2063A",
- "u2F80E", "u514D",
- "u2F80F", "u5154",
- "u2F810", "u5164",
- "u2F811", "u5177",
- "u2F812", "u2051C",
- "u2F813", "u34B9",
- "u2F814", "u5167",
- "u2F815", "u518D",
- "u2F816", "u2054B",
- "u2F817", "u5197",
- "u2F818", "u51A4",
- "u2F819", "u4ECC",
- "u2F81A", "u51AC",
- "u2F81B", "u51B5",
- "u2F81C", "u291DF",
- "u2F81D", "u51F5",
- "u2F81E", "u5203",
- "u2F81F", "u34DF",
- "u2F820", "u523B",
- "u2F821", "u5246",
- "u2F822", "u5272",
- "u2F823", "u5277",
- "u2F824", "u3515",
- "u2F825", "u52C7",
- "u2F826", "u52C9",
- "u2F827", "u52E4",
- "u2F828", "u52FA",
- "u2F829", "u5305",
- "u2F82A", "u5306",
- "u2F82B", "u5317",
- "u2F82C", "u5349",
- "u2F82D", "u5351",
- "u2F82E", "u535A",
- "u2F82F", "u5373",
- "u2F830", "u537D",
- "u2F831", "u537F",
- "u2F832", "u537F",
- "u2F833", "u537F",
- "u2F834", "u20A2C",
- "u2F835", "u7070",
- "u2F836", "u53CA",
- "u2F837", "u53DF",
- "u2F838", "u20B63",
- "u2F839", "u53EB",
- "u2F83A", "u53F1",
- "u2F83B", "u5406",
- "u2F83C", "u549E",
- "u2F83D", "u5438",
- "u2F83E", "u5448",
- "u2F83F", "u5468",
- "u2F840", "u54A2",
- "u2F841", "u54F6",
- "u2F842", "u5510",
- "u2F843", "u5553",
- "u2F844", "u5563",
- "u2F845", "u5584",
- "u2F846", "u5584",
- "u2F847", "u5599",
- "u2F848", "u55AB",
- "u2F849", "u55B3",
- "u2F84A", "u55C2",
- "u2F84B", "u5716",
- "u2F84C", "u5606",
- "u2F84D", "u5717",
- "u2F84E", "u5651",
- "u2F84F", "u5674",
- "u2F850", "u5207",
- "u2F851", "u58EE",
- "u2F852", "u57CE",
- "u2F853", "u57F4",
- "u2F854", "u580D",
- "u2F855", "u578B",
- "u2F856", "u5832",
- "u2F857", "u5831",
- "u2F858", "u58AC",
- "u2F859", "u214E4",
- "u2F85A", "u58F2",
- "u2F85B", "u58F7",
- "u2F85C", "u5906",
- "u2F85D", "u591A",
- "u2F85E", "u5922",
- "u2F85F", "u5962",
- "u2F860", "u216A8",
- "u2F861", "u216EA",
- "u2F862", "u59EC",
- "u2F863", "u5A1B",
- "u2F864", "u5A27",
- "u2F865", "u59D8",
- "u2F866", "u5A66",
- "u2F867", "u36EE",
- "u2F868", "u2136A",
- "u2F869", "u5B08",
- "u2F86A", "u5B3E",
- "u2F86B", "u5B3E",
- "u2F86C", "u219C8",
- "u2F86D", "u5BC3",
- "u2F86E", "u5BD8",
- "u2F86F", "u5BE7",
- "u2F870", "u5BF3",
- "u2F871", "u21B18",
- "u2F872", "u5BFF",
- "u2F873", "u5C06",
- "u2F874", "u5F33",
- "u2F875", "u5C22",
- "u2F876", "u3781",
- "u2F877", "u5C60",
- "u2F878", "u5C6E",
- "u2F879", "u5CC0",
- "u2F87A", "u5C8D",
- "u2F87B", "u21DE4",
- "u2F87C", "u5D43",
- "u2F87D", "u21DE6",
- "u2F87E", "u5D6E",
- "u2F87F", "u5D6B",
- "u2F880", "u5D7C",
- "u2F881", "u5DE1",
- "u2F882", "u5DE2",
- "u2F883", "u382F",
- "u2F884", "u5DFD",
- "u2F885", "u5E28",
- "u2F886", "u5E3D",
- "u2F887", "u5E69",
- "u2F888", "u3862",
- "u2F889", "u22183",
- "u2F88A", "u387C",
- "u2F88B", "u5EB0",
- "u2F88C", "u5EB3",
- "u2F88D", "u5EB6",
- "u2F88E", "u5ECA",
- "u2F88F", "u2A392",
- "u2F890", "u5EFE",
- "u2F891", "u22331",
- "u2F892", "u22331",
- "u2F893", "u8201",
- "u2F894", "u5F22",
- "u2F895", "u5F22",
- "u2F896", "u38C7",
- "u2F897", "u232B8",
- "u2F898", "u261DA",
- "u2F899", "u5F62",
- "u2F89A", "u5F6B",
- "u2F89B", "u38E3",
- "u2F89C", "u5F9A",
- "u2F89D", "u5FCD",
- "u2F89E", "u5FD7",
- "u2F89F", "u5FF9",
- "u2F8A0", "u6081",
- "u2F8A1", "u393A",
- "u2F8A2", "u391C",
- "u2F8A3", "u6094",
- "u2F8A4", "u226D4",
- "u2F8A5", "u60C7",
- "u2F8A6", "u6148",
- "u2F8A7", "u614C",
- "u2F8A8", "u614E",
- "u2F8A9", "u614C",
- "u2F8AA", "u617A",
- "u2F8AB", "u618E",
- "u2F8AC", "u61B2",
- "u2F8AD", "u61A4",
- "u2F8AE", "u61AF",
- "u2F8AF", "u61DE",
- "u2F8B0", "u61F2",
- "u2F8B1", "u61F6",
- "u2F8B2", "u6210",
- "u2F8B3", "u621B",
- "u2F8B4", "u625D",
- "u2F8B5", "u62B1",
- "u2F8B6", "u62D4",
- "u2F8B7", "u6350",
- "u2F8B8", "u22B0C",
- "u2F8B9", "u633D",
- "u2F8BA", "u62FC",
- "u2F8BB", "u6368",
- "u2F8BC", "u6383",
- "u2F8BD", "u63E4",
- "u2F8BE", "u22BF1",
- "u2F8BF", "u6422",
- "u2F8C0", "u63C5",
- "u2F8C1", "u63A9",
- "u2F8C2", "u3A2E",
- "u2F8C3", "u6469",
- "u2F8C4", "u647E",
- "u2F8C5", "u649D",
- "u2F8C6", "u6477",
- "u2F8C7", "u3A6C",
- "u2F8C8", "u654F",
- "u2F8C9", "u656C",
- "u2F8CA", "u2300A",
- "u2F8CB", "u65E3",
- "u2F8CC", "u66F8",
- "u2F8CD", "u6649",
- "u2F8CE", "u3B19",
- "u2F8CF", "u6691",
- "u2F8D0", "u3B08",
- "u2F8D1", "u3AE4",
- "u2F8D2", "u5192",
- "u2F8D3", "u5195",
- "u2F8D4", "u6700",
- "u2F8D5", "u669C",
- "u2F8D6", "u80AD",
- "u2F8D7", "u43D9",
- "u2F8D8", "u6717",
- "u2F8D9", "u671B",
- "u2F8DA", "u6721",
- "u2F8DB", "u675E",
- "u2F8DC", "u6753",
- "u2F8DD", "u233C3",
- "u2F8DE", "u3B49",
- "u2F8DF", "u67FA",
- "u2F8E0", "u6785",
- "u2F8E1", "u6852",
- "u2F8E2", "u6885",
- "u2F8E3", "u2346D",
- "u2F8E4", "u688E",
- "u2F8E5", "u681F",
- "u2F8E6", "u6914",
- "u2F8E7", "u3B9D",
- "u2F8E8", "u6942",
- "u2F8E9", "u69A3",
- "u2F8EA", "u69EA",
- "u2F8EB", "u6AA8",
- "u2F8EC", "u236A3",
- "u2F8ED", "u6ADB",
- "u2F8EE", "u3C18",
- "u2F8EF", "u6B21",
- "u2F8F0", "u238A7",
- "u2F8F1", "u6B54",
- "u2F8F2", "u3C4E",
- "u2F8F3", "u6B72",
- "u2F8F4", "u6B9F",
- "u2F8F5", "u6BBA",
- "u2F8F6", "u6BBB",
- "u2F8F7", "u23A8D",
- "u2F8F8", "u21D0B",
- "u2F8F9", "u23AFA",
- "u2F8FA", "u6C4E",
- "u2F8FB", "u23CBC",
- "u2F8FC", "u6CBF",
- "u2F8FD", "u6CCD",
- "u2F8FE", "u6C67",
- "u2F8FF", "u6D16",
- "u2F900", "u6D3E",
- "u2F901", "u6D77",
- "u2F902", "u6D41",
- "u2F903", "u6D69",
- "u2F904", "u6D78",
- "u2F905", "u6D85",
- "u2F906", "u23D1E",
- "u2F907", "u6D34",
- "u2F908", "u6E2F",
- "u2F909", "u6E6E",
- "u2F90A", "u3D33",
- "u2F90B", "u6ECB",
- "u2F90C", "u6EC7",
- "u2F90D", "u23ED1",
- "u2F90E", "u6DF9",
- "u2F90F", "u6F6E",
- "u2F910", "u23F5E",
- "u2F911", "u23F8E",
- "u2F912", "u6FC6",
- "u2F913", "u7039",
- "u2F914", "u701E",
- "u2F915", "u701B",
- "u2F916", "u3D96",
- "u2F917", "u704A",
- "u2F918", "u707D",
- "u2F919", "u7077",
- "u2F91A", "u70AD",
- "u2F91B", "u20525",
- "u2F91C", "u7145",
- "u2F91D", "u24263",
- "u2F91E", "u719C",
- "u2F91F", "u43AB",
- "u2F920", "u7228",
- "u2F921", "u7235",
- "u2F922", "u7250",
- "u2F923", "u24608",
- "u2F924", "u7280",
- "u2F925", "u7295",
- "u2F926", "u24735",
- "u2F927", "u24814",
- "u2F928", "u737A",
- "u2F929", "u738B",
- "u2F92A", "u3EAC",
- "u2F92B", "u73A5",
- "u2F92C", "u3EB8",
- "u2F92D", "u3EB8",
- "u2F92E", "u7447",
- "u2F92F", "u745C",
- "u2F930", "u7471",
- "u2F931", "u7485",
- "u2F932", "u74CA",
- "u2F933", "u3F1B",
- "u2F934", "u7524",
- "u2F935", "u24C36",
- "u2F936", "u753E",
- "u2F937", "u24C92",
- "u2F938", "u7570",
- "u2F939", "u2219F",
- "u2F93A", "u7610",
- "u2F93B", "u24FA1",
- "u2F93C", "u24FB8",
- "u2F93D", "u25044",
- "u2F93E", "u3FFC",
- "u2F93F", "u4008",
- "u2F940", "u76F4",
- "u2F941", "u250F3",
- "u2F942", "u250F2",
- "u2F943", "u25119",
- "u2F944", "u25133",
- "u2F945", "u771E",
- "u2F946", "u771F",
- "u2F947", "u771F",
- "u2F948", "u774A",
- "u2F949", "u4039",
- "u2F94A", "u778B",
- "u2F94B", "u4046",
- "u2F94C", "u4096",
- "u2F94D", "u2541D",
- "u2F94E", "u784E",
- "u2F94F", "u788C",
- "u2F950", "u78CC",
- "u2F951", "u40E3",
- "u2F952", "u25626",
- "u2F953", "u7956",
- "u2F954", "u2569A",
- "u2F955", "u256C5",
- "u2F956", "u798F",
- "u2F957", "u79EB",
- "u2F958", "u412F",
- "u2F959", "u7A40",
- "u2F95A", "u7A4A",
- "u2F95B", "u7A4F",
- "u2F95C", "u2597C",
- "u2F95D", "u25AA7",
- "u2F95E", "u25AA7",
- "u2F95F", "u7AAE",
- "u2F960", "u4202",
- "u2F961", "u25BAB",
- "u2F962", "u7BC6",
- "u2F963", "u7BC9",
- "u2F964", "u4227",
- "u2F965", "u25C80",
- "u2F966", "u7CD2",
- "u2F967", "u42A0",
- "u2F968", "u7CE8",
- "u2F969", "u7CE3",
- "u2F96A", "u7D00",
- "u2F96B", "u25F86",
- "u2F96C", "u7D63",
- "u2F96D", "u4301",
- "u2F96E", "u7DC7",
- "u2F96F", "u7E02",
- "u2F970", "u7E45",
- "u2F971", "u4334",
- "u2F972", "u26228",
- "u2F973", "u26247",
- "u2F974", "u4359",
- "u2F975", "u262D9",
- "u2F976", "u7F7A",
- "u2F977", "u2633E",
- "u2F978", "u7F95",
- "u2F979", "u7FFA",
- "u2F97A", "u8005",
- "u2F97B", "u264DA",
- "u2F97C", "u26523",
- "u2F97D", "u8060",
- "u2F97E", "u265A8",
- "u2F97F", "u8070",
- "u2F980", "u2335F",
- "u2F981", "u43D5",
- "u2F982", "u80B2",
- "u2F983", "u8103",
- "u2F984", "u440B",
- "u2F985", "u813E",
- "u2F986", "u5AB5",
- "u2F987", "u267A7",
- "u2F988", "u267B5",
- "u2F989", "u23393",
- "u2F98A", "u2339C",
- "u2F98B", "u8201",
- "u2F98C", "u8204",
- "u2F98D", "u8F9E",
- "u2F98E", "u446B",
- "u2F98F", "u8291",
- "u2F990", "u828B",
- "u2F991", "u829D",
- "u2F992", "u52B3",
- "u2F993", "u82B1",
- "u2F994", "u82B3",
- "u2F995", "u82BD",
- "u2F996", "u82E6",
- "u2F997", "u26B3C",
- "u2F998", "u82E5",
- "u2F999", "u831D",
- "u2F99A", "u8363",
- "u2F99B", "u83AD",
- "u2F99C", "u8323",
- "u2F99D", "u83BD",
- "u2F99E", "u83E7",
- "u2F99F", "u8457",
- "u2F9A0", "u8353",
- "u2F9A1", "u83CA",
- "u2F9A2", "u83CC",
- "u2F9A3", "u83DC",
- "u2F9A4", "u26C36",
- "u2F9A5", "u26D6B",
- "u2F9A6", "u26CD5",
- "u2F9A7", "u452B",
- "u2F9A8", "u84F1",
- "u2F9A9", "u84F3",
- "u2F9AA", "u8516",
- "u2F9AB", "u273CA",
- "u2F9AC", "u8564",
- "u2F9AD", "u26F2C",
- "u2F9AE", "u455D",
- "u2F9AF", "u4561",
- "u2F9B0", "u26FB1",
- "u2F9B1", "u270D2",
- "u2F9B2", "u456B",
- "u2F9B3", "u8650",
- "u2F9B4", "u865C",
- "u2F9B5", "u8667",
- "u2F9B6", "u8669",
- "u2F9B7", "u86A9",
- "u2F9B8", "u8688",
- "u2F9B9", "u870E",
- "u2F9BA", "u86E2",
- "u2F9BB", "u8779",
- "u2F9BC", "u8728",
- "u2F9BD", "u876B",
- "u2F9BE", "u8786",
- "u2F9BF", "u4D57",
- "u2F9C0", "u87E1",
- "u2F9C1", "u8801",
- "u2F9C2", "u45F9",
- "u2F9C3", "u8860",
- "u2F9C4", "u8863",
- "u2F9C5", "u27667",
- "u2F9C6", "u88D7",
- "u2F9C7", "u88DE",
- "u2F9C8", "u4635",
- "u2F9C9", "u88FA",
- "u2F9CA", "u34BB",
- "u2F9CB", "u278AE",
- "u2F9CC", "u27966",
- "u2F9CD", "u46BE",
- "u2F9CE", "u46C7",
- "u2F9CF", "u8AA0",
- "u2F9D0", "u8AED",
- "u2F9D1", "u8B8A",
- "u2F9D2", "u8C55",
- "u2F9D3", "u27CA8",
- "u2F9D4", "u8CAB",
- "u2F9D5", "u8CC1",
- "u2F9D6", "u8D1B",
- "u2F9D7", "u8D77",
- "u2F9D8", "u27F2F",
- "u2F9D9", "u20804",
- "u2F9DA", "u8DCB",
- "u2F9DB", "u8DBC",
- "u2F9DC", "u8DF0",
- "u2F9DD", "u208DE",
- "u2F9DE", "u8ED4",
- "u2F9DF", "u8F38",
- "u2F9E0", "u285D2",
- "u2F9E1", "u285ED",
- "u2F9E2", "u9094",
- "u2F9E3", "u90F1",
- "u2F9E4", "u9111",
- "u2F9E5", "u2872E",
- "u2F9E6", "u911B",
- "u2F9E7", "u9238",
- "u2F9E8", "u92D7",
- "u2F9E9", "u92D8",
- "u2F9EA", "u927C",
- "u2F9EB", "u93F9",
- "u2F9EC", "u9415",
- "u2F9ED", "u28BFA",
- "u2F9EE", "u958B",
- "u2F9EF", "u4995",
- "u2F9F0", "u95B7",
- "u2F9F1", "u28D77",
- "u2F9F2", "u49E6",
- "u2F9F3", "u96C3",
- "u2F9F4", "u5DB2",
- "u2F9F5", "u9723",
- "u2F9F6", "u29145",
- "u2F9F7", "u2921A",
- "u2F9F8", "u4A6E",
- "u2F9F9", "u4A76",
- "u2F9FA", "u97E0",
- "u2F9FB", "u2940A",
- "u2F9FC", "u4AB2",
- "u2F9FD", "u29496",
- "u2F9FE", "u980B",
- "u2F9FF", "u980B",
- "u2FA00", "u9829",
- "u2FA01", "u295B6",
- "u2FA02", "u98E2",
- "u2FA03", "u4B33",
- "u2FA04", "u9929",
- "u2FA05", "u99A7",
- "u2FA06", "u99C2",
- "u2FA07", "u99FE",
- "u2FA08", "u4BCE",
- "u2FA09", "u29B30",
- "u2FA0A", "u9B12",
- "u2FA0B", "u9C40",
- "u2FA0C", "u9CFD",
- "u2FA0D", "u4CCE",
- "u2FA0E", "u4CED",
- "u2FA0F", "u9D67",
- "u2FA10", "u2A0CE",
- "u2FA11", "u4CF8",
- "u2FA12", "u2A105",
- "u2FA13", "u2A20E",
- "u2FA14", "u2A291",
- "u2FA15", "u9EBB",
- "u2FA16", "u4D56",
- "u2FA17", "u9EF9",
- "u2FA18", "u9EFE",
- "u2FA19", "u9F05",
- "u2FA1A", "u9F0F",
- "u2FA1B", "u9F16",
- "u2FA1C", "u9F3B",
- "u2FA1D", "u2A600",
+use strict;
+
+my %unicode_decomposed = (
+ "00C0", "0041_0300",
+ "00C1", "0041_0301",
+ "00C2", "0041_0302",
+ "00C3", "0041_0303",
+ "00C4", "0041_0308",
+ "00C5", "0041_030A",
+ "00C7", "0043_0327",
+ "00C8", "0045_0300",
+ "00C9", "0045_0301",
+ "00CA", "0045_0302",
+ "00CB", "0045_0308",
+ "00CC", "0049_0300",
+ "00CD", "0049_0301",
+ "00CE", "0049_0302",
+ "00CF", "0049_0308",
+ "00D1", "004E_0303",
+ "00D2", "004F_0300",
+ "00D3", "004F_0301",
+ "00D4", "004F_0302",
+ "00D5", "004F_0303",
+ "00D6", "004F_0308",
+ "00D9", "0055_0300",
+ "00DA", "0055_0301",
+ "00DB", "0055_0302",
+ "00DC", "0055_0308",
+ "00DD", "0059_0301",
+ "00E0", "0061_0300",
+ "00E1", "0061_0301",
+ "00E2", "0061_0302",
+ "00E3", "0061_0303",
+ "00E4", "0061_0308",
+ "00E5", "0061_030A",
+ "00E7", "0063_0327",
+ "00E8", "0065_0300",
+ "00E9", "0065_0301",
+ "00EA", "0065_0302",
+ "00EB", "0065_0308",
+ "00EC", "0069_0300",
+ "00ED", "0069_0301",
+ "00EE", "0069_0302",
+ "00EF", "0069_0308",
+ "00F1", "006E_0303",
+ "00F2", "006F_0300",
+ "00F3", "006F_0301",
+ "00F4", "006F_0302",
+ "00F5", "006F_0303",
+ "00F6", "006F_0308",
+ "00F9", "0075_0300",
+ "00FA", "0075_0301",
+ "00FB", "0075_0302",
+ "00FC", "0075_0308",
+ "00FD", "0079_0301",
+ "00FF", "0079_0308",
+ "0100", "0041_0304",
+ "0101", "0061_0304",
+ "0102", "0041_0306",
+ "0103", "0061_0306",
+ "0104", "0041_0328",
+ "0105", "0061_0328",
+ "0106", "0043_0301",
+ "0107", "0063_0301",
+ "0108", "0043_0302",
+ "0109", "0063_0302",
+ "010A", "0043_0307",
+ "010B", "0063_0307",
+ "010C", "0043_030C",
+ "010D", "0063_030C",
+ "010E", "0044_030C",
+ "010F", "0064_030C",
+ "0112", "0045_0304",
+ "0113", "0065_0304",
+ "0114", "0045_0306",
+ "0115", "0065_0306",
+ "0116", "0045_0307",
+ "0117", "0065_0307",
+ "0118", "0045_0328",
+ "0119", "0065_0328",
+ "011A", "0045_030C",
+ "011B", "0065_030C",
+ "011C", "0047_0302",
+ "011D", "0067_0302",
+ "011E", "0047_0306",
+ "011F", "0067_0306",
+ "0120", "0047_0307",
+ "0121", "0067_0307",
+ "0122", "0047_0327",
+ "0123", "0067_0327",
+ "0124", "0048_0302",
+ "0125", "0068_0302",
+ "0128", "0049_0303",
+ "0129", "0069_0303",
+ "012A", "0049_0304",
+ "012B", "0069_0304",
+ "012C", "0049_0306",
+ "012D", "0069_0306",
+ "012E", "0049_0328",
+ "012F", "0069_0328",
+ "0130", "0049_0307",
+ "0134", "004A_0302",
+ "0135", "006A_0302",
+ "0136", "004B_0327",
+ "0137", "006B_0327",
+ "0139", "004C_0301",
+ "013A", "006C_0301",
+ "013B", "004C_0327",
+ "013C", "006C_0327",
+ "013D", "004C_030C",
+ "013E", "006C_030C",
+ "0143", "004E_0301",
+ "0144", "006E_0301",
+ "0145", "004E_0327",
+ "0146", "006E_0327",
+ "0147", "004E_030C",
+ "0148", "006E_030C",
+ "014C", "004F_0304",
+ "014D", "006F_0304",
+ "014E", "004F_0306",
+ "014F", "006F_0306",
+ "0150", "004F_030B",
+ "0151", "006F_030B",
+ "0154", "0052_0301",
+ "0155", "0072_0301",
+ "0156", "0052_0327",
+ "0157", "0072_0327",
+ "0158", "0052_030C",
+ "0159", "0072_030C",
+ "015A", "0053_0301",
+ "015B", "0073_0301",
+ "015C", "0053_0302",
+ "015D", "0073_0302",
+ "015E", "0053_0327",
+ "015F", "0073_0327",
+ "0160", "0053_030C",
+ "0161", "0073_030C",
+ "0162", "0054_0327",
+ "0163", "0074_0327",
+ "0164", "0054_030C",
+ "0165", "0074_030C",
+ "0168", "0055_0303",
+ "0169", "0075_0303",
+ "016A", "0055_0304",
+ "016B", "0075_0304",
+ "016C", "0055_0306",
+ "016D", "0075_0306",
+ "016E", "0055_030A",
+ "016F", "0075_030A",
+ "0170", "0055_030B",
+ "0171", "0075_030B",
+ "0172", "0055_0328",
+ "0173", "0075_0328",
+ "0174", "0057_0302",
+ "0175", "0077_0302",
+ "0176", "0059_0302",
+ "0177", "0079_0302",
+ "0178", "0059_0308",
+ "0179", "005A_0301",
+ "017A", "007A_0301",
+ "017B", "005A_0307",
+ "017C", "007A_0307",
+ "017D", "005A_030C",
+ "017E", "007A_030C",
+ "01A0", "004F_031B",
+ "01A1", "006F_031B",
+ "01AF", "0055_031B",
+ "01B0", "0075_031B",
+ "01CD", "0041_030C",
+ "01CE", "0061_030C",
+ "01CF", "0049_030C",
+ "01D0", "0069_030C",
+ "01D1", "004F_030C",
+ "01D2", "006F_030C",
+ "01D3", "0055_030C",
+ "01D4", "0075_030C",
+ "01D5", "0055_0308_0304",
+ "01D6", "0075_0308_0304",
+ "01D7", "0055_0308_0301",
+ "01D8", "0075_0308_0301",
+ "01D9", "0055_0308_030C",
+ "01DA", "0075_0308_030C",
+ "01DB", "0055_0308_0300",
+ "01DC", "0075_0308_0300",
+ "01DE", "0041_0308_0304",
+ "01DF", "0061_0308_0304",
+ "01E0", "0041_0307_0304",
+ "01E1", "0061_0307_0304",
+ "01E2", "00C6_0304",
+ "01E3", "00E6_0304",
+ "01E6", "0047_030C",
+ "01E7", "0067_030C",
+ "01E8", "004B_030C",
+ "01E9", "006B_030C",
+ "01EA", "004F_0328",
+ "01EB", "006F_0328",
+ "01EC", "004F_0328_0304",
+ "01ED", "006F_0328_0304",
+ "01EE", "01B7_030C",
+ "01EF", "0292_030C",
+ "01F0", "006A_030C",
+ "01F4", "0047_0301",
+ "01F5", "0067_0301",
+ "01F8", "004E_0300",
+ "01F9", "006E_0300",
+ "01FA", "0041_030A_0301",
+ "01FB", "0061_030A_0301",
+ "01FC", "00C6_0301",
+ "01FD", "00E6_0301",
+ "01FE", "00D8_0301",
+ "01FF", "00F8_0301",
+ "0200", "0041_030F",
+ "0201", "0061_030F",
+ "0202", "0041_0311",
+ "0203", "0061_0311",
+ "0204", "0045_030F",
+ "0205", "0065_030F",
+ "0206", "0045_0311",
+ "0207", "0065_0311",
+ "0208", "0049_030F",
+ "0209", "0069_030F",
+ "020A", "0049_0311",
+ "020B", "0069_0311",
+ "020C", "004F_030F",
+ "020D", "006F_030F",
+ "020E", "004F_0311",
+ "020F", "006F_0311",
+ "0210", "0052_030F",
+ "0211", "0072_030F",
+ "0212", "0052_0311",
+ "0213", "0072_0311",
+ "0214", "0055_030F",
+ "0215", "0075_030F",
+ "0216", "0055_0311",
+ "0217", "0075_0311",
+ "0218", "0053_0326",
+ "0219", "0073_0326",
+ "021A", "0054_0326",
+ "021B", "0074_0326",
+ "021E", "0048_030C",
+ "021F", "0068_030C",
+ "0226", "0041_0307",
+ "0227", "0061_0307",
+ "0228", "0045_0327",
+ "0229", "0065_0327",
+ "022A", "004F_0308_0304",
+ "022B", "006F_0308_0304",
+ "022C", "004F_0303_0304",
+ "022D", "006F_0303_0304",
+ "022E", "004F_0307",
+ "022F", "006F_0307",
+ "0230", "004F_0307_0304",
+ "0231", "006F_0307_0304",
+ "0232", "0059_0304",
+ "0233", "0079_0304",
+ "0340", "0300",
+ "0341", "0301",
+ "0343", "0313",
+ "0344", "0308_0301",
+ "0374", "02B9",
+ "037E", "003B",
+ "0385", "00A8_0301",
+ "0386", "0391_0301",
+ "0387", "00B7",
+ "0388", "0395_0301",
+ "0389", "0397_0301",
+ "038A", "0399_0301",
+ "038C", "039F_0301",
+ "038E", "03A5_0301",
+ "038F", "03A9_0301",
+ "0390", "03B9_0308_0301",
+ "03AA", "0399_0308",
+ "03AB", "03A5_0308",
+ "03AC", "03B1_0301",
+ "03AD", "03B5_0301",
+ "03AE", "03B7_0301",
+ "03AF", "03B9_0301",
+ "03B0", "03C5_0308_0301",
+ "03CA", "03B9_0308",
+ "03CB", "03C5_0308",
+ "03CC", "03BF_0301",
+ "03CD", "03C5_0301",
+ "03CE", "03C9_0301",
+ "03D3", "03D2_0301",
+ "03D4", "03D2_0308",
+ "0400", "0415_0300",
+ "0401", "0415_0308",
+ "0403", "0413_0301",
+ "0407", "0406_0308",
+ "040C", "041A_0301",
+ "040D", "0418_0300",
+ "040E", "0423_0306",
+ "0419", "0418_0306",
+ "0439", "0438_0306",
+ "0450", "0435_0300",
+ "0451", "0435_0308",
+ "0453", "0433_0301",
+ "0457", "0456_0308",
+ "045C", "043A_0301",
+ "045D", "0438_0300",
+ "045E", "0443_0306",
+ "0476", "0474_030F",
+ "0477", "0475_030F",
+ "04C1", "0416_0306",
+ "04C2", "0436_0306",
+ "04D0", "0410_0306",
+ "04D1", "0430_0306",
+ "04D2", "0410_0308",
+ "04D3", "0430_0308",
+ "04D6", "0415_0306",
+ "04D7", "0435_0306",
+ "04DA", "04D8_0308",
+ "04DB", "04D9_0308",
+ "04DC", "0416_0308",
+ "04DD", "0436_0308",
+ "04DE", "0417_0308",
+ "04DF", "0437_0308",
+ "04E2", "0418_0304",
+ "04E3", "0438_0304",
+ "04E4", "0418_0308",
+ "04E5", "0438_0308",
+ "04E6", "041E_0308",
+ "04E7", "043E_0308",
+ "04EA", "04E8_0308",
+ "04EB", "04E9_0308",
+ "04EC", "042D_0308",
+ "04ED", "044D_0308",
+ "04EE", "0423_0304",
+ "04EF", "0443_0304",
+ "04F0", "0423_0308",
+ "04F1", "0443_0308",
+ "04F2", "0423_030B",
+ "04F3", "0443_030B",
+ "04F4", "0427_0308",
+ "04F5", "0447_0308",
+ "04F8", "042B_0308",
+ "04F9", "044B_0308",
+ "0622", "0627_0653",
+ "0623", "0627_0654",
+ "0624", "0648_0654",
+ "0625", "0627_0655",
+ "0626", "064A_0654",
+ "06C0", "06D5_0654",
+ "06C2", "06C1_0654",
+ "06D3", "06D2_0654",
+ "0929", "0928_093C",
+ "0931", "0930_093C",
+ "0934", "0933_093C",
+ "0958", "0915_093C",
+ "0959", "0916_093C",
+ "095A", "0917_093C",
+ "095B", "091C_093C",
+ "095C", "0921_093C",
+ "095D", "0922_093C",
+ "095E", "092B_093C",
+ "095F", "092F_093C",
+ "09CB", "09C7_09BE",
+ "09CC", "09C7_09D7",
+ "09DC", "09A1_09BC",
+ "09DD", "09A2_09BC",
+ "09DF", "09AF_09BC",
+ "0A33", "0A32_0A3C",
+ "0A36", "0A38_0A3C",
+ "0A59", "0A16_0A3C",
+ "0A5A", "0A17_0A3C",
+ "0A5B", "0A1C_0A3C",
+ "0A5E", "0A2B_0A3C",
+ "0B48", "0B47_0B56",
+ "0B4B", "0B47_0B3E",
+ "0B4C", "0B47_0B57",
+ "0B5C", "0B21_0B3C",
+ "0B5D", "0B22_0B3C",
+ "0B94", "0B92_0BD7",
+ "0BCA", "0BC6_0BBE",
+ "0BCB", "0BC7_0BBE",
+ "0BCC", "0BC6_0BD7",
+ "0C48", "0C46_0C56",
+ "0CC0", "0CBF_0CD5",
+ "0CC7", "0CC6_0CD5",
+ "0CC8", "0CC6_0CD6",
+ "0CCA", "0CC6_0CC2",
+ "0CCB", "0CC6_0CC2_0CD5",
+ "0D4A", "0D46_0D3E",
+ "0D4B", "0D47_0D3E",
+ "0D4C", "0D46_0D57",
+ "0DDA", "0DD9_0DCA",
+ "0DDC", "0DD9_0DCF",
+ "0DDD", "0DD9_0DCF_0DCA",
+ "0DDE", "0DD9_0DDF",
+ "0F43", "0F42_0FB7",
+ "0F4D", "0F4C_0FB7",
+ "0F52", "0F51_0FB7",
+ "0F57", "0F56_0FB7",
+ "0F5C", "0F5B_0FB7",
+ "0F69", "0F40_0FB5",
+ "0F73", "0F71_0F72",
+ "0F75", "0F71_0F74",
+ "0F76", "0FB2_0F80",
+ "0F78", "0FB3_0F80",
+ "0F81", "0F71_0F80",
+ "0F93", "0F92_0FB7",
+ "0F9D", "0F9C_0FB7",
+ "0FA2", "0FA1_0FB7",
+ "0FA7", "0FA6_0FB7",
+ "0FAC", "0FAB_0FB7",
+ "0FB9", "0F90_0FB5",
+ "1026", "1025_102E",
+ "1E00", "0041_0325",
+ "1E01", "0061_0325",
+ "1E02", "0042_0307",
+ "1E03", "0062_0307",
+ "1E04", "0042_0323",
+ "1E05", "0062_0323",
+ "1E06", "0042_0331",
+ "1E07", "0062_0331",
+ "1E08", "0043_0327_0301",
+ "1E09", "0063_0327_0301",
+ "1E0A", "0044_0307",
+ "1E0B", "0064_0307",
+ "1E0C", "0044_0323",
+ "1E0D", "0064_0323",
+ "1E0E", "0044_0331",
+ "1E0F", "0064_0331",
+ "1E10", "0044_0327",
+ "1E11", "0064_0327",
+ "1E12", "0044_032D",
+ "1E13", "0064_032D",
+ "1E14", "0045_0304_0300",
+ "1E15", "0065_0304_0300",
+ "1E16", "0045_0304_0301",
+ "1E17", "0065_0304_0301",
+ "1E18", "0045_032D",
+ "1E19", "0065_032D",
+ "1E1A", "0045_0330",
+ "1E1B", "0065_0330",
+ "1E1C", "0045_0327_0306",
+ "1E1D", "0065_0327_0306",
+ "1E1E", "0046_0307",
+ "1E1F", "0066_0307",
+ "1E20", "0047_0304",
+ "1E21", "0067_0304",
+ "1E22", "0048_0307",
+ "1E23", "0068_0307",
+ "1E24", "0048_0323",
+ "1E25", "0068_0323",
+ "1E26", "0048_0308",
+ "1E27", "0068_0308",
+ "1E28", "0048_0327",
+ "1E29", "0068_0327",
+ "1E2A", "0048_032E",
+ "1E2B", "0068_032E",
+ "1E2C", "0049_0330",
+ "1E2D", "0069_0330",
+ "1E2E", "0049_0308_0301",
+ "1E2F", "0069_0308_0301",
+ "1E30", "004B_0301",
+ "1E31", "006B_0301",
+ "1E32", "004B_0323",
+ "1E33", "006B_0323",
+ "1E34", "004B_0331",
+ "1E35", "006B_0331",
+ "1E36", "004C_0323",
+ "1E37", "006C_0323",
+ "1E38", "004C_0323_0304",
+ "1E39", "006C_0323_0304",
+ "1E3A", "004C_0331",
+ "1E3B", "006C_0331",
+ "1E3C", "004C_032D",
+ "1E3D", "006C_032D",
+ "1E3E", "004D_0301",
+ "1E3F", "006D_0301",
+ "1E40", "004D_0307",
+ "1E41", "006D_0307",
+ "1E42", "004D_0323",
+ "1E43", "006D_0323",
+ "1E44", "004E_0307",
+ "1E45", "006E_0307",
+ "1E46", "004E_0323",
+ "1E47", "006E_0323",
+ "1E48", "004E_0331",
+ "1E49", "006E_0331",
+ "1E4A", "004E_032D",
+ "1E4B", "006E_032D",
+ "1E4C", "004F_0303_0301",
+ "1E4D", "006F_0303_0301",
+ "1E4E", "004F_0303_0308",
+ "1E4F", "006F_0303_0308",
+ "1E50", "004F_0304_0300",
+ "1E51", "006F_0304_0300",
+ "1E52", "004F_0304_0301",
+ "1E53", "006F_0304_0301",
+ "1E54", "0050_0301",
+ "1E55", "0070_0301",
+ "1E56", "0050_0307",
+ "1E57", "0070_0307",
+ "1E58", "0052_0307",
+ "1E59", "0072_0307",
+ "1E5A", "0052_0323",
+ "1E5B", "0072_0323",
+ "1E5C", "0052_0323_0304",
+ "1E5D", "0072_0323_0304",
+ "1E5E", "0052_0331",
+ "1E5F", "0072_0331",
+ "1E60", "0053_0307",
+ "1E61", "0073_0307",
+ "1E62", "0053_0323",
+ "1E63", "0073_0323",
+ "1E64", "0053_0301_0307",
+ "1E65", "0073_0301_0307",
+ "1E66", "0053_030C_0307",
+ "1E67", "0073_030C_0307",
+ "1E68", "0053_0323_0307",
+ "1E69", "0073_0323_0307",
+ "1E6A", "0054_0307",
+ "1E6B", "0074_0307",
+ "1E6C", "0054_0323",
+ "1E6D", "0074_0323",
+ "1E6E", "0054_0331",
+ "1E6F", "0074_0331",
+ "1E70", "0054_032D",
+ "1E71", "0074_032D",
+ "1E72", "0055_0324",
+ "1E73", "0075_0324",
+ "1E74", "0055_0330",
+ "1E75", "0075_0330",
+ "1E76", "0055_032D",
+ "1E77", "0075_032D",
+ "1E78", "0055_0303_0301",
+ "1E79", "0075_0303_0301",
+ "1E7A", "0055_0304_0308",
+ "1E7B", "0075_0304_0308",
+ "1E7C", "0056_0303",
+ "1E7D", "0076_0303",
+ "1E7E", "0056_0323",
+ "1E7F", "0076_0323",
+ "1E80", "0057_0300",
+ "1E81", "0077_0300",
+ "1E82", "0057_0301",
+ "1E83", "0077_0301",
+ "1E84", "0057_0308",
+ "1E85", "0077_0308",
+ "1E86", "0057_0307",
+ "1E87", "0077_0307",
+ "1E88", "0057_0323",
+ "1E89", "0077_0323",
+ "1E8A", "0058_0307",
+ "1E8B", "0078_0307",
+ "1E8C", "0058_0308",
+ "1E8D", "0078_0308",
+ "1E8E", "0059_0307",
+ "1E8F", "0079_0307",
+ "1E90", "005A_0302",
+ "1E91", "007A_0302",
+ "1E92", "005A_0323",
+ "1E93", "007A_0323",
+ "1E94", "005A_0331",
+ "1E95", "007A_0331",
+ "1E96", "0068_0331",
+ "1E97", "0074_0308",
+ "1E98", "0077_030A",
+ "1E99", "0079_030A",
+ "1E9B", "017F_0307",
+ "1EA0", "0041_0323",
+ "1EA1", "0061_0323",
+ "1EA2", "0041_0309",
+ "1EA3", "0061_0309",
+ "1EA4", "0041_0302_0301",
+ "1EA5", "0061_0302_0301",
+ "1EA6", "0041_0302_0300",
+ "1EA7", "0061_0302_0300",
+ "1EA8", "0041_0302_0309",
+ "1EA9", "0061_0302_0309",
+ "1EAA", "0041_0302_0303",
+ "1EAB", "0061_0302_0303",
+ "1EAC", "0041_0323_0302",
+ "1EAD", "0061_0323_0302",
+ "1EAE", "0041_0306_0301",
+ "1EAF", "0061_0306_0301",
+ "1EB0", "0041_0306_0300",
+ "1EB1", "0061_0306_0300",
+ "1EB2", "0041_0306_0309",
+ "1EB3", "0061_0306_0309",
+ "1EB4", "0041_0306_0303",
+ "1EB5", "0061_0306_0303",
+ "1EB6", "0041_0323_0306",
+ "1EB7", "0061_0323_0306",
+ "1EB8", "0045_0323",
+ "1EB9", "0065_0323",
+ "1EBA", "0045_0309",
+ "1EBB", "0065_0309",
+ "1EBC", "0045_0303",
+ "1EBD", "0065_0303",
+ "1EBE", "0045_0302_0301",
+ "1EBF", "0065_0302_0301",
+ "1EC0", "0045_0302_0300",
+ "1EC1", "0065_0302_0300",
+ "1EC2", "0045_0302_0309",
+ "1EC3", "0065_0302_0309",
+ "1EC4", "0045_0302_0303",
+ "1EC5", "0065_0302_0303",
+ "1EC6", "0045_0323_0302",
+ "1EC7", "0065_0323_0302",
+ "1EC8", "0049_0309",
+ "1EC9", "0069_0309",
+ "1ECA", "0049_0323",
+ "1ECB", "0069_0323",
+ "1ECC", "004F_0323",
+ "1ECD", "006F_0323",
+ "1ECE", "004F_0309",
+ "1ECF", "006F_0309",
+ "1ED0", "004F_0302_0301",
+ "1ED1", "006F_0302_0301",
+ "1ED2", "004F_0302_0300",
+ "1ED3", "006F_0302_0300",
+ "1ED4", "004F_0302_0309",
+ "1ED5", "006F_0302_0309",
+ "1ED6", "004F_0302_0303",
+ "1ED7", "006F_0302_0303",
+ "1ED8", "004F_0323_0302",
+ "1ED9", "006F_0323_0302",
+ "1EDA", "004F_031B_0301",
+ "1EDB", "006F_031B_0301",
+ "1EDC", "004F_031B_0300",
+ "1EDD", "006F_031B_0300",
+ "1EDE", "004F_031B_0309",
+ "1EDF", "006F_031B_0309",
+ "1EE0", "004F_031B_0303",
+ "1EE1", "006F_031B_0303",
+ "1EE2", "004F_031B_0323",
+ "1EE3", "006F_031B_0323",
+ "1EE4", "0055_0323",
+ "1EE5", "0075_0323",
+ "1EE6", "0055_0309",
+ "1EE7", "0075_0309",
+ "1EE8", "0055_031B_0301",
+ "1EE9", "0075_031B_0301",
+ "1EEA", "0055_031B_0300",
+ "1EEB", "0075_031B_0300",
+ "1EEC", "0055_031B_0309",
+ "1EED", "0075_031B_0309",
+ "1EEE", "0055_031B_0303",
+ "1EEF", "0075_031B_0303",
+ "1EF0", "0055_031B_0323",
+ "1EF1", "0075_031B_0323",
+ "1EF2", "0059_0300",
+ "1EF3", "0079_0300",
+ "1EF4", "0059_0323",
+ "1EF5", "0079_0323",
+ "1EF6", "0059_0309",
+ "1EF7", "0079_0309",
+ "1EF8", "0059_0303",
+ "1EF9", "0079_0303",
+ "1F00", "03B1_0313",
+ "1F01", "03B1_0314",
+ "1F02", "03B1_0313_0300",
+ "1F03", "03B1_0314_0300",
+ "1F04", "03B1_0313_0301",
+ "1F05", "03B1_0314_0301",
+ "1F06", "03B1_0313_0342",
+ "1F07", "03B1_0314_0342",
+ "1F08", "0391_0313",
+ "1F09", "0391_0314",
+ "1F0A", "0391_0313_0300",
+ "1F0B", "0391_0314_0300",
+ "1F0C", "0391_0313_0301",
+ "1F0D", "0391_0314_0301",
+ "1F0E", "0391_0313_0342",
+ "1F0F", "0391_0314_0342",
+ "1F10", "03B5_0313",
+ "1F11", "03B5_0314",
+ "1F12", "03B5_0313_0300",
+ "1F13", "03B5_0314_0300",
+ "1F14", "03B5_0313_0301",
+ "1F15", "03B5_0314_0301",
+ "1F18", "0395_0313",
+ "1F19", "0395_0314",
+ "1F1A", "0395_0313_0300",
+ "1F1B", "0395_0314_0300",
+ "1F1C", "0395_0313_0301",
+ "1F1D", "0395_0314_0301",
+ "1F20", "03B7_0313",
+ "1F21", "03B7_0314",
+ "1F22", "03B7_0313_0300",
+ "1F23", "03B7_0314_0300",
+ "1F24", "03B7_0313_0301",
+ "1F25", "03B7_0314_0301",
+ "1F26", "03B7_0313_0342",
+ "1F27", "03B7_0314_0342",
+ "1F28", "0397_0313",
+ "1F29", "0397_0314",
+ "1F2A", "0397_0313_0300",
+ "1F2B", "0397_0314_0300",
+ "1F2C", "0397_0313_0301",
+ "1F2D", "0397_0314_0301",
+ "1F2E", "0397_0313_0342",
+ "1F2F", "0397_0314_0342",
+ "1F30", "03B9_0313",
+ "1F31", "03B9_0314",
+ "1F32", "03B9_0313_0300",
+ "1F33", "03B9_0314_0300",
+ "1F34", "03B9_0313_0301",
+ "1F35", "03B9_0314_0301",
+ "1F36", "03B9_0313_0342",
+ "1F37", "03B9_0314_0342",
+ "1F38", "0399_0313",
+ "1F39", "0399_0314",
+ "1F3A", "0399_0313_0300",
+ "1F3B", "0399_0314_0300",
+ "1F3C", "0399_0313_0301",
+ "1F3D", "0399_0314_0301",
+ "1F3E", "0399_0313_0342",
+ "1F3F", "0399_0314_0342",
+ "1F40", "03BF_0313",
+ "1F41", "03BF_0314",
+ "1F42", "03BF_0313_0300",
+ "1F43", "03BF_0314_0300",
+ "1F44", "03BF_0313_0301",
+ "1F45", "03BF_0314_0301",
+ "1F48", "039F_0313",
+ "1F49", "039F_0314",
+ "1F4A", "039F_0313_0300",
+ "1F4B", "039F_0314_0300",
+ "1F4C", "039F_0313_0301",
+ "1F4D", "039F_0314_0301",
+ "1F50", "03C5_0313",
+ "1F51", "03C5_0314",
+ "1F52", "03C5_0313_0300",
+ "1F53", "03C5_0314_0300",
+ "1F54", "03C5_0313_0301",
+ "1F55", "03C5_0314_0301",
+ "1F56", "03C5_0313_0342",
+ "1F57", "03C5_0314_0342",
+ "1F59", "03A5_0314",
+ "1F5B", "03A5_0314_0300",
+ "1F5D", "03A5_0314_0301",
+ "1F5F", "03A5_0314_0342",
+ "1F60", "03C9_0313",
+ "1F61", "03C9_0314",
+ "1F62", "03C9_0313_0300",
+ "1F63", "03C9_0314_0300",
+ "1F64", "03C9_0313_0301",
+ "1F65", "03C9_0314_0301",
+ "1F66", "03C9_0313_0342",
+ "1F67", "03C9_0314_0342",
+ "1F68", "03A9_0313",
+ "1F69", "03A9_0314",
+ "1F6A", "03A9_0313_0300",
+ "1F6B", "03A9_0314_0300",
+ "1F6C", "03A9_0313_0301",
+ "1F6D", "03A9_0314_0301",
+ "1F6E", "03A9_0313_0342",
+ "1F6F", "03A9_0314_0342",
+ "1F70", "03B1_0300",
+ "1F71", "03B1_0301",
+ "1F72", "03B5_0300",
+ "1F73", "03B5_0301",
+ "1F74", "03B7_0300",
+ "1F75", "03B7_0301",
+ "1F76", "03B9_0300",
+ "1F77", "03B9_0301",
+ "1F78", "03BF_0300",
+ "1F79", "03BF_0301",
+ "1F7A", "03C5_0300",
+ "1F7B", "03C5_0301",
+ "1F7C", "03C9_0300",
+ "1F7D", "03C9_0301",
+ "1F80", "03B1_0313_0345",
+ "1F81", "03B1_0314_0345",
+ "1F82", "03B1_0313_0300_0345",
+ "1F83", "03B1_0314_0300_0345",
+ "1F84", "03B1_0313_0301_0345",
+ "1F85", "03B1_0314_0301_0345",
+ "1F86", "03B1_0313_0342_0345",
+ "1F87", "03B1_0314_0342_0345",
+ "1F88", "0391_0313_0345",
+ "1F89", "0391_0314_0345",
+ "1F8A", "0391_0313_0300_0345",
+ "1F8B", "0391_0314_0300_0345",
+ "1F8C", "0391_0313_0301_0345",
+ "1F8D", "0391_0314_0301_0345",
+ "1F8E", "0391_0313_0342_0345",
+ "1F8F", "0391_0314_0342_0345",
+ "1F90", "03B7_0313_0345",
+ "1F91", "03B7_0314_0345",
+ "1F92", "03B7_0313_0300_0345",
+ "1F93", "03B7_0314_0300_0345",
+ "1F94", "03B7_0313_0301_0345",
+ "1F95", "03B7_0314_0301_0345",
+ "1F96", "03B7_0313_0342_0345",
+ "1F97", "03B7_0314_0342_0345",
+ "1F98", "0397_0313_0345",
+ "1F99", "0397_0314_0345",
+ "1F9A", "0397_0313_0300_0345",
+ "1F9B", "0397_0314_0300_0345",
+ "1F9C", "0397_0313_0301_0345",
+ "1F9D", "0397_0314_0301_0345",
+ "1F9E", "0397_0313_0342_0345",
+ "1F9F", "0397_0314_0342_0345",
+ "1FA0", "03C9_0313_0345",
+ "1FA1", "03C9_0314_0345",
+ "1FA2", "03C9_0313_0300_0345",
+ "1FA3", "03C9_0314_0300_0345",
+ "1FA4", "03C9_0313_0301_0345",
+ "1FA5", "03C9_0314_0301_0345",
+ "1FA6", "03C9_0313_0342_0345",
+ "1FA7", "03C9_0314_0342_0345",
+ "1FA8", "03A9_0313_0345",
+ "1FA9", "03A9_0314_0345",
+ "1FAA", "03A9_0313_0300_0345",
+ "1FAB", "03A9_0314_0300_0345",
+ "1FAC", "03A9_0313_0301_0345",
+ "1FAD", "03A9_0314_0301_0345",
+ "1FAE", "03A9_0313_0342_0345",
+ "1FAF", "03A9_0314_0342_0345",
+ "1FB0", "03B1_0306",
+ "1FB1", "03B1_0304",
+ "1FB2", "03B1_0300_0345",
+ "1FB3", "03B1_0345",
+ "1FB4", "03B1_0301_0345",
+ "1FB6", "03B1_0342",
+ "1FB7", "03B1_0342_0345",
+ "1FB8", "0391_0306",
+ "1FB9", "0391_0304",
+ "1FBA", "0391_0300",
+ "1FBB", "0391_0301",
+ "1FBC", "0391_0345",
+ "1FBE", "03B9",
+ "1FC1", "00A8_0342",
+ "1FC2", "03B7_0300_0345",
+ "1FC3", "03B7_0345",
+ "1FC4", "03B7_0301_0345",
+ "1FC6", "03B7_0342",
+ "1FC7", "03B7_0342_0345",
+ "1FC8", "0395_0300",
+ "1FC9", "0395_0301",
+ "1FCA", "0397_0300",
+ "1FCB", "0397_0301",
+ "1FCC", "0397_0345",
+ "1FCD", "1FBF_0300",
+ "1FCE", "1FBF_0301",
+ "1FCF", "1FBF_0342",
+ "1FD0", "03B9_0306",
+ "1FD1", "03B9_0304",
+ "1FD2", "03B9_0308_0300",
+ "1FD3", "03B9_0308_0301",
+ "1FD6", "03B9_0342",
+ "1FD7", "03B9_0308_0342",
+ "1FD8", "0399_0306",
+ "1FD9", "0399_0304",
+ "1FDA", "0399_0300",
+ "1FDB", "0399_0301",
+ "1FDD", "1FFE_0300",
+ "1FDE", "1FFE_0301",
+ "1FDF", "1FFE_0342",
+ "1FE0", "03C5_0306",
+ "1FE1", "03C5_0304",
+ "1FE2", "03C5_0308_0300",
+ "1FE3", "03C5_0308_0301",
+ "1FE4", "03C1_0313",
+ "1FE5", "03C1_0314",
+ "1FE6", "03C5_0342",
+ "1FE7", "03C5_0308_0342",
+ "1FE8", "03A5_0306",
+ "1FE9", "03A5_0304",
+ "1FEA", "03A5_0300",
+ "1FEB", "03A5_0301",
+ "1FEC", "03A1_0314",
+ "1FED", "00A8_0300",
+ "1FEE", "00A8_0301",
+ "1FEF", "0060",
+ "1FF2", "03C9_0300_0345",
+ "1FF3", "03C9_0345",
+ "1FF4", "03C9_0301_0345",
+ "1FF6", "03C9_0342",
+ "1FF7", "03C9_0342_0345",
+ "1FF8", "039F_0300",
+ "1FF9", "039F_0301",
+ "1FFA", "03A9_0300",
+ "1FFB", "03A9_0301",
+ "1FFC", "03A9_0345",
+ "1FFD", "00B4",
+ "2000", "2002",
+ "2001", "2003",
+ "2126", "03A9",
+ "212A", "004B",
+ "212B", "0041_030A",
+ "219A", "2190_0338",
+ "219B", "2192_0338",
+ "21AE", "2194_0338",
+ "21CD", "21D0_0338",
+ "21CE", "21D4_0338",
+ "21CF", "21D2_0338",
+ "2204", "2203_0338",
+ "2209", "2208_0338",
+ "220C", "220B_0338",
+ "2224", "2223_0338",
+ "2226", "2225_0338",
+ "2241", "223C_0338",
+ "2244", "2243_0338",
+ "2247", "2245_0338",
+ "2249", "2248_0338",
+ "2260", "003D_0338",
+ "2262", "2261_0338",
+ "226D", "224D_0338",
+ "226E", "003C_0338",
+ "226F", "003E_0338",
+ "2270", "2264_0338",
+ "2271", "2265_0338",
+ "2274", "2272_0338",
+ "2275", "2273_0338",
+ "2278", "2276_0338",
+ "2279", "2277_0338",
+ "2280", "227A_0338",
+ "2281", "227B_0338",
+ "2284", "2282_0338",
+ "2285", "2283_0338",
+ "2288", "2286_0338",
+ "2289", "2287_0338",
+ "22AC", "22A2_0338",
+ "22AD", "22A8_0338",
+ "22AE", "22A9_0338",
+ "22AF", "22AB_0338",
+ "22E0", "227C_0338",
+ "22E1", "227D_0338",
+ "22E2", "2291_0338",
+ "22E3", "2292_0338",
+ "22EA", "22B2_0338",
+ "22EB", "22B3_0338",
+ "22EC", "22B4_0338",
+ "22ED", "22B5_0338",
+ "2329", "3008",
+ "232A", "3009",
+ "2ADC", "2ADD_0338",
+ "304C", "304B_3099",
+ "304E", "304D_3099",
+ "3050", "304F_3099",
+ "3052", "3051_3099",
+ "3054", "3053_3099",
+ "3056", "3055_3099",
+ "3058", "3057_3099",
+ "305A", "3059_3099",
+ "305C", "305B_3099",
+ "305E", "305D_3099",
+ "3060", "305F_3099",
+ "3062", "3061_3099",
+ "3065", "3064_3099",
+ "3067", "3066_3099",
+ "3069", "3068_3099",
+ "3070", "306F_3099",
+ "3071", "306F_309A",
+ "3073", "3072_3099",
+ "3074", "3072_309A",
+ "3076", "3075_3099",
+ "3077", "3075_309A",
+ "3079", "3078_3099",
+ "307A", "3078_309A",
+ "307C", "307B_3099",
+ "307D", "307B_309A",
+ "3094", "3046_3099",
+ "309E", "309D_3099",
+ "30AC", "30AB_3099",
+ "30AE", "30AD_3099",
+ "30B0", "30AF_3099",
+ "30B2", "30B1_3099",
+ "30B4", "30B3_3099",
+ "30B6", "30B5_3099",
+ "30B8", "30B7_3099",
+ "30BA", "30B9_3099",
+ "30BC", "30BB_3099",
+ "30BE", "30BD_3099",
+ "30C0", "30BF_3099",
+ "30C2", "30C1_3099",
+ "30C5", "30C4_3099",
+ "30C7", "30C6_3099",
+ "30C9", "30C8_3099",
+ "30D0", "30CF_3099",
+ "30D1", "30CF_309A",
+ "30D3", "30D2_3099",
+ "30D4", "30D2_309A",
+ "30D6", "30D5_3099",
+ "30D7", "30D5_309A",
+ "30D9", "30D8_3099",
+ "30DA", "30D8_309A",
+ "30DC", "30DB_3099",
+ "30DD", "30DB_309A",
+ "30F4", "30A6_3099",
+ "30F7", "30EF_3099",
+ "30F8", "30F0_3099",
+ "30F9", "30F1_3099",
+ "30FA", "30F2_3099",
+ "30FE", "30FD_3099",
+ "F900", "8C48",
+ "F901", "66F4",
+ "F902", "8ECA",
+ "F903", "8CC8",
+ "F904", "6ED1",
+ "F905", "4E32",
+ "F906", "53E5",
+ "F907", "9F9C",
+ "F908", "9F9C",
+ "F909", "5951",
+ "F90A", "91D1",
+ "F90B", "5587",
+ "F90C", "5948",
+ "F90D", "61F6",
+ "F90E", "7669",
+ "F90F", "7F85",
+ "F910", "863F",
+ "F911", "87BA",
+ "F912", "88F8",
+ "F913", "908F",
+ "F914", "6A02",
+ "F915", "6D1B",
+ "F916", "70D9",
+ "F917", "73DE",
+ "F918", "843D",
+ "F919", "916A",
+ "F91A", "99F1",
+ "F91B", "4E82",
+ "F91C", "5375",
+ "F91D", "6B04",
+ "F91E", "721B",
+ "F91F", "862D",
+ "F920", "9E1E",
+ "F921", "5D50",
+ "F922", "6FEB",
+ "F923", "85CD",
+ "F924", "8964",
+ "F925", "62C9",
+ "F926", "81D8",
+ "F927", "881F",
+ "F928", "5ECA",
+ "F929", "6717",
+ "F92A", "6D6A",
+ "F92B", "72FC",
+ "F92C", "90CE",
+ "F92D", "4F86",
+ "F92E", "51B7",
+ "F92F", "52DE",
+ "F930", "64C4",
+ "F931", "6AD3",
+ "F932", "7210",
+ "F933", "76E7",
+ "F934", "8001",
+ "F935", "8606",
+ "F936", "865C",
+ "F937", "8DEF",
+ "F938", "9732",
+ "F939", "9B6F",
+ "F93A", "9DFA",
+ "F93B", "788C",
+ "F93C", "797F",
+ "F93D", "7DA0",
+ "F93E", "83C9",
+ "F93F", "9304",
+ "F940", "9E7F",
+ "F941", "8AD6",
+ "F942", "58DF",
+ "F943", "5F04",
+ "F944", "7C60",
+ "F945", "807E",
+ "F946", "7262",
+ "F947", "78CA",
+ "F948", "8CC2",
+ "F949", "96F7",
+ "F94A", "58D8",
+ "F94B", "5C62",
+ "F94C", "6A13",
+ "F94D", "6DDA",
+ "F94E", "6F0F",
+ "F94F", "7D2F",
+ "F950", "7E37",
+ "F951", "964B",
+ "F952", "52D2",
+ "F953", "808B",
+ "F954", "51DC",
+ "F955", "51CC",
+ "F956", "7A1C",
+ "F957", "7DBE",
+ "F958", "83F1",
+ "F959", "9675",
+ "F95A", "8B80",
+ "F95B", "62CF",
+ "F95C", "6A02",
+ "F95D", "8AFE",
+ "F95E", "4E39",
+ "F95F", "5BE7",
+ "F960", "6012",
+ "F961", "7387",
+ "F962", "7570",
+ "F963", "5317",
+ "F964", "78FB",
+ "F965", "4FBF",
+ "F966", "5FA9",
+ "F967", "4E0D",
+ "F968", "6CCC",
+ "F969", "6578",
+ "F96A", "7D22",
+ "F96B", "53C3",
+ "F96C", "585E",
+ "F96D", "7701",
+ "F96E", "8449",
+ "F96F", "8AAA",
+ "F970", "6BBA",
+ "F971", "8FB0",
+ "F972", "6C88",
+ "F973", "62FE",
+ "F974", "82E5",
+ "F975", "63A0",
+ "F976", "7565",
+ "F977", "4EAE",
+ "F978", "5169",
+ "F979", "51C9",
+ "F97A", "6881",
+ "F97B", "7CE7",
+ "F97C", "826F",
+ "F97D", "8AD2",
+ "F97E", "91CF",
+ "F97F", "52F5",
+ "F980", "5442",
+ "F981", "5973",
+ "F982", "5EEC",
+ "F983", "65C5",
+ "F984", "6FFE",
+ "F985", "792A",
+ "F986", "95AD",
+ "F987", "9A6A",
+ "F988", "9E97",
+ "F989", "9ECE",
+ "F98A", "529B",
+ "F98B", "66C6",
+ "F98C", "6B77",
+ "F98D", "8F62",
+ "F98E", "5E74",
+ "F98F", "6190",
+ "F990", "6200",
+ "F991", "649A",
+ "F992", "6F23",
+ "F993", "7149",
+ "F994", "7489",
+ "F995", "79CA",
+ "F996", "7DF4",
+ "F997", "806F",
+ "F998", "8F26",
+ "F999", "84EE",
+ "F99A", "9023",
+ "F99B", "934A",
+ "F99C", "5217",
+ "F99D", "52A3",
+ "F99E", "54BD",
+ "F99F", "70C8",
+ "F9A0", "88C2",
+ "F9A1", "8AAA",
+ "F9A2", "5EC9",
+ "F9A3", "5FF5",
+ "F9A4", "637B",
+ "F9A5", "6BAE",
+ "F9A6", "7C3E",
+ "F9A7", "7375",
+ "F9A8", "4EE4",
+ "F9A9", "56F9",
+ "F9AA", "5BE7",
+ "F9AB", "5DBA",
+ "F9AC", "601C",
+ "F9AD", "73B2",
+ "F9AE", "7469",
+ "F9AF", "7F9A",
+ "F9B0", "8046",
+ "F9B1", "9234",
+ "F9B2", "96F6",
+ "F9B3", "9748",
+ "F9B4", "9818",
+ "F9B5", "4F8B",
+ "F9B6", "79AE",
+ "F9B7", "91B4",
+ "F9B8", "96B8",
+ "F9B9", "60E1",
+ "F9BA", "4E86",
+ "F9BB", "50DA",
+ "F9BC", "5BEE",
+ "F9BD", "5C3F",
+ "F9BE", "6599",
+ "F9BF", "6A02",
+ "F9C0", "71CE",
+ "F9C1", "7642",
+ "F9C2", "84FC",
+ "F9C3", "907C",
+ "F9C4", "9F8D",
+ "F9C5", "6688",
+ "F9C6", "962E",
+ "F9C7", "5289",
+ "F9C8", "677B",
+ "F9C9", "67F3",
+ "F9CA", "6D41",
+ "F9CB", "6E9C",
+ "F9CC", "7409",
+ "F9CD", "7559",
+ "F9CE", "786B",
+ "F9CF", "7D10",
+ "F9D0", "985E",
+ "F9D1", "516D",
+ "F9D2", "622E",
+ "F9D3", "9678",
+ "F9D4", "502B",
+ "F9D5", "5D19",
+ "F9D6", "6DEA",
+ "F9D7", "8F2A",
+ "F9D8", "5F8B",
+ "F9D9", "6144",
+ "F9DA", "6817",
+ "F9DB", "7387",
+ "F9DC", "9686",
+ "F9DD", "5229",
+ "F9DE", "540F",
+ "F9DF", "5C65",
+ "F9E0", "6613",
+ "F9E1", "674E",
+ "F9E2", "68A8",
+ "F9E3", "6CE5",
+ "F9E4", "7406",
+ "F9E5", "75E2",
+ "F9E6", "7F79",
+ "F9E7", "88CF",
+ "F9E8", "88E1",
+ "F9E9", "91CC",
+ "F9EA", "96E2",
+ "F9EB", "533F",
+ "F9EC", "6EBA",
+ "F9ED", "541D",
+ "F9EE", "71D0",
+ "F9EF", "7498",
+ "F9F0", "85FA",
+ "F9F1", "96A3",
+ "F9F2", "9C57",
+ "F9F3", "9E9F",
+ "F9F4", "6797",
+ "F9F5", "6DCB",
+ "F9F6", "81E8",
+ "F9F7", "7ACB",
+ "F9F8", "7B20",
+ "F9F9", "7C92",
+ "F9FA", "72C0",
+ "F9FB", "7099",
+ "F9FC", "8B58",
+ "F9FD", "4EC0",
+ "F9FE", "8336",
+ "F9FF", "523A",
+ "FA00", "5207",
+ "FA01", "5EA6",
+ "FA02", "62D3",
+ "FA03", "7CD6",
+ "FA04", "5B85",
+ "FA05", "6D1E",
+ "FA06", "66B4",
+ "FA07", "8F3B",
+ "FA08", "884C",
+ "FA09", "964D",
+ "FA0A", "898B",
+ "FA0B", "5ED3",
+ "FA0C", "5140",
+ "FA0D", "55C0",
+ "FA10", "585A",
+ "FA12", "6674",
+ "FA15", "51DE",
+ "FA16", "732A",
+ "FA17", "76CA",
+ "FA18", "793C",
+ "FA19", "795E",
+ "FA1A", "7965",
+ "FA1B", "798F",
+ "FA1C", "9756",
+ "FA1D", "7CBE",
+ "FA1E", "7FBD",
+ "FA20", "8612",
+ "FA22", "8AF8",
+ "FA25", "9038",
+ "FA26", "90FD",
+ "FA2A", "98EF",
+ "FA2B", "98FC",
+ "FA2C", "9928",
+ "FA2D", "9DB4",
+ "FA30", "4FAE",
+ "FA31", "50E7",
+ "FA32", "514D",
+ "FA33", "52C9",
+ "FA34", "52E4",
+ "FA35", "5351",
+ "FA36", "559D",
+ "FA37", "5606",
+ "FA38", "5668",
+ "FA39", "5840",
+ "FA3A", "58A8",
+ "FA3B", "5C64",
+ "FA3C", "5C6E",
+ "FA3D", "6094",
+ "FA3E", "6168",
+ "FA3F", "618E",
+ "FA40", "61F2",
+ "FA41", "654F",
+ "FA42", "65E2",
+ "FA43", "6691",
+ "FA44", "6885",
+ "FA45", "6D77",
+ "FA46", "6E1A",
+ "FA47", "6F22",
+ "FA48", "716E",
+ "FA49", "722B",
+ "FA4A", "7422",
+ "FA4B", "7891",
+ "FA4C", "793E",
+ "FA4D", "7949",
+ "FA4E", "7948",
+ "FA4F", "7950",
+ "FA50", "7956",
+ "FA51", "795D",
+ "FA52", "798D",
+ "FA53", "798E",
+ "FA54", "7A40",
+ "FA55", "7A81",
+ "FA56", "7BC0",
+ "FA57", "7DF4",
+ "FA58", "7E09",
+ "FA59", "7E41",
+ "FA5A", "7F72",
+ "FA5B", "8005",
+ "FA5C", "81ED",
+ "FA5D", "8279",
+ "FA5E", "8279",
+ "FA5F", "8457",
+ "FA60", "8910",
+ "FA61", "8996",
+ "FA62", "8B01",
+ "FA63", "8B39",
+ "FA64", "8CD3",
+ "FA65", "8D08",
+ "FA66", "8FB6",
+ "FA67", "9038",
+ "FA68", "96E3",
+ "FA69", "97FF",
+ "FA6A", "983B",
+ "FB1D", "05D9_05B4",
+ "FB1F", "05F2_05B7",
+ "FB2A", "05E9_05C1",
+ "FB2B", "05E9_05C2",
+ "FB2C", "05E9_05BC_05C1",
+ "FB2D", "05E9_05BC_05C2",
+ "FB2E", "05D0_05B7",
+ "FB2F", "05D0_05B8",
+ "FB30", "05D0_05BC",
+ "FB31", "05D1_05BC",
+ "FB32", "05D2_05BC",
+ "FB33", "05D3_05BC",
+ "FB34", "05D4_05BC",
+ "FB35", "05D5_05BC",
+ "FB36", "05D6_05BC",
+ "FB38", "05D8_05BC",
+ "FB39", "05D9_05BC",
+ "FB3A", "05DA_05BC",
+ "FB3B", "05DB_05BC",
+ "FB3C", "05DC_05BC",
+ "FB3E", "05DE_05BC",
+ "FB40", "05E0_05BC",
+ "FB41", "05E1_05BC",
+ "FB43", "05E3_05BC",
+ "FB44", "05E4_05BC",
+ "FB46", "05E6_05BC",
+ "FB47", "05E7_05BC",
+ "FB48", "05E8_05BC",
+ "FB49", "05E9_05BC",
+ "FB4A", "05EA_05BC",
+ "FB4B", "05D5_05B9",
+ "FB4C", "05D1_05BF",
+ "FB4D", "05DB_05BF",
+ "FB4E", "05E4_05BF",
+ "1D15E", "1D157_1D165",
+ "1D15F", "1D158_1D165",
+ "1D160", "1D158_1D165_1D16E",
+ "1D161", "1D158_1D165_1D16F",
+ "1D162", "1D158_1D165_1D170",
+ "1D163", "1D158_1D165_1D171",
+ "1D164", "1D158_1D165_1D172",
+ "1D1BB", "1D1B9_1D165",
+ "1D1BC", "1D1BA_1D165",
+ "1D1BD", "1D1B9_1D165_1D16E",
+ "1D1BE", "1D1BA_1D165_1D16E",
+ "1D1BF", "1D1B9_1D165_1D16F",
+ "1D1C0", "1D1BA_1D165_1D16F",
+ "2F800", "4E3D",
+ "2F801", "4E38",
+ "2F802", "4E41",
+ "2F803", "20122",
+ "2F804", "4F60",
+ "2F805", "4FAE",
+ "2F806", "4FBB",
+ "2F807", "5002",
+ "2F808", "507A",
+ "2F809", "5099",
+ "2F80A", "50E7",
+ "2F80B", "50CF",
+ "2F80C", "349E",
+ "2F80D", "2063A",
+ "2F80E", "514D",
+ "2F80F", "5154",
+ "2F810", "5164",
+ "2F811", "5177",
+ "2F812", "2051C",
+ "2F813", "34B9",
+ "2F814", "5167",
+ "2F815", "518D",
+ "2F816", "2054B",
+ "2F817", "5197",
+ "2F818", "51A4",
+ "2F819", "4ECC",
+ "2F81A", "51AC",
+ "2F81B", "51B5",
+ "2F81C", "291DF",
+ "2F81D", "51F5",
+ "2F81E", "5203",
+ "2F81F", "34DF",
+ "2F820", "523B",
+ "2F821", "5246",
+ "2F822", "5272",
+ "2F823", "5277",
+ "2F824", "3515",
+ "2F825", "52C7",
+ "2F826", "52C9",
+ "2F827", "52E4",
+ "2F828", "52FA",
+ "2F829", "5305",
+ "2F82A", "5306",
+ "2F82B", "5317",
+ "2F82C", "5349",
+ "2F82D", "5351",
+ "2F82E", "535A",
+ "2F82F", "5373",
+ "2F830", "537D",
+ "2F831", "537F",
+ "2F832", "537F",
+ "2F833", "537F",
+ "2F834", "20A2C",
+ "2F835", "7070",
+ "2F836", "53CA",
+ "2F837", "53DF",
+ "2F838", "20B63",
+ "2F839", "53EB",
+ "2F83A", "53F1",
+ "2F83B", "5406",
+ "2F83C", "549E",
+ "2F83D", "5438",
+ "2F83E", "5448",
+ "2F83F", "5468",
+ "2F840", "54A2",
+ "2F841", "54F6",
+ "2F842", "5510",
+ "2F843", "5553",
+ "2F844", "5563",
+ "2F845", "5584",
+ "2F846", "5584",
+ "2F847", "5599",
+ "2F848", "55AB",
+ "2F849", "55B3",
+ "2F84A", "55C2",
+ "2F84B", "5716",
+ "2F84C", "5606",
+ "2F84D", "5717",
+ "2F84E", "5651",
+ "2F84F", "5674",
+ "2F850", "5207",
+ "2F851", "58EE",
+ "2F852", "57CE",
+ "2F853", "57F4",
+ "2F854", "580D",
+ "2F855", "578B",
+ "2F856", "5832",
+ "2F857", "5831",
+ "2F858", "58AC",
+ "2F859", "214E4",
+ "2F85A", "58F2",
+ "2F85B", "58F7",
+ "2F85C", "5906",
+ "2F85D", "591A",
+ "2F85E", "5922",
+ "2F85F", "5962",
+ "2F860", "216A8",
+ "2F861", "216EA",
+ "2F862", "59EC",
+ "2F863", "5A1B",
+ "2F864", "5A27",
+ "2F865", "59D8",
+ "2F866", "5A66",
+ "2F867", "36EE",
+ "2F868", "2136A",
+ "2F869", "5B08",
+ "2F86A", "5B3E",
+ "2F86B", "5B3E",
+ "2F86C", "219C8",
+ "2F86D", "5BC3",
+ "2F86E", "5BD8",
+ "2F86F", "5BE7",
+ "2F870", "5BF3",
+ "2F871", "21B18",
+ "2F872", "5BFF",
+ "2F873", "5C06",
+ "2F874", "5F33",
+ "2F875", "5C22",
+ "2F876", "3781",
+ "2F877", "5C60",
+ "2F878", "5C6E",
+ "2F879", "5CC0",
+ "2F87A", "5C8D",
+ "2F87B", "21DE4",
+ "2F87C", "5D43",
+ "2F87D", "21DE6",
+ "2F87E", "5D6E",
+ "2F87F", "5D6B",
+ "2F880", "5D7C",
+ "2F881", "5DE1",
+ "2F882", "5DE2",
+ "2F883", "382F",
+ "2F884", "5DFD",
+ "2F885", "5E28",
+ "2F886", "5E3D",
+ "2F887", "5E69",
+ "2F888", "3862",
+ "2F889", "22183",
+ "2F88A", "387C",
+ "2F88B", "5EB0",
+ "2F88C", "5EB3",
+ "2F88D", "5EB6",
+ "2F88E", "5ECA",
+ "2F88F", "2A392",
+ "2F890", "5EFE",
+ "2F891", "22331",
+ "2F892", "22331",
+ "2F893", "8201",
+ "2F894", "5F22",
+ "2F895", "5F22",
+ "2F896", "38C7",
+ "2F897", "232B8",
+ "2F898", "261DA",
+ "2F899", "5F62",
+ "2F89A", "5F6B",
+ "2F89B", "38E3",
+ "2F89C", "5F9A",
+ "2F89D", "5FCD",
+ "2F89E", "5FD7",
+ "2F89F", "5FF9",
+ "2F8A0", "6081",
+ "2F8A1", "393A",
+ "2F8A2", "391C",
+ "2F8A3", "6094",
+ "2F8A4", "226D4",
+ "2F8A5", "60C7",
+ "2F8A6", "6148",
+ "2F8A7", "614C",
+ "2F8A8", "614E",
+ "2F8A9", "614C",
+ "2F8AA", "617A",
+ "2F8AB", "618E",
+ "2F8AC", "61B2",
+ "2F8AD", "61A4",
+ "2F8AE", "61AF",
+ "2F8AF", "61DE",
+ "2F8B0", "61F2",
+ "2F8B1", "61F6",
+ "2F8B2", "6210",
+ "2F8B3", "621B",
+ "2F8B4", "625D",
+ "2F8B5", "62B1",
+ "2F8B6", "62D4",
+ "2F8B7", "6350",
+ "2F8B8", "22B0C",
+ "2F8B9", "633D",
+ "2F8BA", "62FC",
+ "2F8BB", "6368",
+ "2F8BC", "6383",
+ "2F8BD", "63E4",
+ "2F8BE", "22BF1",
+ "2F8BF", "6422",
+ "2F8C0", "63C5",
+ "2F8C1", "63A9",
+ "2F8C2", "3A2E",
+ "2F8C3", "6469",
+ "2F8C4", "647E",
+ "2F8C5", "649D",
+ "2F8C6", "6477",
+ "2F8C7", "3A6C",
+ "2F8C8", "654F",
+ "2F8C9", "656C",
+ "2F8CA", "2300A",
+ "2F8CB", "65E3",
+ "2F8CC", "66F8",
+ "2F8CD", "6649",
+ "2F8CE", "3B19",
+ "2F8CF", "6691",
+ "2F8D0", "3B08",
+ "2F8D1", "3AE4",
+ "2F8D2", "5192",
+ "2F8D3", "5195",
+ "2F8D4", "6700",
+ "2F8D5", "669C",
+ "2F8D6", "80AD",
+ "2F8D7", "43D9",
+ "2F8D8", "6717",
+ "2F8D9", "671B",
+ "2F8DA", "6721",
+ "2F8DB", "675E",
+ "2F8DC", "6753",
+ "2F8DD", "233C3",
+ "2F8DE", "3B49",
+ "2F8DF", "67FA",
+ "2F8E0", "6785",
+ "2F8E1", "6852",
+ "2F8E2", "6885",
+ "2F8E3", "2346D",
+ "2F8E4", "688E",
+ "2F8E5", "681F",
+ "2F8E6", "6914",
+ "2F8E7", "3B9D",
+ "2F8E8", "6942",
+ "2F8E9", "69A3",
+ "2F8EA", "69EA",
+ "2F8EB", "6AA8",
+ "2F8EC", "236A3",
+ "2F8ED", "6ADB",
+ "2F8EE", "3C18",
+ "2F8EF", "6B21",
+ "2F8F0", "238A7",
+ "2F8F1", "6B54",
+ "2F8F2", "3C4E",
+ "2F8F3", "6B72",
+ "2F8F4", "6B9F",
+ "2F8F5", "6BBA",
+ "2F8F6", "6BBB",
+ "2F8F7", "23A8D",
+ "2F8F8", "21D0B",
+ "2F8F9", "23AFA",
+ "2F8FA", "6C4E",
+ "2F8FB", "23CBC",
+ "2F8FC", "6CBF",
+ "2F8FD", "6CCD",
+ "2F8FE", "6C67",
+ "2F8FF", "6D16",
+ "2F900", "6D3E",
+ "2F901", "6D77",
+ "2F902", "6D41",
+ "2F903", "6D69",
+ "2F904", "6D78",
+ "2F905", "6D85",
+ "2F906", "23D1E",
+ "2F907", "6D34",
+ "2F908", "6E2F",
+ "2F909", "6E6E",
+ "2F90A", "3D33",
+ "2F90B", "6ECB",
+ "2F90C", "6EC7",
+ "2F90D", "23ED1",
+ "2F90E", "6DF9",
+ "2F90F", "6F6E",
+ "2F910", "23F5E",
+ "2F911", "23F8E",
+ "2F912", "6FC6",
+ "2F913", "7039",
+ "2F914", "701E",
+ "2F915", "701B",
+ "2F916", "3D96",
+ "2F917", "704A",
+ "2F918", "707D",
+ "2F919", "7077",
+ "2F91A", "70AD",
+ "2F91B", "20525",
+ "2F91C", "7145",
+ "2F91D", "24263",
+ "2F91E", "719C",
+ "2F91F", "43AB",
+ "2F920", "7228",
+ "2F921", "7235",
+ "2F922", "7250",
+ "2F923", "24608",
+ "2F924", "7280",
+ "2F925", "7295",
+ "2F926", "24735",
+ "2F927", "24814",
+ "2F928", "737A",
+ "2F929", "738B",
+ "2F92A", "3EAC",
+ "2F92B", "73A5",
+ "2F92C", "3EB8",
+ "2F92D", "3EB8",
+ "2F92E", "7447",
+ "2F92F", "745C",
+ "2F930", "7471",
+ "2F931", "7485",
+ "2F932", "74CA",
+ "2F933", "3F1B",
+ "2F934", "7524",
+ "2F935", "24C36",
+ "2F936", "753E",
+ "2F937", "24C92",
+ "2F938", "7570",
+ "2F939", "2219F",
+ "2F93A", "7610",
+ "2F93B", "24FA1",
+ "2F93C", "24FB8",
+ "2F93D", "25044",
+ "2F93E", "3FFC",
+ "2F93F", "4008",
+ "2F940", "76F4",
+ "2F941", "250F3",
+ "2F942", "250F2",
+ "2F943", "25119",
+ "2F944", "25133",
+ "2F945", "771E",
+ "2F946", "771F",
+ "2F947", "771F",
+ "2F948", "774A",
+ "2F949", "4039",
+ "2F94A", "778B",
+ "2F94B", "4046",
+ "2F94C", "4096",
+ "2F94D", "2541D",
+ "2F94E", "784E",
+ "2F94F", "788C",
+ "2F950", "78CC",
+ "2F951", "40E3",
+ "2F952", "25626",
+ "2F953", "7956",
+ "2F954", "2569A",
+ "2F955", "256C5",
+ "2F956", "798F",
+ "2F957", "79EB",
+ "2F958", "412F",
+ "2F959", "7A40",
+ "2F95A", "7A4A",
+ "2F95B", "7A4F",
+ "2F95C", "2597C",
+ "2F95D", "25AA7",
+ "2F95E", "25AA7",
+ "2F95F", "7AAE",
+ "2F960", "4202",
+ "2F961", "25BAB",
+ "2F962", "7BC6",
+ "2F963", "7BC9",
+ "2F964", "4227",
+ "2F965", "25C80",
+ "2F966", "7CD2",
+ "2F967", "42A0",
+ "2F968", "7CE8",
+ "2F969", "7CE3",
+ "2F96A", "7D00",
+ "2F96B", "25F86",
+ "2F96C", "7D63",
+ "2F96D", "4301",
+ "2F96E", "7DC7",
+ "2F96F", "7E02",
+ "2F970", "7E45",
+ "2F971", "4334",
+ "2F972", "26228",
+ "2F973", "26247",
+ "2F974", "4359",
+ "2F975", "262D9",
+ "2F976", "7F7A",
+ "2F977", "2633E",
+ "2F978", "7F95",
+ "2F979", "7FFA",
+ "2F97A", "8005",
+ "2F97B", "264DA",
+ "2F97C", "26523",
+ "2F97D", "8060",
+ "2F97E", "265A8",
+ "2F97F", "8070",
+ "2F980", "2335F",
+ "2F981", "43D5",
+ "2F982", "80B2",
+ "2F983", "8103",
+ "2F984", "440B",
+ "2F985", "813E",
+ "2F986", "5AB5",
+ "2F987", "267A7",
+ "2F988", "267B5",
+ "2F989", "23393",
+ "2F98A", "2339C",
+ "2F98B", "8201",
+ "2F98C", "8204",
+ "2F98D", "8F9E",
+ "2F98E", "446B",
+ "2F98F", "8291",
+ "2F990", "828B",
+ "2F991", "829D",
+ "2F992", "52B3",
+ "2F993", "82B1",
+ "2F994", "82B3",
+ "2F995", "82BD",
+ "2F996", "82E6",
+ "2F997", "26B3C",
+ "2F998", "82E5",
+ "2F999", "831D",
+ "2F99A", "8363",
+ "2F99B", "83AD",
+ "2F99C", "8323",
+ "2F99D", "83BD",
+ "2F99E", "83E7",
+ "2F99F", "8457",
+ "2F9A0", "8353",
+ "2F9A1", "83CA",
+ "2F9A2", "83CC",
+ "2F9A3", "83DC",
+ "2F9A4", "26C36",
+ "2F9A5", "26D6B",
+ "2F9A6", "26CD5",
+ "2F9A7", "452B",
+ "2F9A8", "84F1",
+ "2F9A9", "84F3",
+ "2F9AA", "8516",
+ "2F9AB", "273CA",
+ "2F9AC", "8564",
+ "2F9AD", "26F2C",
+ "2F9AE", "455D",
+ "2F9AF", "4561",
+ "2F9B0", "26FB1",
+ "2F9B1", "270D2",
+ "2F9B2", "456B",
+ "2F9B3", "8650",
+ "2F9B4", "865C",
+ "2F9B5", "8667",
+ "2F9B6", "8669",
+ "2F9B7", "86A9",
+ "2F9B8", "8688",
+ "2F9B9", "870E",
+ "2F9BA", "86E2",
+ "2F9BB", "8779",
+ "2F9BC", "8728",
+ "2F9BD", "876B",
+ "2F9BE", "8786",
+ "2F9BF", "4D57",
+ "2F9C0", "87E1",
+ "2F9C1", "8801",
+ "2F9C2", "45F9",
+ "2F9C3", "8860",
+ "2F9C4", "8863",
+ "2F9C5", "27667",
+ "2F9C6", "88D7",
+ "2F9C7", "88DE",
+ "2F9C8", "4635",
+ "2F9C9", "88FA",
+ "2F9CA", "34BB",
+ "2F9CB", "278AE",
+ "2F9CC", "27966",
+ "2F9CD", "46BE",
+ "2F9CE", "46C7",
+ "2F9CF", "8AA0",
+ "2F9D0", "8AED",
+ "2F9D1", "8B8A",
+ "2F9D2", "8C55",
+ "2F9D3", "27CA8",
+ "2F9D4", "8CAB",
+ "2F9D5", "8CC1",
+ "2F9D6", "8D1B",
+ "2F9D7", "8D77",
+ "2F9D8", "27F2F",
+ "2F9D9", "20804",
+ "2F9DA", "8DCB",
+ "2F9DB", "8DBC",
+ "2F9DC", "8DF0",
+ "2F9DD", "208DE",
+ "2F9DE", "8ED4",
+ "2F9DF", "8F38",
+ "2F9E0", "285D2",
+ "2F9E1", "285ED",
+ "2F9E2", "9094",
+ "2F9E3", "90F1",
+ "2F9E4", "9111",
+ "2F9E5", "2872E",
+ "2F9E6", "911B",
+ "2F9E7", "9238",
+ "2F9E8", "92D7",
+ "2F9E9", "92D8",
+ "2F9EA", "927C",
+ "2F9EB", "93F9",
+ "2F9EC", "9415",
+ "2F9ED", "28BFA",
+ "2F9EE", "958B",
+ "2F9EF", "4995",
+ "2F9F0", "95B7",
+ "2F9F1", "28D77",
+ "2F9F2", "49E6",
+ "2F9F3", "96C3",
+ "2F9F4", "5DB2",
+ "2F9F5", "9723",
+ "2F9F6", "29145",
+ "2F9F7", "2921A",
+ "2F9F8", "4A6E",
+ "2F9F9", "4A76",
+ "2F9FA", "97E0",
+ "2F9FB", "2940A",
+ "2F9FC", "4AB2",
+ "2F9FD", "29496",
+ "2F9FE", "980B",
+ "2F9FF", "980B",
+ "2FA00", "9829",
+ "2FA01", "295B6",
+ "2FA02", "98E2",
+ "2FA03", "4B33",
+ "2FA04", "9929",
+ "2FA05", "99A7",
+ "2FA06", "99C2",
+ "2FA07", "99FE",
+ "2FA08", "4BCE",
+ "2FA09", "29B30",
+ "2FA0A", "9B12",
+ "2FA0B", "9C40",
+ "2FA0C", "9CFD",
+ "2FA0D", "4CCE",
+ "2FA0E", "4CED",
+ "2FA0F", "9D67",
+ "2FA10", "2A0CE",
+ "2FA11", "4CF8",
+ "2FA12", "2A105",
+ "2FA13", "2A20E",
+ "2FA14", "2A291",
+ "2FA15", "9EBB",
+ "2FA16", "4D56",
+ "2FA17", "9EF9",
+ "2FA18", "9EFE",
+ "2FA19", "9F05",
+ "2FA1A", "9F0F",
+ "2FA1B", "9F16",
+ "2FA1C", "9F3B",
+ "2FA1D", "2A600",
);
-%AGL_to_unicode = (
- "A", "u0041",
- "AE", "u00C6",
- "AEacute", "u01FC",
- "AEmacron", "u01E2",
- "Aacute", "u00C1",
- "Abreve", "u0102",
- "Abreveacute", "u1EAE",
- "Abrevecyrillic", "u04D0",
- "Abrevedotbelow", "u1EB6",
- "Abrevegrave", "u1EB0",
- "Abrevehookabove", "u1EB2",
- "Abrevetilde", "u1EB4",
- "Acaron", "u01CD",
- "Acircle", "u24B6",
- "Acircumflex", "u00C2",
- "Acircumflexacute", "u1EA4",
- "Acircumflexdotbelow", "u1EAC",
- "Acircumflexgrave", "u1EA6",
- "Acircumflexhookabove", "u1EA8",
- "Acircumflextilde", "u1EAA",
- "Acyrillic", "u0410",
- "Adblgrave", "u0200",
- "Adieresis", "u00C4",
- "Adieresiscyrillic", "u04D2",
- "Adieresismacron", "u01DE",
- "Adotbelow", "u1EA0",
- "Adotmacron", "u01E0",
- "Agrave", "u00C0",
- "Ahookabove", "u1EA2",
- "Aiecyrillic", "u04D4",
- "Ainvertedbreve", "u0202",
- "Alpha", "u0391",
- "Alphatonos", "u0386",
- "Amacron", "u0100",
- "Amonospace", "uFF21",
- "Aogonek", "u0104",
- "Aring", "u00C5",
- "Aringacute", "u01FA",
- "Aringbelow", "u1E00",
- "Atilde", "u00C3",
- "Aybarmenian", "u0531",
- "B", "u0042",
- "Bcircle", "u24B7",
- "Bdotaccent", "u1E02",
- "Bdotbelow", "u1E04",
- "Becyrillic", "u0411",
- "Benarmenian", "u0532",
- "Beta", "u0392",
- "Bhook", "u0181",
- "Blinebelow", "u1E06",
- "Bmonospace", "uFF22",
- "Btopbar", "u0182",
- "C", "u0043",
- "Caarmenian", "u053E",
- "Cacute", "u0106",
- "Ccaron", "u010C",
- "Ccedilla", "u00C7",
- "Ccedillaacute", "u1E08",
- "Ccircle", "u24B8",
- "Ccircumflex", "u0108",
- "Cdot", "u010A",
- "Cdotaccent", "u010A",
- "Chaarmenian", "u0549",
- "Cheabkhasiancyrillic", "u04BC",
- "Checyrillic", "u0427",
- "Chedescenderabkhasiancyrillic", "u04BE",
- "Chedescendercyrillic", "u04B6",
- "Chedieresiscyrillic", "u04F4",
- "Cheharmenian", "u0543",
- "Chekhakassiancyrillic", "u04CB",
- "Cheverticalstrokecyrillic", "u04B8",
- "Chi", "u03A7",
- "Chook", "u0187",
- "Cmonospace", "uFF23",
- "Coarmenian", "u0551",
- "D", "u0044",
- "DZ", "u01F1",
- "DZcaron", "u01C4",
- "Daarmenian", "u0534",
- "Dafrican", "u0189",
- "Dcaron", "u010E",
- "Dcedilla", "u1E10",
- "Dcircle", "u24B9",
- "Dcircumflexbelow", "u1E12",
- "Dcroat", "u0110",
- "Ddotaccent", "u1E0A",
- "Ddotbelow", "u1E0C",
- "Decyrillic", "u0414",
- "Deicoptic", "u03EE",
- "Delta", "u2206",
- "Deltagreek", "u0394",
- "Dhook", "u018A",
- "Digammagreek", "u03DC",
- "Djecyrillic", "u0402",
- "Dlinebelow", "u1E0E",
- "Dmonospace", "uFF24",
- "Dslash", "u0110",
- "Dtopbar", "u018B",
- "Dz", "u01F2",
- "Dzcaron", "u01C5",
- "Dzeabkhasiancyrillic", "u04E0",
- "Dzecyrillic", "u0405",
- "Dzhecyrillic", "u040F",
- "E", "u0045",
- "Eacute", "u00C9",
- "Ebreve", "u0114",
- "Ecaron", "u011A",
- "Ecedillabreve", "u1E1C",
- "Echarmenian", "u0535",
- "Ecircle", "u24BA",
- "Ecircumflex", "u00CA",
- "Ecircumflexacute", "u1EBE",
- "Ecircumflexbelow", "u1E18",
- "Ecircumflexdotbelow", "u1EC6",
- "Ecircumflexgrave", "u1EC0",
- "Ecircumflexhookabove", "u1EC2",
- "Ecircumflextilde", "u1EC4",
- "Ecyrillic", "u0404",
- "Edblgrave", "u0204",
- "Edieresis", "u00CB",
- "Edot", "u0116",
- "Edotaccent", "u0116",
- "Edotbelow", "u1EB8",
- "Efcyrillic", "u0424",
- "Egrave", "u00C8",
- "Eharmenian", "u0537",
- "Ehookabove", "u1EBA",
- "Eightroman", "u2167",
- "Einvertedbreve", "u0206",
- "Eiotifiedcyrillic", "u0464",
- "Elcyrillic", "u041B",
- "Elevenroman", "u216A",
- "Emacron", "u0112",
- "Emacronacute", "u1E16",
- "Emacrongrave", "u1E14",
- "Emcyrillic", "u041C",
- "Emonospace", "uFF25",
- "Encyrillic", "u041D",
- "Endescendercyrillic", "u04A2",
- "Eng", "u014A",
- "Enghecyrillic", "u04A4",
- "Enhookcyrillic", "u04C7",
- "Eogonek", "u0118",
- "Eopen", "u0190",
- "Epsilon", "u0395",
- "Epsilontonos", "u0388",
- "Ercyrillic", "u0420",
- "Ereversed", "u018E",
- "Ereversedcyrillic", "u042D",
- "Escyrillic", "u0421",
- "Esdescendercyrillic", "u04AA",
- "Esh", "u01A9",
- "Eta", "u0397",
- "Etarmenian", "u0538",
- "Etatonos", "u0389",
- "Eth", "u00D0",
- "Etilde", "u1EBC",
- "Etildebelow", "u1E1A",
- "Euro", "u20AC",
- "Ezh", "u01B7",
- "Ezhcaron", "u01EE",
- "Ezhreversed", "u01B8",
- "F", "u0046",
- "Fcircle", "u24BB",
- "Fdotaccent", "u1E1E",
- "Feharmenian", "u0556",
- "Feicoptic", "u03E4",
- "Fhook", "u0191",
- "Fitacyrillic", "u0472",
- "Fiveroman", "u2164",
- "Fmonospace", "uFF26",
- "Fourroman", "u2163",
- "G", "u0047",
- "GBsquare", "u3387",
- "Gacute", "u01F4",
- "Gamma", "u0393",
- "Gammaafrican", "u0194",
- "Gangiacoptic", "u03EA",
- "Gbreve", "u011E",
- "Gcaron", "u01E6",
- "Gcedilla", "u0122",
- "Gcircle", "u24BC",
- "Gcircumflex", "u011C",
- "Gcommaaccent", "u0122",
- "Gdot", "u0120",
- "Gdotaccent", "u0120",
- "Gecyrillic", "u0413",
- "Ghadarmenian", "u0542",
- "Ghemiddlehookcyrillic", "u0494",
- "Ghestrokecyrillic", "u0492",
- "Gheupturncyrillic", "u0490",
- "Ghook", "u0193",
- "Gimarmenian", "u0533",
- "Gjecyrillic", "u0403",
- "Gmacron", "u1E20",
- "Gmonospace", "uFF27",
- "Gsmallhook", "u029B",
- "Gstroke", "u01E4",
- "H", "u0048",
- "H18533", "u25CF",
- "H18543", "u25AA",
- "H18551", "u25AB",
- "H22073", "u25A1",
- "HPsquare", "u33CB",
- "Haabkhasiancyrillic", "u04A8",
- "Hadescendercyrillic", "u04B2",
- "Hardsigncyrillic", "u042A",
- "Hbar", "u0126",
- "Hbrevebelow", "u1E2A",
- "Hcedilla", "u1E28",
- "Hcircle", "u24BD",
- "Hcircumflex", "u0124",
- "Hdieresis", "u1E26",
- "Hdotaccent", "u1E22",
- "Hdotbelow", "u1E24",
- "Hmonospace", "uFF28",
- "Hoarmenian", "u0540",
- "Horicoptic", "u03E8",
- "Hzsquare", "u3390",
- "I", "u0049",
- "IAcyrillic", "u042F",
- "IJ", "u0132",
- "IUcyrillic", "u042E",
- "Iacute", "u00CD",
- "Ibreve", "u012C",
- "Icaron", "u01CF",
- "Icircle", "u24BE",
- "Icircumflex", "u00CE",
- "Icyrillic", "u0406",
- "Idblgrave", "u0208",
- "Idieresis", "u00CF",
- "Idieresisacute", "u1E2E",
- "Idieresiscyrillic", "u04E4",
- "Idot", "u0130",
- "Idotaccent", "u0130",
- "Idotbelow", "u1ECA",
- "Iebrevecyrillic", "u04D6",
- "Iecyrillic", "u0415",
- "Ifraktur", "u2111",
- "Igrave", "u00CC",
- "Ihookabove", "u1EC8",
- "Iicyrillic", "u0418",
- "Iinvertedbreve", "u020A",
- "Iishortcyrillic", "u0419",
- "Imacron", "u012A",
- "Imacroncyrillic", "u04E2",
- "Imonospace", "uFF29",
- "Iniarmenian", "u053B",
- "Iocyrillic", "u0401",
- "Iogonek", "u012E",
- "Iota", "u0399",
- "Iotaafrican", "u0196",
- "Iotadieresis", "u03AA",
- "Iotatonos", "u038A",
- "Istroke", "u0197",
- "Itilde", "u0128",
- "Itildebelow", "u1E2C",
- "Izhitsacyrillic", "u0474",
- "Izhitsadblgravecyrillic", "u0476",
- "J", "u004A",
- "Jaarmenian", "u0541",
- "Jcircle", "u24BF",
- "Jcircumflex", "u0134",
- "Jecyrillic", "u0408",
- "Jheharmenian", "u054B",
- "Jmonospace", "uFF2A",
- "K", "u004B",
- "KBsquare", "u3385",
- "KKsquare", "u33CD",
- "Kabashkircyrillic", "u04A0",
- "Kacute", "u1E30",
- "Kacyrillic", "u041A",
- "Kadescendercyrillic", "u049A",
- "Kahookcyrillic", "u04C3",
- "Kappa", "u039A",
- "Kastrokecyrillic", "u049E",
- "Kaverticalstrokecyrillic", "u049C",
- "Kcaron", "u01E8",
- "Kcedilla", "u0136",
- "Kcircle", "u24C0",
- "Kcommaaccent", "u0136",
- "Kdotbelow", "u1E32",
- "Keharmenian", "u0554",
- "Kenarmenian", "u053F",
- "Khacyrillic", "u0425",
- "Kheicoptic", "u03E6",
- "Khook", "u0198",
- "Kjecyrillic", "u040C",
- "Klinebelow", "u1E34",
- "Kmonospace", "uFF2B",
- "Koppacyrillic", "u0480",
- "Koppagreek", "u03DE",
- "Ksicyrillic", "u046E",
- "L", "u004C",
- "LJ", "u01C7",
- "Lacute", "u0139",
- "Lambda", "u039B",
- "Lcaron", "u013D",
- "Lcedilla", "u013B",
- "Lcircle", "u24C1",
- "Lcircumflexbelow", "u1E3C",
- "Lcommaaccent", "u013B",
- "Ldot", "u013F",
- "Ldotaccent", "u013F",
- "Ldotbelow", "u1E36",
- "Ldotbelowmacron", "u1E38",
- "Liwnarmenian", "u053C",
- "Lj", "u01C8",
- "Ljecyrillic", "u0409",
- "Llinebelow", "u1E3A",
- "Lmonospace", "uFF2C",
- "Lslash", "u0141",
- "M", "u004D",
- "MBsquare", "u3386",
- "Macute", "u1E3E",
- "Mcircle", "u24C2",
- "Mdotaccent", "u1E40",
- "Mdotbelow", "u1E42",
- "Menarmenian", "u0544",
- "Mmonospace", "uFF2D",
- "Mturned", "u019C",
- "Mu", "u039C",
- "N", "u004E",
- "NJ", "u01CA",
- "Nacute", "u0143",
- "Ncaron", "u0147",
- "Ncedilla", "u0145",
- "Ncircle", "u24C3",
- "Ncircumflexbelow", "u1E4A",
- "Ncommaaccent", "u0145",
- "Ndotaccent", "u1E44",
- "Ndotbelow", "u1E46",
- "Nhookleft", "u019D",
- "Nineroman", "u2168",
- "Nj", "u01CB",
- "Njecyrillic", "u040A",
- "Nlinebelow", "u1E48",
- "Nmonospace", "uFF2E",
- "Nowarmenian", "u0546",
- "Ntilde", "u00D1",
- "Nu", "u039D",
- "O", "u004F",
- "OE", "u0152",
- "Oacute", "u00D3",
- "Obarredcyrillic", "u04E8",
- "Obarreddieresiscyrillic", "u04EA",
- "Obreve", "u014E",
- "Ocaron", "u01D1",
- "Ocenteredtilde", "u019F",
- "Ocircle", "u24C4",
- "Ocircumflex", "u00D4",
- "Ocircumflexacute", "u1ED0",
- "Ocircumflexdotbelow", "u1ED8",
- "Ocircumflexgrave", "u1ED2",
- "Ocircumflexhookabove", "u1ED4",
- "Ocircumflextilde", "u1ED6",
- "Ocyrillic", "u041E",
- "Odblacute", "u0150",
- "Odblgrave", "u020C",
- "Odieresis", "u00D6",
- "Odieresiscyrillic", "u04E6",
- "Odotbelow", "u1ECC",
- "Ograve", "u00D2",
- "Oharmenian", "u0555",
- "Ohm", "u2126",
- "Ohookabove", "u1ECE",
- "Ohorn", "u01A0",
- "Ohornacute", "u1EDA",
- "Ohorndotbelow", "u1EE2",
- "Ohorngrave", "u1EDC",
- "Ohornhookabove", "u1EDE",
- "Ohorntilde", "u1EE0",
- "Ohungarumlaut", "u0150",
- "Oi", "u01A2",
- "Oinvertedbreve", "u020E",
- "Omacron", "u014C",
- "Omacronacute", "u1E52",
- "Omacrongrave", "u1E50",
- "Omega", "u2126",
- "Omegacyrillic", "u0460",
- "Omegagreek", "u03A9",
- "Omegaroundcyrillic", "u047A",
- "Omegatitlocyrillic", "u047C",
- "Omegatonos", "u038F",
- "Omicron", "u039F",
- "Omicrontonos", "u038C",
- "Omonospace", "uFF2F",
- "Oneroman", "u2160",
- "Oogonek", "u01EA",
- "Oogonekmacron", "u01EC",
- "Oopen", "u0186",
- "Oslash", "u00D8",
- "Oslashacute", "u01FE",
- "Ostrokeacute", "u01FE",
- "Otcyrillic", "u047E",
- "Otilde", "u00D5",
- "Otildeacute", "u1E4C",
- "Otildedieresis", "u1E4E",
- "P", "u0050",
- "Pacute", "u1E54",
- "Pcircle", "u24C5",
- "Pdotaccent", "u1E56",
- "Pecyrillic", "u041F",
- "Peharmenian", "u054A",
- "Pemiddlehookcyrillic", "u04A6",
- "Phi", "u03A6",
- "Phook", "u01A4",
- "Pi", "u03A0",
- "Piwrarmenian", "u0553",
- "Pmonospace", "uFF30",
- "Psi", "u03A8",
- "Psicyrillic", "u0470",
- "Q", "u0051",
- "Qcircle", "u24C6",
- "Qmonospace", "uFF31",
- "R", "u0052",
- "Raarmenian", "u054C",
- "Racute", "u0154",
- "Rcaron", "u0158",
- "Rcedilla", "u0156",
- "Rcircle", "u24C7",
- "Rcommaaccent", "u0156",
- "Rdblgrave", "u0210",
- "Rdotaccent", "u1E58",
- "Rdotbelow", "u1E5A",
- "Rdotbelowmacron", "u1E5C",
- "Reharmenian", "u0550",
- "Rfraktur", "u211C",
- "Rho", "u03A1",
- "Rinvertedbreve", "u0212",
- "Rlinebelow", "u1E5E",
- "Rmonospace", "uFF32",
- "Rsmallinverted", "u0281",
- "Rsmallinvertedsuperior", "u02B6",
- "S", "u0053",
- "SF010000", "u250C",
- "SF020000", "u2514",
- "SF030000", "u2510",
- "SF040000", "u2518",
- "SF050000", "u253C",
- "SF060000", "u252C",
- "SF070000", "u2534",
- "SF080000", "u251C",
- "SF090000", "u2524",
- "SF100000", "u2500",
- "SF110000", "u2502",
- "SF190000", "u2561",
- "SF200000", "u2562",
- "SF210000", "u2556",
- "SF220000", "u2555",
- "SF230000", "u2563",
- "SF240000", "u2551",
- "SF250000", "u2557",
- "SF260000", "u255D",
- "SF270000", "u255C",
- "SF280000", "u255B",
- "SF360000", "u255E",
- "SF370000", "u255F",
- "SF380000", "u255A",
- "SF390000", "u2554",
- "SF400000", "u2569",
- "SF410000", "u2566",
- "SF420000", "u2560",
- "SF430000", "u2550",
- "SF440000", "u256C",
- "SF450000", "u2567",
- "SF460000", "u2568",
- "SF470000", "u2564",
- "SF480000", "u2565",
- "SF490000", "u2559",
- "SF500000", "u2558",
- "SF510000", "u2552",
- "SF520000", "u2553",
- "SF530000", "u256B",
- "SF540000", "u256A",
- "Sacute", "u015A",
- "Sacutedotaccent", "u1E64",
- "Sampigreek", "u03E0",
- "Scaron", "u0160",
- "Scarondotaccent", "u1E66",
- "Scedilla", "u015E",
- "Schwa", "u018F",
- "Schwacyrillic", "u04D8",
- "Schwadieresiscyrillic", "u04DA",
- "Scircle", "u24C8",
- "Scircumflex", "u015C",
- "Scommaaccent", "u0218",
- "Sdotaccent", "u1E60",
- "Sdotbelow", "u1E62",
- "Sdotbelowdotaccent", "u1E68",
- "Seharmenian", "u054D",
- "Sevenroman", "u2166",
- "Shaarmenian", "u0547",
- "Shacyrillic", "u0428",
- "Shchacyrillic", "u0429",
- "Sheicoptic", "u03E2",
- "Shhacyrillic", "u04BA",
- "Shimacoptic", "u03EC",
- "Sigma", "u03A3",
- "Sixroman", "u2165",
- "Smonospace", "uFF33",
- "Softsigncyrillic", "u042C",
- "Stigmagreek", "u03DA",
- "T", "u0054",
- "Tau", "u03A4",
- "Tbar", "u0166",
- "Tcaron", "u0164",
- "Tcedilla", "u0162",
- "Tcircle", "u24C9",
- "Tcircumflexbelow", "u1E70",
- "Tcommaaccent", "u0162",
- "Tdotaccent", "u1E6A",
- "Tdotbelow", "u1E6C",
- "Tecyrillic", "u0422",
- "Tedescendercyrillic", "u04AC",
- "Tenroman", "u2169",
- "Tetsecyrillic", "u04B4",
- "Theta", "u0398",
- "Thook", "u01AC",
- "Thorn", "u00DE",
- "Threeroman", "u2162",
- "Tiwnarmenian", "u054F",
- "Tlinebelow", "u1E6E",
- "Tmonospace", "uFF34",
- "Toarmenian", "u0539",
- "Tonefive", "u01BC",
- "Tonesix", "u0184",
- "Tonetwo", "u01A7",
- "Tretroflexhook", "u01AE",
- "Tsecyrillic", "u0426",
- "Tshecyrillic", "u040B",
- "Twelveroman", "u216B",
- "Tworoman", "u2161",
- "U", "u0055",
- "Uacute", "u00DA",
- "Ubreve", "u016C",
- "Ucaron", "u01D3",
- "Ucircle", "u24CA",
- "Ucircumflex", "u00DB",
- "Ucircumflexbelow", "u1E76",
- "Ucyrillic", "u0423",
- "Udblacute", "u0170",
- "Udblgrave", "u0214",
- "Udieresis", "u00DC",
- "Udieresisacute", "u01D7",
- "Udieresisbelow", "u1E72",
- "Udieresiscaron", "u01D9",
- "Udieresiscyrillic", "u04F0",
- "Udieresisgrave", "u01DB",
- "Udieresismacron", "u01D5",
- "Udotbelow", "u1EE4",
- "Ugrave", "u00D9",
- "Uhookabove", "u1EE6",
- "Uhorn", "u01AF",
- "Uhornacute", "u1EE8",
- "Uhorndotbelow", "u1EF0",
- "Uhorngrave", "u1EEA",
- "Uhornhookabove", "u1EEC",
- "Uhorntilde", "u1EEE",
- "Uhungarumlaut", "u0170",
- "Uhungarumlautcyrillic", "u04F2",
- "Uinvertedbreve", "u0216",
- "Ukcyrillic", "u0478",
- "Umacron", "u016A",
- "Umacroncyrillic", "u04EE",
- "Umacrondieresis", "u1E7A",
- "Umonospace", "uFF35",
- "Uogonek", "u0172",
- "Upsilon", "u03A5",
- "Upsilon1", "u03D2",
- "Upsilonacutehooksymbolgreek", "u03D3",
- "Upsilonafrican", "u01B1",
- "Upsilondieresis", "u03AB",
- "Upsilondieresishooksymbolgreek", "u03D4",
- "Upsilonhooksymbol", "u03D2",
- "Upsilontonos", "u038E",
- "Uring", "u016E",
- "Ushortcyrillic", "u040E",
- "Ustraightcyrillic", "u04AE",
- "Ustraightstrokecyrillic", "u04B0",
- "Utilde", "u0168",
- "Utildeacute", "u1E78",
- "Utildebelow", "u1E74",
- "V", "u0056",
- "Vcircle", "u24CB",
- "Vdotbelow", "u1E7E",
- "Vecyrillic", "u0412",
- "Vewarmenian", "u054E",
- "Vhook", "u01B2",
- "Vmonospace", "uFF36",
- "Voarmenian", "u0548",
- "Vtilde", "u1E7C",
- "W", "u0057",
- "Wacute", "u1E82",
- "Wcircle", "u24CC",
- "Wcircumflex", "u0174",
- "Wdieresis", "u1E84",
- "Wdotaccent", "u1E86",
- "Wdotbelow", "u1E88",
- "Wgrave", "u1E80",
- "Wmonospace", "uFF37",
- "X", "u0058",
- "Xcircle", "u24CD",
- "Xdieresis", "u1E8C",
- "Xdotaccent", "u1E8A",
- "Xeharmenian", "u053D",
- "Xi", "u039E",
- "Xmonospace", "uFF38",
- "Y", "u0059",
- "Yacute", "u00DD",
- "Yatcyrillic", "u0462",
- "Ycircle", "u24CE",
- "Ycircumflex", "u0176",
- "Ydieresis", "u0178",
- "Ydotaccent", "u1E8E",
- "Ydotbelow", "u1EF4",
- "Yericyrillic", "u042B",
- "Yerudieresiscyrillic", "u04F8",
- "Ygrave", "u1EF2",
- "Yhook", "u01B3",
- "Yhookabove", "u1EF6",
- "Yiarmenian", "u0545",
- "Yicyrillic", "u0407",
- "Yiwnarmenian", "u0552",
- "Ymonospace", "uFF39",
- "Ytilde", "u1EF8",
- "Yusbigcyrillic", "u046A",
- "Yusbigiotifiedcyrillic", "u046C",
- "Yuslittlecyrillic", "u0466",
- "Yuslittleiotifiedcyrillic", "u0468",
- "Z", "u005A",
- "Zaarmenian", "u0536",
- "Zacute", "u0179",
- "Zcaron", "u017D",
- "Zcircle", "u24CF",
- "Zcircumflex", "u1E90",
- "Zdot", "u017B",
- "Zdotaccent", "u017B",
- "Zdotbelow", "u1E92",
- "Zecyrillic", "u0417",
- "Zedescendercyrillic", "u0498",
- "Zedieresiscyrillic", "u04DE",
- "Zeta", "u0396",
- "Zhearmenian", "u053A",
- "Zhebrevecyrillic", "u04C1",
- "Zhecyrillic", "u0416",
- "Zhedescendercyrillic", "u0496",
- "Zhedieresiscyrillic", "u04DC",
- "Zlinebelow", "u1E94",
- "Zmonospace", "uFF3A",
- "Zstroke", "u01B5",
- "a", "u0061",
- "aabengali", "u0986",
- "aacute", "u00E1",
- "aadeva", "u0906",
- "aagujarati", "u0A86",
- "aagurmukhi", "u0A06",
- "aamatragurmukhi", "u0A3E",
- "aarusquare", "u3303",
- "aavowelsignbengali", "u09BE",
- "aavowelsigndeva", "u093E",
- "aavowelsigngujarati", "u0ABE",
- "abbreviationmarkarmenian", "u055F",
- "abbreviationsigndeva", "u0970",
- "abengali", "u0985",
- "abopomofo", "u311A",
- "abreve", "u0103",
- "abreveacute", "u1EAF",
- "abrevecyrillic", "u04D1",
- "abrevedotbelow", "u1EB7",
- "abrevegrave", "u1EB1",
- "abrevehookabove", "u1EB3",
- "abrevetilde", "u1EB5",
- "acaron", "u01CE",
- "acircle", "u24D0",
- "acircumflex", "u00E2",
- "acircumflexacute", "u1EA5",
- "acircumflexdotbelow", "u1EAD",
- "acircumflexgrave", "u1EA7",
- "acircumflexhookabove", "u1EA9",
- "acircumflextilde", "u1EAB",
- "acute", "u00B4",
- "acutebelowcmb", "u0317",
- "acutecmb", "u0301",
- "acutecomb", "u0301",
- "acutedeva", "u0954",
- "acutelowmod", "u02CF",
- "acutetonecmb", "u0341",
- "acyrillic", "u0430",
- "adblgrave", "u0201",
- "addakgurmukhi", "u0A71",
- "adeva", "u0905",
- "adieresis", "u00E4",
- "adieresiscyrillic", "u04D3",
- "adieresismacron", "u01DF",
- "adotbelow", "u1EA1",
- "adotmacron", "u01E1",
- "ae", "u00E6",
- "aeacute", "u01FD",
- "aekorean", "u3150",
- "aemacron", "u01E3",
- "afii00208", "u2015",
- "afii08941", "u20A4",
- "afii10017", "u0410",
- "afii10018", "u0411",
- "afii10019", "u0412",
- "afii10020", "u0413",
- "afii10021", "u0414",
- "afii10022", "u0415",
- "afii10023", "u0401",
- "afii10024", "u0416",
- "afii10025", "u0417",
- "afii10026", "u0418",
- "afii10027", "u0419",
- "afii10028", "u041A",
- "afii10029", "u041B",
- "afii10030", "u041C",
- "afii10031", "u041D",
- "afii10032", "u041E",
- "afii10033", "u041F",
- "afii10034", "u0420",
- "afii10035", "u0421",
- "afii10036", "u0422",
- "afii10037", "u0423",
- "afii10038", "u0424",
- "afii10039", "u0425",
- "afii10040", "u0426",
- "afii10041", "u0427",
- "afii10042", "u0428",
- "afii10043", "u0429",
- "afii10044", "u042A",
- "afii10045", "u042B",
- "afii10046", "u042C",
- "afii10047", "u042D",
- "afii10048", "u042E",
- "afii10049", "u042F",
- "afii10050", "u0490",
- "afii10051", "u0402",
- "afii10052", "u0403",
- "afii10053", "u0404",
- "afii10054", "u0405",
- "afii10055", "u0406",
- "afii10056", "u0407",
- "afii10057", "u0408",
- "afii10058", "u0409",
- "afii10059", "u040A",
- "afii10060", "u040B",
- "afii10061", "u040C",
- "afii10062", "u040E",
- "afii10065", "u0430",
- "afii10066", "u0431",
- "afii10067", "u0432",
- "afii10068", "u0433",
- "afii10069", "u0434",
- "afii10070", "u0435",
- "afii10071", "u0451",
- "afii10072", "u0436",
- "afii10073", "u0437",
- "afii10074", "u0438",
- "afii10075", "u0439",
- "afii10076", "u043A",
- "afii10077", "u043B",
- "afii10078", "u043C",
- "afii10079", "u043D",
- "afii10080", "u043E",
- "afii10081", "u043F",
- "afii10082", "u0440",
- "afii10083", "u0441",
- "afii10084", "u0442",
- "afii10085", "u0443",
- "afii10086", "u0444",
- "afii10087", "u0445",
- "afii10088", "u0446",
- "afii10089", "u0447",
- "afii10090", "u0448",
- "afii10091", "u0449",
- "afii10092", "u044A",
- "afii10093", "u044B",
- "afii10094", "u044C",
- "afii10095", "u044D",
- "afii10096", "u044E",
- "afii10097", "u044F",
- "afii10098", "u0491",
- "afii10099", "u0452",
- "afii10100", "u0453",
- "afii10101", "u0454",
- "afii10102", "u0455",
- "afii10103", "u0456",
- "afii10104", "u0457",
- "afii10105", "u0458",
- "afii10106", "u0459",
- "afii10107", "u045A",
- "afii10108", "u045B",
- "afii10109", "u045C",
- "afii10110", "u045E",
- "afii10145", "u040F",
- "afii10146", "u0462",
- "afii10147", "u0472",
- "afii10148", "u0474",
- "afii10193", "u045F",
- "afii10194", "u0463",
- "afii10195", "u0473",
- "afii10196", "u0475",
- "afii10846", "u04D9",
- "afii299", "u200E",
- "afii300", "u200F",
- "afii301", "u200D",
- "afii57381", "u066A",
- "afii57388", "u060C",
- "afii57392", "u0660",
- "afii57393", "u0661",
- "afii57394", "u0662",
- "afii57395", "u0663",
- "afii57396", "u0664",
- "afii57397", "u0665",
- "afii57398", "u0666",
- "afii57399", "u0667",
- "afii57400", "u0668",
- "afii57401", "u0669",
- "afii57403", "u061B",
- "afii57407", "u061F",
- "afii57409", "u0621",
- "afii57410", "u0622",
- "afii57411", "u0623",
- "afii57412", "u0624",
- "afii57413", "u0625",
- "afii57414", "u0626",
- "afii57415", "u0627",
- "afii57416", "u0628",
- "afii57417", "u0629",
- "afii57418", "u062A",
- "afii57419", "u062B",
- "afii57420", "u062C",
- "afii57421", "u062D",
- "afii57422", "u062E",
- "afii57423", "u062F",
- "afii57424", "u0630",
- "afii57425", "u0631",
- "afii57426", "u0632",
- "afii57427", "u0633",
- "afii57428", "u0634",
- "afii57429", "u0635",
- "afii57430", "u0636",
- "afii57431", "u0637",
- "afii57432", "u0638",
- "afii57433", "u0639",
- "afii57434", "u063A",
- "afii57440", "u0640",
- "afii57441", "u0641",
- "afii57442", "u0642",
- "afii57443", "u0643",
- "afii57444", "u0644",
- "afii57445", "u0645",
- "afii57446", "u0646",
- "afii57448", "u0648",
- "afii57449", "u0649",
- "afii57450", "u064A",
- "afii57451", "u064B",
- "afii57452", "u064C",
- "afii57453", "u064D",
- "afii57454", "u064E",
- "afii57455", "u064F",
- "afii57456", "u0650",
- "afii57457", "u0651",
- "afii57458", "u0652",
- "afii57470", "u0647",
- "afii57505", "u06A4",
- "afii57506", "u067E",
- "afii57507", "u0686",
- "afii57508", "u0698",
- "afii57509", "u06AF",
- "afii57511", "u0679",
- "afii57512", "u0688",
- "afii57513", "u0691",
- "afii57514", "u06BA",
- "afii57519", "u06D2",
- "afii57534", "u06D5",
- "afii57636", "u20AA",
- "afii57645", "u05BE",
- "afii57658", "u05C3",
- "afii57664", "u05D0",
- "afii57665", "u05D1",
- "afii57666", "u05D2",
- "afii57667", "u05D3",
- "afii57668", "u05D4",
- "afii57669", "u05D5",
- "afii57670", "u05D6",
- "afii57671", "u05D7",
- "afii57672", "u05D8",
- "afii57673", "u05D9",
- "afii57674", "u05DA",
- "afii57675", "u05DB",
- "afii57676", "u05DC",
- "afii57677", "u05DD",
- "afii57678", "u05DE",
- "afii57679", "u05DF",
- "afii57680", "u05E0",
- "afii57681", "u05E1",
- "afii57682", "u05E2",
- "afii57683", "u05E3",
- "afii57684", "u05E4",
- "afii57685", "u05E5",
- "afii57686", "u05E6",
- "afii57687", "u05E7",
- "afii57688", "u05E8",
- "afii57689", "u05E9",
- "afii57690", "u05EA",
- "afii57694", "uFB2A",
- "afii57695", "uFB2B",
- "afii57700", "uFB4B",
- "afii57705", "uFB1F",
- "afii57716", "u05F0",
- "afii57717", "u05F1",
- "afii57718", "u05F2",
- "afii57723", "uFB35",
- "afii57793", "u05B4",
- "afii57794", "u05B5",
- "afii57795", "u05B6",
- "afii57796", "u05BB",
- "afii57797", "u05B8",
- "afii57798", "u05B7",
- "afii57799", "u05B0",
- "afii57800", "u05B2",
- "afii57801", "u05B1",
- "afii57802", "u05B3",
- "afii57803", "u05C2",
- "afii57804", "u05C1",
- "afii57806", "u05B9",
- "afii57807", "u05BC",
- "afii57839", "u05BD",
- "afii57841", "u05BF",
- "afii57842", "u05C0",
- "afii57929", "u02BC",
- "afii61248", "u2105",
- "afii61289", "u2113",
- "afii61352", "u2116",
- "afii61573", "u202C",
- "afii61574", "u202D",
- "afii61575", "u202E",
- "afii61664", "u200C",
- "afii63167", "u066D",
- "afii64937", "u02BD",
- "agrave", "u00E0",
- "agujarati", "u0A85",
- "agurmukhi", "u0A05",
- "ahiragana", "u3042",
- "ahookabove", "u1EA3",
- "aibengali", "u0990",
- "aibopomofo", "u311E",
- "aideva", "u0910",
- "aiecyrillic", "u04D5",
- "aigujarati", "u0A90",
- "aigurmukhi", "u0A10",
- "aimatragurmukhi", "u0A48",
- "ainarabic", "u0639",
- "ainfinalarabic", "uFECA",
- "aininitialarabic", "uFECB",
- "ainmedialarabic", "uFECC",
- "ainvertedbreve", "u0203",
- "aivowelsignbengali", "u09C8",
- "aivowelsigndeva", "u0948",
- "aivowelsigngujarati", "u0AC8",
- "akatakana", "u30A2",
- "akatakanahalfwidth", "uFF71",
- "akorean", "u314F",
- "alef", "u05D0",
- "alefarabic", "u0627",
- "alefdageshhebrew", "uFB30",
- "aleffinalarabic", "uFE8E",
- "alefhamzaabovearabic", "u0623",
- "alefhamzaabovefinalarabic", "uFE84",
- "alefhamzabelowarabic", "u0625",
- "alefhamzabelowfinalarabic", "uFE88",
- "alefhebrew", "u05D0",
- "aleflamedhebrew", "uFB4F",
- "alefmaddaabovearabic", "u0622",
- "alefmaddaabovefinalarabic", "uFE82",
- "alefmaksuraarabic", "u0649",
- "alefmaksurafinalarabic", "uFEF0",
- "alefmaksurainitialarabic", "uFEF3",
- "alefmaksuramedialarabic", "uFEF4",
- "alefpatahhebrew", "uFB2E",
- "alefqamatshebrew", "uFB2F",
- "aleph", "u2135",
- "allequal", "u224C",
- "alpha", "u03B1",
- "alphatonos", "u03AC",
- "amacron", "u0101",
- "amonospace", "uFF41",
- "ampersand", "u0026",
- "ampersandmonospace", "uFF06",
- "amsquare", "u33C2",
- "anbopomofo", "u3122",
- "angbopomofo", "u3124",
- "angkhankhuthai", "u0E5A",
- "angle", "u2220",
- "anglebracketleft", "u3008",
- "anglebracketleftvertical", "uFE3F",
- "anglebracketright", "u3009",
- "anglebracketrightvertical", "uFE40",
- "angleleft", "u2329",
- "angleright", "u232A",
- "angstrom", "u212B",
- "anoteleia", "u0387",
- "anudattadeva", "u0952",
- "anusvarabengali", "u0982",
- "anusvaradeva", "u0902",
- "anusvaragujarati", "u0A82",
- "aogonek", "u0105",
- "apaatosquare", "u3300",
- "aparen", "u249C",
- "apostrophearmenian", "u055A",
- "apostrophemod", "u02BC",
- "approaches", "u2250",
- "approxequal", "u2248",
- "approxequalorimage", "u2252",
- "approximatelyequal", "u2245",
- "araeaekorean", "u318E",
- "araeakorean", "u318D",
- "arc", "u2312",
- "arighthalfring", "u1E9A",
- "aring", "u00E5",
- "aringacute", "u01FB",
- "aringbelow", "u1E01",
- "arrowboth", "u2194",
- "arrowdashdown", "u21E3",
- "arrowdashleft", "u21E0",
- "arrowdashright", "u21E2",
- "arrowdashup", "u21E1",
- "arrowdblboth", "u21D4",
- "arrowdbldown", "u21D3",
- "arrowdblleft", "u21D0",
- "arrowdblright", "u21D2",
- "arrowdblup", "u21D1",
- "arrowdown", "u2193",
- "arrowdownleft", "u2199",
- "arrowdownright", "u2198",
- "arrowdownwhite", "u21E9",
- "arrowheaddownmod", "u02C5",
- "arrowheadleftmod", "u02C2",
- "arrowheadrightmod", "u02C3",
- "arrowheadupmod", "u02C4",
- "arrowleft", "u2190",
- "arrowleftdbl", "u21D0",
- "arrowleftdblstroke", "u21CD",
- "arrowleftoverright", "u21C6",
- "arrowleftwhite", "u21E6",
- "arrowright", "u2192",
- "arrowrightdblstroke", "u21CF",
- "arrowrightheavy", "u279E",
- "arrowrightoverleft", "u21C4",
- "arrowrightwhite", "u21E8",
- "arrowtableft", "u21E4",
- "arrowtabright", "u21E5",
- "arrowup", "u2191",
- "arrowupdn", "u2195",
- "arrowupdnbse", "u21A8",
- "arrowupdownbase", "u21A8",
- "arrowupleft", "u2196",
- "arrowupleftofdown", "u21C5",
- "arrowupright", "u2197",
- "arrowupwhite", "u21E7",
- "asciicircum", "u005E",
- "asciicircummonospace", "uFF3E",
- "asciitilde", "u007E",
- "asciitildemonospace", "uFF5E",
- "ascript", "u0251",
- "ascriptturned", "u0252",
- "asmallhiragana", "u3041",
- "asmallkatakana", "u30A1",
- "asmallkatakanahalfwidth", "uFF67",
- "asterisk", "u002A",
- "asteriskaltonearabic", "u066D",
- "asteriskarabic", "u066D",
- "asteriskmath", "u2217",
- "asteriskmonospace", "uFF0A",
- "asterisksmall", "uFE61",
- "asterism", "u2042",
- "asymptoticallyequal", "u2243",
- "at", "u0040",
- "atilde", "u00E3",
- "atmonospace", "uFF20",
- "atsmall", "uFE6B",
- "aturned", "u0250",
- "aubengali", "u0994",
- "aubopomofo", "u3120",
- "audeva", "u0914",
- "augujarati", "u0A94",
- "augurmukhi", "u0A14",
- "aulengthmarkbengali", "u09D7",
- "aumatragurmukhi", "u0A4C",
- "auvowelsignbengali", "u09CC",
- "auvowelsigndeva", "u094C",
- "auvowelsigngujarati", "u0ACC",
- "avagrahadeva", "u093D",
- "aybarmenian", "u0561",
- "ayin", "u05E2",
- "ayinaltonehebrew", "uFB20",
- "ayinhebrew", "u05E2",
- "b", "u0062",
- "babengali", "u09AC",
- "backslash", "u005C",
- "backslashmonospace", "uFF3C",
- "badeva", "u092C",
- "bagujarati", "u0AAC",
- "bagurmukhi", "u0A2C",
- "bahiragana", "u3070",
- "bahtthai", "u0E3F",
- "bakatakana", "u30D0",
- "bar", "u007C",
- "barmonospace", "uFF5C",
- "bbopomofo", "u3105",
- "bcircle", "u24D1",
- "bdotaccent", "u1E03",
- "bdotbelow", "u1E05",
- "beamedsixteenthnotes", "u266C",
- "because", "u2235",
- "becyrillic", "u0431",
- "beharabic", "u0628",
- "behfinalarabic", "uFE90",
- "behinitialarabic", "uFE91",
- "behiragana", "u3079",
- "behmedialarabic", "uFE92",
- "behmeeminitialarabic", "uFC9F",
- "behmeemisolatedarabic", "uFC08",
- "behnoonfinalarabic", "uFC6D",
- "bekatakana", "u30D9",
- "benarmenian", "u0562",
- "bet", "u05D1",
- "beta", "u03B2",
- "betasymbolgreek", "u03D0",
- "betdagesh", "uFB31",
- "betdageshhebrew", "uFB31",
- "bethebrew", "u05D1",
- "betrafehebrew", "uFB4C",
- "bhabengali", "u09AD",
- "bhadeva", "u092D",
- "bhagujarati", "u0AAD",
- "bhagurmukhi", "u0A2D",
- "bhook", "u0253",
- "bihiragana", "u3073",
- "bikatakana", "u30D3",
- "bilabialclick", "u0298",
- "bindigurmukhi", "u0A02",
- "birusquare", "u3331",
- "blackcircle", "u25CF",
- "blackdiamond", "u25C6",
- "blackdownpointingtriangle", "u25BC",
- "blackleftpointingpointer", "u25C4",
- "blackleftpointingtriangle", "u25C0",
- "blacklenticularbracketleft", "u3010",
- "blacklenticularbracketleftvertical", "uFE3B",
- "blacklenticularbracketright", "u3011",
- "blacklenticularbracketrightvertical", "uFE3C",
- "blacklowerlefttriangle", "u25E3",
- "blacklowerrighttriangle", "u25E2",
- "blackrectangle", "u25AC",
- "blackrightpointingpointer", "u25BA",
- "blackrightpointingtriangle", "u25B6",
- "blacksmallsquare", "u25AA",
- "blacksmilingface", "u263B",
- "blacksquare", "u25A0",
- "blackstar", "u2605",
- "blackupperlefttriangle", "u25E4",
- "blackupperrighttriangle", "u25E5",
- "blackuppointingsmalltriangle", "u25B4",
- "blackuppointingtriangle", "u25B2",
- "blank", "u2423",
- "blinebelow", "u1E07",
- "block", "u2588",
- "bmonospace", "uFF42",
- "bobaimaithai", "u0E1A",
- "bohiragana", "u307C",
- "bokatakana", "u30DC",
- "bparen", "u249D",
- "bqsquare", "u33C3",
- "braceleft", "u007B",
- "braceleftmonospace", "uFF5B",
- "braceleftsmall", "uFE5B",
- "braceleftvertical", "uFE37",
- "braceright", "u007D",
- "bracerightmonospace", "uFF5D",
- "bracerightsmall", "uFE5C",
- "bracerightvertical", "uFE38",
- "bracketleft", "u005B",
- "bracketleftmonospace", "uFF3B",
- "bracketright", "u005D",
- "bracketrightmonospace", "uFF3D",
- "breve", "u02D8",
- "brevebelowcmb", "u032E",
- "brevecmb", "u0306",
- "breveinvertedbelowcmb", "u032F",
- "breveinvertedcmb", "u0311",
- "breveinverteddoublecmb", "u0361",
- "bridgebelowcmb", "u032A",
- "bridgeinvertedbelowcmb", "u033A",
- "brokenbar", "u00A6",
- "bstroke", "u0180",
- "btopbar", "u0183",
- "buhiragana", "u3076",
- "bukatakana", "u30D6",
- "bullet", "u2022",
- "bulletinverse", "u25D8",
- "bulletoperator", "u2219",
- "bullseye", "u25CE",
- "c", "u0063",
- "caarmenian", "u056E",
- "cabengali", "u099A",
- "cacute", "u0107",
- "cadeva", "u091A",
- "cagujarati", "u0A9A",
- "cagurmukhi", "u0A1A",
- "calsquare", "u3388",
- "candrabindubengali", "u0981",
- "candrabinducmb", "u0310",
- "candrabindudeva", "u0901",
- "candrabindugujarati", "u0A81",
- "capslock", "u21EA",
- "careof", "u2105",
- "caron", "u02C7",
- "caronbelowcmb", "u032C",
- "caroncmb", "u030C",
- "carriagereturn", "u21B5",
- "cbopomofo", "u3118",
- "ccaron", "u010D",
- "ccedilla", "u00E7",
- "ccedillaacute", "u1E09",
- "ccircle", "u24D2",
- "ccircumflex", "u0109",
- "ccurl", "u0255",
- "cdot", "u010B",
- "cdotaccent", "u010B",
- "cdsquare", "u33C5",
- "cedilla", "u00B8",
- "cedillacmb", "u0327",
- "cent", "u00A2",
- "centigrade", "u2103",
- "centmonospace", "uFFE0",
- "chaarmenian", "u0579",
- "chabengali", "u099B",
- "chadeva", "u091B",
- "chagujarati", "u0A9B",
- "chagurmukhi", "u0A1B",
- "chbopomofo", "u3114",
- "cheabkhasiancyrillic", "u04BD",
- "checkmark", "u2713",
- "checyrillic", "u0447",
- "chedescenderabkhasiancyrillic", "u04BF",
- "chedescendercyrillic", "u04B7",
- "chedieresiscyrillic", "u04F5",
- "cheharmenian", "u0573",
- "chekhakassiancyrillic", "u04CC",
- "cheverticalstrokecyrillic", "u04B9",
- "chi", "u03C7",
- "chieuchacirclekorean", "u3277",
- "chieuchaparenkorean", "u3217",
- "chieuchcirclekorean", "u3269",
- "chieuchkorean", "u314A",
- "chieuchparenkorean", "u3209",
- "chochangthai", "u0E0A",
- "chochanthai", "u0E08",
- "chochingthai", "u0E09",
- "chochoethai", "u0E0C",
- "chook", "u0188",
- "cieucacirclekorean", "u3276",
- "cieucaparenkorean", "u3216",
- "cieuccirclekorean", "u3268",
- "cieuckorean", "u3148",
- "cieucparenkorean", "u3208",
- "cieucuparenkorean", "u321C",
- "circle", "u25CB",
- "circlemultiply", "u2297",
- "circleot", "u2299",
- "circleplus", "u2295",
- "circlepostalmark", "u3036",
- "circlewithlefthalfblack", "u25D0",
- "circlewithrighthalfblack", "u25D1",
- "circumflex", "u02C6",
- "circumflexbelowcmb", "u032D",
- "circumflexcmb", "u0302",
- "clear", "u2327",
- "clickalveolar", "u01C2",
- "clickdental", "u01C0",
- "clicklateral", "u01C1",
- "clickretroflex", "u01C3",
- "club", "u2663",
- "clubsuitblack", "u2663",
- "clubsuitwhite", "u2667",
- "cmcubedsquare", "u33A4",
- "cmonospace", "uFF43",
- "cmsquaredsquare", "u33A0",
- "coarmenian", "u0581",
- "colon", "u003A",
- "colonmonetary", "u20A1",
- "colonmonospace", "uFF1A",
- "colonsign", "u20A1",
- "colonsmall", "uFE55",
- "colontriangularhalfmod", "u02D1",
- "colontriangularmod", "u02D0",
- "comma", "u002C",
- "commaabovecmb", "u0313",
- "commaaboverightcmb", "u0315",
- "commaarabic", "u060C",
- "commaarmenian", "u055D",
- "commamonospace", "uFF0C",
- "commareversedabovecmb", "u0314",
- "commareversedmod", "u02BD",
- "commasmall", "uFE50",
- "commaturnedabovecmb", "u0312",
- "commaturnedmod", "u02BB",
- "compass", "u263C",
- "congruent", "u2245",
- "contourintegral", "u222E",
- "control", "u2303",
- "controlACK", "u0006",
- "controlBEL", "u0007",
- "controlBS", "u0008",
- "controlCAN", "u0018",
- "controlCR", "u000D",
- "controlDC1", "u0011",
- "controlDC2", "u0012",
- "controlDC3", "u0013",
- "controlDC4", "u0014",
- "controlDEL", "u007F",
- "controlDLE", "u0010",
- "controlEM", "u0019",
- "controlENQ", "u0005",
- "controlEOT", "u0004",
- "controlESC", "u001B",
- "controlETB", "u0017",
- "controlETX", "u0003",
- "controlFF", "u000C",
- "controlFS", "u001C",
- "controlGS", "u001D",
- "controlHT", "u0009",
- "controlLF", "u000A",
- "controlNAK", "u0015",
- "controlRS", "u001E",
- "controlSI", "u000F",
- "controlSO", "u000E",
- "controlSOT", "u0002",
- "controlSTX", "u0001",
- "controlSUB", "u001A",
- "controlSYN", "u0016",
- "controlUS", "u001F",
- "controlVT", "u000B",
- "copyright", "u00A9",
- "cornerbracketleft", "u300C",
- "cornerbracketlefthalfwidth", "uFF62",
- "cornerbracketleftvertical", "uFE41",
- "cornerbracketright", "u300D",
- "cornerbracketrighthalfwidth", "uFF63",
- "cornerbracketrightvertical", "uFE42",
- "corporationsquare", "u337F",
- "cosquare", "u33C7",
- "coverkgsquare", "u33C6",
- "cparen", "u249E",
- "cruzeiro", "u20A2",
- "cstretched", "u0297",
- "curlyand", "u22CF",
- "curlyor", "u22CE",
- "currency", "u00A4",
- "d", "u0064",
- "daarmenian", "u0564",
- "dabengali", "u09A6",
- "dadarabic", "u0636",
- "dadeva", "u0926",
- "dadfinalarabic", "uFEBE",
- "dadinitialarabic", "uFEBF",
- "dadmedialarabic", "uFEC0",
- "dagesh", "u05BC",
- "dageshhebrew", "u05BC",
- "dagger", "u2020",
- "daggerdbl", "u2021",
- "dagujarati", "u0AA6",
- "dagurmukhi", "u0A26",
- "dahiragana", "u3060",
- "dakatakana", "u30C0",
- "dalarabic", "u062F",
- "dalet", "u05D3",
- "daletdagesh", "uFB33",
- "daletdageshhebrew", "uFB33",
- "dalethatafpatah", "u05D3_05B2",
- "dalethatafpatahhebrew", "u05D3_05B2",
- "dalethatafsegol", "u05D3_05B1",
- "dalethatafsegolhebrew", "u05D3_05B1",
- "dalethebrew", "u05D3",
- "dalethiriq", "u05D3_05B4",
- "dalethiriqhebrew", "u05D3_05B4",
- "daletholam", "u05D3_05B9",
- "daletholamhebrew", "u05D3_05B9",
- "daletpatah", "u05D3_05B7",
- "daletpatahhebrew", "u05D3_05B7",
- "daletqamats", "u05D3_05B8",
- "daletqamatshebrew", "u05D3_05B8",
- "daletqubuts", "u05D3_05BB",
- "daletqubutshebrew", "u05D3_05BB",
- "daletsegol", "u05D3_05B6",
- "daletsegolhebrew", "u05D3_05B6",
- "daletsheva", "u05D3_05B0",
- "daletshevahebrew", "u05D3_05B0",
- "dalettsere", "u05D3_05B5",
- "dalettserehebrew", "u05D3_05B5",
- "dalfinalarabic", "uFEAA",
- "dammaarabic", "u064F",
- "dammalowarabic", "u064F",
- "dammatanaltonearabic", "u064C",
- "dammatanarabic", "u064C",
- "danda", "u0964",
- "dargahebrew", "u05A7",
- "dargalefthebrew", "u05A7",
- "dasiapneumatacyrilliccmb", "u0485",
- "dblanglebracketleft", "u300A",
- "dblanglebracketleftvertical", "uFE3D",
- "dblanglebracketright", "u300B",
- "dblanglebracketrightvertical", "uFE3E",
- "dblarchinvertedbelowcmb", "u032B",
- "dblarrowleft", "u21D4",
- "dblarrowright", "u21D2",
- "dbldanda", "u0965",
- "dblgravecmb", "u030F",
- "dblintegral", "u222C",
- "dbllowline", "u2017",
- "dbllowlinecmb", "u0333",
- "dbloverlinecmb", "u033F",
- "dblprimemod", "u02BA",
- "dblverticalbar", "u2016",
- "dblverticallineabovecmb", "u030E",
- "dbopomofo", "u3109",
- "dbsquare", "u33C8",
- "dcaron", "u010F",
- "dcedilla", "u1E11",
- "dcircle", "u24D3",
- "dcircumflexbelow", "u1E13",
- "dcroat", "u0111",
- "ddabengali", "u09A1",
- "ddadeva", "u0921",
- "ddagujarati", "u0AA1",
- "ddagurmukhi", "u0A21",
- "ddalarabic", "u0688",
- "ddalfinalarabic", "uFB89",
- "dddhadeva", "u095C",
- "ddhabengali", "u09A2",
- "ddhadeva", "u0922",
- "ddhagujarati", "u0AA2",
- "ddhagurmukhi", "u0A22",
- "ddotaccent", "u1E0B",
- "ddotbelow", "u1E0D",
- "decimalseparatorarabic", "u066B",
- "decimalseparatorpersian", "u066B",
- "decyrillic", "u0434",
- "degree", "u00B0",
- "dehihebrew", "u05AD",
- "dehiragana", "u3067",
- "deicoptic", "u03EF",
- "dekatakana", "u30C7",
- "deleteleft", "u232B",
- "deleteright", "u2326",
- "delta", "u03B4",
- "deltaturned", "u018D",
- "denominatorminusonenumeratorbengali", "u09F8",
- "dezh", "u02A4",
- "dhabengali", "u09A7",
- "dhadeva", "u0927",
- "dhagujarati", "u0AA7",
- "dhagurmukhi", "u0A27",
- "dhook", "u0257",
- "dialytikatonos", "u0385",
- "dialytikatonoscmb", "u0344",
- "diamond", "u2666",
- "diamondsuitwhite", "u2662",
- "dieresis", "u00A8",
- "dieresisbelowcmb", "u0324",
- "dieresiscmb", "u0308",
- "dieresistonos", "u0385",
- "dihiragana", "u3062",
- "dikatakana", "u30C2",
- "dittomark", "u3003",
- "divide", "u00F7",
- "divides", "u2223",
- "divisionslash", "u2215",
- "djecyrillic", "u0452",
- "dkshade", "u2593",
- "dlinebelow", "u1E0F",
- "dlsquare", "u3397",
- "dmacron", "u0111",
- "dmonospace", "uFF44",
- "dnblock", "u2584",
- "dochadathai", "u0E0E",
- "dodekthai", "u0E14",
- "dohiragana", "u3069",
- "dokatakana", "u30C9",
- "dollar", "u0024",
- "dollarmonospace", "uFF04",
- "dollarsmall", "uFE69",
- "dong", "u20AB",
- "dorusquare", "u3326",
- "dotaccent", "u02D9",
- "dotaccentcmb", "u0307",
- "dotbelowcmb", "u0323",
- "dotbelowcomb", "u0323",
- "dotkatakana", "u30FB",
- "dotlessi", "u0131",
- "dotlessjstrokehook", "u0284",
- "dotmath", "u22C5",
- "dottedcircle", "u25CC",
- "doubleyodpatah", "uFB1F",
- "doubleyodpatahhebrew", "uFB1F",
- "downtackbelowcmb", "u031E",
- "downtackmod", "u02D5",
- "dparen", "u249F",
- "dtail", "u0256",
- "dtopbar", "u018C",
- "duhiragana", "u3065",
- "dukatakana", "u30C5",
- "dz", "u01F3",
- "dzaltone", "u02A3",
- "dzcaron", "u01C6",
- "dzcurl", "u02A5",
- "dzeabkhasiancyrillic", "u04E1",
- "dzecyrillic", "u0455",
- "dzhecyrillic", "u045F",
- "e", "u0065",
- "eacute", "u00E9",
- "earth", "u2641",
- "ebengali", "u098F",
- "ebopomofo", "u311C",
- "ebreve", "u0115",
- "ecandradeva", "u090D",
- "ecandragujarati", "u0A8D",
- "ecandravowelsigndeva", "u0945",
- "ecandravowelsigngujarati", "u0AC5",
- "ecaron", "u011B",
- "ecedillabreve", "u1E1D",
- "echarmenian", "u0565",
- "echyiwnarmenian", "u0587",
- "ecircle", "u24D4",
- "ecircumflex", "u00EA",
- "ecircumflexacute", "u1EBF",
- "ecircumflexbelow", "u1E19",
- "ecircumflexdotbelow", "u1EC7",
- "ecircumflexgrave", "u1EC1",
- "ecircumflexhookabove", "u1EC3",
- "ecircumflextilde", "u1EC5",
- "ecyrillic", "u0454",
- "edblgrave", "u0205",
- "edeva", "u090F",
- "edieresis", "u00EB",
- "edot", "u0117",
- "edotaccent", "u0117",
- "edotbelow", "u1EB9",
- "eegurmukhi", "u0A0F",
- "eematragurmukhi", "u0A47",
- "efcyrillic", "u0444",
- "egrave", "u00E8",
- "egujarati", "u0A8F",
- "eharmenian", "u0567",
- "ehbopomofo", "u311D",
- "ehiragana", "u3048",
- "ehookabove", "u1EBB",
- "eibopomofo", "u311F",
- "eight", "u0038",
- "eightarabic", "u0668",
- "eightbengali", "u09EE",
- "eightcircle", "u2467",
- "eightcircleinversesansserif", "u2791",
- "eightdeva", "u096E",
- "eighteencircle", "u2471",
- "eighteenparen", "u2485",
- "eighteenperiod", "u2499",
- "eightgujarati", "u0AEE",
- "eightgurmukhi", "u0A6E",
- "eighthackarabic", "u0668",
- "eighthangzhou", "u3028",
- "eighthnotebeamed", "u266B",
- "eightideographicparen", "u3227",
- "eightinferior", "u2088",
- "eightmonospace", "uFF18",
- "eightparen", "u247B",
- "eightperiod", "u248F",
- "eightpersian", "u06F8",
- "eightroman", "u2177",
- "eightsuperior", "u2078",
- "eightthai", "u0E58",
- "einvertedbreve", "u0207",
- "eiotifiedcyrillic", "u0465",
- "ekatakana", "u30A8",
- "ekatakanahalfwidth", "uFF74",
- "ekonkargurmukhi", "u0A74",
- "ekorean", "u3154",
- "elcyrillic", "u043B",
- "element", "u2208",
- "elevencircle", "u246A",
- "elevenparen", "u247E",
- "elevenperiod", "u2492",
- "elevenroman", "u217A",
- "ellipsis", "u2026",
- "ellipsisvertical", "u22EE",
- "emacron", "u0113",
- "emacronacute", "u1E17",
- "emacrongrave", "u1E15",
- "emcyrillic", "u043C",
- "emdash", "u2014",
- "emdashvertical", "uFE31",
- "emonospace", "uFF45",
- "emphasismarkarmenian", "u055B",
- "emptyset", "u2205",
- "enbopomofo", "u3123",
- "encyrillic", "u043D",
- "endash", "u2013",
- "endashvertical", "uFE32",
- "endescendercyrillic", "u04A3",
- "eng", "u014B",
- "engbopomofo", "u3125",
- "enghecyrillic", "u04A5",
- "enhookcyrillic", "u04C8",
- "enspace", "u2002",
- "eogonek", "u0119",
- "eokorean", "u3153",
- "eopen", "u025B",
- "eopenclosed", "u029A",
- "eopenreversed", "u025C",
- "eopenreversedclosed", "u025E",
- "eopenreversedhook", "u025D",
- "eparen", "u24A0",
- "epsilon", "u03B5",
- "epsilontonos", "u03AD",
- "equal", "u003D",
- "equalmonospace", "uFF1D",
- "equalsmall", "uFE66",
- "equalsuperior", "u207C",
- "equivalence", "u2261",
- "erbopomofo", "u3126",
- "ercyrillic", "u0440",
- "ereversed", "u0258",
- "ereversedcyrillic", "u044D",
- "escyrillic", "u0441",
- "esdescendercyrillic", "u04AB",
- "esh", "u0283",
- "eshcurl", "u0286",
- "eshortdeva", "u090E",
- "eshortvowelsigndeva", "u0946",
- "eshreversedloop", "u01AA",
- "eshsquatreversed", "u0285",
- "esmallhiragana", "u3047",
- "esmallkatakana", "u30A7",
- "esmallkatakanahalfwidth", "uFF6A",
- "estimated", "u212E",
- "eta", "u03B7",
- "etarmenian", "u0568",
- "etatonos", "u03AE",
- "eth", "u00F0",
- "etilde", "u1EBD",
- "etildebelow", "u1E1B",
- "etnahtafoukhhebrew", "u0591",
- "etnahtafoukhlefthebrew", "u0591",
- "etnahtahebrew", "u0591",
- "etnahtalefthebrew", "u0591",
- "eturned", "u01DD",
- "eukorean", "u3161",
- "euro", "u20AC",
- "evowelsignbengali", "u09C7",
- "evowelsigndeva", "u0947",
- "evowelsigngujarati", "u0AC7",
- "exclam", "u0021",
- "exclamarmenian", "u055C",
- "exclamdbl", "u203C",
- "exclamdown", "u00A1",
- "exclammonospace", "uFF01",
- "existential", "u2203",
- "ezh", "u0292",
- "ezhcaron", "u01EF",
- "ezhcurl", "u0293",
- "ezhreversed", "u01B9",
- "ezhtail", "u01BA",
- "f", "u0066",
- "fadeva", "u095E",
- "fagurmukhi", "u0A5E",
- "fahrenheit", "u2109",
- "fathaarabic", "u064E",
- "fathalowarabic", "u064E",
- "fathatanarabic", "u064B",
- "fbopomofo", "u3108",
- "fcircle", "u24D5",
- "fdotaccent", "u1E1F",
- "feharabic", "u0641",
- "feharmenian", "u0586",
- "fehfinalarabic", "uFED2",
- "fehinitialarabic", "uFED3",
- "fehmedialarabic", "uFED4",
- "feicoptic", "u03E5",
- "female", "u2640",
- "ff", "uFB00",
- "ffi", "uFB03",
- "ffl", "uFB04",
- "fi", "uFB01",
- "fifteencircle", "u246E",
- "fifteenparen", "u2482",
- "fifteenperiod", "u2496",
- "figuredash", "u2012",
- "filledbox", "u25A0",
- "filledrect", "u25AC",
- "finalkaf", "u05DA",
- "finalkafdagesh", "uFB3A",
- "finalkafdageshhebrew", "uFB3A",
- "finalkafhebrew", "u05DA",
- "finalkafqamats", "u05DA_05B8",
- "finalkafqamatshebrew", "u05DA_05B8",
- "finalkafsheva", "u05DA_05B0",
- "finalkafshevahebrew", "u05DA_05B0",
- "finalmem", "u05DD",
- "finalmemhebrew", "u05DD",
- "finalnun", "u05DF",
- "finalnunhebrew", "u05DF",
- "finalpe", "u05E3",
- "finalpehebrew", "u05E3",
- "finaltsadi", "u05E5",
- "finaltsadihebrew", "u05E5",
- "firsttonechinese", "u02C9",
- "fisheye", "u25C9",
- "fitacyrillic", "u0473",
- "five", "u0035",
- "fivearabic", "u0665",
- "fivebengali", "u09EB",
- "fivecircle", "u2464",
- "fivecircleinversesansserif", "u278E",
- "fivedeva", "u096B",
- "fiveeighths", "u215D",
- "fivegujarati", "u0AEB",
- "fivegurmukhi", "u0A6B",
- "fivehackarabic", "u0665",
- "fivehangzhou", "u3025",
- "fiveideographicparen", "u3224",
- "fiveinferior", "u2085",
- "fivemonospace", "uFF15",
- "fiveparen", "u2478",
- "fiveperiod", "u248C",
- "fivepersian", "u06F5",
- "fiveroman", "u2174",
- "fivesuperior", "u2075",
- "fivethai", "u0E55",
- "fl", "uFB02",
- "florin", "u0192",
- "fmonospace", "uFF46",
- "fmsquare", "u3399",
- "fofanthai", "u0E1F",
- "fofathai", "u0E1D",
- "fongmanthai", "u0E4F",
- "forall", "u2200",
- "four", "u0034",
- "fourarabic", "u0664",
- "fourbengali", "u09EA",
- "fourcircle", "u2463",
- "fourcircleinversesansserif", "u278D",
- "fourdeva", "u096A",
- "fourgujarati", "u0AEA",
- "fourgurmukhi", "u0A6A",
- "fourhackarabic", "u0664",
- "fourhangzhou", "u3024",
- "fourideographicparen", "u3223",
- "fourinferior", "u2084",
- "fourmonospace", "uFF14",
- "fournumeratorbengali", "u09F7",
- "fourparen", "u2477",
- "fourperiod", "u248B",
- "fourpersian", "u06F4",
- "fourroman", "u2173",
- "foursuperior", "u2074",
- "fourteencircle", "u246D",
- "fourteenparen", "u2481",
- "fourteenperiod", "u2495",
- "fourthai", "u0E54",
- "fourthtonechinese", "u02CB",
- "fparen", "u24A1",
- "fraction", "u2044",
- "franc", "u20A3",
- "g", "u0067",
- "gabengali", "u0997",
- "gacute", "u01F5",
- "gadeva", "u0917",
- "gafarabic", "u06AF",
- "gaffinalarabic", "uFB93",
- "gafinitialarabic", "uFB94",
- "gafmedialarabic", "uFB95",
- "gagujarati", "u0A97",
- "gagurmukhi", "u0A17",
- "gahiragana", "u304C",
- "gakatakana", "u30AC",
- "gamma", "u03B3",
- "gammalatinsmall", "u0263",
- "gammasuperior", "u02E0",
- "gangiacoptic", "u03EB",
- "gbopomofo", "u310D",
- "gbreve", "u011F",
- "gcaron", "u01E7",
- "gcedilla", "u0123",
- "gcircle", "u24D6",
- "gcircumflex", "u011D",
- "gcommaaccent", "u0123",
- "gdot", "u0121",
- "gdotaccent", "u0121",
- "gecyrillic", "u0433",
- "gehiragana", "u3052",
- "gekatakana", "u30B2",
- "geometricallyequal", "u2251",
- "gereshaccenthebrew", "u059C",
- "gereshhebrew", "u05F3",
- "gereshmuqdamhebrew", "u059D",
- "germandbls", "u00DF",
- "gershayimaccenthebrew", "u059E",
- "gershayimhebrew", "u05F4",
- "getamark", "u3013",
- "ghabengali", "u0998",
- "ghadarmenian", "u0572",
- "ghadeva", "u0918",
- "ghagujarati", "u0A98",
- "ghagurmukhi", "u0A18",
- "ghainarabic", "u063A",
- "ghainfinalarabic", "uFECE",
- "ghaininitialarabic", "uFECF",
- "ghainmedialarabic", "uFED0",
- "ghemiddlehookcyrillic", "u0495",
- "ghestrokecyrillic", "u0493",
- "gheupturncyrillic", "u0491",
- "ghhadeva", "u095A",
- "ghhagurmukhi", "u0A5A",
- "ghook", "u0260",
- "ghzsquare", "u3393",
- "gihiragana", "u304E",
- "gikatakana", "u30AE",
- "gimarmenian", "u0563",
- "gimel", "u05D2",
- "gimeldagesh", "uFB32",
- "gimeldageshhebrew", "uFB32",
- "gimelhebrew", "u05D2",
- "gjecyrillic", "u0453",
- "glottalinvertedstroke", "u01BE",
- "glottalstop", "u0294",
- "glottalstopinverted", "u0296",
- "glottalstopmod", "u02C0",
- "glottalstopreversed", "u0295",
- "glottalstopreversedmod", "u02C1",
- "glottalstopreversedsuperior", "u02E4",
- "glottalstopstroke", "u02A1",
- "glottalstopstrokereversed", "u02A2",
- "gmacron", "u1E21",
- "gmonospace", "uFF47",
- "gohiragana", "u3054",
- "gokatakana", "u30B4",
- "gparen", "u24A2",
- "gpasquare", "u33AC",
- "gradient", "u2207",
- "grave", "u0060",
- "gravebelowcmb", "u0316",
- "gravecmb", "u0300",
- "gravecomb", "u0300",
- "gravedeva", "u0953",
- "gravelowmod", "u02CE",
- "gravemonospace", "uFF40",
- "gravetonecmb", "u0340",
- "greater", "u003E",
- "greaterequal", "u2265",
- "greaterequalorless", "u22DB",
- "greatermonospace", "uFF1E",
- "greaterorequivalent", "u2273",
- "greaterorless", "u2277",
- "greateroverequal", "u2267",
- "greatersmall", "uFE65",
- "gscript", "u0261",
- "gstroke", "u01E5",
- "guhiragana", "u3050",
- "guillemotleft", "u00AB",
- "guillemotright", "u00BB",
- "guilsinglleft", "u2039",
- "guilsinglright", "u203A",
- "gukatakana", "u30B0",
- "guramusquare", "u3318",
- "gysquare", "u33C9",
- "h", "u0068",
- "haabkhasiancyrillic", "u04A9",
- "haaltonearabic", "u06C1",
- "habengali", "u09B9",
- "hadescendercyrillic", "u04B3",
- "hadeva", "u0939",
- "hagujarati", "u0AB9",
- "hagurmukhi", "u0A39",
- "haharabic", "u062D",
- "hahfinalarabic", "uFEA2",
- "hahinitialarabic", "uFEA3",
- "hahiragana", "u306F",
- "hahmedialarabic", "uFEA4",
- "haitusquare", "u332A",
- "hakatakana", "u30CF",
- "hakatakanahalfwidth", "uFF8A",
- "halantgurmukhi", "u0A4D",
- "hamzaarabic", "u0621",
- "hamzadammaarabic", "u0621_064F",
- "hamzadammatanarabic", "u0621_064C",
- "hamzafathaarabic", "u0621_064E",
- "hamzafathatanarabic", "u0621_064B",
- "hamzalowarabic", "u0621",
- "hamzalowkasraarabic", "u0621_0650",
- "hamzalowkasratanarabic", "u0621_064D",
- "hamzasukunarabic", "u0621_0652",
- "hangulfiller", "u3164",
- "hardsigncyrillic", "u044A",
- "harpoonleftbarbup", "u21BC",
- "harpoonrightbarbup", "u21C0",
- "hasquare", "u33CA",
- "hatafpatah", "u05B2",
- "hatafpatah16", "u05B2",
- "hatafpatah23", "u05B2",
- "hatafpatah2f", "u05B2",
- "hatafpatahhebrew", "u05B2",
- "hatafpatahnarrowhebrew", "u05B2",
- "hatafpatahquarterhebrew", "u05B2",
- "hatafpatahwidehebrew", "u05B2",
- "hatafqamats", "u05B3",
- "hatafqamats1b", "u05B3",
- "hatafqamats28", "u05B3",
- "hatafqamats34", "u05B3",
- "hatafqamatshebrew", "u05B3",
- "hatafqamatsnarrowhebrew", "u05B3",
- "hatafqamatsquarterhebrew", "u05B3",
- "hatafqamatswidehebrew", "u05B3",
- "hatafsegol", "u05B1",
- "hatafsegol17", "u05B1",
- "hatafsegol24", "u05B1",
- "hatafsegol30", "u05B1",
- "hatafsegolhebrew", "u05B1",
- "hatafsegolnarrowhebrew", "u05B1",
- "hatafsegolquarterhebrew", "u05B1",
- "hatafsegolwidehebrew", "u05B1",
- "hbar", "u0127",
- "hbopomofo", "u310F",
- "hbrevebelow", "u1E2B",
- "hcedilla", "u1E29",
- "hcircle", "u24D7",
- "hcircumflex", "u0125",
- "hdieresis", "u1E27",
- "hdotaccent", "u1E23",
- "hdotbelow", "u1E25",
- "he", "u05D4",
- "heart", "u2665",
- "heartsuitblack", "u2665",
- "heartsuitwhite", "u2661",
- "hedagesh", "uFB34",
- "hedageshhebrew", "uFB34",
- "hehaltonearabic", "u06C1",
- "heharabic", "u0647",
- "hehebrew", "u05D4",
- "hehfinalaltonearabic", "uFBA7",
- "hehfinalalttwoarabic", "uFEEA",
- "hehfinalarabic", "uFEEA",
- "hehhamzaabovefinalarabic", "uFBA5",
- "hehhamzaaboveisolatedarabic", "uFBA4",
- "hehinitialaltonearabic", "uFBA8",
- "hehinitialarabic", "uFEEB",
- "hehiragana", "u3078",
- "hehmedialaltonearabic", "uFBA9",
- "hehmedialarabic", "uFEEC",
- "heiseierasquare", "u337B",
- "hekatakana", "u30D8",
- "hekatakanahalfwidth", "uFF8D",
- "hekutaarusquare", "u3336",
- "henghook", "u0267",
- "herutusquare", "u3339",
- "het", "u05D7",
- "hethebrew", "u05D7",
- "hhook", "u0266",
- "hhooksuperior", "u02B1",
- "hieuhacirclekorean", "u327B",
- "hieuhaparenkorean", "u321B",
- "hieuhcirclekorean", "u326D",
- "hieuhkorean", "u314E",
- "hieuhparenkorean", "u320D",
- "hihiragana", "u3072",
- "hikatakana", "u30D2",
- "hikatakanahalfwidth", "uFF8B",
- "hiriq", "u05B4",
- "hiriq14", "u05B4",
- "hiriq21", "u05B4",
- "hiriq2d", "u05B4",
- "hiriqhebrew", "u05B4",
- "hiriqnarrowhebrew", "u05B4",
- "hiriqquarterhebrew", "u05B4",
- "hiriqwidehebrew", "u05B4",
- "hlinebelow", "u1E96",
- "hmonospace", "uFF48",
- "hoarmenian", "u0570",
- "hohipthai", "u0E2B",
- "hohiragana", "u307B",
- "hokatakana", "u30DB",
- "hokatakanahalfwidth", "uFF8E",
- "holam", "u05B9",
- "holam19", "u05B9",
- "holam26", "u05B9",
- "holam32", "u05B9",
- "holamhebrew", "u05B9",
- "holamnarrowhebrew", "u05B9",
- "holamquarterhebrew", "u05B9",
- "holamwidehebrew", "u05B9",
- "honokhukthai", "u0E2E",
- "hookabovecomb", "u0309",
- "hookcmb", "u0309",
- "hookpalatalizedbelowcmb", "u0321",
- "hookretroflexbelowcmb", "u0322",
- "hoonsquare", "u3342",
- "horicoptic", "u03E9",
- "horizontalbar", "u2015",
- "horncmb", "u031B",
- "hotsprings", "u2668",
- "house", "u2302",
- "hparen", "u24A3",
- "hsuperior", "u02B0",
- "hturned", "u0265",
- "huhiragana", "u3075",
- "huiitosquare", "u3333",
- "hukatakana", "u30D5",
- "hukatakanahalfwidth", "uFF8C",
- "hungarumlaut", "u02DD",
- "hungarumlautcmb", "u030B",
- "hv", "u0195",
- "hyphen", "u002D",
- "hyphenmonospace", "uFF0D",
- "hyphensmall", "uFE63",
- "hyphentwo", "u2010",
- "i", "u0069",
- "iacute", "u00ED",
- "iacyrillic", "u044F",
- "ibengali", "u0987",
- "ibopomofo", "u3127",
- "ibreve", "u012D",
- "icaron", "u01D0",
- "icircle", "u24D8",
- "icircumflex", "u00EE",
- "icyrillic", "u0456",
- "idblgrave", "u0209",
- "ideographearthcircle", "u328F",
- "ideographfirecircle", "u328B",
- "ideographicallianceparen", "u323F",
- "ideographiccallparen", "u323A",
- "ideographiccentrecircle", "u32A5",
- "ideographicclose", "u3006",
- "ideographiccomma", "u3001",
- "ideographiccommaleft", "uFF64",
- "ideographiccongratulationparen", "u3237",
- "ideographiccorrectcircle", "u32A3",
- "ideographicearthparen", "u322F",
- "ideographicenterpriseparen", "u323D",
- "ideographicexcellentcircle", "u329D",
- "ideographicfestivalparen", "u3240",
- "ideographicfinancialcircle", "u3296",
- "ideographicfinancialparen", "u3236",
- "ideographicfireparen", "u322B",
- "ideographichaveparen", "u3232",
- "ideographichighcircle", "u32A4",
- "ideographiciterationmark", "u3005",
- "ideographiclaborcircle", "u3298",
- "ideographiclaborparen", "u3238",
- "ideographicleftcircle", "u32A7",
- "ideographiclowcircle", "u32A6",
- "ideographicmedicinecircle", "u32A9",
- "ideographicmetalparen", "u322E",
- "ideographicmoonparen", "u322A",
- "ideographicnameparen", "u3234",
- "ideographicperiod", "u3002",
- "ideographicprintcircle", "u329E",
- "ideographicreachparen", "u3243",
- "ideographicrepresentparen", "u3239",
- "ideographicresourceparen", "u323E",
- "ideographicrightcircle", "u32A8",
- "ideographicsecretcircle", "u3299",
- "ideographicselfparen", "u3242",
- "ideographicsocietyparen", "u3233",
- "ideographicspace", "u3000",
- "ideographicspecialparen", "u3235",
- "ideographicstockparen", "u3231",
- "ideographicstudyparen", "u323B",
- "ideographicsunparen", "u3230",
- "ideographicsuperviseparen", "u323C",
- "ideographicwaterparen", "u322C",
- "ideographicwoodparen", "u322D",
- "ideographiczero", "u3007",
- "ideographmetalcircle", "u328E",
- "ideographmooncircle", "u328A",
- "ideographnamecircle", "u3294",
- "ideographsuncircle", "u3290",
- "ideographwatercircle", "u328C",
- "ideographwoodcircle", "u328D",
- "ideva", "u0907",
- "idieresis", "u00EF",
- "idieresisacute", "u1E2F",
- "idieresiscyrillic", "u04E5",
- "idotbelow", "u1ECB",
- "iebrevecyrillic", "u04D7",
- "iecyrillic", "u0435",
- "ieungacirclekorean", "u3275",
- "ieungaparenkorean", "u3215",
- "ieungcirclekorean", "u3267",
- "ieungkorean", "u3147",
- "ieungparenkorean", "u3207",
- "igrave", "u00EC",
- "igujarati", "u0A87",
- "igurmukhi", "u0A07",
- "ihiragana", "u3044",
- "ihookabove", "u1EC9",
- "iibengali", "u0988",
- "iicyrillic", "u0438",
- "iideva", "u0908",
- "iigujarati", "u0A88",
- "iigurmukhi", "u0A08",
- "iimatragurmukhi", "u0A40",
- "iinvertedbreve", "u020B",
- "iishortcyrillic", "u0439",
- "iivowelsignbengali", "u09C0",
- "iivowelsigndeva", "u0940",
- "iivowelsigngujarati", "u0AC0",
- "ij", "u0133",
- "ikatakana", "u30A4",
- "ikatakanahalfwidth", "uFF72",
- "ikorean", "u3163",
- "ilde", "u02DC",
- "iluyhebrew", "u05AC",
- "imacron", "u012B",
- "imacroncyrillic", "u04E3",
- "imageorapproximatelyequal", "u2253",
- "imatragurmukhi", "u0A3F",
- "imonospace", "uFF49",
- "increment", "u2206",
- "infinity", "u221E",
- "iniarmenian", "u056B",
- "integral", "u222B",
- "integralbottom", "u2321",
- "integralbt", "u2321",
- "integraltop", "u2320",
- "integraltp", "u2320",
- "intersection", "u2229",
- "intisquare", "u3305",
- "invbullet", "u25D8",
- "invcircle", "u25D9",
- "invsmileface", "u263B",
- "iocyrillic", "u0451",
- "iogonek", "u012F",
- "iota", "u03B9",
- "iotadieresis", "u03CA",
- "iotadieresistonos", "u0390",
- "iotalatin", "u0269",
- "iotatonos", "u03AF",
- "iparen", "u24A4",
- "irigurmukhi", "u0A72",
- "ismallhiragana", "u3043",
- "ismallkatakana", "u30A3",
- "ismallkatakanahalfwidth", "uFF68",
- "issharbengali", "u09FA",
- "istroke", "u0268",
- "iterationhiragana", "u309D",
- "iterationkatakana", "u30FD",
- "itilde", "u0129",
- "itildebelow", "u1E2D",
- "iubopomofo", "u3129",
- "iucyrillic", "u044E",
- "ivowelsignbengali", "u09BF",
- "ivowelsigndeva", "u093F",
- "ivowelsigngujarati", "u0ABF",
- "izhitsacyrillic", "u0475",
- "izhitsadblgravecyrillic", "u0477",
- "j", "u006A",
- "jaarmenian", "u0571",
- "jabengali", "u099C",
- "jadeva", "u091C",
- "jagujarati", "u0A9C",
- "jagurmukhi", "u0A1C",
- "jbopomofo", "u3110",
- "jcaron", "u01F0",
- "jcircle", "u24D9",
- "jcircumflex", "u0135",
- "jcrossedtail", "u029D",
- "jdotlessstroke", "u025F",
- "jecyrillic", "u0458",
- "jeemarabic", "u062C",
- "jeemfinalarabic", "uFE9E",
- "jeeminitialarabic", "uFE9F",
- "jeemmedialarabic", "uFEA0",
- "jeharabic", "u0698",
- "jehfinalarabic", "uFB8B",
- "jhabengali", "u099D",
- "jhadeva", "u091D",
- "jhagujarati", "u0A9D",
- "jhagurmukhi", "u0A1D",
- "jheharmenian", "u057B",
- "jis", "u3004",
- "jmonospace", "uFF4A",
- "jparen", "u24A5",
- "jsuperior", "u02B2",
- "k", "u006B",
- "kabashkircyrillic", "u04A1",
- "kabengali", "u0995",
- "kacute", "u1E31",
- "kacyrillic", "u043A",
- "kadescendercyrillic", "u049B",
- "kadeva", "u0915",
- "kaf", "u05DB",
- "kafarabic", "u0643",
- "kafdagesh", "uFB3B",
- "kafdageshhebrew", "uFB3B",
- "kaffinalarabic", "uFEDA",
- "kafhebrew", "u05DB",
- "kafinitialarabic", "uFEDB",
- "kafmedialarabic", "uFEDC",
- "kafrafehebrew", "uFB4D",
- "kagujarati", "u0A95",
- "kagurmukhi", "u0A15",
- "kahiragana", "u304B",
- "kahookcyrillic", "u04C4",
- "kakatakana", "u30AB",
- "kakatakanahalfwidth", "uFF76",
- "kappa", "u03BA",
- "kappasymbolgreek", "u03F0",
- "kapyeounmieumkorean", "u3171",
- "kapyeounphieuphkorean", "u3184",
- "kapyeounpieupkorean", "u3178",
- "kapyeounssangpieupkorean", "u3179",
- "karoriisquare", "u330D",
- "kashidaautoarabic", "u0640",
- "kashidaautonosidebearingarabic", "u0640",
- "kasmallkatakana", "u30F5",
- "kasquare", "u3384",
- "kasraarabic", "u0650",
- "kasratanarabic", "u064D",
- "kastrokecyrillic", "u049F",
- "katahiraprolongmarkhalfwidth", "uFF70",
- "kaverticalstrokecyrillic", "u049D",
- "kbopomofo", "u310E",
- "kcalsquare", "u3389",
- "kcaron", "u01E9",
- "kcedilla", "u0137",
- "kcircle", "u24DA",
- "kcommaaccent", "u0137",
- "kdotbelow", "u1E33",
- "keharmenian", "u0584",
- "kehiragana", "u3051",
- "kekatakana", "u30B1",
- "kekatakanahalfwidth", "uFF79",
- "kenarmenian", "u056F",
- "kesmallkatakana", "u30F6",
- "kgreenlandic", "u0138",
- "khabengali", "u0996",
- "khacyrillic", "u0445",
- "khadeva", "u0916",
- "khagujarati", "u0A96",
- "khagurmukhi", "u0A16",
- "khaharabic", "u062E",
- "khahfinalarabic", "uFEA6",
- "khahinitialarabic", "uFEA7",
- "khahmedialarabic", "uFEA8",
- "kheicoptic", "u03E7",
- "khhadeva", "u0959",
- "khhagurmukhi", "u0A59",
- "khieukhacirclekorean", "u3278",
- "khieukhaparenkorean", "u3218",
- "khieukhcirclekorean", "u326A",
- "khieukhkorean", "u314B",
- "khieukhparenkorean", "u320A",
- "khokhaithai", "u0E02",
- "khokhonthai", "u0E05",
- "khokhuatthai", "u0E03",
- "khokhwaithai", "u0E04",
- "khomutthai", "u0E5B",
- "khook", "u0199",
- "khorakhangthai", "u0E06",
- "khzsquare", "u3391",
- "kihiragana", "u304D",
- "kikatakana", "u30AD",
- "kikatakanahalfwidth", "uFF77",
- "kiroguramusquare", "u3315",
- "kiromeetorusquare", "u3316",
- "kirosquare", "u3314",
- "kiyeokacirclekorean", "u326E",
- "kiyeokaparenkorean", "u320E",
- "kiyeokcirclekorean", "u3260",
- "kiyeokkorean", "u3131",
- "kiyeokparenkorean", "u3200",
- "kiyeoksioskorean", "u3133",
- "kjecyrillic", "u045C",
- "klinebelow", "u1E35",
- "klsquare", "u3398",
- "kmcubedsquare", "u33A6",
- "kmonospace", "uFF4B",
- "kmsquaredsquare", "u33A2",
- "kohiragana", "u3053",
- "kohmsquare", "u33C0",
- "kokaithai", "u0E01",
- "kokatakana", "u30B3",
- "kokatakanahalfwidth", "uFF7A",
- "kooposquare", "u331E",
- "koppacyrillic", "u0481",
- "koreanstandardsymbol", "u327F",
- "koroniscmb", "u0343",
- "kparen", "u24A6",
- "kpasquare", "u33AA",
- "ksicyrillic", "u046F",
- "ktsquare", "u33CF",
- "kturned", "u029E",
- "kuhiragana", "u304F",
- "kukatakana", "u30AF",
- "kukatakanahalfwidth", "uFF78",
- "kvsquare", "u33B8",
- "kwsquare", "u33BE",
- "l", "u006C",
- "labengali", "u09B2",
- "lacute", "u013A",
- "ladeva", "u0932",
- "lagujarati", "u0AB2",
- "lagurmukhi", "u0A32",
- "lakkhangyaothai", "u0E45",
- "lamaleffinalarabic", "uFEFC",
- "lamalefhamzaabovefinalarabic", "uFEF8",
- "lamalefhamzaaboveisolatedarabic", "uFEF7",
- "lamalefhamzabelowfinalarabic", "uFEFA",
- "lamalefhamzabelowisolatedarabic", "uFEF9",
- "lamalefisolatedarabic", "uFEFB",
- "lamalefmaddaabovefinalarabic", "uFEF6",
- "lamalefmaddaaboveisolatedarabic", "uFEF5",
- "lamarabic", "u0644",
- "lambda", "u03BB",
- "lambdastroke", "u019B",
- "lamed", "u05DC",
- "lameddagesh", "uFB3C",
- "lameddageshhebrew", "uFB3C",
- "lamedhebrew", "u05DC",
- "lamedholam", "u05DC_05B9",
- "lamedholamdagesh", "u05DC_05B9_05BC",
- "lamedholamdageshhebrew", "u05DC_05B9_05BC",
- "lamedholamhebrew", "u05DC_05B9",
- "lamfinalarabic", "uFEDE",
- "lamhahinitialarabic", "uFCCA",
- "laminitialarabic", "uFEDF",
- "lamjeeminitialarabic", "uFCC9",
- "lamkhahinitialarabic", "uFCCB",
- "lamlamhehisolatedarabic", "uFDF2",
- "lammedialarabic", "uFEE0",
- "lammeemhahinitialarabic", "uFD88",
- "lammeeminitialarabic", "uFCCC",
- "lammeemjeeminitialarabic", "uFEDF_FEE4_FEA0",
- "lammeemkhahinitialarabic", "uFEDF_FEE4_FEA8",
- "largecircle", "u25EF",
- "lbar", "u019A",
- "lbelt", "u026C",
- "lbopomofo", "u310C",
- "lcaron", "u013E",
- "lcedilla", "u013C",
- "lcircle", "u24DB",
- "lcircumflexbelow", "u1E3D",
- "lcommaaccent", "u013C",
- "ldot", "u0140",
- "ldotaccent", "u0140",
- "ldotbelow", "u1E37",
- "ldotbelowmacron", "u1E39",
- "leftangleabovecmb", "u031A",
- "lefttackbelowcmb", "u0318",
- "less", "u003C",
- "lessequal", "u2264",
- "lessequalorgreater", "u22DA",
- "lessmonospace", "uFF1C",
- "lessorequivalent", "u2272",
- "lessorgreater", "u2276",
- "lessoverequal", "u2266",
- "lesssmall", "uFE64",
- "lezh", "u026E",
- "lfblock", "u258C",
- "lhookretroflex", "u026D",
- "lira", "u20A4",
- "liwnarmenian", "u056C",
- "lj", "u01C9",
- "ljecyrillic", "u0459",
- "lladeva", "u0933",
- "llagujarati", "u0AB3",
- "llinebelow", "u1E3B",
- "llladeva", "u0934",
- "llvocalicbengali", "u09E1",
- "llvocalicdeva", "u0961",
- "llvocalicvowelsignbengali", "u09E3",
- "llvocalicvowelsigndeva", "u0963",
- "lmiddletilde", "u026B",
- "lmonospace", "uFF4C",
- "lmsquare", "u33D0",
- "lochulathai", "u0E2C",
- "logicaland", "u2227",
- "logicalnot", "u00AC",
- "logicalnotreversed", "u2310",
- "logicalor", "u2228",
- "lolingthai", "u0E25",
- "longs", "u017F",
- "lowlinecenterline", "uFE4E",
- "lowlinecmb", "u0332",
- "lowlinedashed", "uFE4D",
- "lozenge", "u25CA",
- "lparen", "u24A7",
- "lslash", "u0142",
- "lsquare", "u2113",
- "ltshade", "u2591",
- "luthai", "u0E26",
- "lvocalicbengali", "u098C",
- "lvocalicdeva", "u090C",
- "lvocalicvowelsignbengali", "u09E2",
- "lvocalicvowelsigndeva", "u0962",
- "lxsquare", "u33D3",
- "m", "u006D",
- "mabengali", "u09AE",
- "macron", "u00AF",
- "macronbelowcmb", "u0331",
- "macroncmb", "u0304",
- "macronlowmod", "u02CD",
- "macronmonospace", "uFFE3",
- "macute", "u1E3F",
- "madeva", "u092E",
- "magujarati", "u0AAE",
- "magurmukhi", "u0A2E",
- "mahapakhhebrew", "u05A4",
- "mahapakhlefthebrew", "u05A4",
- "mahiragana", "u307E",
- "maichattawathai", "u0E4B",
- "maiekthai", "u0E48",
- "maihanakatthai", "u0E31",
- "maitaikhuthai", "u0E47",
- "maithothai", "u0E49",
- "maitrithai", "u0E4A",
- "maiyamokthai", "u0E46",
- "makatakana", "u30DE",
- "makatakanahalfwidth", "uFF8F",
- "male", "u2642",
- "mansyonsquare", "u3347",
- "maqafhebrew", "u05BE",
- "mars", "u2642",
- "masoracirclehebrew", "u05AF",
- "masquare", "u3383",
- "mbopomofo", "u3107",
- "mbsquare", "u33D4",
- "mcircle", "u24DC",
- "mcubedsquare", "u33A5",
- "mdotaccent", "u1E41",
- "mdotbelow", "u1E43",
- "meemarabic", "u0645",
- "meemfinalarabic", "uFEE2",
- "meeminitialarabic", "uFEE3",
- "meemmedialarabic", "uFEE4",
- "meemmeeminitialarabic", "uFCD1",
- "meemmeemisolatedarabic", "uFC48",
- "meetorusquare", "u334D",
- "mehiragana", "u3081",
- "meizierasquare", "u337E",
- "mekatakana", "u30E1",
- "mekatakanahalfwidth", "uFF92",
- "mem", "u05DE",
- "memdagesh", "uFB3E",
- "memdageshhebrew", "uFB3E",
- "memhebrew", "u05DE",
- "menarmenian", "u0574",
- "merkhahebrew", "u05A5",
- "merkhakefulahebrew", "u05A6",
- "merkhakefulalefthebrew", "u05A6",
- "merkhalefthebrew", "u05A5",
- "mhook", "u0271",
- "mhzsquare", "u3392",
- "middledotkatakanahalfwidth", "uFF65",
- "middot", "u00B7",
- "mieumacirclekorean", "u3272",
- "mieumaparenkorean", "u3212",
- "mieumcirclekorean", "u3264",
- "mieumkorean", "u3141",
- "mieumpansioskorean", "u3170",
- "mieumparenkorean", "u3204",
- "mieumpieupkorean", "u316E",
- "mieumsioskorean", "u316F",
- "mihiragana", "u307F",
- "mikatakana", "u30DF",
- "mikatakanahalfwidth", "uFF90",
- "minus", "u2212",
- "minusbelowcmb", "u0320",
- "minuscircle", "u2296",
- "minusmod", "u02D7",
- "minusplus", "u2213",
- "minute", "u2032",
- "miribaarusquare", "u334A",
- "mirisquare", "u3349",
- "mlonglegturned", "u0270",
- "mlsquare", "u3396",
- "mmcubedsquare", "u33A3",
- "mmonospace", "uFF4D",
- "mmsquaredsquare", "u339F",
- "mohiragana", "u3082",
- "mohmsquare", "u33C1",
- "mokatakana", "u30E2",
- "mokatakanahalfwidth", "uFF93",
- "molsquare", "u33D6",
- "momathai", "u0E21",
- "moverssquare", "u33A7",
- "moverssquaredsquare", "u33A8",
- "mparen", "u24A8",
- "mpasquare", "u33AB",
- "mssquare", "u33B3",
- "mturned", "u026F",
- "mu", "u00B5",
- "mu1", "u00B5",
- "muasquare", "u3382",
- "muchgreater", "u226B",
- "muchless", "u226A",
- "mufsquare", "u338C",
- "mugreek", "u03BC",
- "mugsquare", "u338D",
- "muhiragana", "u3080",
- "mukatakana", "u30E0",
- "mukatakanahalfwidth", "uFF91",
- "mulsquare", "u3395",
- "multiply", "u00D7",
- "mumsquare", "u339B",
- "munahhebrew", "u05A3",
- "munahlefthebrew", "u05A3",
- "musicalnote", "u266A",
- "musicalnotedbl", "u266B",
- "musicflatsign", "u266D",
- "musicsharpsign", "u266F",
- "mussquare", "u33B2",
- "muvsquare", "u33B6",
- "muwsquare", "u33BC",
- "mvmegasquare", "u33B9",
- "mvsquare", "u33B7",
- "mwmegasquare", "u33BF",
- "mwsquare", "u33BD",
- "n", "u006E",
- "nabengali", "u09A8",
- "nabla", "u2207",
- "nacute", "u0144",
- "nadeva", "u0928",
- "nagujarati", "u0AA8",
- "nagurmukhi", "u0A28",
- "nahiragana", "u306A",
- "nakatakana", "u30CA",
- "nakatakanahalfwidth", "uFF85",
- "napostrophe", "u0149",
- "nasquare", "u3381",
- "nbopomofo", "u310B",
- "nbspace", "u00A0",
- "ncaron", "u0148",
- "ncedilla", "u0146",
- "ncircle", "u24DD",
- "ncircumflexbelow", "u1E4B",
- "ncommaaccent", "u0146",
- "ndotaccent", "u1E45",
- "ndotbelow", "u1E47",
- "nehiragana", "u306D",
- "nekatakana", "u30CD",
- "nekatakanahalfwidth", "uFF88",
- "newsheqelsign", "u20AA",
- "nfsquare", "u338B",
- "ngabengali", "u0999",
- "ngadeva", "u0919",
- "ngagujarati", "u0A99",
- "ngagurmukhi", "u0A19",
- "ngonguthai", "u0E07",
- "nhiragana", "u3093",
- "nhookleft", "u0272",
- "nhookretroflex", "u0273",
- "nieunacirclekorean", "u326F",
- "nieunaparenkorean", "u320F",
- "nieuncieuckorean", "u3135",
- "nieuncirclekorean", "u3261",
- "nieunhieuhkorean", "u3136",
- "nieunkorean", "u3134",
- "nieunpansioskorean", "u3168",
- "nieunparenkorean", "u3201",
- "nieunsioskorean", "u3167",
- "nieuntikeutkorean", "u3166",
- "nihiragana", "u306B",
- "nikatakana", "u30CB",
- "nikatakanahalfwidth", "uFF86",
- "nikhahitthai", "u0E4D",
- "nine", "u0039",
- "ninearabic", "u0669",
- "ninebengali", "u09EF",
- "ninecircle", "u2468",
- "ninecircleinversesansserif", "u2792",
- "ninedeva", "u096F",
- "ninegujarati", "u0AEF",
- "ninegurmukhi", "u0A6F",
- "ninehackarabic", "u0669",
- "ninehangzhou", "u3029",
- "nineideographicparen", "u3228",
- "nineinferior", "u2089",
- "ninemonospace", "uFF19",
- "nineparen", "u247C",
- "nineperiod", "u2490",
- "ninepersian", "u06F9",
- "nineroman", "u2178",
- "ninesuperior", "u2079",
- "nineteencircle", "u2472",
- "nineteenparen", "u2486",
- "nineteenperiod", "u249A",
- "ninethai", "u0E59",
- "nj", "u01CC",
- "njecyrillic", "u045A",
- "nkatakana", "u30F3",
- "nkatakanahalfwidth", "uFF9D",
- "nlegrightlong", "u019E",
- "nlinebelow", "u1E49",
- "nmonospace", "uFF4E",
- "nmsquare", "u339A",
- "nnabengali", "u09A3",
- "nnadeva", "u0923",
- "nnagujarati", "u0AA3",
- "nnagurmukhi", "u0A23",
- "nnnadeva", "u0929",
- "nohiragana", "u306E",
- "nokatakana", "u30CE",
- "nokatakanahalfwidth", "uFF89",
- "nonbreakingspace", "u00A0",
- "nonenthai", "u0E13",
- "nonuthai", "u0E19",
- "noonarabic", "u0646",
- "noonfinalarabic", "uFEE6",
- "noonghunnaarabic", "u06BA",
- "noonghunnafinalarabic", "uFB9F",
- "noonhehinitialarabic", "uFEE7_FEEC",
- "nooninitialarabic", "uFEE7",
- "noonjeeminitialarabic", "uFCD2",
- "noonjeemisolatedarabic", "uFC4B",
- "noonmedialarabic", "uFEE8",
- "noonmeeminitialarabic", "uFCD5",
- "noonmeemisolatedarabic", "uFC4E",
- "noonnoonfinalarabic", "uFC8D",
- "notcontains", "u220C",
- "notelement", "u2209",
- "notelementof", "u2209",
- "notequal", "u2260",
- "notgreater", "u226F",
- "notgreaternorequal", "u2271",
- "notgreaternorless", "u2279",
- "notidentical", "u2262",
- "notless", "u226E",
- "notlessnorequal", "u2270",
- "notparallel", "u2226",
- "notprecedes", "u2280",
- "notsubset", "u2284",
- "notsucceeds", "u2281",
- "notsuperset", "u2285",
- "nowarmenian", "u0576",
- "nparen", "u24A9",
- "nssquare", "u33B1",
- "nsuperior", "u207F",
- "ntilde", "u00F1",
- "nu", "u03BD",
- "nuhiragana", "u306C",
- "nukatakana", "u30CC",
- "nukatakanahalfwidth", "uFF87",
- "nuktabengali", "u09BC",
- "nuktadeva", "u093C",
- "nuktagujarati", "u0ABC",
- "nuktagurmukhi", "u0A3C",
- "numbersign", "u0023",
- "numbersignmonospace", "uFF03",
- "numbersignsmall", "uFE5F",
- "numeralsigngreek", "u0374",
- "numeralsignlowergreek", "u0375",
- "numero", "u2116",
- "nun", "u05E0",
- "nundagesh", "uFB40",
- "nundageshhebrew", "uFB40",
- "nunhebrew", "u05E0",
- "nvsquare", "u33B5",
- "nwsquare", "u33BB",
- "nyabengali", "u099E",
- "nyadeva", "u091E",
- "nyagujarati", "u0A9E",
- "nyagurmukhi", "u0A1E",
- "o", "u006F",
- "oacute", "u00F3",
- "oangthai", "u0E2D",
- "obarred", "u0275",
- "obarredcyrillic", "u04E9",
- "obarreddieresiscyrillic", "u04EB",
- "obengali", "u0993",
- "obopomofo", "u311B",
- "obreve", "u014F",
- "ocandradeva", "u0911",
- "ocandragujarati", "u0A91",
- "ocandravowelsigndeva", "u0949",
- "ocandravowelsigngujarati", "u0AC9",
- "ocaron", "u01D2",
- "ocircle", "u24DE",
- "ocircumflex", "u00F4",
- "ocircumflexacute", "u1ED1",
- "ocircumflexdotbelow", "u1ED9",
- "ocircumflexgrave", "u1ED3",
- "ocircumflexhookabove", "u1ED5",
- "ocircumflextilde", "u1ED7",
- "ocyrillic", "u043E",
- "odblacute", "u0151",
- "odblgrave", "u020D",
- "odeva", "u0913",
- "odieresis", "u00F6",
- "odieresiscyrillic", "u04E7",
- "odotbelow", "u1ECD",
- "oe", "u0153",
- "oekorean", "u315A",
- "ogonek", "u02DB",
- "ogonekcmb", "u0328",
- "ograve", "u00F2",
- "ogujarati", "u0A93",
- "oharmenian", "u0585",
- "ohiragana", "u304A",
- "ohookabove", "u1ECF",
- "ohorn", "u01A1",
- "ohornacute", "u1EDB",
- "ohorndotbelow", "u1EE3",
- "ohorngrave", "u1EDD",
- "ohornhookabove", "u1EDF",
- "ohorntilde", "u1EE1",
- "ohungarumlaut", "u0151",
- "oi", "u01A3",
- "oinvertedbreve", "u020F",
- "okatakana", "u30AA",
- "okatakanahalfwidth", "uFF75",
- "okorean", "u3157",
- "olehebrew", "u05AB",
- "omacron", "u014D",
- "omacronacute", "u1E53",
- "omacrongrave", "u1E51",
- "omdeva", "u0950",
- "omega", "u03C9",
- "omega1", "u03D6",
- "omegacyrillic", "u0461",
- "omegalatinclosed", "u0277",
- "omegaroundcyrillic", "u047B",
- "omegatitlocyrillic", "u047D",
- "omegatonos", "u03CE",
- "omgujarati", "u0AD0",
- "omicron", "u03BF",
- "omicrontonos", "u03CC",
- "omonospace", "uFF4F",
- "one", "u0031",
- "onearabic", "u0661",
- "onebengali", "u09E7",
- "onecircle", "u2460",
- "onecircleinversesansserif", "u278A",
- "onedeva", "u0967",
- "onedotenleader", "u2024",
- "oneeighth", "u215B",
- "onegujarati", "u0AE7",
- "onegurmukhi", "u0A67",
- "onehackarabic", "u0661",
- "onehalf", "u00BD",
- "onehangzhou", "u3021",
- "oneideographicparen", "u3220",
- "oneinferior", "u2081",
- "onemonospace", "uFF11",
- "onenumeratorbengali", "u09F4",
- "oneparen", "u2474",
- "oneperiod", "u2488",
- "onepersian", "u06F1",
- "onequarter", "u00BC",
- "oneroman", "u2170",
- "onesuperior", "u00B9",
- "onethai", "u0E51",
- "onethird", "u2153",
- "oogonek", "u01EB",
- "oogonekmacron", "u01ED",
- "oogurmukhi", "u0A13",
- "oomatragurmukhi", "u0A4B",
- "oopen", "u0254",
- "oparen", "u24AA",
- "openbullet", "u25E6",
- "option", "u2325",
- "ordfeminine", "u00AA",
- "ordmasculine", "u00BA",
- "orthogonal", "u221F",
- "oshortdeva", "u0912",
- "oshortvowelsigndeva", "u094A",
- "oslash", "u00F8",
- "oslashacute", "u01FF",
- "osmallhiragana", "u3049",
- "osmallkatakana", "u30A9",
- "osmallkatakanahalfwidth", "uFF6B",
- "ostrokeacute", "u01FF",
- "otcyrillic", "u047F",
- "otilde", "u00F5",
- "otildeacute", "u1E4D",
- "otildedieresis", "u1E4F",
- "oubopomofo", "u3121",
- "overline", "u203E",
- "overlinecenterline", "uFE4A",
- "overlinecmb", "u0305",
- "overlinedashed", "uFE49",
- "overlinedblwavy", "uFE4C",
- "overlinewavy", "uFE4B",
- "overscore", "u00AF",
- "ovowelsignbengali", "u09CB",
- "ovowelsigndeva", "u094B",
- "ovowelsigngujarati", "u0ACB",
- "p", "u0070",
- "paampssquare", "u3380",
- "paasentosquare", "u332B",
- "pabengali", "u09AA",
- "pacute", "u1E55",
- "padeva", "u092A",
- "pagedown", "u21DF",
- "pageup", "u21DE",
- "pagujarati", "u0AAA",
- "pagurmukhi", "u0A2A",
- "pahiragana", "u3071",
- "paiyannoithai", "u0E2F",
- "pakatakana", "u30D1",
- "palatalizationcyrilliccmb", "u0484",
- "palochkacyrillic", "u04C0",
- "pansioskorean", "u317F",
- "paragraph", "u00B6",
- "parallel", "u2225",
- "parenleft", "u0028",
- "parenleftaltonearabic", "uFD3E",
- "parenleftinferior", "u208D",
- "parenleftmonospace", "uFF08",
- "parenleftsmall", "uFE59",
- "parenleftsuperior", "u207D",
- "parenleftvertical", "uFE35",
- "parenright", "u0029",
- "parenrightaltonearabic", "uFD3F",
- "parenrightinferior", "u208E",
- "parenrightmonospace", "uFF09",
- "parenrightsmall", "uFE5A",
- "parenrightsuperior", "u207E",
- "parenrightvertical", "uFE36",
- "partialdiff", "u2202",
- "paseqhebrew", "u05C0",
- "pashtahebrew", "u0599",
- "pasquare", "u33A9",
- "patah", "u05B7",
- "patah11", "u05B7",
- "patah1d", "u05B7",
- "patah2a", "u05B7",
- "patahhebrew", "u05B7",
- "patahnarrowhebrew", "u05B7",
- "patahquarterhebrew", "u05B7",
- "patahwidehebrew", "u05B7",
- "pazerhebrew", "u05A1",
- "pbopomofo", "u3106",
- "pcircle", "u24DF",
- "pdotaccent", "u1E57",
- "pe", "u05E4",
- "pecyrillic", "u043F",
- "pedagesh", "uFB44",
- "pedageshhebrew", "uFB44",
- "peezisquare", "u333B",
- "pefinaldageshhebrew", "uFB43",
- "peharabic", "u067E",
- "peharmenian", "u057A",
- "pehebrew", "u05E4",
- "pehfinalarabic", "uFB57",
- "pehinitialarabic", "uFB58",
- "pehiragana", "u307A",
- "pehmedialarabic", "uFB59",
- "pekatakana", "u30DA",
- "pemiddlehookcyrillic", "u04A7",
- "perafehebrew", "uFB4E",
- "percent", "u0025",
- "percentarabic", "u066A",
- "percentmonospace", "uFF05",
- "percentsmall", "uFE6A",
- "period", "u002E",
- "periodarmenian", "u0589",
- "periodcentered", "u00B7",
- "periodhalfwidth", "uFF61",
- "periodmonospace", "uFF0E",
- "periodsmall", "uFE52",
- "perispomenigreekcmb", "u0342",
- "perpendicular", "u22A5",
- "perthousand", "u2030",
- "peseta", "u20A7",
- "pfsquare", "u338A",
- "phabengali", "u09AB",
- "phadeva", "u092B",
- "phagujarati", "u0AAB",
- "phagurmukhi", "u0A2B",
- "phi", "u03C6",
- "phi1", "u03D5",
- "phieuphacirclekorean", "u327A",
- "phieuphaparenkorean", "u321A",
- "phieuphcirclekorean", "u326C",
- "phieuphkorean", "u314D",
- "phieuphparenkorean", "u320C",
- "philatin", "u0278",
- "phinthuthai", "u0E3A",
- "phisymbolgreek", "u03D5",
- "phook", "u01A5",
- "phophanthai", "u0E1E",
- "phophungthai", "u0E1C",
- "phosamphaothai", "u0E20",
- "pi", "u03C0",
- "pieupacirclekorean", "u3273",
- "pieupaparenkorean", "u3213",
- "pieupcieuckorean", "u3176",
- "pieupcirclekorean", "u3265",
- "pieupkiyeokkorean", "u3172",
- "pieupkorean", "u3142",
- "pieupparenkorean", "u3205",
- "pieupsioskiyeokkorean", "u3174",
- "pieupsioskorean", "u3144",
- "pieupsiostikeutkorean", "u3175",
- "pieupthieuthkorean", "u3177",
- "pieuptikeutkorean", "u3173",
- "pihiragana", "u3074",
- "pikatakana", "u30D4",
- "pisymbolgreek", "u03D6",
- "piwrarmenian", "u0583",
- "plus", "u002B",
- "plusbelowcmb", "u031F",
- "pluscircle", "u2295",
- "plusminus", "u00B1",
- "plusmod", "u02D6",
- "plusmonospace", "uFF0B",
- "plussmall", "uFE62",
- "plussuperior", "u207A",
- "pmonospace", "uFF50",
- "pmsquare", "u33D8",
- "pohiragana", "u307D",
- "pointingindexdownwhite", "u261F",
- "pointingindexleftwhite", "u261C",
- "pointingindexrightwhite", "u261E",
- "pointingindexupwhite", "u261D",
- "pokatakana", "u30DD",
- "poplathai", "u0E1B",
- "postalmark", "u3012",
- "postalmarkface", "u3020",
- "pparen", "u24AB",
- "precedes", "u227A",
- "prescription", "u211E",
- "primemod", "u02B9",
- "primereversed", "u2035",
- "product", "u220F",
- "projective", "u2305",
- "prolongedkana", "u30FC",
- "propellor", "u2318",
- "propersubset", "u2282",
- "propersuperset", "u2283",
- "proportion", "u2237",
- "proportional", "u221D",
- "psi", "u03C8",
- "psicyrillic", "u0471",
- "psilipneumatacyrilliccmb", "u0486",
- "pssquare", "u33B0",
- "puhiragana", "u3077",
- "pukatakana", "u30D7",
- "pvsquare", "u33B4",
- "pwsquare", "u33BA",
- "q", "u0071",
- "qadeva", "u0958",
- "qadmahebrew", "u05A8",
- "qafarabic", "u0642",
- "qaffinalarabic", "uFED6",
- "qafinitialarabic", "uFED7",
- "qafmedialarabic", "uFED8",
- "qamats", "u05B8",
- "qamats10", "u05B8",
- "qamats1a", "u05B8",
- "qamats1c", "u05B8",
- "qamats27", "u05B8",
- "qamats29", "u05B8",
- "qamats33", "u05B8",
- "qamatsde", "u05B8",
- "qamatshebrew", "u05B8",
- "qamatsnarrowhebrew", "u05B8",
- "qamatsqatanhebrew", "u05B8",
- "qamatsqatannarrowhebrew", "u05B8",
- "qamatsqatanquarterhebrew", "u05B8",
- "qamatsqatanwidehebrew", "u05B8",
- "qamatsquarterhebrew", "u05B8",
- "qamatswidehebrew", "u05B8",
- "qarneyparahebrew", "u059F",
- "qbopomofo", "u3111",
- "qcircle", "u24E0",
- "qhook", "u02A0",
- "qmonospace", "uFF51",
- "qof", "u05E7",
- "qofdagesh", "uFB47",
- "qofdageshhebrew", "uFB47",
- "qofhatafpatah", "u05E7_05B2",
- "qofhatafpatahhebrew", "u05E7_05B2",
- "qofhatafsegol", "u05E7_05B1",
- "qofhatafsegolhebrew", "u05E7_05B1",
- "qofhebrew", "u05E7",
- "qofhiriq", "u05E7_05B4",
- "qofhiriqhebrew", "u05E7_05B4",
- "qofholam", "u05E7_05B9",
- "qofholamhebrew", "u05E7_05B9",
- "qofpatah", "u05E7_05B7",
- "qofpatahhebrew", "u05E7_05B7",
- "qofqamats", "u05E7_05B8",
- "qofqamatshebrew", "u05E7_05B8",
- "qofqubuts", "u05E7_05BB",
- "qofqubutshebrew", "u05E7_05BB",
- "qofsegol", "u05E7_05B6",
- "qofsegolhebrew", "u05E7_05B6",
- "qofsheva", "u05E7_05B0",
- "qofshevahebrew", "u05E7_05B0",
- "qoftsere", "u05E7_05B5",
- "qoftserehebrew", "u05E7_05B5",
- "qparen", "u24AC",
- "quarternote", "u2669",
- "qubuts", "u05BB",
- "qubuts18", "u05BB",
- "qubuts25", "u05BB",
- "qubuts31", "u05BB",
- "qubutshebrew", "u05BB",
- "qubutsnarrowhebrew", "u05BB",
- "qubutsquarterhebrew", "u05BB",
- "qubutswidehebrew", "u05BB",
- "question", "u003F",
- "questionarabic", "u061F",
- "questionarmenian", "u055E",
- "questiondown", "u00BF",
- "questiongreek", "u037E",
- "questionmonospace", "uFF1F",
- "quotedbl", "u0022",
- "quotedblbase", "u201E",
- "quotedblleft", "u201C",
- "quotedblmonospace", "uFF02",
- "quotedblprime", "u301E",
- "quotedblprimereversed", "u301D",
- "quotedblright", "u201D",
- "quoteleft", "u2018",
- "quoteleftreversed", "u201B",
- "quotereversed", "u201B",
- "quoteright", "u2019",
- "quoterightn", "u0149",
- "quotesinglbase", "u201A",
- "quotesingle", "u0027",
- "quotesinglemonospace", "uFF07",
- "r", "u0072",
- "raarmenian", "u057C",
- "rabengali", "u09B0",
- "racute", "u0155",
- "radeva", "u0930",
- "radical", "u221A",
- "radoverssquare", "u33AE",
- "radoverssquaredsquare", "u33AF",
- "radsquare", "u33AD",
- "rafe", "u05BF",
- "rafehebrew", "u05BF",
- "ragujarati", "u0AB0",
- "ragurmukhi", "u0A30",
- "rahiragana", "u3089",
- "rakatakana", "u30E9",
- "rakatakanahalfwidth", "uFF97",
- "ralowerdiagonalbengali", "u09F1",
- "ramiddlediagonalbengali", "u09F0",
- "ramshorn", "u0264",
- "ratio", "u2236",
- "rbopomofo", "u3116",
- "rcaron", "u0159",
- "rcedilla", "u0157",
- "rcircle", "u24E1",
- "rcommaaccent", "u0157",
- "rdblgrave", "u0211",
- "rdotaccent", "u1E59",
- "rdotbelow", "u1E5B",
- "rdotbelowmacron", "u1E5D",
- "referencemark", "u203B",
- "reflexsubset", "u2286",
- "reflexsuperset", "u2287",
- "registered", "u00AE",
- "reharabic", "u0631",
- "reharmenian", "u0580",
- "rehfinalarabic", "uFEAE",
- "rehiragana", "u308C",
- "rehyehaleflamarabic", "u0631_FEF3_FE8E_0644",
- "rekatakana", "u30EC",
- "rekatakanahalfwidth", "uFF9A",
- "resh", "u05E8",
- "reshdageshhebrew", "uFB48",
- "reshhatafpatah", "u05E8_05B2",
- "reshhatafpatahhebrew", "u05E8_05B2",
- "reshhatafsegol", "u05E8_05B1",
- "reshhatafsegolhebrew", "u05E8_05B1",
- "reshhebrew", "u05E8",
- "reshhiriq", "u05E8_05B4",
- "reshhiriqhebrew", "u05E8_05B4",
- "reshholam", "u05E8_05B9",
- "reshholamhebrew", "u05E8_05B9",
- "reshpatah", "u05E8_05B7",
- "reshpatahhebrew", "u05E8_05B7",
- "reshqamats", "u05E8_05B8",
- "reshqamatshebrew", "u05E8_05B8",
- "reshqubuts", "u05E8_05BB",
- "reshqubutshebrew", "u05E8_05BB",
- "reshsegol", "u05E8_05B6",
- "reshsegolhebrew", "u05E8_05B6",
- "reshsheva", "u05E8_05B0",
- "reshshevahebrew", "u05E8_05B0",
- "reshtsere", "u05E8_05B5",
- "reshtserehebrew", "u05E8_05B5",
- "reversedtilde", "u223D",
- "reviahebrew", "u0597",
- "reviamugrashhebrew", "u0597",
- "revlogicalnot", "u2310",
- "rfishhook", "u027E",
- "rfishhookreversed", "u027F",
- "rhabengali", "u09DD",
- "rhadeva", "u095D",
- "rho", "u03C1",
- "rhook", "u027D",
- "rhookturned", "u027B",
- "rhookturnedsuperior", "u02B5",
- "rhosymbolgreek", "u03F1",
- "rhotichookmod", "u02DE",
- "rieulacirclekorean", "u3271",
- "rieulaparenkorean", "u3211",
- "rieulcirclekorean", "u3263",
- "rieulhieuhkorean", "u3140",
- "rieulkiyeokkorean", "u313A",
- "rieulkiyeoksioskorean", "u3169",
- "rieulkorean", "u3139",
- "rieulmieumkorean", "u313B",
- "rieulpansioskorean", "u316C",
- "rieulparenkorean", "u3203",
- "rieulphieuphkorean", "u313F",
- "rieulpieupkorean", "u313C",
- "rieulpieupsioskorean", "u316B",
- "rieulsioskorean", "u313D",
- "rieulthieuthkorean", "u313E",
- "rieultikeutkorean", "u316A",
- "rieulyeorinhieuhkorean", "u316D",
- "rightangle", "u221F",
- "righttackbelowcmb", "u0319",
- "righttriangle", "u22BF",
- "rihiragana", "u308A",
- "rikatakana", "u30EA",
- "rikatakanahalfwidth", "uFF98",
- "ring", "u02DA",
- "ringbelowcmb", "u0325",
- "ringcmb", "u030A",
- "ringhalfleft", "u02BF",
- "ringhalfleftarmenian", "u0559",
- "ringhalfleftbelowcmb", "u031C",
- "ringhalfleftcentered", "u02D3",
- "ringhalfright", "u02BE",
- "ringhalfrightbelowcmb", "u0339",
- "ringhalfrightcentered", "u02D2",
- "rinvertedbreve", "u0213",
- "rittorusquare", "u3351",
- "rlinebelow", "u1E5F",
- "rlongleg", "u027C",
- "rlonglegturned", "u027A",
- "rmonospace", "uFF52",
- "rohiragana", "u308D",
- "rokatakana", "u30ED",
- "rokatakanahalfwidth", "uFF9B",
- "roruathai", "u0E23",
- "rparen", "u24AD",
- "rrabengali", "u09DC",
- "rradeva", "u0931",
- "rragurmukhi", "u0A5C",
- "rreharabic", "u0691",
- "rrehfinalarabic", "uFB8D",
- "rrvocalicbengali", "u09E0",
- "rrvocalicdeva", "u0960",
- "rrvocalicgujarati", "u0AE0",
- "rrvocalicvowelsignbengali", "u09C4",
- "rrvocalicvowelsigndeva", "u0944",
- "rrvocalicvowelsigngujarati", "u0AC4",
- "rtblock", "u2590",
- "rturned", "u0279",
- "rturnedsuperior", "u02B4",
- "ruhiragana", "u308B",
- "rukatakana", "u30EB",
- "rukatakanahalfwidth", "uFF99",
- "rupeemarkbengali", "u09F2",
- "rupeesignbengali", "u09F3",
- "ruthai", "u0E24",
- "rvocalicbengali", "u098B",
- "rvocalicdeva", "u090B",
- "rvocalicgujarati", "u0A8B",
- "rvocalicvowelsignbengali", "u09C3",
- "rvocalicvowelsigndeva", "u0943",
- "rvocalicvowelsigngujarati", "u0AC3",
- "s", "u0073",
- "sabengali", "u09B8",
- "sacute", "u015B",
- "sacutedotaccent", "u1E65",
- "sadarabic", "u0635",
- "sadeva", "u0938",
- "sadfinalarabic", "uFEBA",
- "sadinitialarabic", "uFEBB",
- "sadmedialarabic", "uFEBC",
- "sagujarati", "u0AB8",
- "sagurmukhi", "u0A38",
- "sahiragana", "u3055",
- "sakatakana", "u30B5",
- "sakatakanahalfwidth", "uFF7B",
- "sallallahoualayhewasallamarabic", "uFDFA",
- "samekh", "u05E1",
- "samekhdagesh", "uFB41",
- "samekhdageshhebrew", "uFB41",
- "samekhhebrew", "u05E1",
- "saraaathai", "u0E32",
- "saraaethai", "u0E41",
- "saraaimaimalaithai", "u0E44",
- "saraaimaimuanthai", "u0E43",
- "saraamthai", "u0E33",
- "saraathai", "u0E30",
- "saraethai", "u0E40",
- "saraiithai", "u0E35",
- "saraithai", "u0E34",
- "saraothai", "u0E42",
- "saraueethai", "u0E37",
- "sarauethai", "u0E36",
- "sarauthai", "u0E38",
- "sarauuthai", "u0E39",
- "sbopomofo", "u3119",
- "scaron", "u0161",
- "scarondotaccent", "u1E67",
- "scedilla", "u015F",
- "schwa", "u0259",
- "schwacyrillic", "u04D9",
- "schwadieresiscyrillic", "u04DB",
- "schwahook", "u025A",
- "scircle", "u24E2",
- "scircumflex", "u015D",
- "scommaaccent", "u0219",
- "sdotaccent", "u1E61",
- "sdotbelow", "u1E63",
- "sdotbelowdotaccent", "u1E69",
- "seagullbelowcmb", "u033C",
- "second", "u2033",
- "secondtonechinese", "u02CA",
- "section", "u00A7",
- "seenarabic", "u0633",
- "seenfinalarabic", "uFEB2",
- "seeninitialarabic", "uFEB3",
- "seenmedialarabic", "uFEB4",
- "segol", "u05B6",
- "segol13", "u05B6",
- "segol1f", "u05B6",
- "segol2c", "u05B6",
- "segolhebrew", "u05B6",
- "segolnarrowhebrew", "u05B6",
- "segolquarterhebrew", "u05B6",
- "segoltahebrew", "u0592",
- "segolwidehebrew", "u05B6",
- "seharmenian", "u057D",
- "sehiragana", "u305B",
- "sekatakana", "u30BB",
- "sekatakanahalfwidth", "uFF7E",
- "semicolon", "u003B",
- "semicolonarabic", "u061B",
- "semicolonmonospace", "uFF1B",
- "semicolonsmall", "uFE54",
- "semivoicedmarkkana", "u309C",
- "semivoicedmarkkanahalfwidth", "uFF9F",
- "sentisquare", "u3322",
- "sentosquare", "u3323",
- "seven", "u0037",
- "sevenarabic", "u0667",
- "sevenbengali", "u09ED",
- "sevencircle", "u2466",
- "sevencircleinversesansserif", "u2790",
- "sevendeva", "u096D",
- "seveneighths", "u215E",
- "sevengujarati", "u0AED",
- "sevengurmukhi", "u0A6D",
- "sevenhackarabic", "u0667",
- "sevenhangzhou", "u3027",
- "sevenideographicparen", "u3226",
- "seveninferior", "u2087",
- "sevenmonospace", "uFF17",
- "sevenparen", "u247A",
- "sevenperiod", "u248E",
- "sevenpersian", "u06F7",
- "sevenroman", "u2176",
- "sevensuperior", "u2077",
- "seventeencircle", "u2470",
- "seventeenparen", "u2484",
- "seventeenperiod", "u2498",
- "seventhai", "u0E57",
- "sfthyphen", "u00AD",
- "shaarmenian", "u0577",
- "shabengali", "u09B6",
- "shacyrillic", "u0448",
- "shaddaarabic", "u0651",
- "shaddadammaarabic", "uFC61",
- "shaddadammatanarabic", "uFC5E",
- "shaddafathaarabic", "uFC60",
- "shaddafathatanarabic", "u0651_064B",
- "shaddakasraarabic", "uFC62",
- "shaddakasratanarabic", "uFC5F",
- "shade", "u2592",
- "shadedark", "u2593",
- "shadelight", "u2591",
- "shademedium", "u2592",
- "shadeva", "u0936",
- "shagujarati", "u0AB6",
- "shagurmukhi", "u0A36",
- "shalshelethebrew", "u0593",
- "shbopomofo", "u3115",
- "shchacyrillic", "u0449",
- "sheenarabic", "u0634",
- "sheenfinalarabic", "uFEB6",
- "sheeninitialarabic", "uFEB7",
- "sheenmedialarabic", "uFEB8",
- "sheicoptic", "u03E3",
- "sheqel", "u20AA",
- "sheqelhebrew", "u20AA",
- "sheva", "u05B0",
- "sheva115", "u05B0",
- "sheva15", "u05B0",
- "sheva22", "u05B0",
- "sheva2e", "u05B0",
- "shevahebrew", "u05B0",
- "shevanarrowhebrew", "u05B0",
- "shevaquarterhebrew", "u05B0",
- "shevawidehebrew", "u05B0",
- "shhacyrillic", "u04BB",
- "shimacoptic", "u03ED",
- "shin", "u05E9",
- "shindagesh", "uFB49",
- "shindageshhebrew", "uFB49",
- "shindageshshindot", "uFB2C",
- "shindageshshindothebrew", "uFB2C",
- "shindageshsindot", "uFB2D",
- "shindageshsindothebrew", "uFB2D",
- "shindothebrew", "u05C1",
- "shinhebrew", "u05E9",
- "shinshindot", "uFB2A",
- "shinshindothebrew", "uFB2A",
- "shinsindot", "uFB2B",
- "shinsindothebrew", "uFB2B",
- "shook", "u0282",
- "sigma", "u03C3",
- "sigma1", "u03C2",
- "sigmafinal", "u03C2",
- "sigmalunatesymbolgreek", "u03F2",
- "sihiragana", "u3057",
- "sikatakana", "u30B7",
- "sikatakanahalfwidth", "uFF7C",
- "siluqhebrew", "u05BD",
- "siluqlefthebrew", "u05BD",
- "similar", "u223C",
- "sindothebrew", "u05C2",
- "siosacirclekorean", "u3274",
- "siosaparenkorean", "u3214",
- "sioscieuckorean", "u317E",
- "sioscirclekorean", "u3266",
- "sioskiyeokkorean", "u317A",
- "sioskorean", "u3145",
- "siosnieunkorean", "u317B",
- "siosparenkorean", "u3206",
- "siospieupkorean", "u317D",
- "siostikeutkorean", "u317C",
- "six", "u0036",
- "sixarabic", "u0666",
- "sixbengali", "u09EC",
- "sixcircle", "u2465",
- "sixcircleinversesansserif", "u278F",
- "sixdeva", "u096C",
- "sixgujarati", "u0AEC",
- "sixgurmukhi", "u0A6C",
- "sixhackarabic", "u0666",
- "sixhangzhou", "u3026",
- "sixideographicparen", "u3225",
- "sixinferior", "u2086",
- "sixmonospace", "uFF16",
- "sixparen", "u2479",
- "sixperiod", "u248D",
- "sixpersian", "u06F6",
- "sixroman", "u2175",
- "sixsuperior", "u2076",
- "sixteencircle", "u246F",
- "sixteencurrencydenominatorbengali", "u09F9",
- "sixteenparen", "u2483",
- "sixteenperiod", "u2497",
- "sixthai", "u0E56",
- "slash", "u002F",
- "slashmonospace", "uFF0F",
- "slong", "u017F",
- "slongdotaccent", "u1E9B",
- "smileface", "u263A",
- "smonospace", "uFF53",
- "sofpasuqhebrew", "u05C3",
- "softhyphen", "u00AD",
- "softsigncyrillic", "u044C",
- "sohiragana", "u305D",
- "sokatakana", "u30BD",
- "sokatakanahalfwidth", "uFF7F",
- "soliduslongoverlaycmb", "u0338",
- "solidusshortoverlaycmb", "u0337",
- "sorusithai", "u0E29",
- "sosalathai", "u0E28",
- "sosothai", "u0E0B",
- "sosuathai", "u0E2A",
- "space", "u0020",
- "spacehackarabic", "u0020",
- "spade", "u2660",
- "spadesuitblack", "u2660",
- "spadesuitwhite", "u2664",
- "sparen", "u24AE",
- "squarebelowcmb", "u033B",
- "squarecc", "u33C4",
- "squarecm", "u339D",
- "squarediagonalcrosshatchfill", "u25A9",
- "squarehorizontalfill", "u25A4",
- "squarekg", "u338F",
- "squarekm", "u339E",
- "squarekmcapital", "u33CE",
- "squareln", "u33D1",
- "squarelog", "u33D2",
- "squaremg", "u338E",
- "squaremil", "u33D5",
- "squaremm", "u339C",
- "squaremsquared", "u33A1",
- "squareorthogonalcrosshatchfill", "u25A6",
- "squareupperlefttolowerrightfill", "u25A7",
- "squareupperrighttolowerleftfill", "u25A8",
- "squareverticalfill", "u25A5",
- "squarewhitewithsmallblack", "u25A3",
- "srsquare", "u33DB",
- "ssabengali", "u09B7",
- "ssadeva", "u0937",
- "ssagujarati", "u0AB7",
- "ssangcieuckorean", "u3149",
- "ssanghieuhkorean", "u3185",
- "ssangieungkorean", "u3180",
- "ssangkiyeokkorean", "u3132",
- "ssangnieunkorean", "u3165",
- "ssangpieupkorean", "u3143",
- "ssangsioskorean", "u3146",
- "ssangtikeutkorean", "u3138",
- "sterling", "u00A3",
- "sterlingmonospace", "uFFE1",
- "strokelongoverlaycmb", "u0336",
- "strokeshortoverlaycmb", "u0335",
- "subset", "u2282",
- "subsetnotequal", "u228A",
- "subsetorequal", "u2286",
- "succeeds", "u227B",
- "suchthat", "u220B",
- "suhiragana", "u3059",
- "sukatakana", "u30B9",
- "sukatakanahalfwidth", "uFF7D",
- "sukunarabic", "u0652",
- "summation", "u2211",
- "sun", "u263C",
- "superset", "u2283",
- "supersetnotequal", "u228B",
- "supersetorequal", "u2287",
- "svsquare", "u33DC",
- "syouwaerasquare", "u337C",
- "t", "u0074",
- "tabengali", "u09A4",
- "tackdown", "u22A4",
- "tackleft", "u22A3",
- "tadeva", "u0924",
- "tagujarati", "u0AA4",
- "tagurmukhi", "u0A24",
- "taharabic", "u0637",
- "tahfinalarabic", "uFEC2",
- "tahinitialarabic", "uFEC3",
- "tahiragana", "u305F",
- "tahmedialarabic", "uFEC4",
- "taisyouerasquare", "u337D",
- "takatakana", "u30BF",
- "takatakanahalfwidth", "uFF80",
- "tatweelarabic", "u0640",
- "tau", "u03C4",
- "tav", "u05EA",
- "tavdages", "uFB4A",
- "tavdagesh", "uFB4A",
- "tavdageshhebrew", "uFB4A",
- "tavhebrew", "u05EA",
- "tbar", "u0167",
- "tbopomofo", "u310A",
- "tcaron", "u0165",
- "tccurl", "u02A8",
- "tcedilla", "u0163",
- "tcheharabic", "u0686",
- "tchehfinalarabic", "uFB7B",
- "tchehinitialarabic", "uFB7C",
- "tchehmedialarabic", "uFB7D",
- "tchehmeeminitialarabic", "uFB7C_FEE4",
- "tcircle", "u24E3",
- "tcircumflexbelow", "u1E71",
- "tcommaaccent", "u0163",
- "tdieresis", "u1E97",
- "tdotaccent", "u1E6B",
- "tdotbelow", "u1E6D",
- "tecyrillic", "u0442",
- "tedescendercyrillic", "u04AD",
- "teharabic", "u062A",
- "tehfinalarabic", "uFE96",
- "tehhahinitialarabic", "uFCA2",
- "tehhahisolatedarabic", "uFC0C",
- "tehinitialarabic", "uFE97",
- "tehiragana", "u3066",
- "tehjeeminitialarabic", "uFCA1",
- "tehjeemisolatedarabic", "uFC0B",
- "tehmarbutaarabic", "u0629",
- "tehmarbutafinalarabic", "uFE94",
- "tehmedialarabic", "uFE98",
- "tehmeeminitialarabic", "uFCA4",
- "tehmeemisolatedarabic", "uFC0E",
- "tehnoonfinalarabic", "uFC73",
- "tekatakana", "u30C6",
- "tekatakanahalfwidth", "uFF83",
- "telephone", "u2121",
- "telephoneblack", "u260E",
- "telishagedolahebrew", "u05A0",
- "telishaqetanahebrew", "u05A9",
- "tencircle", "u2469",
- "tenideographicparen", "u3229",
- "tenparen", "u247D",
- "tenperiod", "u2491",
- "tenroman", "u2179",
- "tesh", "u02A7",
- "tet", "u05D8",
- "tetdagesh", "uFB38",
- "tetdageshhebrew", "uFB38",
- "tethebrew", "u05D8",
- "tetsecyrillic", "u04B5",
- "tevirhebrew", "u059B",
- "tevirlefthebrew", "u059B",
- "thabengali", "u09A5",
- "thadeva", "u0925",
- "thagujarati", "u0AA5",
- "thagurmukhi", "u0A25",
- "thalarabic", "u0630",
- "thalfinalarabic", "uFEAC",
- "thanthakhatthai", "u0E4C",
- "theharabic", "u062B",
- "thehfinalarabic", "uFE9A",
- "thehinitialarabic", "uFE9B",
- "thehmedialarabic", "uFE9C",
- "thereexists", "u2203",
- "therefore", "u2234",
- "theta", "u03B8",
- "theta1", "u03D1",
- "thetasymbolgreek", "u03D1",
- "thieuthacirclekorean", "u3279",
- "thieuthaparenkorean", "u3219",
- "thieuthcirclekorean", "u326B",
- "thieuthkorean", "u314C",
- "thieuthparenkorean", "u320B",
- "thirteencircle", "u246C",
- "thirteenparen", "u2480",
- "thirteenperiod", "u2494",
- "thonangmonthothai", "u0E11",
- "thook", "u01AD",
- "thophuthaothai", "u0E12",
- "thorn", "u00FE",
- "thothahanthai", "u0E17",
- "thothanthai", "u0E10",
- "thothongthai", "u0E18",
- "thothungthai", "u0E16",
- "thousandcyrillic", "u0482",
- "thousandsseparatorarabic", "u066C",
- "thousandsseparatorpersian", "u066C",
- "three", "u0033",
- "threearabic", "u0663",
- "threebengali", "u09E9",
- "threecircle", "u2462",
- "threecircleinversesansserif", "u278C",
- "threedeva", "u0969",
- "threeeighths", "u215C",
- "threegujarati", "u0AE9",
- "threegurmukhi", "u0A69",
- "threehackarabic", "u0663",
- "threehangzhou", "u3023",
- "threeideographicparen", "u3222",
- "threeinferior", "u2083",
- "threemonospace", "uFF13",
- "threenumeratorbengali", "u09F6",
- "threeparen", "u2476",
- "threeperiod", "u248A",
- "threepersian", "u06F3",
- "threequarters", "u00BE",
- "threeroman", "u2172",
- "threesuperior", "u00B3",
- "threethai", "u0E53",
- "thzsquare", "u3394",
- "tihiragana", "u3061",
- "tikatakana", "u30C1",
- "tikatakanahalfwidth", "uFF81",
- "tikeutacirclekorean", "u3270",
- "tikeutaparenkorean", "u3210",
- "tikeutcirclekorean", "u3262",
- "tikeutkorean", "u3137",
- "tikeutparenkorean", "u3202",
- "tilde", "u02DC",
- "tildebelowcmb", "u0330",
- "tildecmb", "u0303",
- "tildecomb", "u0303",
- "tildedoublecmb", "u0360",
- "tildeoperator", "u223C",
- "tildeoverlaycmb", "u0334",
- "tildeverticalcmb", "u033E",
- "timescircle", "u2297",
- "tipehahebrew", "u0596",
- "tipehalefthebrew", "u0596",
- "tippigurmukhi", "u0A70",
- "titlocyrilliccmb", "u0483",
- "tiwnarmenian", "u057F",
- "tlinebelow", "u1E6F",
- "tmonospace", "uFF54",
- "toarmenian", "u0569",
- "tohiragana", "u3068",
- "tokatakana", "u30C8",
- "tokatakanahalfwidth", "uFF84",
- "tonebarextrahighmod", "u02E5",
- "tonebarextralowmod", "u02E9",
- "tonebarhighmod", "u02E6",
- "tonebarlowmod", "u02E8",
- "tonebarmidmod", "u02E7",
- "tonefive", "u01BD",
- "tonesix", "u0185",
- "tonetwo", "u01A8",
- "tonos", "u0384",
- "tonsquare", "u3327",
- "topatakthai", "u0E0F",
- "tortoiseshellbracketleft", "u3014",
- "tortoiseshellbracketleftsmall", "uFE5D",
- "tortoiseshellbracketleftvertical", "uFE39",
- "tortoiseshellbracketright", "u3015",
- "tortoiseshellbracketrightsmall", "uFE5E",
- "tortoiseshellbracketrightvertical", "uFE3A",
- "totaothai", "u0E15",
- "tpalatalhook", "u01AB",
- "tparen", "u24AF",
- "trademark", "u2122",
- "tretroflexhook", "u0288",
- "triagdn", "u25BC",
- "triaglf", "u25C4",
- "triagrt", "u25BA",
- "triagup", "u25B2",
- "ts", "u02A6",
- "tsadi", "u05E6",
- "tsadidagesh", "uFB46",
- "tsadidageshhebrew", "uFB46",
- "tsadihebrew", "u05E6",
- "tsecyrillic", "u0446",
- "tsere", "u05B5",
- "tsere12", "u05B5",
- "tsere1e", "u05B5",
- "tsere2b", "u05B5",
- "tserehebrew", "u05B5",
- "tserenarrowhebrew", "u05B5",
- "tserequarterhebrew", "u05B5",
- "tserewidehebrew", "u05B5",
- "tshecyrillic", "u045B",
- "ttabengali", "u099F",
- "ttadeva", "u091F",
- "ttagujarati", "u0A9F",
- "ttagurmukhi", "u0A1F",
- "tteharabic", "u0679",
- "ttehfinalarabic", "uFB67",
- "ttehinitialarabic", "uFB68",
- "ttehmedialarabic", "uFB69",
- "tthabengali", "u09A0",
- "tthadeva", "u0920",
- "tthagujarati", "u0AA0",
- "tthagurmukhi", "u0A20",
- "tturned", "u0287",
- "tuhiragana", "u3064",
- "tukatakana", "u30C4",
- "tukatakanahalfwidth", "uFF82",
- "tusmallhiragana", "u3063",
- "tusmallkatakana", "u30C3",
- "tusmallkatakanahalfwidth", "uFF6F",
- "twelvecircle", "u246B",
- "twelveparen", "u247F",
- "twelveperiod", "u2493",
- "twelveroman", "u217B",
- "twentycircle", "u2473",
- "twentyhangzhou", "u5344",
- "twentyparen", "u2487",
- "twentyperiod", "u249B",
- "two", "u0032",
- "twoarabic", "u0662",
- "twobengali", "u09E8",
- "twocircle", "u2461",
- "twocircleinversesansserif", "u278B",
- "twodeva", "u0968",
- "twodotenleader", "u2025",
- "twodotleader", "u2025",
- "twodotleadervertical", "uFE30",
- "twogujarati", "u0AE8",
- "twogurmukhi", "u0A68",
- "twohackarabic", "u0662",
- "twohangzhou", "u3022",
- "twoideographicparen", "u3221",
- "twoinferior", "u2082",
- "twomonospace", "uFF12",
- "twonumeratorbengali", "u09F5",
- "twoparen", "u2475",
- "twoperiod", "u2489",
- "twopersian", "u06F2",
- "tworoman", "u2171",
- "twostroke", "u01BB",
- "twosuperior", "u00B2",
- "twothai", "u0E52",
- "twothirds", "u2154",
- "u", "u0075",
- "uacute", "u00FA",
- "ubar", "u0289",
- "ubengali", "u0989",
- "ubopomofo", "u3128",
- "ubreve", "u016D",
- "ucaron", "u01D4",
- "ucircle", "u24E4",
- "ucircumflex", "u00FB",
- "ucircumflexbelow", "u1E77",
- "ucyrillic", "u0443",
- "udattadeva", "u0951",
- "udblacute", "u0171",
- "udblgrave", "u0215",
- "udeva", "u0909",
- "udieresis", "u00FC",
- "udieresisacute", "u01D8",
- "udieresisbelow", "u1E73",
- "udieresiscaron", "u01DA",
- "udieresiscyrillic", "u04F1",
- "udieresisgrave", "u01DC",
- "udieresismacron", "u01D6",
- "udotbelow", "u1EE5",
- "ugrave", "u00F9",
- "ugujarati", "u0A89",
- "ugurmukhi", "u0A09",
- "uhiragana", "u3046",
- "uhookabove", "u1EE7",
- "uhorn", "u01B0",
- "uhornacute", "u1EE9",
- "uhorndotbelow", "u1EF1",
- "uhorngrave", "u1EEB",
- "uhornhookabove", "u1EED",
- "uhorntilde", "u1EEF",
- "uhungarumlaut", "u0171",
- "uhungarumlautcyrillic", "u04F3",
- "uinvertedbreve", "u0217",
- "ukatakana", "u30A6",
- "ukatakanahalfwidth", "uFF73",
- "ukcyrillic", "u0479",
- "ukorean", "u315C",
- "umacron", "u016B",
- "umacroncyrillic", "u04EF",
- "umacrondieresis", "u1E7B",
- "umatragurmukhi", "u0A41",
- "umonospace", "uFF55",
- "underscore", "u005F",
- "underscoredbl", "u2017",
- "underscoremonospace", "uFF3F",
- "underscorevertical", "uFE33",
- "underscorewavy", "uFE4F",
- "union", "u222A",
- "universal", "u2200",
- "uogonek", "u0173",
- "uparen", "u24B0",
- "upblock", "u2580",
- "upperdothebrew", "u05C4",
- "upsilon", "u03C5",
- "upsilondieresis", "u03CB",
- "upsilondieresistonos", "u03B0",
- "upsilonlatin", "u028A",
- "upsilontonos", "u03CD",
- "uptackbelowcmb", "u031D",
- "uptackmod", "u02D4",
- "uragurmukhi", "u0A73",
- "uring", "u016F",
- "ushortcyrillic", "u045E",
- "usmallhiragana", "u3045",
- "usmallkatakana", "u30A5",
- "usmallkatakanahalfwidth", "uFF69",
- "ustraightcyrillic", "u04AF",
- "ustraightstrokecyrillic", "u04B1",
- "utilde", "u0169",
- "utildeacute", "u1E79",
- "utildebelow", "u1E75",
- "uubengali", "u098A",
- "uudeva", "u090A",
- "uugujarati", "u0A8A",
- "uugurmukhi", "u0A0A",
- "uumatragurmukhi", "u0A42",
- "uuvowelsignbengali", "u09C2",
- "uuvowelsigndeva", "u0942",
- "uuvowelsigngujarati", "u0AC2",
- "uvowelsignbengali", "u09C1",
- "uvowelsigndeva", "u0941",
- "uvowelsigngujarati", "u0AC1",
- "v", "u0076",
- "vadeva", "u0935",
- "vagujarati", "u0AB5",
- "vagurmukhi", "u0A35",
- "vakatakana", "u30F7",
- "vav", "u05D5",
- "vavdagesh", "uFB35",
- "vavdagesh65", "uFB35",
- "vavdageshhebrew", "uFB35",
- "vavhebrew", "u05D5",
- "vavholam", "uFB4B",
- "vavholamhebrew", "uFB4B",
- "vavvavhebrew", "u05F0",
- "vavyodhebrew", "u05F1",
- "vcircle", "u24E5",
- "vdotbelow", "u1E7F",
- "vecyrillic", "u0432",
- "veharabic", "u06A4",
- "vehfinalarabic", "uFB6B",
- "vehinitialarabic", "uFB6C",
- "vehmedialarabic", "uFB6D",
- "vekatakana", "u30F9",
- "venus", "u2640",
- "verticalbar", "u007C",
- "verticallineabovecmb", "u030D",
- "verticallinebelowcmb", "u0329",
- "verticallinelowmod", "u02CC",
- "verticallinemod", "u02C8",
- "vewarmenian", "u057E",
- "vhook", "u028B",
- "vikatakana", "u30F8",
- "viramabengali", "u09CD",
- "viramadeva", "u094D",
- "viramagujarati", "u0ACD",
- "visargabengali", "u0983",
- "visargadeva", "u0903",
- "visargagujarati", "u0A83",
- "vmonospace", "uFF56",
- "voarmenian", "u0578",
- "voicediterationhiragana", "u309E",
- "voicediterationkatakana", "u30FE",
- "voicedmarkkana", "u309B",
- "voicedmarkkanahalfwidth", "uFF9E",
- "vokatakana", "u30FA",
- "vparen", "u24B1",
- "vtilde", "u1E7D",
- "vturned", "u028C",
- "vuhiragana", "u3094",
- "vukatakana", "u30F4",
- "w", "u0077",
- "wacute", "u1E83",
- "waekorean", "u3159",
- "wahiragana", "u308F",
- "wakatakana", "u30EF",
- "wakatakanahalfwidth", "uFF9C",
- "wakorean", "u3158",
- "wasmallhiragana", "u308E",
- "wasmallkatakana", "u30EE",
- "wattosquare", "u3357",
- "wavedash", "u301C",
- "wavyunderscorevertical", "uFE34",
- "wawarabic", "u0648",
- "wawfinalarabic", "uFEEE",
- "wawhamzaabovearabic", "u0624",
- "wawhamzaabovefinalarabic", "uFE86",
- "wbsquare", "u33DD",
- "wcircle", "u24E6",
- "wcircumflex", "u0175",
- "wdieresis", "u1E85",
- "wdotaccent", "u1E87",
- "wdotbelow", "u1E89",
- "wehiragana", "u3091",
- "weierstrass", "u2118",
- "wekatakana", "u30F1",
- "wekorean", "u315E",
- "weokorean", "u315D",
- "wgrave", "u1E81",
- "whitebullet", "u25E6",
- "whitecircle", "u25CB",
- "whitecircleinverse", "u25D9",
- "whitecornerbracketleft", "u300E",
- "whitecornerbracketleftvertical", "uFE43",
- "whitecornerbracketright", "u300F",
- "whitecornerbracketrightvertical", "uFE44",
- "whitediamond", "u25C7",
- "whitediamondcontainingblacksmalldiamond", "u25C8",
- "whitedownpointingsmalltriangle", "u25BF",
- "whitedownpointingtriangle", "u25BD",
- "whiteleftpointingsmalltriangle", "u25C3",
- "whiteleftpointingtriangle", "u25C1",
- "whitelenticularbracketleft", "u3016",
- "whitelenticularbracketright", "u3017",
- "whiterightpointingsmalltriangle", "u25B9",
- "whiterightpointingtriangle", "u25B7",
- "whitesmallsquare", "u25AB",
- "whitesmilingface", "u263A",
- "whitesquare", "u25A1",
- "whitestar", "u2606",
- "whitetelephone", "u260F",
- "whitetortoiseshellbracketleft", "u3018",
- "whitetortoiseshellbracketright", "u3019",
- "whiteuppointingsmalltriangle", "u25B5",
- "whiteuppointingtriangle", "u25B3",
- "wihiragana", "u3090",
- "wikatakana", "u30F0",
- "wikorean", "u315F",
- "wmonospace", "uFF57",
- "wohiragana", "u3092",
- "wokatakana", "u30F2",
- "wokatakanahalfwidth", "uFF66",
- "won", "u20A9",
- "wonmonospace", "uFFE6",
- "wowaenthai", "u0E27",
- "wparen", "u24B2",
- "wring", "u1E98",
- "wsuperior", "u02B7",
- "wturned", "u028D",
- "wynn", "u01BF",
- "x", "u0078",
- "xabovecmb", "u033D",
- "xbopomofo", "u3112",
- "xcircle", "u24E7",
- "xdieresis", "u1E8D",
- "xdotaccent", "u1E8B",
- "xeharmenian", "u056D",
- "xi", "u03BE",
- "xmonospace", "uFF58",
- "xparen", "u24B3",
- "xsuperior", "u02E3",
- "y", "u0079",
- "yaadosquare", "u334E",
- "yabengali", "u09AF",
- "yacute", "u00FD",
- "yadeva", "u092F",
- "yaekorean", "u3152",
- "yagujarati", "u0AAF",
- "yagurmukhi", "u0A2F",
- "yahiragana", "u3084",
- "yakatakana", "u30E4",
- "yakatakanahalfwidth", "uFF94",
- "yakorean", "u3151",
- "yamakkanthai", "u0E4E",
- "yasmallhiragana", "u3083",
- "yasmallkatakana", "u30E3",
- "yasmallkatakanahalfwidth", "uFF6C",
- "yatcyrillic", "u0463",
- "ycircle", "u24E8",
- "ycircumflex", "u0177",
- "ydieresis", "u00FF",
- "ydotaccent", "u1E8F",
- "ydotbelow", "u1EF5",
- "yeharabic", "u064A",
- "yehbarreearabic", "u06D2",
- "yehbarreefinalarabic", "uFBAF",
- "yehfinalarabic", "uFEF2",
- "yehhamzaabovearabic", "u0626",
- "yehhamzaabovefinalarabic", "uFE8A",
- "yehhamzaaboveinitialarabic", "uFE8B",
- "yehhamzaabovemedialarabic", "uFE8C",
- "yehinitialarabic", "uFEF3",
- "yehmedialarabic", "uFEF4",
- "yehmeeminitialarabic", "uFCDD",
- "yehmeemisolatedarabic", "uFC58",
- "yehnoonfinalarabic", "uFC94",
- "yehthreedotsbelowarabic", "u06D1",
- "yekorean", "u3156",
- "yen", "u00A5",
- "yenmonospace", "uFFE5",
- "yeokorean", "u3155",
- "yeorinhieuhkorean", "u3186",
- "yerahbenyomohebrew", "u05AA",
- "yerahbenyomolefthebrew", "u05AA",
- "yericyrillic", "u044B",
- "yerudieresiscyrillic", "u04F9",
- "yesieungkorean", "u3181",
- "yesieungpansioskorean", "u3183",
- "yesieungsioskorean", "u3182",
- "yetivhebrew", "u059A",
- "ygrave", "u1EF3",
- "yhook", "u01B4",
- "yhookabove", "u1EF7",
- "yiarmenian", "u0575",
- "yicyrillic", "u0457",
- "yikorean", "u3162",
- "yinyang", "u262F",
- "yiwnarmenian", "u0582",
- "ymonospace", "uFF59",
- "yod", "u05D9",
- "yoddagesh", "uFB39",
- "yoddageshhebrew", "uFB39",
- "yodhebrew", "u05D9",
- "yodyodhebrew", "u05F2",
- "yodyodpatahhebrew", "uFB1F",
- "yohiragana", "u3088",
- "yoikorean", "u3189",
- "yokatakana", "u30E8",
- "yokatakanahalfwidth", "uFF96",
- "yokorean", "u315B",
- "yosmallhiragana", "u3087",
- "yosmallkatakana", "u30E7",
- "yosmallkatakanahalfwidth", "uFF6E",
- "yotgreek", "u03F3",
- "yoyaekorean", "u3188",
- "yoyakorean", "u3187",
- "yoyakthai", "u0E22",
- "yoyingthai", "u0E0D",
- "yparen", "u24B4",
- "ypogegrammeni", "u037A",
- "ypogegrammenigreekcmb", "u0345",
- "yr", "u01A6",
- "yring", "u1E99",
- "ysuperior", "u02B8",
- "ytilde", "u1EF9",
- "yturned", "u028E",
- "yuhiragana", "u3086",
- "yuikorean", "u318C",
- "yukatakana", "u30E6",
- "yukatakanahalfwidth", "uFF95",
- "yukorean", "u3160",
- "yusbigcyrillic", "u046B",
- "yusbigiotifiedcyrillic", "u046D",
- "yuslittlecyrillic", "u0467",
- "yuslittleiotifiedcyrillic", "u0469",
- "yusmallhiragana", "u3085",
- "yusmallkatakana", "u30E5",
- "yusmallkatakanahalfwidth", "uFF6D",
- "yuyekorean", "u318B",
- "yuyeokorean", "u318A",
- "yyabengali", "u09DF",
- "yyadeva", "u095F",
- "z", "u007A",
- "zaarmenian", "u0566",
- "zacute", "u017A",
- "zadeva", "u095B",
- "zagurmukhi", "u0A5B",
- "zaharabic", "u0638",
- "zahfinalarabic", "uFEC6",
- "zahinitialarabic", "uFEC7",
- "zahiragana", "u3056",
- "zahmedialarabic", "uFEC8",
- "zainarabic", "u0632",
- "zainfinalarabic", "uFEB0",
- "zakatakana", "u30B6",
- "zaqefgadolhebrew", "u0595",
- "zaqefqatanhebrew", "u0594",
- "zarqahebrew", "u0598",
- "zayin", "u05D6",
- "zayindagesh", "uFB36",
- "zayindageshhebrew", "uFB36",
- "zayinhebrew", "u05D6",
- "zbopomofo", "u3117",
- "zcaron", "u017E",
- "zcircle", "u24E9",
- "zcircumflex", "u1E91",
- "zcurl", "u0291",
- "zdot", "u017C",
- "zdotaccent", "u017C",
- "zdotbelow", "u1E93",
- "zecyrillic", "u0437",
- "zedescendercyrillic", "u0499",
- "zedieresiscyrillic", "u04DF",
- "zehiragana", "u305C",
- "zekatakana", "u30BC",
- "zero", "u0030",
- "zeroarabic", "u0660",
- "zerobengali", "u09E6",
- "zerodeva", "u0966",
- "zerogujarati", "u0AE6",
- "zerogurmukhi", "u0A66",
- "zerohackarabic", "u0660",
- "zeroinferior", "u2080",
- "zeromonospace", "uFF10",
- "zeropersian", "u06F0",
- "zerosuperior", "u2070",
- "zerothai", "u0E50",
- "zerowidthjoiner", "uFEFF",
- "zerowidthnonjoiner", "u200C",
- "zerowidthspace", "u200B",
- "zeta", "u03B6",
- "zhbopomofo", "u3113",
- "zhearmenian", "u056A",
- "zhebrevecyrillic", "u04C2",
- "zhecyrillic", "u0436",
- "zhedescendercyrillic", "u0497",
- "zhedieresiscyrillic", "u04DD",
- "zihiragana", "u3058",
- "zikatakana", "u30B8",
- "zinorhebrew", "u05AE",
- "zlinebelow", "u1E95",
- "zmonospace", "uFF5A",
- "zohiragana", "u305E",
- "zokatakana", "u30BE",
- "zparen", "u24B5",
- "zretroflexhook", "u0290",
- "zstroke", "u01B6",
- "zuhiragana", "u305A",
- "zukatakana", "u30BA",
+my %AGL_to_unicode = (
+ "A", "0041",
+ "AE", "00C6",
+ "AEacute", "01FC",
+ "AEmacron", "01E2",
+ "Aacute", "00C1",
+ "Abreve", "0102",
+ "Abreveacute", "1EAE",
+ "Abrevecyrillic", "04D0",
+ "Abrevedotbelow", "1EB6",
+ "Abrevegrave", "1EB0",
+ "Abrevehookabove", "1EB2",
+ "Abrevetilde", "1EB4",
+ "Acaron", "01CD",
+ "Acircle", "24B6",
+ "Acircumflex", "00C2",
+ "Acircumflexacute", "1EA4",
+ "Acircumflexdotbelow", "1EAC",
+ "Acircumflexgrave", "1EA6",
+ "Acircumflexhookabove", "1EA8",
+ "Acircumflextilde", "1EAA",
+ "Acyrillic", "0410",
+ "Adblgrave", "0200",
+ "Adieresis", "00C4",
+ "Adieresiscyrillic", "04D2",
+ "Adieresismacron", "01DE",
+ "Adotbelow", "1EA0",
+ "Adotmacron", "01E0",
+ "Agrave", "00C0",
+ "Ahookabove", "1EA2",
+ "Aiecyrillic", "04D4",
+ "Ainvertedbreve", "0202",
+ "Alpha", "0391",
+ "Alphatonos", "0386",
+ "Amacron", "0100",
+ "Amonospace", "FF21",
+ "Aogonek", "0104",
+ "Aring", "00C5",
+ "Aringacute", "01FA",
+ "Aringbelow", "1E00",
+ "Atilde", "00C3",
+ "Aybarmenian", "0531",
+ "B", "0042",
+ "Bcircle", "24B7",
+ "Bdotaccent", "1E02",
+ "Bdotbelow", "1E04",
+ "Becyrillic", "0411",
+ "Benarmenian", "0532",
+ "Beta", "0392",
+ "Bhook", "0181",
+ "Blinebelow", "1E06",
+ "Bmonospace", "FF22",
+ "Btopbar", "0182",
+ "C", "0043",
+ "Caarmenian", "053E",
+ "Cacute", "0106",
+ "Ccaron", "010C",
+ "Ccedilla", "00C7",
+ "Ccedillaacute", "1E08",
+ "Ccircle", "24B8",
+ "Ccircumflex", "0108",
+ "Cdot", "010A",
+ "Cdotaccent", "010A",
+ "Chaarmenian", "0549",
+ "Cheabkhasiancyrillic", "04BC",
+ "Checyrillic", "0427",
+ "Chedescenderabkhasiancyrillic", "04BE",
+ "Chedescendercyrillic", "04B6",
+ "Chedieresiscyrillic", "04F4",
+ "Cheharmenian", "0543",
+ "Chekhakassiancyrillic", "04CB",
+ "Cheverticalstrokecyrillic", "04B8",
+ "Chi", "03A7",
+ "Chook", "0187",
+ "Cmonospace", "FF23",
+ "Coarmenian", "0551",
+ "D", "0044",
+ "DZ", "01F1",
+ "DZcaron", "01C4",
+ "Daarmenian", "0534",
+ "Dafrican", "0189",
+ "Dcaron", "010E",
+ "Dcedilla", "1E10",
+ "Dcircle", "24B9",
+ "Dcircumflexbelow", "1E12",
+ "Dcroat", "0110",
+ "Ddotaccent", "1E0A",
+ "Ddotbelow", "1E0C",
+ "Decyrillic", "0414",
+ "Deicoptic", "03EE",
+ "Delta", "2206",
+ "Deltagreek", "0394",
+ "Dhook", "018A",
+ "Digammagreek", "03DC",
+ "Djecyrillic", "0402",
+ "Dlinebelow", "1E0E",
+ "Dmonospace", "FF24",
+ "Dslash", "0110",
+ "Dtopbar", "018B",
+ "Dz", "01F2",
+ "Dzcaron", "01C5",
+ "Dzeabkhasiancyrillic", "04E0",
+ "Dzecyrillic", "0405",
+ "Dzhecyrillic", "040F",
+ "E", "0045",
+ "Eacute", "00C9",
+ "Ebreve", "0114",
+ "Ecaron", "011A",
+ "Ecedillabreve", "1E1C",
+ "Echarmenian", "0535",
+ "Ecircle", "24BA",
+ "Ecircumflex", "00CA",
+ "Ecircumflexacute", "1EBE",
+ "Ecircumflexbelow", "1E18",
+ "Ecircumflexdotbelow", "1EC6",
+ "Ecircumflexgrave", "1EC0",
+ "Ecircumflexhookabove", "1EC2",
+ "Ecircumflextilde", "1EC4",
+ "Ecyrillic", "0404",
+ "Edblgrave", "0204",
+ "Edieresis", "00CB",
+ "Edot", "0116",
+ "Edotaccent", "0116",
+ "Edotbelow", "1EB8",
+ "Efcyrillic", "0424",
+ "Egrave", "00C8",
+ "Eharmenian", "0537",
+ "Ehookabove", "1EBA",
+ "Eightroman", "2167",
+ "Einvertedbreve", "0206",
+ "Eiotifiedcyrillic", "0464",
+ "Elcyrillic", "041B",
+ "Elevenroman", "216A",
+ "Emacron", "0112",
+ "Emacronacute", "1E16",
+ "Emacrongrave", "1E14",
+ "Emcyrillic", "041C",
+ "Emonospace", "FF25",
+ "Encyrillic", "041D",
+ "Endescendercyrillic", "04A2",
+ "Eng", "014A",
+ "Enghecyrillic", "04A4",
+ "Enhookcyrillic", "04C7",
+ "Eogonek", "0118",
+ "Eopen", "0190",
+ "Epsilon", "0395",
+ "Epsilontonos", "0388",
+ "Ercyrillic", "0420",
+ "Ereversed", "018E",
+ "Ereversedcyrillic", "042D",
+ "Escyrillic", "0421",
+ "Esdescendercyrillic", "04AA",
+ "Esh", "01A9",
+ "Eta", "0397",
+ "Etarmenian", "0538",
+ "Etatonos", "0389",
+ "Eth", "00D0",
+ "Etilde", "1EBC",
+ "Etildebelow", "1E1A",
+ "Euro", "20AC",
+ "Ezh", "01B7",
+ "Ezhcaron", "01EE",
+ "Ezhreversed", "01B8",
+ "F", "0046",
+ "Fcircle", "24BB",
+ "Fdotaccent", "1E1E",
+ "Feharmenian", "0556",
+ "Feicoptic", "03E4",
+ "Fhook", "0191",
+ "Fitacyrillic", "0472",
+ "Fiveroman", "2164",
+ "Fmonospace", "FF26",
+ "Fourroman", "2163",
+ "G", "0047",
+ "GBsquare", "3387",
+ "Gacute", "01F4",
+ "Gamma", "0393",
+ "Gammaafrican", "0194",
+ "Gangiacoptic", "03EA",
+ "Gbreve", "011E",
+ "Gcaron", "01E6",
+ "Gcedilla", "0122",
+ "Gcircle", "24BC",
+ "Gcircumflex", "011C",
+ "Gcommaaccent", "0122",
+ "Gdot", "0120",
+ "Gdotaccent", "0120",
+ "Gecyrillic", "0413",
+ "Ghadarmenian", "0542",
+ "Ghemiddlehookcyrillic", "0494",
+ "Ghestrokecyrillic", "0492",
+ "Gheupturncyrillic", "0490",
+ "Ghook", "0193",
+ "Gimarmenian", "0533",
+ "Gjecyrillic", "0403",
+ "Gmacron", "1E20",
+ "Gmonospace", "FF27",
+ "Gsmallhook", "029B",
+ "Gstroke", "01E4",
+ "H", "0048",
+ "H18533", "25CF",
+ "H18543", "25AA",
+ "H18551", "25AB",
+ "H22073", "25A1",
+ "HPsquare", "33CB",
+ "Haabkhasiancyrillic", "04A8",
+ "Hadescendercyrillic", "04B2",
+ "Hardsigncyrillic", "042A",
+ "Hbar", "0126",
+ "Hbrevebelow", "1E2A",
+ "Hcedilla", "1E28",
+ "Hcircle", "24BD",
+ "Hcircumflex", "0124",
+ "Hdieresis", "1E26",
+ "Hdotaccent", "1E22",
+ "Hdotbelow", "1E24",
+ "Hmonospace", "FF28",
+ "Hoarmenian", "0540",
+ "Horicoptic", "03E8",
+ "Hzsquare", "3390",
+ "I", "0049",
+ "IAcyrillic", "042F",
+ "IJ", "0132",
+ "IUcyrillic", "042E",
+ "Iacute", "00CD",
+ "Ibreve", "012C",
+ "Icaron", "01CF",
+ "Icircle", "24BE",
+ "Icircumflex", "00CE",
+ "Icyrillic", "0406",
+ "Idblgrave", "0208",
+ "Idieresis", "00CF",
+ "Idieresisacute", "1E2E",
+ "Idieresiscyrillic", "04E4",
+ "Idot", "0130",
+ "Idotaccent", "0130",
+ "Idotbelow", "1ECA",
+ "Iebrevecyrillic", "04D6",
+ "Iecyrillic", "0415",
+ "Ifraktur", "2111",
+ "Igrave", "00CC",
+ "Ihookabove", "1EC8",
+ "Iicyrillic", "0418",
+ "Iinvertedbreve", "020A",
+ "Iishortcyrillic", "0419",
+ "Imacron", "012A",
+ "Imacroncyrillic", "04E2",
+ "Imonospace", "FF29",
+ "Iniarmenian", "053B",
+ "Iocyrillic", "0401",
+ "Iogonek", "012E",
+ "Iota", "0399",
+ "Iotaafrican", "0196",
+ "Iotadieresis", "03AA",
+ "Iotatonos", "038A",
+ "Istroke", "0197",
+ "Itilde", "0128",
+ "Itildebelow", "1E2C",
+ "Izhitsacyrillic", "0474",
+ "Izhitsadblgravecyrillic", "0476",
+ "J", "004A",
+ "Jaarmenian", "0541",
+ "Jcircle", "24BF",
+ "Jcircumflex", "0134",
+ "Jecyrillic", "0408",
+ "Jheharmenian", "054B",
+ "Jmonospace", "FF2A",
+ "K", "004B",
+ "KBsquare", "3385",
+ "KKsquare", "33CD",
+ "Kabashkircyrillic", "04A0",
+ "Kacute", "1E30",
+ "Kacyrillic", "041A",
+ "Kadescendercyrillic", "049A",
+ "Kahookcyrillic", "04C3",
+ "Kappa", "039A",
+ "Kastrokecyrillic", "049E",
+ "Kaverticalstrokecyrillic", "049C",
+ "Kcaron", "01E8",
+ "Kcedilla", "0136",
+ "Kcircle", "24C0",
+ "Kcommaaccent", "0136",
+ "Kdotbelow", "1E32",
+ "Keharmenian", "0554",
+ "Kenarmenian", "053F",
+ "Khacyrillic", "0425",
+ "Kheicoptic", "03E6",
+ "Khook", "0198",
+ "Kjecyrillic", "040C",
+ "Klinebelow", "1E34",
+ "Kmonospace", "FF2B",
+ "Koppacyrillic", "0480",
+ "Koppagreek", "03DE",
+ "Ksicyrillic", "046E",
+ "L", "004C",
+ "LJ", "01C7",
+ "Lacute", "0139",
+ "Lambda", "039B",
+ "Lcaron", "013D",
+ "Lcedilla", "013B",
+ "Lcircle", "24C1",
+ "Lcircumflexbelow", "1E3C",
+ "Lcommaaccent", "013B",
+ "Ldot", "013F",
+ "Ldotaccent", "013F",
+ "Ldotbelow", "1E36",
+ "Ldotbelowmacron", "1E38",
+ "Liwnarmenian", "053C",
+ "Lj", "01C8",
+ "Ljecyrillic", "0409",
+ "Llinebelow", "1E3A",
+ "Lmonospace", "FF2C",
+ "Lslash", "0141",
+ "M", "004D",
+ "MBsquare", "3386",
+ "Macute", "1E3E",
+ "Mcircle", "24C2",
+ "Mdotaccent", "1E40",
+ "Mdotbelow", "1E42",
+ "Menarmenian", "0544",
+ "Mmonospace", "FF2D",
+ "Mturned", "019C",
+ "Mu", "039C",
+ "N", "004E",
+ "NJ", "01CA",
+ "Nacute", "0143",
+ "Ncaron", "0147",
+ "Ncedilla", "0145",
+ "Ncircle", "24C3",
+ "Ncircumflexbelow", "1E4A",
+ "Ncommaaccent", "0145",
+ "Ndotaccent", "1E44",
+ "Ndotbelow", "1E46",
+ "Nhookleft", "019D",
+ "Nineroman", "2168",
+ "Nj", "01CB",
+ "Njecyrillic", "040A",
+ "Nlinebelow", "1E48",
+ "Nmonospace", "FF2E",
+ "Nowarmenian", "0546",
+ "Ntilde", "00D1",
+ "Nu", "039D",
+ "O", "004F",
+ "OE", "0152",
+ "Oacute", "00D3",
+ "Obarredcyrillic", "04E8",
+ "Obarreddieresiscyrillic", "04EA",
+ "Obreve", "014E",
+ "Ocaron", "01D1",
+ "Ocenteredtilde", "019F",
+ "Ocircle", "24C4",
+ "Ocircumflex", "00D4",
+ "Ocircumflexacute", "1ED0",
+ "Ocircumflexdotbelow", "1ED8",
+ "Ocircumflexgrave", "1ED2",
+ "Ocircumflexhookabove", "1ED4",
+ "Ocircumflextilde", "1ED6",
+ "Ocyrillic", "041E",
+ "Odblacute", "0150",
+ "Odblgrave", "020C",
+ "Odieresis", "00D6",
+ "Odieresiscyrillic", "04E6",
+ "Odotbelow", "1ECC",
+ "Ograve", "00D2",
+ "Oharmenian", "0555",
+ "Ohm", "2126",
+ "Ohookabove", "1ECE",
+ "Ohorn", "01A0",
+ "Ohornacute", "1EDA",
+ "Ohorndotbelow", "1EE2",
+ "Ohorngrave", "1EDC",
+ "Ohornhookabove", "1EDE",
+ "Ohorntilde", "1EE0",
+ "Ohungarumlaut", "0150",
+ "Oi", "01A2",
+ "Oinvertedbreve", "020E",
+ "Omacron", "014C",
+ "Omacronacute", "1E52",
+ "Omacrongrave", "1E50",
+ "Omega", "2126",
+ "Omegacyrillic", "0460",
+ "Omegagreek", "03A9",
+ "Omegaroundcyrillic", "047A",
+ "Omegatitlocyrillic", "047C",
+ "Omegatonos", "038F",
+ "Omicron", "039F",
+ "Omicrontonos", "038C",
+ "Omonospace", "FF2F",
+ "Oneroman", "2160",
+ "Oogonek", "01EA",
+ "Oogonekmacron", "01EC",
+ "Oopen", "0186",
+ "Oslash", "00D8",
+ "Oslashacute", "01FE",
+ "Ostrokeacute", "01FE",
+ "Otcyrillic", "047E",
+ "Otilde", "00D5",
+ "Otildeacute", "1E4C",
+ "Otildedieresis", "1E4E",
+ "P", "0050",
+ "Pacute", "1E54",
+ "Pcircle", "24C5",
+ "Pdotaccent", "1E56",
+ "Pecyrillic", "041F",
+ "Peharmenian", "054A",
+ "Pemiddlehookcyrillic", "04A6",
+ "Phi", "03A6",
+ "Phook", "01A4",
+ "Pi", "03A0",
+ "Piwrarmenian", "0553",
+ "Pmonospace", "FF30",
+ "Psi", "03A8",
+ "Psicyrillic", "0470",
+ "Q", "0051",
+ "Qcircle", "24C6",
+ "Qmonospace", "FF31",
+ "R", "0052",
+ "Raarmenian", "054C",
+ "Racute", "0154",
+ "Rcaron", "0158",
+ "Rcedilla", "0156",
+ "Rcircle", "24C7",
+ "Rcommaaccent", "0156",
+ "Rdblgrave", "0210",
+ "Rdotaccent", "1E58",
+ "Rdotbelow", "1E5A",
+ "Rdotbelowmacron", "1E5C",
+ "Reharmenian", "0550",
+ "Rfraktur", "211C",
+ "Rho", "03A1",
+ "Rinvertedbreve", "0212",
+ "Rlinebelow", "1E5E",
+ "Rmonospace", "FF32",
+ "Rsmallinverted", "0281",
+ "Rsmallinvertedsuperior", "02B6",
+ "S", "0053",
+ "SF010000", "250C",
+ "SF020000", "2514",
+ "SF030000", "2510",
+ "SF040000", "2518",
+ "SF050000", "253C",
+ "SF060000", "252C",
+ "SF070000", "2534",
+ "SF080000", "251C",
+ "SF090000", "2524",
+ "SF100000", "2500",
+ "SF110000", "2502",
+ "SF190000", "2561",
+ "SF200000", "2562",
+ "SF210000", "2556",
+ "SF220000", "2555",
+ "SF230000", "2563",
+ "SF240000", "2551",
+ "SF250000", "2557",
+ "SF260000", "255D",
+ "SF270000", "255C",
+ "SF280000", "255B",
+ "SF360000", "255E",
+ "SF370000", "255F",
+ "SF380000", "255A",
+ "SF390000", "2554",
+ "SF400000", "2569",
+ "SF410000", "2566",
+ "SF420000", "2560",
+ "SF430000", "2550",
+ "SF440000", "256C",
+ "SF450000", "2567",
+ "SF460000", "2568",
+ "SF470000", "2564",
+ "SF480000", "2565",
+ "SF490000", "2559",
+ "SF500000", "2558",
+ "SF510000", "2552",
+ "SF520000", "2553",
+ "SF530000", "256B",
+ "SF540000", "256A",
+ "Sacute", "015A",
+ "Sacutedotaccent", "1E64",
+ "Sampigreek", "03E0",
+ "Scaron", "0160",
+ "Scarondotaccent", "1E66",
+ "Scedilla", "015E",
+ "Schwa", "018F",
+ "Schwacyrillic", "04D8",
+ "Schwadieresiscyrillic", "04DA",
+ "Scircle", "24C8",
+ "Scircumflex", "015C",
+ "Scommaaccent", "0218",
+ "Sdotaccent", "1E60",
+ "Sdotbelow", "1E62",
+ "Sdotbelowdotaccent", "1E68",
+ "Seharmenian", "054D",
+ "Sevenroman", "2166",
+ "Shaarmenian", "0547",
+ "Shacyrillic", "0428",
+ "Shchacyrillic", "0429",
+ "Sheicoptic", "03E2",
+ "Shhacyrillic", "04BA",
+ "Shimacoptic", "03EC",
+ "Sigma", "03A3",
+ "Sixroman", "2165",
+ "Smonospace", "FF33",
+ "Softsigncyrillic", "042C",
+ "Stigmagreek", "03DA",
+ "T", "0054",
+ "Tau", "03A4",
+ "Tbar", "0166",
+ "Tcaron", "0164",
+ "Tcedilla", "0162",
+ "Tcircle", "24C9",
+ "Tcircumflexbelow", "1E70",
+ "Tcommaaccent", "0162",
+ "Tdotaccent", "1E6A",
+ "Tdotbelow", "1E6C",
+ "Tecyrillic", "0422",
+ "Tedescendercyrillic", "04AC",
+ "Tenroman", "2169",
+ "Tetsecyrillic", "04B4",
+ "Theta", "0398",
+ "Thook", "01AC",
+ "Thorn", "00DE",
+ "Threeroman", "2162",
+ "Tiwnarmenian", "054F",
+ "Tlinebelow", "1E6E",
+ "Tmonospace", "FF34",
+ "Toarmenian", "0539",
+ "Tonefive", "01BC",
+ "Tonesix", "0184",
+ "Tonetwo", "01A7",
+ "Tretroflexhook", "01AE",
+ "Tsecyrillic", "0426",
+ "Tshecyrillic", "040B",
+ "Twelveroman", "216B",
+ "Tworoman", "2161",
+ "U", "0055",
+ "Uacute", "00DA",
+ "Ubreve", "016C",
+ "Ucaron", "01D3",
+ "Ucircle", "24CA",
+ "Ucircumflex", "00DB",
+ "Ucircumflexbelow", "1E76",
+ "Ucyrillic", "0423",
+ "Udblacute", "0170",
+ "Udblgrave", "0214",
+ "Udieresis", "00DC",
+ "Udieresisacute", "01D7",
+ "Udieresisbelow", "1E72",
+ "Udieresiscaron", "01D9",
+ "Udieresiscyrillic", "04F0",
+ "Udieresisgrave", "01DB",
+ "Udieresismacron", "01D5",
+ "Udotbelow", "1EE4",
+ "Ugrave", "00D9",
+ "Uhookabove", "1EE6",
+ "Uhorn", "01AF",
+ "Uhornacute", "1EE8",
+ "Uhorndotbelow", "1EF0",
+ "Uhorngrave", "1EEA",
+ "Uhornhookabove", "1EEC",
+ "Uhorntilde", "1EEE",
+ "Uhungarumlaut", "0170",
+ "Uhungarumlautcyrillic", "04F2",
+ "Uinvertedbreve", "0216",
+ "Ukcyrillic", "0478",
+ "Umacron", "016A",
+ "Umacroncyrillic", "04EE",
+ "Umacrondieresis", "1E7A",
+ "Umonospace", "FF35",
+ "Uogonek", "0172",
+ "Upsilon", "03A5",
+ "Upsilon1", "03D2",
+ "Upsilonacutehooksymbolgreek", "03D3",
+ "Upsilonafrican", "01B1",
+ "Upsilondieresis", "03AB",
+ "Upsilondieresishooksymbolgreek", "03D4",
+ "Upsilonhooksymbol", "03D2",
+ "Upsilontonos", "038E",
+ "Uring", "016E",
+ "Ushortcyrillic", "040E",
+ "Ustraightcyrillic", "04AE",
+ "Ustraightstrokecyrillic", "04B0",
+ "Utilde", "0168",
+ "Utildeacute", "1E78",
+ "Utildebelow", "1E74",
+ "V", "0056",
+ "Vcircle", "24CB",
+ "Vdotbelow", "1E7E",
+ "Vecyrillic", "0412",
+ "Vewarmenian", "054E",
+ "Vhook", "01B2",
+ "Vmonospace", "FF36",
+ "Voarmenian", "0548",
+ "Vtilde", "1E7C",
+ "W", "0057",
+ "Wacute", "1E82",
+ "Wcircle", "24CC",
+ "Wcircumflex", "0174",
+ "Wdieresis", "1E84",
+ "Wdotaccent", "1E86",
+ "Wdotbelow", "1E88",
+ "Wgrave", "1E80",
+ "Wmonospace", "FF37",
+ "X", "0058",
+ "Xcircle", "24CD",
+ "Xdieresis", "1E8C",
+ "Xdotaccent", "1E8A",
+ "Xeharmenian", "053D",
+ "Xi", "039E",
+ "Xmonospace", "FF38",
+ "Y", "0059",
+ "Yacute", "00DD",
+ "Yatcyrillic", "0462",
+ "Ycircle", "24CE",
+ "Ycircumflex", "0176",
+ "Ydieresis", "0178",
+ "Ydotaccent", "1E8E",
+ "Ydotbelow", "1EF4",
+ "Yericyrillic", "042B",
+ "Yerudieresiscyrillic", "04F8",
+ "Ygrave", "1EF2",
+ "Yhook", "01B3",
+ "Yhookabove", "1EF6",
+ "Yiarmenian", "0545",
+ "Yicyrillic", "0407",
+ "Yiwnarmenian", "0552",
+ "Ymonospace", "FF39",
+ "Ytilde", "1EF8",
+ "Yusbigcyrillic", "046A",
+ "Yusbigiotifiedcyrillic", "046C",
+ "Yuslittlecyrillic", "0466",
+ "Yuslittleiotifiedcyrillic", "0468",
+ "Z", "005A",
+ "Zaarmenian", "0536",
+ "Zacute", "0179",
+ "Zcaron", "017D",
+ "Zcircle", "24CF",
+ "Zcircumflex", "1E90",
+ "Zdot", "017B",
+ "Zdotaccent", "017B",
+ "Zdotbelow", "1E92",
+ "Zecyrillic", "0417",
+ "Zedescendercyrillic", "0498",
+ "Zedieresiscyrillic", "04DE",
+ "Zeta", "0396",
+ "Zhearmenian", "053A",
+ "Zhebrevecyrillic", "04C1",
+ "Zhecyrillic", "0416",
+ "Zhedescendercyrillic", "0496",
+ "Zhedieresiscyrillic", "04DC",
+ "Zlinebelow", "1E94",
+ "Zmonospace", "FF3A",
+ "Zstroke", "01B5",
+ "a", "0061",
+ "aabengali", "0986",
+ "aacute", "00E1",
+ "aadeva", "0906",
+ "aagujarati", "0A86",
+ "aagurmukhi", "0A06",
+ "aamatragurmukhi", "0A3E",
+ "aarusquare", "3303",
+ "aavowelsignbengali", "09BE",
+ "aavowelsigndeva", "093E",
+ "aavowelsigngujarati", "0ABE",
+ "abbreviationmarkarmenian", "055F",
+ "abbreviationsigndeva", "0970",
+ "abengali", "0985",
+ "abopomofo", "311A",
+ "abreve", "0103",
+ "abreveacute", "1EAF",
+ "abrevecyrillic", "04D1",
+ "abrevedotbelow", "1EB7",
+ "abrevegrave", "1EB1",
+ "abrevehookabove", "1EB3",
+ "abrevetilde", "1EB5",
+ "acaron", "01CE",
+ "acircle", "24D0",
+ "acircumflex", "00E2",
+ "acircumflexacute", "1EA5",
+ "acircumflexdotbelow", "1EAD",
+ "acircumflexgrave", "1EA7",
+ "acircumflexhookabove", "1EA9",
+ "acircumflextilde", "1EAB",
+ "acute", "00B4",
+ "acutebelowcmb", "0317",
+ "acutecmb", "0301",
+ "acutecomb", "0301",
+ "acutedeva", "0954",
+ "acutelowmod", "02CF",
+ "acutetonecmb", "0341",
+ "acyrillic", "0430",
+ "adblgrave", "0201",
+ "addakgurmukhi", "0A71",
+ "adeva", "0905",
+ "adieresis", "00E4",
+ "adieresiscyrillic", "04D3",
+ "adieresismacron", "01DF",
+ "adotbelow", "1EA1",
+ "adotmacron", "01E1",
+ "ae", "00E6",
+ "aeacute", "01FD",
+ "aekorean", "3150",
+ "aemacron", "01E3",
+ "afii00208", "2015",
+ "afii08941", "20A4",
+ "afii10017", "0410",
+ "afii10018", "0411",
+ "afii10019", "0412",
+ "afii10020", "0413",
+ "afii10021", "0414",
+ "afii10022", "0415",
+ "afii10023", "0401",
+ "afii10024", "0416",
+ "afii10025", "0417",
+ "afii10026", "0418",
+ "afii10027", "0419",
+ "afii10028", "041A",
+ "afii10029", "041B",
+ "afii10030", "041C",
+ "afii10031", "041D",
+ "afii10032", "041E",
+ "afii10033", "041F",
+ "afii10034", "0420",
+ "afii10035", "0421",
+ "afii10036", "0422",
+ "afii10037", "0423",
+ "afii10038", "0424",
+ "afii10039", "0425",
+ "afii10040", "0426",
+ "afii10041", "0427",
+ "afii10042", "0428",
+ "afii10043", "0429",
+ "afii10044", "042A",
+ "afii10045", "042B",
+ "afii10046", "042C",
+ "afii10047", "042D",
+ "afii10048", "042E",
+ "afii10049", "042F",
+ "afii10050", "0490",
+ "afii10051", "0402",
+ "afii10052", "0403",
+ "afii10053", "0404",
+ "afii10054", "0405",
+ "afii10055", "0406",
+ "afii10056", "0407",
+ "afii10057", "0408",
+ "afii10058", "0409",
+ "afii10059", "040A",
+ "afii10060", "040B",
+ "afii10061", "040C",
+ "afii10062", "040E",
+ "afii10065", "0430",
+ "afii10066", "0431",
+ "afii10067", "0432",
+ "afii10068", "0433",
+ "afii10069", "0434",
+ "afii10070", "0435",
+ "afii10071", "0451",
+ "afii10072", "0436",
+ "afii10073", "0437",
+ "afii10074", "0438",
+ "afii10075", "0439",
+ "afii10076", "043A",
+ "afii10077", "043B",
+ "afii10078", "043C",
+ "afii10079", "043D",
+ "afii10080", "043E",
+ "afii10081", "043F",
+ "afii10082", "0440",
+ "afii10083", "0441",
+ "afii10084", "0442",
+ "afii10085", "0443",
+ "afii10086", "0444",
+ "afii10087", "0445",
+ "afii10088", "0446",
+ "afii10089", "0447",
+ "afii10090", "0448",
+ "afii10091", "0449",
+ "afii10092", "044A",
+ "afii10093", "044B",
+ "afii10094", "044C",
+ "afii10095", "044D",
+ "afii10096", "044E",
+ "afii10097", "044F",
+ "afii10098", "0491",
+ "afii10099", "0452",
+ "afii10100", "0453",
+ "afii10101", "0454",
+ "afii10102", "0455",
+ "afii10103", "0456",
+ "afii10104", "0457",
+ "afii10105", "0458",
+ "afii10106", "0459",
+ "afii10107", "045A",
+ "afii10108", "045B",
+ "afii10109", "045C",
+ "afii10110", "045E",
+ "afii10145", "040F",
+ "afii10146", "0462",
+ "afii10147", "0472",
+ "afii10148", "0474",
+ "afii10193", "045F",
+ "afii10194", "0463",
+ "afii10195", "0473",
+ "afii10196", "0475",
+ "afii10846", "04D9",
+ "afii299", "200E",
+ "afii300", "200F",
+ "afii301", "200D",
+ "afii57381", "066A",
+ "afii57388", "060C",
+ "afii57392", "0660",
+ "afii57393", "0661",
+ "afii57394", "0662",
+ "afii57395", "0663",
+ "afii57396", "0664",
+ "afii57397", "0665",
+ "afii57398", "0666",
+ "afii57399", "0667",
+ "afii57400", "0668",
+ "afii57401", "0669",
+ "afii57403", "061B",
+ "afii57407", "061F",
+ "afii57409", "0621",
+ "afii57410", "0622",
+ "afii57411", "0623",
+ "afii57412", "0624",
+ "afii57413", "0625",
+ "afii57414", "0626",
+ "afii57415", "0627",
+ "afii57416", "0628",
+ "afii57417", "0629",
+ "afii57418", "062A",
+ "afii57419", "062B",
+ "afii57420", "062C",
+ "afii57421", "062D",
+ "afii57422", "062E",
+ "afii57423", "062F",
+ "afii57424", "0630",
+ "afii57425", "0631",
+ "afii57426", "0632",
+ "afii57427", "0633",
+ "afii57428", "0634",
+ "afii57429", "0635",
+ "afii57430", "0636",
+ "afii57431", "0637",
+ "afii57432", "0638",
+ "afii57433", "0639",
+ "afii57434", "063A",
+ "afii57440", "0640",
+ "afii57441", "0641",
+ "afii57442", "0642",
+ "afii57443", "0643",
+ "afii57444", "0644",
+ "afii57445", "0645",
+ "afii57446", "0646",
+ "afii57448", "0648",
+ "afii57449", "0649",
+ "afii57450", "064A",
+ "afii57451", "064B",
+ "afii57452", "064C",
+ "afii57453", "064D",
+ "afii57454", "064E",
+ "afii57455", "064F",
+ "afii57456", "0650",
+ "afii57457", "0651",
+ "afii57458", "0652",
+ "afii57470", "0647",
+ "afii57505", "06A4",
+ "afii57506", "067E",
+ "afii57507", "0686",
+ "afii57508", "0698",
+ "afii57509", "06AF",
+ "afii57511", "0679",
+ "afii57512", "0688",
+ "afii57513", "0691",
+ "afii57514", "06BA",
+ "afii57519", "06D2",
+ "afii57534", "06D5",
+ "afii57636", "20AA",
+ "afii57645", "05BE",
+ "afii57658", "05C3",
+ "afii57664", "05D0",
+ "afii57665", "05D1",
+ "afii57666", "05D2",
+ "afii57667", "05D3",
+ "afii57668", "05D4",
+ "afii57669", "05D5",
+ "afii57670", "05D6",
+ "afii57671", "05D7",
+ "afii57672", "05D8",
+ "afii57673", "05D9",
+ "afii57674", "05DA",
+ "afii57675", "05DB",
+ "afii57676", "05DC",
+ "afii57677", "05DD",
+ "afii57678", "05DE",
+ "afii57679", "05DF",
+ "afii57680", "05E0",
+ "afii57681", "05E1",
+ "afii57682", "05E2",
+ "afii57683", "05E3",
+ "afii57684", "05E4",
+ "afii57685", "05E5",
+ "afii57686", "05E6",
+ "afii57687", "05E7",
+ "afii57688", "05E8",
+ "afii57689", "05E9",
+ "afii57690", "05EA",
+ "afii57694", "FB2A",
+ "afii57695", "FB2B",
+ "afii57700", "FB4B",
+ "afii57705", "FB1F",
+ "afii57716", "05F0",
+ "afii57717", "05F1",
+ "afii57718", "05F2",
+ "afii57723", "FB35",
+ "afii57793", "05B4",
+ "afii57794", "05B5",
+ "afii57795", "05B6",
+ "afii57796", "05BB",
+ "afii57797", "05B8",
+ "afii57798", "05B7",
+ "afii57799", "05B0",
+ "afii57800", "05B2",
+ "afii57801", "05B1",
+ "afii57802", "05B3",
+ "afii57803", "05C2",
+ "afii57804", "05C1",
+ "afii57806", "05B9",
+ "afii57807", "05BC",
+ "afii57839", "05BD",
+ "afii57841", "05BF",
+ "afii57842", "05C0",
+ "afii57929", "02BC",
+ "afii61248", "2105",
+ "afii61289", "2113",
+ "afii61352", "2116",
+ "afii61573", "202C",
+ "afii61574", "202D",
+ "afii61575", "202E",
+ "afii61664", "200C",
+ "afii63167", "066D",
+ "afii64937", "02BD",
+ "agrave", "00E0",
+ "agujarati", "0A85",
+ "agurmukhi", "0A05",
+ "ahiragana", "3042",
+ "ahookabove", "1EA3",
+ "aibengali", "0990",
+ "aibopomofo", "311E",
+ "aideva", "0910",
+ "aiecyrillic", "04D5",
+ "aigujarati", "0A90",
+ "aigurmukhi", "0A10",
+ "aimatragurmukhi", "0A48",
+ "ainarabic", "0639",
+ "ainfinalarabic", "FECA",
+ "aininitialarabic", "FECB",
+ "ainmedialarabic", "FECC",
+ "ainvertedbreve", "0203",
+ "aivowelsignbengali", "09C8",
+ "aivowelsigndeva", "0948",
+ "aivowelsigngujarati", "0AC8",
+ "akatakana", "30A2",
+ "akatakanahalfwidth", "FF71",
+ "akorean", "314F",
+ "alef", "05D0",
+ "alefarabic", "0627",
+ "alefdageshhebrew", "FB30",
+ "aleffinalarabic", "FE8E",
+ "alefhamzaabovearabic", "0623",
+ "alefhamzaabovefinalarabic", "FE84",
+ "alefhamzabelowarabic", "0625",
+ "alefhamzabelowfinalarabic", "FE88",
+ "alefhebrew", "05D0",
+ "aleflamedhebrew", "FB4F",
+ "alefmaddaabovearabic", "0622",
+ "alefmaddaabovefinalarabic", "FE82",
+ "alefmaksuraarabic", "0649",
+ "alefmaksurafinalarabic", "FEF0",
+ "alefmaksurainitialarabic", "FEF3",
+ "alefmaksuramedialarabic", "FEF4",
+ "alefpatahhebrew", "FB2E",
+ "alefqamatshebrew", "FB2F",
+ "aleph", "2135",
+ "allequal", "224C",
+ "alpha", "03B1",
+ "alphatonos", "03AC",
+ "amacron", "0101",
+ "amonospace", "FF41",
+ "ampersand", "0026",
+ "ampersandmonospace", "FF06",
+ "amsquare", "33C2",
+ "anbopomofo", "3122",
+ "angbopomofo", "3124",
+ "angkhankhuthai", "0E5A",
+ "angle", "2220",
+ "anglebracketleft", "3008",
+ "anglebracketleftvertical", "FE3F",
+ "anglebracketright", "3009",
+ "anglebracketrightvertical", "FE40",
+ "angleleft", "2329",
+ "angleright", "232A",
+ "angstrom", "212B",
+ "anoteleia", "0387",
+ "anudattadeva", "0952",
+ "anusvarabengali", "0982",
+ "anusvaradeva", "0902",
+ "anusvaragujarati", "0A82",
+ "aogonek", "0105",
+ "apaatosquare", "3300",
+ "aparen", "249C",
+ "apostrophearmenian", "055A",
+ "apostrophemod", "02BC",
+ "approaches", "2250",
+ "approxequal", "2248",
+ "approxequalorimage", "2252",
+ "approximatelyequal", "2245",
+ "araeaekorean", "318E",
+ "araeakorean", "318D",
+ "arc", "2312",
+ "arighthalfring", "1E9A",
+ "aring", "00E5",
+ "aringacute", "01FB",
+ "aringbelow", "1E01",
+ "arrowboth", "2194",
+ "arrowdashdown", "21E3",
+ "arrowdashleft", "21E0",
+ "arrowdashright", "21E2",
+ "arrowdashup", "21E1",
+ "arrowdblboth", "21D4",
+ "arrowdbldown", "21D3",
+ "arrowdblleft", "21D0",
+ "arrowdblright", "21D2",
+ "arrowdblup", "21D1",
+ "arrowdown", "2193",
+ "arrowdownleft", "2199",
+ "arrowdownright", "2198",
+ "arrowdownwhite", "21E9",
+ "arrowheaddownmod", "02C5",
+ "arrowheadleftmod", "02C2",
+ "arrowheadrightmod", "02C3",
+ "arrowheadupmod", "02C4",
+ "arrowleft", "2190",
+ "arrowleftdbl", "21D0",
+ "arrowleftdblstroke", "21CD",
+ "arrowleftoverright", "21C6",
+ "arrowleftwhite", "21E6",
+ "arrowright", "2192",
+ "arrowrightdblstroke", "21CF",
+ "arrowrightheavy", "279E",
+ "arrowrightoverleft", "21C4",
+ "arrowrightwhite", "21E8",
+ "arrowtableft", "21E4",
+ "arrowtabright", "21E5",
+ "arrowup", "2191",
+ "arrowupdn", "2195",
+ "arrowupdnbse", "21A8",
+ "arrowupdownbase", "21A8",
+ "arrowupleft", "2196",
+ "arrowupleftofdown", "21C5",
+ "arrowupright", "2197",
+ "arrowupwhite", "21E7",
+ "asciicircum", "005E",
+ "asciicircummonospace", "FF3E",
+ "asciitilde", "007E",
+ "asciitildemonospace", "FF5E",
+ "ascript", "0251",
+ "ascriptturned", "0252",
+ "asmallhiragana", "3041",
+ "asmallkatakana", "30A1",
+ "asmallkatakanahalfwidth", "FF67",
+ "asterisk", "002A",
+ "asteriskaltonearabic", "066D",
+ "asteriskarabic", "066D",
+ "asteriskmath", "2217",
+ "asteriskmonospace", "FF0A",
+ "asterisksmall", "FE61",
+ "asterism", "2042",
+ "asymptoticallyequal", "2243",
+ "at", "0040",
+ "atilde", "00E3",
+ "atmonospace", "FF20",
+ "atsmall", "FE6B",
+ "aturned", "0250",
+ "aubengali", "0994",
+ "aubopomofo", "3120",
+ "audeva", "0914",
+ "augujarati", "0A94",
+ "augurmukhi", "0A14",
+ "aulengthmarkbengali", "09D7",
+ "aumatragurmukhi", "0A4C",
+ "auvowelsignbengali", "09CC",
+ "auvowelsigndeva", "094C",
+ "auvowelsigngujarati", "0ACC",
+ "avagrahadeva", "093D",
+ "aybarmenian", "0561",
+ "ayin", "05E2",
+ "ayinaltonehebrew", "FB20",
+ "ayinhebrew", "05E2",
+ "b", "0062",
+ "babengali", "09AC",
+ "backslash", "005C",
+ "backslashmonospace", "FF3C",
+ "badeva", "092C",
+ "bagujarati", "0AAC",
+ "bagurmukhi", "0A2C",
+ "bahiragana", "3070",
+ "bahtthai", "0E3F",
+ "bakatakana", "30D0",
+ "bar", "007C",
+ "barmonospace", "FF5C",
+ "bbopomofo", "3105",
+ "bcircle", "24D1",
+ "bdotaccent", "1E03",
+ "bdotbelow", "1E05",
+ "beamedsixteenthnotes", "266C",
+ "because", "2235",
+ "becyrillic", "0431",
+ "beharabic", "0628",
+ "behfinalarabic", "FE90",
+ "behinitialarabic", "FE91",
+ "behiragana", "3079",
+ "behmedialarabic", "FE92",
+ "behmeeminitialarabic", "FC9F",
+ "behmeemisolatedarabic", "FC08",
+ "behnoonfinalarabic", "FC6D",
+ "bekatakana", "30D9",
+ "benarmenian", "0562",
+ "bet", "05D1",
+ "beta", "03B2",
+ "betasymbolgreek", "03D0",
+ "betdagesh", "FB31",
+ "betdageshhebrew", "FB31",
+ "bethebrew", "05D1",
+ "betrafehebrew", "FB4C",
+ "bhabengali", "09AD",
+ "bhadeva", "092D",
+ "bhagujarati", "0AAD",
+ "bhagurmukhi", "0A2D",
+ "bhook", "0253",
+ "bihiragana", "3073",
+ "bikatakana", "30D3",
+ "bilabialclick", "0298",
+ "bindigurmukhi", "0A02",
+ "birusquare", "3331",
+ "blackcircle", "25CF",
+ "blackdiamond", "25C6",
+ "blackdownpointingtriangle", "25BC",
+ "blackleftpointingpointer", "25C4",
+ "blackleftpointingtriangle", "25C0",
+ "blacklenticularbracketleft", "3010",
+ "blacklenticularbracketleftvertical", "FE3B",
+ "blacklenticularbracketright", "3011",
+ "blacklenticularbracketrightvertical", "FE3C",
+ "blacklowerlefttriangle", "25E3",
+ "blacklowerrighttriangle", "25E2",
+ "blackrectangle", "25AC",
+ "blackrightpointingpointer", "25BA",
+ "blackrightpointingtriangle", "25B6",
+ "blacksmallsquare", "25AA",
+ "blacksmilingface", "263B",
+ "blacksquare", "25A0",
+ "blackstar", "2605",
+ "blackupperlefttriangle", "25E4",
+ "blackupperrighttriangle", "25E5",
+ "blackuppointingsmalltriangle", "25B4",
+ "blackuppointingtriangle", "25B2",
+ "blank", "2423",
+ "blinebelow", "1E07",
+ "block", "2588",
+ "bmonospace", "FF42",
+ "bobaimaithai", "0E1A",
+ "bohiragana", "307C",
+ "bokatakana", "30DC",
+ "bparen", "249D",
+ "bqsquare", "33C3",
+ "braceleft", "007B",
+ "braceleftmonospace", "FF5B",
+ "braceleftsmall", "FE5B",
+ "braceleftvertical", "FE37",
+ "braceright", "007D",
+ "bracerightmonospace", "FF5D",
+ "bracerightsmall", "FE5C",
+ "bracerightvertical", "FE38",
+ "bracketleft", "005B",
+ "bracketleftmonospace", "FF3B",
+ "bracketright", "005D",
+ "bracketrightmonospace", "FF3D",
+ "breve", "02D8",
+ "brevebelowcmb", "032E",
+ "brevecmb", "0306",
+ "breveinvertedbelowcmb", "032F",
+ "breveinvertedcmb", "0311",
+ "breveinverteddoublecmb", "0361",
+ "bridgebelowcmb", "032A",
+ "bridgeinvertedbelowcmb", "033A",
+ "brokenbar", "00A6",
+ "bstroke", "0180",
+ "btopbar", "0183",
+ "buhiragana", "3076",
+ "bukatakana", "30D6",
+ "bullet", "2022",
+ "bulletinverse", "25D8",
+ "bulletoperator", "2219",
+ "bullseye", "25CE",
+ "c", "0063",
+ "caarmenian", "056E",
+ "cabengali", "099A",
+ "cacute", "0107",
+ "cadeva", "091A",
+ "cagujarati", "0A9A",
+ "cagurmukhi", "0A1A",
+ "calsquare", "3388",
+ "candrabindubengali", "0981",
+ "candrabinducmb", "0310",
+ "candrabindudeva", "0901",
+ "candrabindugujarati", "0A81",
+ "capslock", "21EA",
+ "careof", "2105",
+ "caron", "02C7",
+ "caronbelowcmb", "032C",
+ "caroncmb", "030C",
+ "carriagereturn", "21B5",
+ "cbopomofo", "3118",
+ "ccaron", "010D",
+ "ccedilla", "00E7",
+ "ccedillaacute", "1E09",
+ "ccircle", "24D2",
+ "ccircumflex", "0109",
+ "ccurl", "0255",
+ "cdot", "010B",
+ "cdotaccent", "010B",
+ "cdsquare", "33C5",
+ "cedilla", "00B8",
+ "cedillacmb", "0327",
+ "cent", "00A2",
+ "centigrade", "2103",
+ "centmonospace", "FFE0",
+ "chaarmenian", "0579",
+ "chabengali", "099B",
+ "chadeva", "091B",
+ "chagujarati", "0A9B",
+ "chagurmukhi", "0A1B",
+ "chbopomofo", "3114",
+ "cheabkhasiancyrillic", "04BD",
+ "checkmark", "2713",
+ "checyrillic", "0447",
+ "chedescenderabkhasiancyrillic", "04BF",
+ "chedescendercyrillic", "04B7",
+ "chedieresiscyrillic", "04F5",
+ "cheharmenian", "0573",
+ "chekhakassiancyrillic", "04CC",
+ "cheverticalstrokecyrillic", "04B9",
+ "chi", "03C7",
+ "chieuchacirclekorean", "3277",
+ "chieuchaparenkorean", "3217",
+ "chieuchcirclekorean", "3269",
+ "chieuchkorean", "314A",
+ "chieuchparenkorean", "3209",
+ "chochangthai", "0E0A",
+ "chochanthai", "0E08",
+ "chochingthai", "0E09",
+ "chochoethai", "0E0C",
+ "chook", "0188",
+ "cieucacirclekorean", "3276",
+ "cieucaparenkorean", "3216",
+ "cieuccirclekorean", "3268",
+ "cieuckorean", "3148",
+ "cieucparenkorean", "3208",
+ "cieucuparenkorean", "321C",
+ "circle", "25CB",
+ "circlemultiply", "2297",
+ "circleot", "2299",
+ "circleplus", "2295",
+ "circlepostalmark", "3036",
+ "circlewithlefthalfblack", "25D0",
+ "circlewithrighthalfblack", "25D1",
+ "circumflex", "02C6",
+ "circumflexbelowcmb", "032D",
+ "circumflexcmb", "0302",
+ "clear", "2327",
+ "clickalveolar", "01C2",
+ "clickdental", "01C0",
+ "clicklateral", "01C1",
+ "clickretroflex", "01C3",
+ "club", "2663",
+ "clubsuitblack", "2663",
+ "clubsuitwhite", "2667",
+ "cmcubedsquare", "33A4",
+ "cmonospace", "FF43",
+ "cmsquaredsquare", "33A0",
+ "coarmenian", "0581",
+ "colon", "003A",
+ "colonmonetary", "20A1",
+ "colonmonospace", "FF1A",
+ "colonsign", "20A1",
+ "colonsmall", "FE55",
+ "colontriangularhalfmod", "02D1",
+ "colontriangularmod", "02D0",
+ "comma", "002C",
+ "commaabovecmb", "0313",
+ "commaaboverightcmb", "0315",
+ "commaarabic", "060C",
+ "commaarmenian", "055D",
+ "commamonospace", "FF0C",
+ "commareversedabovecmb", "0314",
+ "commareversedmod", "02BD",
+ "commasmall", "FE50",
+ "commaturnedabovecmb", "0312",
+ "commaturnedmod", "02BB",
+ "compass", "263C",
+ "congruent", "2245",
+ "contourintegral", "222E",
+ "control", "2303",
+ "controlACK", "0006",
+ "controlBEL", "0007",
+ "controlBS", "0008",
+ "controlCAN", "0018",
+ "controlCR", "000D",
+ "controlDC1", "0011",
+ "controlDC2", "0012",
+ "controlDC3", "0013",
+ "controlDC4", "0014",
+ "controlDEL", "007F",
+ "controlDLE", "0010",
+ "controlEM", "0019",
+ "controlENQ", "0005",
+ "controlEOT", "0004",
+ "controlESC", "001B",
+ "controlETB", "0017",
+ "controlETX", "0003",
+ "controlFF", "000C",
+ "controlFS", "001C",
+ "controlGS", "001D",
+ "controlHT", "0009",
+ "controlLF", "000A",
+ "controlNAK", "0015",
+ "controlRS", "001E",
+ "controlSI", "000F",
+ "controlSO", "000E",
+ "controlSOT", "0002",
+ "controlSTX", "0001",
+ "controlSUB", "001A",
+ "controlSYN", "0016",
+ "controlUS", "001F",
+ "controlVT", "000B",
+ "copyright", "00A9",
+ "cornerbracketleft", "300C",
+ "cornerbracketlefthalfwidth", "FF62",
+ "cornerbracketleftvertical", "FE41",
+ "cornerbracketright", "300D",
+ "cornerbracketrighthalfwidth", "FF63",
+ "cornerbracketrightvertical", "FE42",
+ "corporationsquare", "337F",
+ "cosquare", "33C7",
+ "coverkgsquare", "33C6",
+ "cparen", "249E",
+ "cruzeiro", "20A2",
+ "cstretched", "0297",
+ "curlyand", "22CF",
+ "curlyor", "22CE",
+ "currency", "00A4",
+ "d", "0064",
+ "daarmenian", "0564",
+ "dabengali", "09A6",
+ "dadarabic", "0636",
+ "dadeva", "0926",
+ "dadfinalarabic", "FEBE",
+ "dadinitialarabic", "FEBF",
+ "dadmedialarabic", "FEC0",
+ "dagesh", "05BC",
+ "dageshhebrew", "05BC",
+ "dagger", "2020",
+ "daggerdbl", "2021",
+ "dagujarati", "0AA6",
+ "dagurmukhi", "0A26",
+ "dahiragana", "3060",
+ "dakatakana", "30C0",
+ "dalarabic", "062F",
+ "dalet", "05D3",
+ "daletdagesh", "FB33",
+ "daletdageshhebrew", "FB33",
+ "dalethatafpatah", "05D3_05B2",
+ "dalethatafpatahhebrew", "05D3_05B2",
+ "dalethatafsegol", "05D3_05B1",
+ "dalethatafsegolhebrew", "05D3_05B1",
+ "dalethebrew", "05D3",
+ "dalethiriq", "05D3_05B4",
+ "dalethiriqhebrew", "05D3_05B4",
+ "daletholam", "05D3_05B9",
+ "daletholamhebrew", "05D3_05B9",
+ "daletpatah", "05D3_05B7",
+ "daletpatahhebrew", "05D3_05B7",
+ "daletqamats", "05D3_05B8",
+ "daletqamatshebrew", "05D3_05B8",
+ "daletqubuts", "05D3_05BB",
+ "daletqubutshebrew", "05D3_05BB",
+ "daletsegol", "05D3_05B6",
+ "daletsegolhebrew", "05D3_05B6",
+ "daletsheva", "05D3_05B0",
+ "daletshevahebrew", "05D3_05B0",
+ "dalettsere", "05D3_05B5",
+ "dalettserehebrew", "05D3_05B5",
+ "dalfinalarabic", "FEAA",
+ "dammaarabic", "064F",
+ "dammalowarabic", "064F",
+ "dammatanaltonearabic", "064C",
+ "dammatanarabic", "064C",
+ "danda", "0964",
+ "dargahebrew", "05A7",
+ "dargalefthebrew", "05A7",
+ "dasiapneumatacyrilliccmb", "0485",
+ "dblanglebracketleft", "300A",
+ "dblanglebracketleftvertical", "FE3D",
+ "dblanglebracketright", "300B",
+ "dblanglebracketrightvertical", "FE3E",
+ "dblarchinvertedbelowcmb", "032B",
+ "dblarrowleft", "21D4",
+ "dblarrowright", "21D2",
+ "dbldanda", "0965",
+ "dblgravecmb", "030F",
+ "dblintegral", "222C",
+ "dbllowline", "2017",
+ "dbllowlinecmb", "0333",
+ "dbloverlinecmb", "033F",
+ "dblprimemod", "02BA",
+ "dblverticalbar", "2016",
+ "dblverticallineabovecmb", "030E",
+ "dbopomofo", "3109",
+ "dbsquare", "33C8",
+ "dcaron", "010F",
+ "dcedilla", "1E11",
+ "dcircle", "24D3",
+ "dcircumflexbelow", "1E13",
+ "dcroat", "0111",
+ "ddabengali", "09A1",
+ "ddadeva", "0921",
+ "ddagujarati", "0AA1",
+ "ddagurmukhi", "0A21",
+ "ddalarabic", "0688",
+ "ddalfinalarabic", "FB89",
+ "dddhadeva", "095C",
+ "ddhabengali", "09A2",
+ "ddhadeva", "0922",
+ "ddhagujarati", "0AA2",
+ "ddhagurmukhi", "0A22",
+ "ddotaccent", "1E0B",
+ "ddotbelow", "1E0D",
+ "decimalseparatorarabic", "066B",
+ "decimalseparatorpersian", "066B",
+ "decyrillic", "0434",
+ "degree", "00B0",
+ "dehihebrew", "05AD",
+ "dehiragana", "3067",
+ "deicoptic", "03EF",
+ "dekatakana", "30C7",
+ "deleteleft", "232B",
+ "deleteright", "2326",
+ "delta", "03B4",
+ "deltaturned", "018D",
+ "denominatorminusonenumeratorbengali", "09F8",
+ "dezh", "02A4",
+ "dhabengali", "09A7",
+ "dhadeva", "0927",
+ "dhagujarati", "0AA7",
+ "dhagurmukhi", "0A27",
+ "dhook", "0257",
+ "dialytikatonos", "0385",
+ "dialytikatonoscmb", "0344",
+ "diamond", "2666",
+ "diamondsuitwhite", "2662",
+ "dieresis", "00A8",
+ "dieresisbelowcmb", "0324",
+ "dieresiscmb", "0308",
+ "dieresistonos", "0385",
+ "dihiragana", "3062",
+ "dikatakana", "30C2",
+ "dittomark", "3003",
+ "divide", "00F7",
+ "divides", "2223",
+ "divisionslash", "2215",
+ "djecyrillic", "0452",
+ "dkshade", "2593",
+ "dlinebelow", "1E0F",
+ "dlsquare", "3397",
+ "dmacron", "0111",
+ "dmonospace", "FF44",
+ "dnblock", "2584",
+ "dochadathai", "0E0E",
+ "dodekthai", "0E14",
+ "dohiragana", "3069",
+ "dokatakana", "30C9",
+ "dollar", "0024",
+ "dollarmonospace", "FF04",
+ "dollarsmall", "FE69",
+ "dong", "20AB",
+ "dorusquare", "3326",
+ "dotaccent", "02D9",
+ "dotaccentcmb", "0307",
+ "dotbelowcmb", "0323",
+ "dotbelowcomb", "0323",
+ "dotkatakana", "30FB",
+ "dotlessi", "0131",
+ "dotlessjstrokehook", "0284",
+ "dotmath", "22C5",
+ "dottedcircle", "25CC",
+ "doubleyodpatah", "FB1F",
+ "doubleyodpatahhebrew", "FB1F",
+ "downtackbelowcmb", "031E",
+ "downtackmod", "02D5",
+ "dparen", "249F",
+ "dtail", "0256",
+ "dtopbar", "018C",
+ "duhiragana", "3065",
+ "dukatakana", "30C5",
+ "dz", "01F3",
+ "dzaltone", "02A3",
+ "dzcaron", "01C6",
+ "dzcurl", "02A5",
+ "dzeabkhasiancyrillic", "04E1",
+ "dzecyrillic", "0455",
+ "dzhecyrillic", "045F",
+ "e", "0065",
+ "eacute", "00E9",
+ "earth", "2641",
+ "ebengali", "098F",
+ "ebopomofo", "311C",
+ "ebreve", "0115",
+ "ecandradeva", "090D",
+ "ecandragujarati", "0A8D",
+ "ecandravowelsigndeva", "0945",
+ "ecandravowelsigngujarati", "0AC5",
+ "ecaron", "011B",
+ "ecedillabreve", "1E1D",
+ "echarmenian", "0565",
+ "echyiwnarmenian", "0587",
+ "ecircle", "24D4",
+ "ecircumflex", "00EA",
+ "ecircumflexacute", "1EBF",
+ "ecircumflexbelow", "1E19",
+ "ecircumflexdotbelow", "1EC7",
+ "ecircumflexgrave", "1EC1",
+ "ecircumflexhookabove", "1EC3",
+ "ecircumflextilde", "1EC5",
+ "ecyrillic", "0454",
+ "edblgrave", "0205",
+ "edeva", "090F",
+ "edieresis", "00EB",
+ "edot", "0117",
+ "edotaccent", "0117",
+ "edotbelow", "1EB9",
+ "eegurmukhi", "0A0F",
+ "eematragurmukhi", "0A47",
+ "efcyrillic", "0444",
+ "egrave", "00E8",
+ "egujarati", "0A8F",
+ "eharmenian", "0567",
+ "ehbopomofo", "311D",
+ "ehiragana", "3048",
+ "ehookabove", "1EBB",
+ "eibopomofo", "311F",
+ "eight", "0038",
+ "eightarabic", "0668",
+ "eightbengali", "09EE",
+ "eightcircle", "2467",
+ "eightcircleinversesansserif", "2791",
+ "eightdeva", "096E",
+ "eighteencircle", "2471",
+ "eighteenparen", "2485",
+ "eighteenperiod", "2499",
+ "eightgujarati", "0AEE",
+ "eightgurmukhi", "0A6E",
+ "eighthackarabic", "0668",
+ "eighthangzhou", "3028",
+ "eighthnotebeamed", "266B",
+ "eightideographicparen", "3227",
+ "eightinferior", "2088",
+ "eightmonospace", "FF18",
+ "eightparen", "247B",
+ "eightperiod", "248F",
+ "eightpersian", "06F8",
+ "eightroman", "2177",
+ "eightsuperior", "2078",
+ "eightthai", "0E58",
+ "einvertedbreve", "0207",
+ "eiotifiedcyrillic", "0465",
+ "ekatakana", "30A8",
+ "ekatakanahalfwidth", "FF74",
+ "ekonkargurmukhi", "0A74",
+ "ekorean", "3154",
+ "elcyrillic", "043B",
+ "element", "2208",
+ "elevencircle", "246A",
+ "elevenparen", "247E",
+ "elevenperiod", "2492",
+ "elevenroman", "217A",
+ "ellipsis", "2026",
+ "ellipsisvertical", "22EE",
+ "emacron", "0113",
+ "emacronacute", "1E17",
+ "emacrongrave", "1E15",
+ "emcyrillic", "043C",
+ "emdash", "2014",
+ "emdashvertical", "FE31",
+ "emonospace", "FF45",
+ "emphasismarkarmenian", "055B",
+ "emptyset", "2205",
+ "enbopomofo", "3123",
+ "encyrillic", "043D",
+ "endash", "2013",
+ "endashvertical", "FE32",
+ "endescendercyrillic", "04A3",
+ "eng", "014B",
+ "engbopomofo", "3125",
+ "enghecyrillic", "04A5",
+ "enhookcyrillic", "04C8",
+ "enspace", "2002",
+ "eogonek", "0119",
+ "eokorean", "3153",
+ "eopen", "025B",
+ "eopenclosed", "029A",
+ "eopenreversed", "025C",
+ "eopenreversedclosed", "025E",
+ "eopenreversedhook", "025D",
+ "eparen", "24A0",
+ "epsilon", "03B5",
+ "epsilontonos", "03AD",
+ "equal", "003D",
+ "equalmonospace", "FF1D",
+ "equalsmall", "FE66",
+ "equalsuperior", "207C",
+ "equivalence", "2261",
+ "erbopomofo", "3126",
+ "ercyrillic", "0440",
+ "ereversed", "0258",
+ "ereversedcyrillic", "044D",
+ "escyrillic", "0441",
+ "esdescendercyrillic", "04AB",
+ "esh", "0283",
+ "eshcurl", "0286",
+ "eshortdeva", "090E",
+ "eshortvowelsigndeva", "0946",
+ "eshreversedloop", "01AA",
+ "eshsquatreversed", "0285",
+ "esmallhiragana", "3047",
+ "esmallkatakana", "30A7",
+ "esmallkatakanahalfwidth", "FF6A",
+ "estimated", "212E",
+ "eta", "03B7",
+ "etarmenian", "0568",
+ "etatonos", "03AE",
+ "eth", "00F0",
+ "etilde", "1EBD",
+ "etildebelow", "1E1B",
+ "etnahtafoukhhebrew", "0591",
+ "etnahtafoukhlefthebrew", "0591",
+ "etnahtahebrew", "0591",
+ "etnahtalefthebrew", "0591",
+ "eturned", "01DD",
+ "eukorean", "3161",
+ "euro", "20AC",
+ "evowelsignbengali", "09C7",
+ "evowelsigndeva", "0947",
+ "evowelsigngujarati", "0AC7",
+ "exclam", "0021",
+ "exclamarmenian", "055C",
+ "exclamdbl", "203C",
+ "exclamdown", "00A1",
+ "exclammonospace", "FF01",
+ "existential", "2203",
+ "ezh", "0292",
+ "ezhcaron", "01EF",
+ "ezhcurl", "0293",
+ "ezhreversed", "01B9",
+ "ezhtail", "01BA",
+ "f", "0066",
+ "fadeva", "095E",
+ "fagurmukhi", "0A5E",
+ "fahrenheit", "2109",
+ "fathaarabic", "064E",
+ "fathalowarabic", "064E",
+ "fathatanarabic", "064B",
+ "fbopomofo", "3108",
+ "fcircle", "24D5",
+ "fdotaccent", "1E1F",
+ "feharabic", "0641",
+ "feharmenian", "0586",
+ "fehfinalarabic", "FED2",
+ "fehinitialarabic", "FED3",
+ "fehmedialarabic", "FED4",
+ "feicoptic", "03E5",
+ "female", "2640",
+ "ff", "FB00",
+ "ffi", "FB03",
+ "ffl", "FB04",
+ "fi", "FB01",
+ "fifteencircle", "246E",
+ "fifteenparen", "2482",
+ "fifteenperiod", "2496",
+ "figuredash", "2012",
+ "filledbox", "25A0",
+ "filledrect", "25AC",
+ "finalkaf", "05DA",
+ "finalkafdagesh", "FB3A",
+ "finalkafdageshhebrew", "FB3A",
+ "finalkafhebrew", "05DA",
+ "finalkafqamats", "05DA_05B8",
+ "finalkafqamatshebrew", "05DA_05B8",
+ "finalkafsheva", "05DA_05B0",
+ "finalkafshevahebrew", "05DA_05B0",
+ "finalmem", "05DD",
+ "finalmemhebrew", "05DD",
+ "finalnun", "05DF",
+ "finalnunhebrew", "05DF",
+ "finalpe", "05E3",
+ "finalpehebrew", "05E3",
+ "finaltsadi", "05E5",
+ "finaltsadihebrew", "05E5",
+ "firsttonechinese", "02C9",
+ "fisheye", "25C9",
+ "fitacyrillic", "0473",
+ "five", "0035",
+ "fivearabic", "0665",
+ "fivebengali", "09EB",
+ "fivecircle", "2464",
+ "fivecircleinversesansserif", "278E",
+ "fivedeva", "096B",
+ "fiveeighths", "215D",
+ "fivegujarati", "0AEB",
+ "fivegurmukhi", "0A6B",
+ "fivehackarabic", "0665",
+ "fivehangzhou", "3025",
+ "fiveideographicparen", "3224",
+ "fiveinferior", "2085",
+ "fivemonospace", "FF15",
+ "fiveparen", "2478",
+ "fiveperiod", "248C",
+ "fivepersian", "06F5",
+ "fiveroman", "2174",
+ "fivesuperior", "2075",
+ "fivethai", "0E55",
+ "fl", "FB02",
+ "florin", "0192",
+ "fmonospace", "FF46",
+ "fmsquare", "3399",
+ "fofanthai", "0E1F",
+ "fofathai", "0E1D",
+ "fongmanthai", "0E4F",
+ "forall", "2200",
+ "four", "0034",
+ "fourarabic", "0664",
+ "fourbengali", "09EA",
+ "fourcircle", "2463",
+ "fourcircleinversesansserif", "278D",
+ "fourdeva", "096A",
+ "fourgujarati", "0AEA",
+ "fourgurmukhi", "0A6A",
+ "fourhackarabic", "0664",
+ "fourhangzhou", "3024",
+ "fourideographicparen", "3223",
+ "fourinferior", "2084",
+ "fourmonospace", "FF14",
+ "fournumeratorbengali", "09F7",
+ "fourparen", "2477",
+ "fourperiod", "248B",
+ "fourpersian", "06F4",
+ "fourroman", "2173",
+ "foursuperior", "2074",
+ "fourteencircle", "246D",
+ "fourteenparen", "2481",
+ "fourteenperiod", "2495",
+ "fourthai", "0E54",
+ "fourthtonechinese", "02CB",
+ "fparen", "24A1",
+ "fraction", "2044",
+ "franc", "20A3",
+ "g", "0067",
+ "gabengali", "0997",
+ "gacute", "01F5",
+ "gadeva", "0917",
+ "gafarabic", "06AF",
+ "gaffinalarabic", "FB93",
+ "gafinitialarabic", "FB94",
+ "gafmedialarabic", "FB95",
+ "gagujarati", "0A97",
+ "gagurmukhi", "0A17",
+ "gahiragana", "304C",
+ "gakatakana", "30AC",
+ "gamma", "03B3",
+ "gammalatinsmall", "0263",
+ "gammasuperior", "02E0",
+ "gangiacoptic", "03EB",
+ "gbopomofo", "310D",
+ "gbreve", "011F",
+ "gcaron", "01E7",
+ "gcedilla", "0123",
+ "gcircle", "24D6",
+ "gcircumflex", "011D",
+ "gcommaaccent", "0123",
+ "gdot", "0121",
+ "gdotaccent", "0121",
+ "gecyrillic", "0433",
+ "gehiragana", "3052",
+ "gekatakana", "30B2",
+ "geometricallyequal", "2251",
+ "gereshaccenthebrew", "059C",
+ "gereshhebrew", "05F3",
+ "gereshmuqdamhebrew", "059D",
+ "germandbls", "00DF",
+ "gershayimaccenthebrew", "059E",
+ "gershayimhebrew", "05F4",
+ "getamark", "3013",
+ "ghabengali", "0998",
+ "ghadarmenian", "0572",
+ "ghadeva", "0918",
+ "ghagujarati", "0A98",
+ "ghagurmukhi", "0A18",
+ "ghainarabic", "063A",
+ "ghainfinalarabic", "FECE",
+ "ghaininitialarabic", "FECF",
+ "ghainmedialarabic", "FED0",
+ "ghemiddlehookcyrillic", "0495",
+ "ghestrokecyrillic", "0493",
+ "gheupturncyrillic", "0491",
+ "ghhadeva", "095A",
+ "ghhagurmukhi", "0A5A",
+ "ghook", "0260",
+ "ghzsquare", "3393",
+ "gihiragana", "304E",
+ "gikatakana", "30AE",
+ "gimarmenian", "0563",
+ "gimel", "05D2",
+ "gimeldagesh", "FB32",
+ "gimeldageshhebrew", "FB32",
+ "gimelhebrew", "05D2",
+ "gjecyrillic", "0453",
+ "glottalinvertedstroke", "01BE",
+ "glottalstop", "0294",
+ "glottalstopinverted", "0296",
+ "glottalstopmod", "02C0",
+ "glottalstopreversed", "0295",
+ "glottalstopreversedmod", "02C1",
+ "glottalstopreversedsuperior", "02E4",
+ "glottalstopstroke", "02A1",
+ "glottalstopstrokereversed", "02A2",
+ "gmacron", "1E21",
+ "gmonospace", "FF47",
+ "gohiragana", "3054",
+ "gokatakana", "30B4",
+ "gparen", "24A2",
+ "gpasquare", "33AC",
+ "gradient", "2207",
+ "grave", "0060",
+ "gravebelowcmb", "0316",
+ "gravecmb", "0300",
+ "gravecomb", "0300",
+ "gravedeva", "0953",
+ "gravelowmod", "02CE",
+ "gravemonospace", "FF40",
+ "gravetonecmb", "0340",
+ "greater", "003E",
+ "greaterequal", "2265",
+ "greaterequalorless", "22DB",
+ "greatermonospace", "FF1E",
+ "greaterorequivalent", "2273",
+ "greaterorless", "2277",
+ "greateroverequal", "2267",
+ "greatersmall", "FE65",
+ "gscript", "0261",
+ "gstroke", "01E5",
+ "guhiragana", "3050",
+ "guillemotleft", "00AB",
+ "guillemotright", "00BB",
+ "guilsinglleft", "2039",
+ "guilsinglright", "203A",
+ "gukatakana", "30B0",
+ "guramusquare", "3318",
+ "gysquare", "33C9",
+ "h", "0068",
+ "haabkhasiancyrillic", "04A9",
+ "haaltonearabic", "06C1",
+ "habengali", "09B9",
+ "hadescendercyrillic", "04B3",
+ "hadeva", "0939",
+ "hagujarati", "0AB9",
+ "hagurmukhi", "0A39",
+ "haharabic", "062D",
+ "hahfinalarabic", "FEA2",
+ "hahinitialarabic", "FEA3",
+ "hahiragana", "306F",
+ "hahmedialarabic", "FEA4",
+ "haitusquare", "332A",
+ "hakatakana", "30CF",
+ "hakatakanahalfwidth", "FF8A",
+ "halantgurmukhi", "0A4D",
+ "hamzaarabic", "0621",
+ "hamzadammaarabic", "0621_064F",
+ "hamzadammatanarabic", "0621_064C",
+ "hamzafathaarabic", "0621_064E",
+ "hamzafathatanarabic", "0621_064B",
+ "hamzalowarabic", "0621",
+ "hamzalowkasraarabic", "0621_0650",
+ "hamzalowkasratanarabic", "0621_064D",
+ "hamzasukunarabic", "0621_0652",
+ "hangulfiller", "3164",
+ "hardsigncyrillic", "044A",
+ "harpoonleftbarbup", "21BC",
+ "harpoonrightbarbup", "21C0",
+ "hasquare", "33CA",
+ "hatafpatah", "05B2",
+ "hatafpatah16", "05B2",
+ "hatafpatah23", "05B2",
+ "hatafpatah2f", "05B2",
+ "hatafpatahhebrew", "05B2",
+ "hatafpatahnarrowhebrew", "05B2",
+ "hatafpatahquarterhebrew", "05B2",
+ "hatafpatahwidehebrew", "05B2",
+ "hatafqamats", "05B3",
+ "hatafqamats1b", "05B3",
+ "hatafqamats28", "05B3",
+ "hatafqamats34", "05B3",
+ "hatafqamatshebrew", "05B3",
+ "hatafqamatsnarrowhebrew", "05B3",
+ "hatafqamatsquarterhebrew", "05B3",
+ "hatafqamatswidehebrew", "05B3",
+ "hatafsegol", "05B1",
+ "hatafsegol17", "05B1",
+ "hatafsegol24", "05B1",
+ "hatafsegol30", "05B1",
+ "hatafsegolhebrew", "05B1",
+ "hatafsegolnarrowhebrew", "05B1",
+ "hatafsegolquarterhebrew", "05B1",
+ "hatafsegolwidehebrew", "05B1",
+ "hbar", "0127",
+ "hbopomofo", "310F",
+ "hbrevebelow", "1E2B",
+ "hcedilla", "1E29",
+ "hcircle", "24D7",
+ "hcircumflex", "0125",
+ "hdieresis", "1E27",
+ "hdotaccent", "1E23",
+ "hdotbelow", "1E25",
+ "he", "05D4",
+ "heart", "2665",
+ "heartsuitblack", "2665",
+ "heartsuitwhite", "2661",
+ "hedagesh", "FB34",
+ "hedageshhebrew", "FB34",
+ "hehaltonearabic", "06C1",
+ "heharabic", "0647",
+ "hehebrew", "05D4",
+ "hehfinalaltonearabic", "FBA7",
+ "hehfinalalttwoarabic", "FEEA",
+ "hehfinalarabic", "FEEA",
+ "hehhamzaabovefinalarabic", "FBA5",
+ "hehhamzaaboveisolatedarabic", "FBA4",
+ "hehinitialaltonearabic", "FBA8",
+ "hehinitialarabic", "FEEB",
+ "hehiragana", "3078",
+ "hehmedialaltonearabic", "FBA9",
+ "hehmedialarabic", "FEEC",
+ "heiseierasquare", "337B",
+ "hekatakana", "30D8",
+ "hekatakanahalfwidth", "FF8D",
+ "hekutaarusquare", "3336",
+ "henghook", "0267",
+ "herutusquare", "3339",
+ "het", "05D7",
+ "hethebrew", "05D7",
+ "hhook", "0266",
+ "hhooksuperior", "02B1",
+ "hieuhacirclekorean", "327B",
+ "hieuhaparenkorean", "321B",
+ "hieuhcirclekorean", "326D",
+ "hieuhkorean", "314E",
+ "hieuhparenkorean", "320D",
+ "hihiragana", "3072",
+ "hikatakana", "30D2",
+ "hikatakanahalfwidth", "FF8B",
+ "hiriq", "05B4",
+ "hiriq14", "05B4",
+ "hiriq21", "05B4",
+ "hiriq2d", "05B4",
+ "hiriqhebrew", "05B4",
+ "hiriqnarrowhebrew", "05B4",
+ "hiriqquarterhebrew", "05B4",
+ "hiriqwidehebrew", "05B4",
+ "hlinebelow", "1E96",
+ "hmonospace", "FF48",
+ "hoarmenian", "0570",
+ "hohipthai", "0E2B",
+ "hohiragana", "307B",
+ "hokatakana", "30DB",
+ "hokatakanahalfwidth", "FF8E",
+ "holam", "05B9",
+ "holam19", "05B9",
+ "holam26", "05B9",
+ "holam32", "05B9",
+ "holamhebrew", "05B9",
+ "holamnarrowhebrew", "05B9",
+ "holamquarterhebrew", "05B9",
+ "holamwidehebrew", "05B9",
+ "honokhukthai", "0E2E",
+ "hookabovecomb", "0309",
+ "hookcmb", "0309",
+ "hookpalatalizedbelowcmb", "0321",
+ "hookretroflexbelowcmb", "0322",
+ "hoonsquare", "3342",
+ "horicoptic", "03E9",
+ "horizontalbar", "2015",
+ "horncmb", "031B",
+ "hotsprings", "2668",
+ "house", "2302",
+ "hparen", "24A3",
+ "hsuperior", "02B0",
+ "hturned", "0265",
+ "huhiragana", "3075",
+ "huiitosquare", "3333",
+ "hukatakana", "30D5",
+ "hukatakanahalfwidth", "FF8C",
+ "hungarumlaut", "02DD",
+ "hungarumlautcmb", "030B",
+ "hv", "0195",
+ "hyphen", "002D",
+ "hyphenmonospace", "FF0D",
+ "hyphensmall", "FE63",
+ "hyphentwo", "2010",
+ "i", "0069",
+ "iacute", "00ED",
+ "iacyrillic", "044F",
+ "ibengali", "0987",
+ "ibopomofo", "3127",
+ "ibreve", "012D",
+ "icaron", "01D0",
+ "icircle", "24D8",
+ "icircumflex", "00EE",
+ "icyrillic", "0456",
+ "idblgrave", "0209",
+ "ideographearthcircle", "328F",
+ "ideographfirecircle", "328B",
+ "ideographicallianceparen", "323F",
+ "ideographiccallparen", "323A",
+ "ideographiccentrecircle", "32A5",
+ "ideographicclose", "3006",
+ "ideographiccomma", "3001",
+ "ideographiccommaleft", "FF64",
+ "ideographiccongratulationparen", "3237",
+ "ideographiccorrectcircle", "32A3",
+ "ideographicearthparen", "322F",
+ "ideographicenterpriseparen", "323D",
+ "ideographicexcellentcircle", "329D",
+ "ideographicfestivalparen", "3240",
+ "ideographicfinancialcircle", "3296",
+ "ideographicfinancialparen", "3236",
+ "ideographicfireparen", "322B",
+ "ideographichaveparen", "3232",
+ "ideographichighcircle", "32A4",
+ "ideographiciterationmark", "3005",
+ "ideographiclaborcircle", "3298",
+ "ideographiclaborparen", "3238",
+ "ideographicleftcircle", "32A7",
+ "ideographiclowcircle", "32A6",
+ "ideographicmedicinecircle", "32A9",
+ "ideographicmetalparen", "322E",
+ "ideographicmoonparen", "322A",
+ "ideographicnameparen", "3234",
+ "ideographicperiod", "3002",
+ "ideographicprintcircle", "329E",
+ "ideographicreachparen", "3243",
+ "ideographicrepresentparen", "3239",
+ "ideographicresourceparen", "323E",
+ "ideographicrightcircle", "32A8",
+ "ideographicsecretcircle", "3299",
+ "ideographicselfparen", "3242",
+ "ideographicsocietyparen", "3233",
+ "ideographicspace", "3000",
+ "ideographicspecialparen", "3235",
+ "ideographicstockparen", "3231",
+ "ideographicstudyparen", "323B",
+ "ideographicsunparen", "3230",
+ "ideographicsuperviseparen", "323C",
+ "ideographicwaterparen", "322C",
+ "ideographicwoodparen", "322D",
+ "ideographiczero", "3007",
+ "ideographmetalcircle", "328E",
+ "ideographmooncircle", "328A",
+ "ideographnamecircle", "3294",
+ "ideographsuncircle", "3290",
+ "ideographwatercircle", "328C",
+ "ideographwoodcircle", "328D",
+ "ideva", "0907",
+ "idieresis", "00EF",
+ "idieresisacute", "1E2F",
+ "idieresiscyrillic", "04E5",
+ "idotbelow", "1ECB",
+ "iebrevecyrillic", "04D7",
+ "iecyrillic", "0435",
+ "ieungacirclekorean", "3275",
+ "ieungaparenkorean", "3215",
+ "ieungcirclekorean", "3267",
+ "ieungkorean", "3147",
+ "ieungparenkorean", "3207",
+ "igrave", "00EC",
+ "igujarati", "0A87",
+ "igurmukhi", "0A07",
+ "ihiragana", "3044",
+ "ihookabove", "1EC9",
+ "iibengali", "0988",
+ "iicyrillic", "0438",
+ "iideva", "0908",
+ "iigujarati", "0A88",
+ "iigurmukhi", "0A08",
+ "iimatragurmukhi", "0A40",
+ "iinvertedbreve", "020B",
+ "iishortcyrillic", "0439",
+ "iivowelsignbengali", "09C0",
+ "iivowelsigndeva", "0940",
+ "iivowelsigngujarati", "0AC0",
+ "ij", "0133",
+ "ikatakana", "30A4",
+ "ikatakanahalfwidth", "FF72",
+ "ikorean", "3163",
+ "ilde", "02DC",
+ "iluyhebrew", "05AC",
+ "imacron", "012B",
+ "imacroncyrillic", "04E3",
+ "imageorapproximatelyequal", "2253",
+ "imatragurmukhi", "0A3F",
+ "imonospace", "FF49",
+ "increment", "2206",
+ "infinity", "221E",
+ "iniarmenian", "056B",
+ "integral", "222B",
+ "integralbottom", "2321",
+ "integralbt", "2321",
+ "integraltop", "2320",
+ "integraltp", "2320",
+ "intersection", "2229",
+ "intisquare", "3305",
+ "invbullet", "25D8",
+ "invcircle", "25D9",
+ "invsmileface", "263B",
+ "iocyrillic", "0451",
+ "iogonek", "012F",
+ "iota", "03B9",
+ "iotadieresis", "03CA",
+ "iotadieresistonos", "0390",
+ "iotalatin", "0269",
+ "iotatonos", "03AF",
+ "iparen", "24A4",
+ "irigurmukhi", "0A72",
+ "ismallhiragana", "3043",
+ "ismallkatakana", "30A3",
+ "ismallkatakanahalfwidth", "FF68",
+ "issharbengali", "09FA",
+ "istroke", "0268",
+ "iterationhiragana", "309D",
+ "iterationkatakana", "30FD",
+ "itilde", "0129",
+ "itildebelow", "1E2D",
+ "iubopomofo", "3129",
+ "iucyrillic", "044E",
+ "ivowelsignbengali", "09BF",
+ "ivowelsigndeva", "093F",
+ "ivowelsigngujarati", "0ABF",
+ "izhitsacyrillic", "0475",
+ "izhitsadblgravecyrillic", "0477",
+ "j", "006A",
+ "jaarmenian", "0571",
+ "jabengali", "099C",
+ "jadeva", "091C",
+ "jagujarati", "0A9C",
+ "jagurmukhi", "0A1C",
+ "jbopomofo", "3110",
+ "jcaron", "01F0",
+ "jcircle", "24D9",
+ "jcircumflex", "0135",
+ "jcrossedtail", "029D",
+ "jdotlessstroke", "025F",
+ "jecyrillic", "0458",
+ "jeemarabic", "062C",
+ "jeemfinalarabic", "FE9E",
+ "jeeminitialarabic", "FE9F",
+ "jeemmedialarabic", "FEA0",
+ "jeharabic", "0698",
+ "jehfinalarabic", "FB8B",
+ "jhabengali", "099D",
+ "jhadeva", "091D",
+ "jhagujarati", "0A9D",
+ "jhagurmukhi", "0A1D",
+ "jheharmenian", "057B",
+ "jis", "3004",
+ "jmonospace", "FF4A",
+ "jparen", "24A5",
+ "jsuperior", "02B2",
+ "k", "006B",
+ "kabashkircyrillic", "04A1",
+ "kabengali", "0995",
+ "kacute", "1E31",
+ "kacyrillic", "043A",
+ "kadescendercyrillic", "049B",
+ "kadeva", "0915",
+ "kaf", "05DB",
+ "kafarabic", "0643",
+ "kafdagesh", "FB3B",
+ "kafdageshhebrew", "FB3B",
+ "kaffinalarabic", "FEDA",
+ "kafhebrew", "05DB",
+ "kafinitialarabic", "FEDB",
+ "kafmedialarabic", "FEDC",
+ "kafrafehebrew", "FB4D",
+ "kagujarati", "0A95",
+ "kagurmukhi", "0A15",
+ "kahiragana", "304B",
+ "kahookcyrillic", "04C4",
+ "kakatakana", "30AB",
+ "kakatakanahalfwidth", "FF76",
+ "kappa", "03BA",
+ "kappasymbolgreek", "03F0",
+ "kapyeounmieumkorean", "3171",
+ "kapyeounphieuphkorean", "3184",
+ "kapyeounpieupkorean", "3178",
+ "kapyeounssangpieupkorean", "3179",
+ "karoriisquare", "330D",
+ "kashidaautoarabic", "0640",
+ "kashidaautonosidebearingarabic", "0640",
+ "kasmallkatakana", "30F5",
+ "kasquare", "3384",
+ "kasraarabic", "0650",
+ "kasratanarabic", "064D",
+ "kastrokecyrillic", "049F",
+ "katahiraprolongmarkhalfwidth", "FF70",
+ "kaverticalstrokecyrillic", "049D",
+ "kbopomofo", "310E",
+ "kcalsquare", "3389",
+ "kcaron", "01E9",
+ "kcedilla", "0137",
+ "kcircle", "24DA",
+ "kcommaaccent", "0137",
+ "kdotbelow", "1E33",
+ "keharmenian", "0584",
+ "kehiragana", "3051",
+ "kekatakana", "30B1",
+ "kekatakanahalfwidth", "FF79",
+ "kenarmenian", "056F",
+ "kesmallkatakana", "30F6",
+ "kgreenlandic", "0138",
+ "khabengali", "0996",
+ "khacyrillic", "0445",
+ "khadeva", "0916",
+ "khagujarati", "0A96",
+ "khagurmukhi", "0A16",
+ "khaharabic", "062E",
+ "khahfinalarabic", "FEA6",
+ "khahinitialarabic", "FEA7",
+ "khahmedialarabic", "FEA8",
+ "kheicoptic", "03E7",
+ "khhadeva", "0959",
+ "khhagurmukhi", "0A59",
+ "khieukhacirclekorean", "3278",
+ "khieukhaparenkorean", "3218",
+ "khieukhcirclekorean", "326A",
+ "khieukhkorean", "314B",
+ "khieukhparenkorean", "320A",
+ "khokhaithai", "0E02",
+ "khokhonthai", "0E05",
+ "khokhuatthai", "0E03",
+ "khokhwaithai", "0E04",
+ "khomutthai", "0E5B",
+ "khook", "0199",
+ "khorakhangthai", "0E06",
+ "khzsquare", "3391",
+ "kihiragana", "304D",
+ "kikatakana", "30AD",
+ "kikatakanahalfwidth", "FF77",
+ "kiroguramusquare", "3315",
+ "kiromeetorusquare", "3316",
+ "kirosquare", "3314",
+ "kiyeokacirclekorean", "326E",
+ "kiyeokaparenkorean", "320E",
+ "kiyeokcirclekorean", "3260",
+ "kiyeokkorean", "3131",
+ "kiyeokparenkorean", "3200",
+ "kiyeoksioskorean", "3133",
+ "kjecyrillic", "045C",
+ "klinebelow", "1E35",
+ "klsquare", "3398",
+ "kmcubedsquare", "33A6",
+ "kmonospace", "FF4B",
+ "kmsquaredsquare", "33A2",
+ "kohiragana", "3053",
+ "kohmsquare", "33C0",
+ "kokaithai", "0E01",
+ "kokatakana", "30B3",
+ "kokatakanahalfwidth", "FF7A",
+ "kooposquare", "331E",
+ "koppacyrillic", "0481",
+ "koreanstandardsymbol", "327F",
+ "koroniscmb", "0343",
+ "kparen", "24A6",
+ "kpasquare", "33AA",
+ "ksicyrillic", "046F",
+ "ktsquare", "33CF",
+ "kturned", "029E",
+ "kuhiragana", "304F",
+ "kukatakana", "30AF",
+ "kukatakanahalfwidth", "FF78",
+ "kvsquare", "33B8",
+ "kwsquare", "33BE",
+ "l", "006C",
+ "labengali", "09B2",
+ "lacute", "013A",
+ "ladeva", "0932",
+ "lagujarati", "0AB2",
+ "lagurmukhi", "0A32",
+ "lakkhangyaothai", "0E45",
+ "lamaleffinalarabic", "FEFC",
+ "lamalefhamzaabovefinalarabic", "FEF8",
+ "lamalefhamzaaboveisolatedarabic", "FEF7",
+ "lamalefhamzabelowfinalarabic", "FEFA",
+ "lamalefhamzabelowisolatedarabic", "FEF9",
+ "lamalefisolatedarabic", "FEFB",
+ "lamalefmaddaabovefinalarabic", "FEF6",
+ "lamalefmaddaaboveisolatedarabic", "FEF5",
+ "lamarabic", "0644",
+ "lambda", "03BB",
+ "lambdastroke", "019B",
+ "lamed", "05DC",
+ "lameddagesh", "FB3C",
+ "lameddageshhebrew", "FB3C",
+ "lamedhebrew", "05DC",
+ "lamedholam", "05DC_05B9",
+ "lamedholamdagesh", "05DC_05B9_05BC",
+ "lamedholamdageshhebrew", "05DC_05B9_05BC",
+ "lamedholamhebrew", "05DC_05B9",
+ "lamfinalarabic", "FEDE",
+ "lamhahinitialarabic", "FCCA",
+ "laminitialarabic", "FEDF",
+ "lamjeeminitialarabic", "FCC9",
+ "lamkhahinitialarabic", "FCCB",
+ "lamlamhehisolatedarabic", "FDF2",
+ "lammedialarabic", "FEE0",
+ "lammeemhahinitialarabic", "FD88",
+ "lammeeminitialarabic", "FCCC",
+ "lammeemjeeminitialarabic", "FEDF_FEE4_FEA0",
+ "lammeemkhahinitialarabic", "FEDF_FEE4_FEA8",
+ "largecircle", "25EF",
+ "lbar", "019A",
+ "lbelt", "026C",
+ "lbopomofo", "310C",
+ "lcaron", "013E",
+ "lcedilla", "013C",
+ "lcircle", "24DB",
+ "lcircumflexbelow", "1E3D",
+ "lcommaaccent", "013C",
+ "ldot", "0140",
+ "ldotaccent", "0140",
+ "ldotbelow", "1E37",
+ "ldotbelowmacron", "1E39",
+ "leftangleabovecmb", "031A",
+ "lefttackbelowcmb", "0318",
+ "less", "003C",
+ "lessequal", "2264",
+ "lessequalorgreater", "22DA",
+ "lessmonospace", "FF1C",
+ "lessorequivalent", "2272",
+ "lessorgreater", "2276",
+ "lessoverequal", "2266",
+ "lesssmall", "FE64",
+ "lezh", "026E",
+ "lfblock", "258C",
+ "lhookretroflex", "026D",
+ "lira", "20A4",
+ "liwnarmenian", "056C",
+ "lj", "01C9",
+ "ljecyrillic", "0459",
+ "lladeva", "0933",
+ "llagujarati", "0AB3",
+ "llinebelow", "1E3B",
+ "llladeva", "0934",
+ "llvocalicbengali", "09E1",
+ "llvocalicdeva", "0961",
+ "llvocalicvowelsignbengali", "09E3",
+ "llvocalicvowelsigndeva", "0963",
+ "lmiddletilde", "026B",
+ "lmonospace", "FF4C",
+ "lmsquare", "33D0",
+ "lochulathai", "0E2C",
+ "logicaland", "2227",
+ "logicalnot", "00AC",
+ "logicalnotreversed", "2310",
+ "logicalor", "2228",
+ "lolingthai", "0E25",
+ "longs", "017F",
+ "lowlinecenterline", "FE4E",
+ "lowlinecmb", "0332",
+ "lowlinedashed", "FE4D",
+ "lozenge", "25CA",
+ "lparen", "24A7",
+ "lslash", "0142",
+ "lsquare", "2113",
+ "ltshade", "2591",
+ "luthai", "0E26",
+ "lvocalicbengali", "098C",
+ "lvocalicdeva", "090C",
+ "lvocalicvowelsignbengali", "09E2",
+ "lvocalicvowelsigndeva", "0962",
+ "lxsquare", "33D3",
+ "m", "006D",
+ "mabengali", "09AE",
+ "macron", "00AF",
+ "macronbelowcmb", "0331",
+ "macroncmb", "0304",
+ "macronlowmod", "02CD",
+ "macronmonospace", "FFE3",
+ "macute", "1E3F",
+ "madeva", "092E",
+ "magujarati", "0AAE",
+ "magurmukhi", "0A2E",
+ "mahapakhhebrew", "05A4",
+ "mahapakhlefthebrew", "05A4",
+ "mahiragana", "307E",
+ "maichattawathai", "0E4B",
+ "maiekthai", "0E48",
+ "maihanakatthai", "0E31",
+ "maitaikhuthai", "0E47",
+ "maithothai", "0E49",
+ "maitrithai", "0E4A",
+ "maiyamokthai", "0E46",
+ "makatakana", "30DE",
+ "makatakanahalfwidth", "FF8F",
+ "male", "2642",
+ "mansyonsquare", "3347",
+ "maqafhebrew", "05BE",
+ "mars", "2642",
+ "masoracirclehebrew", "05AF",
+ "masquare", "3383",
+ "mbopomofo", "3107",
+ "mbsquare", "33D4",
+ "mcircle", "24DC",
+ "mcubedsquare", "33A5",
+ "mdotaccent", "1E41",
+ "mdotbelow", "1E43",
+ "meemarabic", "0645",
+ "meemfinalarabic", "FEE2",
+ "meeminitialarabic", "FEE3",
+ "meemmedialarabic", "FEE4",
+ "meemmeeminitialarabic", "FCD1",
+ "meemmeemisolatedarabic", "FC48",
+ "meetorusquare", "334D",
+ "mehiragana", "3081",
+ "meizierasquare", "337E",
+ "mekatakana", "30E1",
+ "mekatakanahalfwidth", "FF92",
+ "mem", "05DE",
+ "memdagesh", "FB3E",
+ "memdageshhebrew", "FB3E",
+ "memhebrew", "05DE",
+ "menarmenian", "0574",
+ "merkhahebrew", "05A5",
+ "merkhakefulahebrew", "05A6",
+ "merkhakefulalefthebrew", "05A6",
+ "merkhalefthebrew", "05A5",
+ "mhook", "0271",
+ "mhzsquare", "3392",
+ "middledotkatakanahalfwidth", "FF65",
+ "middot", "00B7",
+ "mieumacirclekorean", "3272",
+ "mieumaparenkorean", "3212",
+ "mieumcirclekorean", "3264",
+ "mieumkorean", "3141",
+ "mieumpansioskorean", "3170",
+ "mieumparenkorean", "3204",
+ "mieumpieupkorean", "316E",
+ "mieumsioskorean", "316F",
+ "mihiragana", "307F",
+ "mikatakana", "30DF",
+ "mikatakanahalfwidth", "FF90",
+ "minus", "2212",
+ "minusbelowcmb", "0320",
+ "minuscircle", "2296",
+ "minusmod", "02D7",
+ "minusplus", "2213",
+ "minute", "2032",
+ "miribaarusquare", "334A",
+ "mirisquare", "3349",
+ "mlonglegturned", "0270",
+ "mlsquare", "3396",
+ "mmcubedsquare", "33A3",
+ "mmonospace", "FF4D",
+ "mmsquaredsquare", "339F",
+ "mohiragana", "3082",
+ "mohmsquare", "33C1",
+ "mokatakana", "30E2",
+ "mokatakanahalfwidth", "FF93",
+ "molsquare", "33D6",
+ "momathai", "0E21",
+ "moverssquare", "33A7",
+ "moverssquaredsquare", "33A8",
+ "mparen", "24A8",
+ "mpasquare", "33AB",
+ "mssquare", "33B3",
+ "mturned", "026F",
+ "mu", "00B5",
+ "mu1", "00B5",
+ "muasquare", "3382",
+ "muchgreater", "226B",
+ "muchless", "226A",
+ "mufsquare", "338C",
+ "mugreek", "03BC",
+ "mugsquare", "338D",
+ "muhiragana", "3080",
+ "mukatakana", "30E0",
+ "mukatakanahalfwidth", "FF91",
+ "mulsquare", "3395",
+ "multiply", "00D7",
+ "mumsquare", "339B",
+ "munahhebrew", "05A3",
+ "munahlefthebrew", "05A3",
+ "musicalnote", "266A",
+ "musicalnotedbl", "266B",
+ "musicflatsign", "266D",
+ "musicsharpsign", "266F",
+ "mussquare", "33B2",
+ "muvsquare", "33B6",
+ "muwsquare", "33BC",
+ "mvmegasquare", "33B9",
+ "mvsquare", "33B7",
+ "mwmegasquare", "33BF",
+ "mwsquare", "33BD",
+ "n", "006E",
+ "nabengali", "09A8",
+ "nabla", "2207",
+ "nacute", "0144",
+ "nadeva", "0928",
+ "nagujarati", "0AA8",
+ "nagurmukhi", "0A28",
+ "nahiragana", "306A",
+ "nakatakana", "30CA",
+ "nakatakanahalfwidth", "FF85",
+ "napostrophe", "0149",
+ "nasquare", "3381",
+ "nbopomofo", "310B",
+ "nbspace", "00A0",
+ "ncaron", "0148",
+ "ncedilla", "0146",
+ "ncircle", "24DD",
+ "ncircumflexbelow", "1E4B",
+ "ncommaaccent", "0146",
+ "ndotaccent", "1E45",
+ "ndotbelow", "1E47",
+ "nehiragana", "306D",
+ "nekatakana", "30CD",
+ "nekatakanahalfwidth", "FF88",
+ "newsheqelsign", "20AA",
+ "nfsquare", "338B",
+ "ngabengali", "0999",
+ "ngadeva", "0919",
+ "ngagujarati", "0A99",
+ "ngagurmukhi", "0A19",
+ "ngonguthai", "0E07",
+ "nhiragana", "3093",
+ "nhookleft", "0272",
+ "nhookretroflex", "0273",
+ "nieunacirclekorean", "326F",
+ "nieunaparenkorean", "320F",
+ "nieuncieuckorean", "3135",
+ "nieuncirclekorean", "3261",
+ "nieunhieuhkorean", "3136",
+ "nieunkorean", "3134",
+ "nieunpansioskorean", "3168",
+ "nieunparenkorean", "3201",
+ "nieunsioskorean", "3167",
+ "nieuntikeutkorean", "3166",
+ "nihiragana", "306B",
+ "nikatakana", "30CB",
+ "nikatakanahalfwidth", "FF86",
+ "nikhahitthai", "0E4D",
+ "nine", "0039",
+ "ninearabic", "0669",
+ "ninebengali", "09EF",
+ "ninecircle", "2468",
+ "ninecircleinversesansserif", "2792",
+ "ninedeva", "096F",
+ "ninegujarati", "0AEF",
+ "ninegurmukhi", "0A6F",
+ "ninehackarabic", "0669",
+ "ninehangzhou", "3029",
+ "nineideographicparen", "3228",
+ "nineinferior", "2089",
+ "ninemonospace", "FF19",
+ "nineparen", "247C",
+ "nineperiod", "2490",
+ "ninepersian", "06F9",
+ "nineroman", "2178",
+ "ninesuperior", "2079",
+ "nineteencircle", "2472",
+ "nineteenparen", "2486",
+ "nineteenperiod", "249A",
+ "ninethai", "0E59",
+ "nj", "01CC",
+ "njecyrillic", "045A",
+ "nkatakana", "30F3",
+ "nkatakanahalfwidth", "FF9D",
+ "nlegrightlong", "019E",
+ "nlinebelow", "1E49",
+ "nmonospace", "FF4E",
+ "nmsquare", "339A",
+ "nnabengali", "09A3",
+ "nnadeva", "0923",
+ "nnagujarati", "0AA3",
+ "nnagurmukhi", "0A23",
+ "nnnadeva", "0929",
+ "nohiragana", "306E",
+ "nokatakana", "30CE",
+ "nokatakanahalfwidth", "FF89",
+ "nonbreakingspace", "00A0",
+ "nonenthai", "0E13",
+ "nonuthai", "0E19",
+ "noonarabic", "0646",
+ "noonfinalarabic", "FEE6",
+ "noonghunnaarabic", "06BA",
+ "noonghunnafinalarabic", "FB9F",
+ "noonhehinitialarabic", "FEE7_FEEC",
+ "nooninitialarabic", "FEE7",
+ "noonjeeminitialarabic", "FCD2",
+ "noonjeemisolatedarabic", "FC4B",
+ "noonmedialarabic", "FEE8",
+ "noonmeeminitialarabic", "FCD5",
+ "noonmeemisolatedarabic", "FC4E",
+ "noonnoonfinalarabic", "FC8D",
+ "notcontains", "220C",
+ "notelement", "2209",
+ "notelementof", "2209",
+ "notequal", "2260",
+ "notgreater", "226F",
+ "notgreaternorequal", "2271",
+ "notgreaternorless", "2279",
+ "notidentical", "2262",
+ "notless", "226E",
+ "notlessnorequal", "2270",
+ "notparallel", "2226",
+ "notprecedes", "2280",
+ "notsubset", "2284",
+ "notsucceeds", "2281",
+ "notsuperset", "2285",
+ "nowarmenian", "0576",
+ "nparen", "24A9",
+ "nssquare", "33B1",
+ "nsuperior", "207F",
+ "ntilde", "00F1",
+ "nu", "03BD",
+ "nuhiragana", "306C",
+ "nukatakana", "30CC",
+ "nukatakanahalfwidth", "FF87",
+ "nuktabengali", "09BC",
+ "nuktadeva", "093C",
+ "nuktagujarati", "0ABC",
+ "nuktagurmukhi", "0A3C",
+ "numbersign", "0023",
+ "numbersignmonospace", "FF03",
+ "numbersignsmall", "FE5F",
+ "numeralsigngreek", "0374",
+ "numeralsignlowergreek", "0375",
+ "numero", "2116",
+ "nun", "05E0",
+ "nundagesh", "FB40",
+ "nundageshhebrew", "FB40",
+ "nunhebrew", "05E0",
+ "nvsquare", "33B5",
+ "nwsquare", "33BB",
+ "nyabengali", "099E",
+ "nyadeva", "091E",
+ "nyagujarati", "0A9E",
+ "nyagurmukhi", "0A1E",
+ "o", "006F",
+ "oacute", "00F3",
+ "oangthai", "0E2D",
+ "obarred", "0275",
+ "obarredcyrillic", "04E9",
+ "obarreddieresiscyrillic", "04EB",
+ "obengali", "0993",
+ "obopomofo", "311B",
+ "obreve", "014F",
+ "ocandradeva", "0911",
+ "ocandragujarati", "0A91",
+ "ocandravowelsigndeva", "0949",
+ "ocandravowelsigngujarati", "0AC9",
+ "ocaron", "01D2",
+ "ocircle", "24DE",
+ "ocircumflex", "00F4",
+ "ocircumflexacute", "1ED1",
+ "ocircumflexdotbelow", "1ED9",
+ "ocircumflexgrave", "1ED3",
+ "ocircumflexhookabove", "1ED5",
+ "ocircumflextilde", "1ED7",
+ "ocyrillic", "043E",
+ "odblacute", "0151",
+ "odblgrave", "020D",
+ "odeva", "0913",
+ "odieresis", "00F6",
+ "odieresiscyrillic", "04E7",
+ "odotbelow", "1ECD",
+ "oe", "0153",
+ "oekorean", "315A",
+ "ogonek", "02DB",
+ "ogonekcmb", "0328",
+ "ograve", "00F2",
+ "ogujarati", "0A93",
+ "oharmenian", "0585",
+ "ohiragana", "304A",
+ "ohookabove", "1ECF",
+ "ohorn", "01A1",
+ "ohornacute", "1EDB",
+ "ohorndotbelow", "1EE3",
+ "ohorngrave", "1EDD",
+ "ohornhookabove", "1EDF",
+ "ohorntilde", "1EE1",
+ "ohungarumlaut", "0151",
+ "oi", "01A3",
+ "oinvertedbreve", "020F",
+ "okatakana", "30AA",
+ "okatakanahalfwidth", "FF75",
+ "okorean", "3157",
+ "olehebrew", "05AB",
+ "omacron", "014D",
+ "omacronacute", "1E53",
+ "omacrongrave", "1E51",
+ "omdeva", "0950",
+ "omega", "03C9",
+ "omega1", "03D6",
+ "omegacyrillic", "0461",
+ "omegalatinclosed", "0277",
+ "omegaroundcyrillic", "047B",
+ "omegatitlocyrillic", "047D",
+ "omegatonos", "03CE",
+ "omgujarati", "0AD0",
+ "omicron", "03BF",
+ "omicrontonos", "03CC",
+ "omonospace", "FF4F",
+ "one", "0031",
+ "onearabic", "0661",
+ "onebengali", "09E7",
+ "onecircle", "2460",
+ "onecircleinversesansserif", "278A",
+ "onedeva", "0967",
+ "onedotenleader", "2024",
+ "oneeighth", "215B",
+ "onegujarati", "0AE7",
+ "onegurmukhi", "0A67",
+ "onehackarabic", "0661",
+ "onehalf", "00BD",
+ "onehangzhou", "3021",
+ "oneideographicparen", "3220",
+ "oneinferior", "2081",
+ "onemonospace", "FF11",
+ "onenumeratorbengali", "09F4",
+ "oneparen", "2474",
+ "oneperiod", "2488",
+ "onepersian", "06F1",
+ "onequarter", "00BC",
+ "oneroman", "2170",
+ "onesuperior", "00B9",
+ "onethai", "0E51",
+ "onethird", "2153",
+ "oogonek", "01EB",
+ "oogonekmacron", "01ED",
+ "oogurmukhi", "0A13",
+ "oomatragurmukhi", "0A4B",
+ "oopen", "0254",
+ "oparen", "24AA",
+ "openbullet", "25E6",
+ "option", "2325",
+ "ordfeminine", "00AA",
+ "ordmasculine", "00BA",
+ "orthogonal", "221F",
+ "oshortdeva", "0912",
+ "oshortvowelsigndeva", "094A",
+ "oslash", "00F8",
+ "oslashacute", "01FF",
+ "osmallhiragana", "3049",
+ "osmallkatakana", "30A9",
+ "osmallkatakanahalfwidth", "FF6B",
+ "ostrokeacute", "01FF",
+ "otcyrillic", "047F",
+ "otilde", "00F5",
+ "otildeacute", "1E4D",
+ "otildedieresis", "1E4F",
+ "oubopomofo", "3121",
+ "overline", "203E",
+ "overlinecenterline", "FE4A",
+ "overlinecmb", "0305",
+ "overlinedashed", "FE49",
+ "overlinedblwavy", "FE4C",
+ "overlinewavy", "FE4B",
+ "overscore", "00AF",
+ "ovowelsignbengali", "09CB",
+ "ovowelsigndeva", "094B",
+ "ovowelsigngujarati", "0ACB",
+ "p", "0070",
+ "paampssquare", "3380",
+ "paasentosquare", "332B",
+ "pabengali", "09AA",
+ "pacute", "1E55",
+ "padeva", "092A",
+ "pagedown", "21DF",
+ "pageup", "21DE",
+ "pagujarati", "0AAA",
+ "pagurmukhi", "0A2A",
+ "pahiragana", "3071",
+ "paiyannoithai", "0E2F",
+ "pakatakana", "30D1",
+ "palatalizationcyrilliccmb", "0484",
+ "palochkacyrillic", "04C0",
+ "pansioskorean", "317F",
+ "paragraph", "00B6",
+ "parallel", "2225",
+ "parenleft", "0028",
+ "parenleftaltonearabic", "FD3E",
+ "parenleftinferior", "208D",
+ "parenleftmonospace", "FF08",
+ "parenleftsmall", "FE59",
+ "parenleftsuperior", "207D",
+ "parenleftvertical", "FE35",
+ "parenright", "0029",
+ "parenrightaltonearabic", "FD3F",
+ "parenrightinferior", "208E",
+ "parenrightmonospace", "FF09",
+ "parenrightsmall", "FE5A",
+ "parenrightsuperior", "207E",
+ "parenrightvertical", "FE36",
+ "partialdiff", "2202",
+ "paseqhebrew", "05C0",
+ "pashtahebrew", "0599",
+ "pasquare", "33A9",
+ "patah", "05B7",
+ "patah11", "05B7",
+ "patah1d", "05B7",
+ "patah2a", "05B7",
+ "patahhebrew", "05B7",
+ "patahnarrowhebrew", "05B7",
+ "patahquarterhebrew", "05B7",
+ "patahwidehebrew", "05B7",
+ "pazerhebrew", "05A1",
+ "pbopomofo", "3106",
+ "pcircle", "24DF",
+ "pdotaccent", "1E57",
+ "pe", "05E4",
+ "pecyrillic", "043F",
+ "pedagesh", "FB44",
+ "pedageshhebrew", "FB44",
+ "peezisquare", "333B",
+ "pefinaldageshhebrew", "FB43",
+ "peharabic", "067E",
+ "peharmenian", "057A",
+ "pehebrew", "05E4",
+ "pehfinalarabic", "FB57",
+ "pehinitialarabic", "FB58",
+ "pehiragana", "307A",
+ "pehmedialarabic", "FB59",
+ "pekatakana", "30DA",
+ "pemiddlehookcyrillic", "04A7",
+ "perafehebrew", "FB4E",
+ "percent", "0025",
+ "percentarabic", "066A",
+ "percentmonospace", "FF05",
+ "percentsmall", "FE6A",
+ "period", "002E",
+ "periodarmenian", "0589",
+ "periodcentered", "00B7",
+ "periodhalfwidth", "FF61",
+ "periodmonospace", "FF0E",
+ "periodsmall", "FE52",
+ "perispomenigreekcmb", "0342",
+ "perpendicular", "22A5",
+ "perthousand", "2030",
+ "peseta", "20A7",
+ "pfsquare", "338A",
+ "phabengali", "09AB",
+ "phadeva", "092B",
+ "phagujarati", "0AAB",
+ "phagurmukhi", "0A2B",
+ "phi", "03C6",
+ "phi1", "03D5",
+ "phieuphacirclekorean", "327A",
+ "phieuphaparenkorean", "321A",
+ "phieuphcirclekorean", "326C",
+ "phieuphkorean", "314D",
+ "phieuphparenkorean", "320C",
+ "philatin", "0278",
+ "phinthuthai", "0E3A",
+ "phisymbolgreek", "03D5",
+ "phook", "01A5",
+ "phophanthai", "0E1E",
+ "phophungthai", "0E1C",
+ "phosamphaothai", "0E20",
+ "pi", "03C0",
+ "pieupacirclekorean", "3273",
+ "pieupaparenkorean", "3213",
+ "pieupcieuckorean", "3176",
+ "pieupcirclekorean", "3265",
+ "pieupkiyeokkorean", "3172",
+ "pieupkorean", "3142",
+ "pieupparenkorean", "3205",
+ "pieupsioskiyeokkorean", "3174",
+ "pieupsioskorean", "3144",
+ "pieupsiostikeutkorean", "3175",
+ "pieupthieuthkorean", "3177",
+ "pieuptikeutkorean", "3173",
+ "pihiragana", "3074",
+ "pikatakana", "30D4",
+ "pisymbolgreek", "03D6",
+ "piwrarmenian", "0583",
+ "plus", "002B",
+ "plusbelowcmb", "031F",
+ "pluscircle", "2295",
+ "plusminus", "00B1",
+ "plusmod", "02D6",
+ "plusmonospace", "FF0B",
+ "plussmall", "FE62",
+ "plussuperior", "207A",
+ "pmonospace", "FF50",
+ "pmsquare", "33D8",
+ "pohiragana", "307D",
+ "pointingindexdownwhite", "261F",
+ "pointingindexleftwhite", "261C",
+ "pointingindexrightwhite", "261E",
+ "pointingindexupwhite", "261D",
+ "pokatakana", "30DD",
+ "poplathai", "0E1B",
+ "postalmark", "3012",
+ "postalmarkface", "3020",
+ "pparen", "24AB",
+ "precedes", "227A",
+ "prescription", "211E",
+ "primemod", "02B9",
+ "primereversed", "2035",
+ "product", "220F",
+ "projective", "2305",
+ "prolongedkana", "30FC",
+ "propellor", "2318",
+ "propersubset", "2282",
+ "propersuperset", "2283",
+ "proportion", "2237",
+ "proportional", "221D",
+ "psi", "03C8",
+ "psicyrillic", "0471",
+ "psilipneumatacyrilliccmb", "0486",
+ "pssquare", "33B0",
+ "puhiragana", "3077",
+ "pukatakana", "30D7",
+ "pvsquare", "33B4",
+ "pwsquare", "33BA",
+ "q", "0071",
+ "qadeva", "0958",
+ "qadmahebrew", "05A8",
+ "qafarabic", "0642",
+ "qaffinalarabic", "FED6",
+ "qafinitialarabic", "FED7",
+ "qafmedialarabic", "FED8",
+ "qamats", "05B8",
+ "qamats10", "05B8",
+ "qamats1a", "05B8",
+ "qamats1c", "05B8",
+ "qamats27", "05B8",
+ "qamats29", "05B8",
+ "qamats33", "05B8",
+ "qamatsde", "05B8",
+ "qamatshebrew", "05B8",
+ "qamatsnarrowhebrew", "05B8",
+ "qamatsqatanhebrew", "05B8",
+ "qamatsqatannarrowhebrew", "05B8",
+ "qamatsqatanquarterhebrew", "05B8",
+ "qamatsqatanwidehebrew", "05B8",
+ "qamatsquarterhebrew", "05B8",
+ "qamatswidehebrew", "05B8",
+ "qarneyparahebrew", "059F",
+ "qbopomofo", "3111",
+ "qcircle", "24E0",
+ "qhook", "02A0",
+ "qmonospace", "FF51",
+ "qof", "05E7",
+ "qofdagesh", "FB47",
+ "qofdageshhebrew", "FB47",
+ "qofhatafpatah", "05E7_05B2",
+ "qofhatafpatahhebrew", "05E7_05B2",
+ "qofhatafsegol", "05E7_05B1",
+ "qofhatafsegolhebrew", "05E7_05B1",
+ "qofhebrew", "05E7",
+ "qofhiriq", "05E7_05B4",
+ "qofhiriqhebrew", "05E7_05B4",
+ "qofholam", "05E7_05B9",
+ "qofholamhebrew", "05E7_05B9",
+ "qofpatah", "05E7_05B7",
+ "qofpatahhebrew", "05E7_05B7",
+ "qofqamats", "05E7_05B8",
+ "qofqamatshebrew", "05E7_05B8",
+ "qofqubuts", "05E7_05BB",
+ "qofqubutshebrew", "05E7_05BB",
+ "qofsegol", "05E7_05B6",
+ "qofsegolhebrew", "05E7_05B6",
+ "qofsheva", "05E7_05B0",
+ "qofshevahebrew", "05E7_05B0",
+ "qoftsere", "05E7_05B5",
+ "qoftserehebrew", "05E7_05B5",
+ "qparen", "24AC",
+ "quarternote", "2669",
+ "qubuts", "05BB",
+ "qubuts18", "05BB",
+ "qubuts25", "05BB",
+ "qubuts31", "05BB",
+ "qubutshebrew", "05BB",
+ "qubutsnarrowhebrew", "05BB",
+ "qubutsquarterhebrew", "05BB",
+ "qubutswidehebrew", "05BB",
+ "question", "003F",
+ "questionarabic", "061F",
+ "questionarmenian", "055E",
+ "questiondown", "00BF",
+ "questiongreek", "037E",
+ "questionmonospace", "FF1F",
+ "quotedbl", "0022",
+ "quotedblbase", "201E",
+ "quotedblleft", "201C",
+ "quotedblmonospace", "FF02",
+ "quotedblprime", "301E",
+ "quotedblprimereversed", "301D",
+ "quotedblright", "201D",
+ "quoteleft", "2018",
+ "quoteleftreversed", "201B",
+ "quotereversed", "201B",
+ "quoteright", "2019",
+ "quoterightn", "0149",
+ "quotesinglbase", "201A",
+ "quotesingle", "0027",
+ "quotesinglemonospace", "FF07",
+ "r", "0072",
+ "raarmenian", "057C",
+ "rabengali", "09B0",
+ "racute", "0155",
+ "radeva", "0930",
+ "radical", "221A",
+ "radoverssquare", "33AE",
+ "radoverssquaredsquare", "33AF",
+ "radsquare", "33AD",
+ "rafe", "05BF",
+ "rafehebrew", "05BF",
+ "ragujarati", "0AB0",
+ "ragurmukhi", "0A30",
+ "rahiragana", "3089",
+ "rakatakana", "30E9",
+ "rakatakanahalfwidth", "FF97",
+ "ralowerdiagonalbengali", "09F1",
+ "ramiddlediagonalbengali", "09F0",
+ "ramshorn", "0264",
+ "ratio", "2236",
+ "rbopomofo", "3116",
+ "rcaron", "0159",
+ "rcedilla", "0157",
+ "rcircle", "24E1",
+ "rcommaaccent", "0157",
+ "rdblgrave", "0211",
+ "rdotaccent", "1E59",
+ "rdotbelow", "1E5B",
+ "rdotbelowmacron", "1E5D",
+ "referencemark", "203B",
+ "reflexsubset", "2286",
+ "reflexsuperset", "2287",
+ "registered", "00AE",
+ "reharabic", "0631",
+ "reharmenian", "0580",
+ "rehfinalarabic", "FEAE",
+ "rehiragana", "308C",
+ "rehyehaleflamarabic", "0631_FEF3_FE8E_0644",
+ "rekatakana", "30EC",
+ "rekatakanahalfwidth", "FF9A",
+ "resh", "05E8",
+ "reshdageshhebrew", "FB48",
+ "reshhatafpatah", "05E8_05B2",
+ "reshhatafpatahhebrew", "05E8_05B2",
+ "reshhatafsegol", "05E8_05B1",
+ "reshhatafsegolhebrew", "05E8_05B1",
+ "reshhebrew", "05E8",
+ "reshhiriq", "05E8_05B4",
+ "reshhiriqhebrew", "05E8_05B4",
+ "reshholam", "05E8_05B9",
+ "reshholamhebrew", "05E8_05B9",
+ "reshpatah", "05E8_05B7",
+ "reshpatahhebrew", "05E8_05B7",
+ "reshqamats", "05E8_05B8",
+ "reshqamatshebrew", "05E8_05B8",
+ "reshqubuts", "05E8_05BB",
+ "reshqubutshebrew", "05E8_05BB",
+ "reshsegol", "05E8_05B6",
+ "reshsegolhebrew", "05E8_05B6",
+ "reshsheva", "05E8_05B0",
+ "reshshevahebrew", "05E8_05B0",
+ "reshtsere", "05E8_05B5",
+ "reshtserehebrew", "05E8_05B5",
+ "reversedtilde", "223D",
+ "reviahebrew", "0597",
+ "reviamugrashhebrew", "0597",
+ "revlogicalnot", "2310",
+ "rfishhook", "027E",
+ "rfishhookreversed", "027F",
+ "rhabengali", "09DD",
+ "rhadeva", "095D",
+ "rho", "03C1",
+ "rhook", "027D",
+ "rhookturned", "027B",
+ "rhookturnedsuperior", "02B5",
+ "rhosymbolgreek", "03F1",
+ "rhotichookmod", "02DE",
+ "rieulacirclekorean", "3271",
+ "rieulaparenkorean", "3211",
+ "rieulcirclekorean", "3263",
+ "rieulhieuhkorean", "3140",
+ "rieulkiyeokkorean", "313A",
+ "rieulkiyeoksioskorean", "3169",
+ "rieulkorean", "3139",
+ "rieulmieumkorean", "313B",
+ "rieulpansioskorean", "316C",
+ "rieulparenkorean", "3203",
+ "rieulphieuphkorean", "313F",
+ "rieulpieupkorean", "313C",
+ "rieulpieupsioskorean", "316B",
+ "rieulsioskorean", "313D",
+ "rieulthieuthkorean", "313E",
+ "rieultikeutkorean", "316A",
+ "rieulyeorinhieuhkorean", "316D",
+ "rightangle", "221F",
+ "righttackbelowcmb", "0319",
+ "righttriangle", "22BF",
+ "rihiragana", "308A",
+ "rikatakana", "30EA",
+ "rikatakanahalfwidth", "FF98",
+ "ring", "02DA",
+ "ringbelowcmb", "0325",
+ "ringcmb", "030A",
+ "ringhalfleft", "02BF",
+ "ringhalfleftarmenian", "0559",
+ "ringhalfleftbelowcmb", "031C",
+ "ringhalfleftcentered", "02D3",
+ "ringhalfright", "02BE",
+ "ringhalfrightbelowcmb", "0339",
+ "ringhalfrightcentered", "02D2",
+ "rinvertedbreve", "0213",
+ "rittorusquare", "3351",
+ "rlinebelow", "1E5F",
+ "rlongleg", "027C",
+ "rlonglegturned", "027A",
+ "rmonospace", "FF52",
+ "rohiragana", "308D",
+ "rokatakana", "30ED",
+ "rokatakanahalfwidth", "FF9B",
+ "roruathai", "0E23",
+ "rparen", "24AD",
+ "rrabengali", "09DC",
+ "rradeva", "0931",
+ "rragurmukhi", "0A5C",
+ "rreharabic", "0691",
+ "rrehfinalarabic", "FB8D",
+ "rrvocalicbengali", "09E0",
+ "rrvocalicdeva", "0960",
+ "rrvocalicgujarati", "0AE0",
+ "rrvocalicvowelsignbengali", "09C4",
+ "rrvocalicvowelsigndeva", "0944",
+ "rrvocalicvowelsigngujarati", "0AC4",
+ "rtblock", "2590",
+ "rturned", "0279",
+ "rturnedsuperior", "02B4",
+ "ruhiragana", "308B",
+ "rukatakana", "30EB",
+ "rukatakanahalfwidth", "FF99",
+ "rupeemarkbengali", "09F2",
+ "rupeesignbengali", "09F3",
+ "ruthai", "0E24",
+ "rvocalicbengali", "098B",
+ "rvocalicdeva", "090B",
+ "rvocalicgujarati", "0A8B",
+ "rvocalicvowelsignbengali", "09C3",
+ "rvocalicvowelsigndeva", "0943",
+ "rvocalicvowelsigngujarati", "0AC3",
+ "s", "0073",
+ "sabengali", "09B8",
+ "sacute", "015B",
+ "sacutedotaccent", "1E65",
+ "sadarabic", "0635",
+ "sadeva", "0938",
+ "sadfinalarabic", "FEBA",
+ "sadinitialarabic", "FEBB",
+ "sadmedialarabic", "FEBC",
+ "sagujarati", "0AB8",
+ "sagurmukhi", "0A38",
+ "sahiragana", "3055",
+ "sakatakana", "30B5",
+ "sakatakanahalfwidth", "FF7B",
+ "sallallahoualayhewasallamarabic", "FDFA",
+ "samekh", "05E1",
+ "samekhdagesh", "FB41",
+ "samekhdageshhebrew", "FB41",
+ "samekhhebrew", "05E1",
+ "saraaathai", "0E32",
+ "saraaethai", "0E41",
+ "saraaimaimalaithai", "0E44",
+ "saraaimaimuanthai", "0E43",
+ "saraamthai", "0E33",
+ "saraathai", "0E30",
+ "saraethai", "0E40",
+ "saraiithai", "0E35",
+ "saraithai", "0E34",
+ "saraothai", "0E42",
+ "saraueethai", "0E37",
+ "sarauethai", "0E36",
+ "sarauthai", "0E38",
+ "sarauuthai", "0E39",
+ "sbopomofo", "3119",
+ "scaron", "0161",
+ "scarondotaccent", "1E67",
+ "scedilla", "015F",
+ "schwa", "0259",
+ "schwacyrillic", "04D9",
+ "schwadieresiscyrillic", "04DB",
+ "schwahook", "025A",
+ "scircle", "24E2",
+ "scircumflex", "015D",
+ "scommaaccent", "0219",
+ "sdotaccent", "1E61",
+ "sdotbelow", "1E63",
+ "sdotbelowdotaccent", "1E69",
+ "seagullbelowcmb", "033C",
+ "second", "2033",
+ "secondtonechinese", "02CA",
+ "section", "00A7",
+ "seenarabic", "0633",
+ "seenfinalarabic", "FEB2",
+ "seeninitialarabic", "FEB3",
+ "seenmedialarabic", "FEB4",
+ "segol", "05B6",
+ "segol13", "05B6",
+ "segol1f", "05B6",
+ "segol2c", "05B6",
+ "segolhebrew", "05B6",
+ "segolnarrowhebrew", "05B6",
+ "segolquarterhebrew", "05B6",
+ "segoltahebrew", "0592",
+ "segolwidehebrew", "05B6",
+ "seharmenian", "057D",
+ "sehiragana", "305B",
+ "sekatakana", "30BB",
+ "sekatakanahalfwidth", "FF7E",
+ "semicolon", "003B",
+ "semicolonarabic", "061B",
+ "semicolonmonospace", "FF1B",
+ "semicolonsmall", "FE54",
+ "semivoicedmarkkana", "309C",
+ "semivoicedmarkkanahalfwidth", "FF9F",
+ "sentisquare", "3322",
+ "sentosquare", "3323",
+ "seven", "0037",
+ "sevenarabic", "0667",
+ "sevenbengali", "09ED",
+ "sevencircle", "2466",
+ "sevencircleinversesansserif", "2790",
+ "sevendeva", "096D",
+ "seveneighths", "215E",
+ "sevengujarati", "0AED",
+ "sevengurmukhi", "0A6D",
+ "sevenhackarabic", "0667",
+ "sevenhangzhou", "3027",
+ "sevenideographicparen", "3226",
+ "seveninferior", "2087",
+ "sevenmonospace", "FF17",
+ "sevenparen", "247A",
+ "sevenperiod", "248E",
+ "sevenpersian", "06F7",
+ "sevenroman", "2176",
+ "sevensuperior", "2077",
+ "seventeencircle", "2470",
+ "seventeenparen", "2484",
+ "seventeenperiod", "2498",
+ "seventhai", "0E57",
+ "sfthyphen", "00AD",
+ "shaarmenian", "0577",
+ "shabengali", "09B6",
+ "shacyrillic", "0448",
+ "shaddaarabic", "0651",
+ "shaddadammaarabic", "FC61",
+ "shaddadammatanarabic", "FC5E",
+ "shaddafathaarabic", "FC60",
+ "shaddafathatanarabic", "0651_064B",
+ "shaddakasraarabic", "FC62",
+ "shaddakasratanarabic", "FC5F",
+ "shade", "2592",
+ "shadedark", "2593",
+ "shadelight", "2591",
+ "shademedium", "2592",
+ "shadeva", "0936",
+ "shagujarati", "0AB6",
+ "shagurmukhi", "0A36",
+ "shalshelethebrew", "0593",
+ "shbopomofo", "3115",
+ "shchacyrillic", "0449",
+ "sheenarabic", "0634",
+ "sheenfinalarabic", "FEB6",
+ "sheeninitialarabic", "FEB7",
+ "sheenmedialarabic", "FEB8",
+ "sheicoptic", "03E3",
+ "sheqel", "20AA",
+ "sheqelhebrew", "20AA",
+ "sheva", "05B0",
+ "sheva115", "05B0",
+ "sheva15", "05B0",
+ "sheva22", "05B0",
+ "sheva2e", "05B0",
+ "shevahebrew", "05B0",
+ "shevanarrowhebrew", "05B0",
+ "shevaquarterhebrew", "05B0",
+ "shevawidehebrew", "05B0",
+ "shhacyrillic", "04BB",
+ "shimacoptic", "03ED",
+ "shin", "05E9",
+ "shindagesh", "FB49",
+ "shindageshhebrew", "FB49",
+ "shindageshshindot", "FB2C",
+ "shindageshshindothebrew", "FB2C",
+ "shindageshsindot", "FB2D",
+ "shindageshsindothebrew", "FB2D",
+ "shindothebrew", "05C1",
+ "shinhebrew", "05E9",
+ "shinshindot", "FB2A",
+ "shinshindothebrew", "FB2A",
+ "shinsindot", "FB2B",
+ "shinsindothebrew", "FB2B",
+ "shook", "0282",
+ "sigma", "03C3",
+ "sigma1", "03C2",
+ "sigmafinal", "03C2",
+ "sigmalunatesymbolgreek", "03F2",
+ "sihiragana", "3057",
+ "sikatakana", "30B7",
+ "sikatakanahalfwidth", "FF7C",
+ "siluqhebrew", "05BD",
+ "siluqlefthebrew", "05BD",
+ "similar", "223C",
+ "sindothebrew", "05C2",
+ "siosacirclekorean", "3274",
+ "siosaparenkorean", "3214",
+ "sioscieuckorean", "317E",
+ "sioscirclekorean", "3266",
+ "sioskiyeokkorean", "317A",
+ "sioskorean", "3145",
+ "siosnieunkorean", "317B",
+ "siosparenkorean", "3206",
+ "siospieupkorean", "317D",
+ "siostikeutkorean", "317C",
+ "six", "0036",
+ "sixarabic", "0666",
+ "sixbengali", "09EC",
+ "sixcircle", "2465",
+ "sixcircleinversesansserif", "278F",
+ "sixdeva", "096C",
+ "sixgujarati", "0AEC",
+ "sixgurmukhi", "0A6C",
+ "sixhackarabic", "0666",
+ "sixhangzhou", "3026",
+ "sixideographicparen", "3225",
+ "sixinferior", "2086",
+ "sixmonospace", "FF16",
+ "sixparen", "2479",
+ "sixperiod", "248D",
+ "sixpersian", "06F6",
+ "sixroman", "2175",
+ "sixsuperior", "2076",
+ "sixteencircle", "246F",
+ "sixteencurrencydenominatorbengali", "09F9",
+ "sixteenparen", "2483",
+ "sixteenperiod", "2497",
+ "sixthai", "0E56",
+ "slash", "002F",
+ "slashmonospace", "FF0F",
+ "slong", "017F",
+ "slongdotaccent", "1E9B",
+ "smileface", "263A",
+ "smonospace", "FF53",
+ "sofpasuqhebrew", "05C3",
+ "softhyphen", "00AD",
+ "softsigncyrillic", "044C",
+ "sohiragana", "305D",
+ "sokatakana", "30BD",
+ "sokatakanahalfwidth", "FF7F",
+ "soliduslongoverlaycmb", "0338",
+ "solidusshortoverlaycmb", "0337",
+ "sorusithai", "0E29",
+ "sosalathai", "0E28",
+ "sosothai", "0E0B",
+ "sosuathai", "0E2A",
+ "space", "0020",
+ "spacehackarabic", "0020",
+ "spade", "2660",
+ "spadesuitblack", "2660",
+ "spadesuitwhite", "2664",
+ "sparen", "24AE",
+ "squarebelowcmb", "033B",
+ "squarecc", "33C4",
+ "squarecm", "339D",
+ "squarediagonalcrosshatchfill", "25A9",
+ "squarehorizontalfill", "25A4",
+ "squarekg", "338F",
+ "squarekm", "339E",
+ "squarekmcapital", "33CE",
+ "squareln", "33D1",
+ "squarelog", "33D2",
+ "squaremg", "338E",
+ "squaremil", "33D5",
+ "squaremm", "339C",
+ "squaremsquared", "33A1",
+ "squareorthogonalcrosshatchfill", "25A6",
+ "squareupperlefttolowerrightfill", "25A7",
+ "squareupperrighttolowerleftfill", "25A8",
+ "squareverticalfill", "25A5",
+ "squarewhitewithsmallblack", "25A3",
+ "srsquare", "33DB",
+ "ssabengali", "09B7",
+ "ssadeva", "0937",
+ "ssagujarati", "0AB7",
+ "ssangcieuckorean", "3149",
+ "ssanghieuhkorean", "3185",
+ "ssangieungkorean", "3180",
+ "ssangkiyeokkorean", "3132",
+ "ssangnieunkorean", "3165",
+ "ssangpieupkorean", "3143",
+ "ssangsioskorean", "3146",
+ "ssangtikeutkorean", "3138",
+ "sterling", "00A3",
+ "sterlingmonospace", "FFE1",
+ "strokelongoverlaycmb", "0336",
+ "strokeshortoverlaycmb", "0335",
+ "subset", "2282",
+ "subsetnotequal", "228A",
+ "subsetorequal", "2286",
+ "succeeds", "227B",
+ "suchthat", "220B",
+ "suhiragana", "3059",
+ "sukatakana", "30B9",
+ "sukatakanahalfwidth", "FF7D",
+ "sukunarabic", "0652",
+ "summation", "2211",
+ "sun", "263C",
+ "superset", "2283",
+ "supersetnotequal", "228B",
+ "supersetorequal", "2287",
+ "svsquare", "33DC",
+ "syouwaerasquare", "337C",
+ "t", "0074",
+ "tabengali", "09A4",
+ "tackdown", "22A4",
+ "tackleft", "22A3",
+ "tadeva", "0924",
+ "tagujarati", "0AA4",
+ "tagurmukhi", "0A24",
+ "taharabic", "0637",
+ "tahfinalarabic", "FEC2",
+ "tahinitialarabic", "FEC3",
+ "tahiragana", "305F",
+ "tahmedialarabic", "FEC4",
+ "taisyouerasquare", "337D",
+ "takatakana", "30BF",
+ "takatakanahalfwidth", "FF80",
+ "tatweelarabic", "0640",
+ "tau", "03C4",
+ "tav", "05EA",
+ "tavdages", "FB4A",
+ "tavdagesh", "FB4A",
+ "tavdageshhebrew", "FB4A",
+ "tavhebrew", "05EA",
+ "tbar", "0167",
+ "tbopomofo", "310A",
+ "tcaron", "0165",
+ "tccurl", "02A8",
+ "tcedilla", "0163",
+ "tcheharabic", "0686",
+ "tchehfinalarabic", "FB7B",
+ "tchehinitialarabic", "FB7C",
+ "tchehmedialarabic", "FB7D",
+ "tchehmeeminitialarabic", "FB7C_FEE4",
+ "tcircle", "24E3",
+ "tcircumflexbelow", "1E71",
+ "tcommaaccent", "0163",
+ "tdieresis", "1E97",
+ "tdotaccent", "1E6B",
+ "tdotbelow", "1E6D",
+ "tecyrillic", "0442",
+ "tedescendercyrillic", "04AD",
+ "teharabic", "062A",
+ "tehfinalarabic", "FE96",
+ "tehhahinitialarabic", "FCA2",
+ "tehhahisolatedarabic", "FC0C",
+ "tehinitialarabic", "FE97",
+ "tehiragana", "3066",
+ "tehjeeminitialarabic", "FCA1",
+ "tehjeemisolatedarabic", "FC0B",
+ "tehmarbutaarabic", "0629",
+ "tehmarbutafinalarabic", "FE94",
+ "tehmedialarabic", "FE98",
+ "tehmeeminitialarabic", "FCA4",
+ "tehmeemisolatedarabic", "FC0E",
+ "tehnoonfinalarabic", "FC73",
+ "tekatakana", "30C6",
+ "tekatakanahalfwidth", "FF83",
+ "telephone", "2121",
+ "telephoneblack", "260E",
+ "telishagedolahebrew", "05A0",
+ "telishaqetanahebrew", "05A9",
+ "tencircle", "2469",
+ "tenideographicparen", "3229",
+ "tenparen", "247D",
+ "tenperiod", "2491",
+ "tenroman", "2179",
+ "tesh", "02A7",
+ "tet", "05D8",
+ "tetdagesh", "FB38",
+ "tetdageshhebrew", "FB38",
+ "tethebrew", "05D8",
+ "tetsecyrillic", "04B5",
+ "tevirhebrew", "059B",
+ "tevirlefthebrew", "059B",
+ "thabengali", "09A5",
+ "thadeva", "0925",
+ "thagujarati", "0AA5",
+ "thagurmukhi", "0A25",
+ "thalarabic", "0630",
+ "thalfinalarabic", "FEAC",
+ "thanthakhatthai", "0E4C",
+ "theharabic", "062B",
+ "thehfinalarabic", "FE9A",
+ "thehinitialarabic", "FE9B",
+ "thehmedialarabic", "FE9C",
+ "thereexists", "2203",
+ "therefore", "2234",
+ "theta", "03B8",
+ "theta1", "03D1",
+ "thetasymbolgreek", "03D1",
+ "thieuthacirclekorean", "3279",
+ "thieuthaparenkorean", "3219",
+ "thieuthcirclekorean", "326B",
+ "thieuthkorean", "314C",
+ "thieuthparenkorean", "320B",
+ "thirteencircle", "246C",
+ "thirteenparen", "2480",
+ "thirteenperiod", "2494",
+ "thonangmonthothai", "0E11",
+ "thook", "01AD",
+ "thophuthaothai", "0E12",
+ "thorn", "00FE",
+ "thothahanthai", "0E17",
+ "thothanthai", "0E10",
+ "thothongthai", "0E18",
+ "thothungthai", "0E16",
+ "thousandcyrillic", "0482",
+ "thousandsseparatorarabic", "066C",
+ "thousandsseparatorpersian", "066C",
+ "three", "0033",
+ "threearabic", "0663",
+ "threebengali", "09E9",
+ "threecircle", "2462",
+ "threecircleinversesansserif", "278C",
+ "threedeva", "0969",
+ "threeeighths", "215C",
+ "threegujarati", "0AE9",
+ "threegurmukhi", "0A69",
+ "threehackarabic", "0663",
+ "threehangzhou", "3023",
+ "threeideographicparen", "3222",
+ "threeinferior", "2083",
+ "threemonospace", "FF13",
+ "threenumeratorbengali", "09F6",
+ "threeparen", "2476",
+ "threeperiod", "248A",
+ "threepersian", "06F3",
+ "threequarters", "00BE",
+ "threeroman", "2172",
+ "threesuperior", "00B3",
+ "threethai", "0E53",
+ "thzsquare", "3394",
+ "tihiragana", "3061",
+ "tikatakana", "30C1",
+ "tikatakanahalfwidth", "FF81",
+ "tikeutacirclekorean", "3270",
+ "tikeutaparenkorean", "3210",
+ "tikeutcirclekorean", "3262",
+ "tikeutkorean", "3137",
+ "tikeutparenkorean", "3202",
+ "tilde", "02DC",
+ "tildebelowcmb", "0330",
+ "tildecmb", "0303",
+ "tildecomb", "0303",
+ "tildedoublecmb", "0360",
+ "tildeoperator", "223C",
+ "tildeoverlaycmb", "0334",
+ "tildeverticalcmb", "033E",
+ "timescircle", "2297",
+ "tipehahebrew", "0596",
+ "tipehalefthebrew", "0596",
+ "tippigurmukhi", "0A70",
+ "titlocyrilliccmb", "0483",
+ "tiwnarmenian", "057F",
+ "tlinebelow", "1E6F",
+ "tmonospace", "FF54",
+ "toarmenian", "0569",
+ "tohiragana", "3068",
+ "tokatakana", "30C8",
+ "tokatakanahalfwidth", "FF84",
+ "tonebarextrahighmod", "02E5",
+ "tonebarextralowmod", "02E9",
+ "tonebarhighmod", "02E6",
+ "tonebarlowmod", "02E8",
+ "tonebarmidmod", "02E7",
+ "tonefive", "01BD",
+ "tonesix", "0185",
+ "tonetwo", "01A8",
+ "tonos", "0384",
+ "tonsquare", "3327",
+ "topatakthai", "0E0F",
+ "tortoiseshellbracketleft", "3014",
+ "tortoiseshellbracketleftsmall", "FE5D",
+ "tortoiseshellbracketleftvertical", "FE39",
+ "tortoiseshellbracketright", "3015",
+ "tortoiseshellbracketrightsmall", "FE5E",
+ "tortoiseshellbracketrightvertical", "FE3A",
+ "totaothai", "0E15",
+ "tpalatalhook", "01AB",
+ "tparen", "24AF",
+ "trademark", "2122",
+ "tretroflexhook", "0288",
+ "triagdn", "25BC",
+ "triaglf", "25C4",
+ "triagrt", "25BA",
+ "triagup", "25B2",
+ "ts", "02A6",
+ "tsadi", "05E6",
+ "tsadidagesh", "FB46",
+ "tsadidageshhebrew", "FB46",
+ "tsadihebrew", "05E6",
+ "tsecyrillic", "0446",
+ "tsere", "05B5",
+ "tsere12", "05B5",
+ "tsere1e", "05B5",
+ "tsere2b", "05B5",
+ "tserehebrew", "05B5",
+ "tserenarrowhebrew", "05B5",
+ "tserequarterhebrew", "05B5",
+ "tserewidehebrew", "05B5",
+ "tshecyrillic", "045B",
+ "ttabengali", "099F",
+ "ttadeva", "091F",
+ "ttagujarati", "0A9F",
+ "ttagurmukhi", "0A1F",
+ "tteharabic", "0679",
+ "ttehfinalarabic", "FB67",
+ "ttehinitialarabic", "FB68",
+ "ttehmedialarabic", "FB69",
+ "tthabengali", "09A0",
+ "tthadeva", "0920",
+ "tthagujarati", "0AA0",
+ "tthagurmukhi", "0A20",
+ "tturned", "0287",
+ "tuhiragana", "3064",
+ "tukatakana", "30C4",
+ "tukatakanahalfwidth", "FF82",
+ "tusmallhiragana", "3063",
+ "tusmallkatakana", "30C3",
+ "tusmallkatakanahalfwidth", "FF6F",
+ "twelvecircle", "246B",
+ "twelveparen", "247F",
+ "twelveperiod", "2493",
+ "twelveroman", "217B",
+ "twentycircle", "2473",
+ "twentyhangzhou", "5344",
+ "twentyparen", "2487",
+ "twentyperiod", "249B",
+ "two", "0032",
+ "twoarabic", "0662",
+ "twobengali", "09E8",
+ "twocircle", "2461",
+ "twocircleinversesansserif", "278B",
+ "twodeva", "0968",
+ "twodotenleader", "2025",
+ "twodotleader", "2025",
+ "twodotleadervertical", "FE30",
+ "twogujarati", "0AE8",
+ "twogurmukhi", "0A68",
+ "twohackarabic", "0662",
+ "twohangzhou", "3022",
+ "twoideographicparen", "3221",
+ "twoinferior", "2082",
+ "twomonospace", "FF12",
+ "twonumeratorbengali", "09F5",
+ "twoparen", "2475",
+ "twoperiod", "2489",
+ "twopersian", "06F2",
+ "tworoman", "2171",
+ "twostroke", "01BB",
+ "twosuperior", "00B2",
+ "twothai", "0E52",
+ "twothirds", "2154",
+ "u", "0075",
+ "uacute", "00FA",
+ "ubar", "0289",
+ "ubengali", "0989",
+ "ubopomofo", "3128",
+ "ubreve", "016D",
+ "ucaron", "01D4",
+ "ucircle", "24E4",
+ "ucircumflex", "00FB",
+ "ucircumflexbelow", "1E77",
+ "ucyrillic", "0443",
+ "udattadeva", "0951",
+ "udblacute", "0171",
+ "udblgrave", "0215",
+ "udeva", "0909",
+ "udieresis", "00FC",
+ "udieresisacute", "01D8",
+ "udieresisbelow", "1E73",
+ "udieresiscaron", "01DA",
+ "udieresiscyrillic", "04F1",
+ "udieresisgrave", "01DC",
+ "udieresismacron", "01D6",
+ "udotbelow", "1EE5",
+ "ugrave", "00F9",
+ "ugujarati", "0A89",
+ "ugurmukhi", "0A09",
+ "uhiragana", "3046",
+ "uhookabove", "1EE7",
+ "uhorn", "01B0",
+ "uhornacute", "1EE9",
+ "uhorndotbelow", "1EF1",
+ "uhorngrave", "1EEB",
+ "uhornhookabove", "1EED",
+ "uhorntilde", "1EEF",
+ "uhungarumlaut", "0171",
+ "uhungarumlautcyrillic", "04F3",
+ "uinvertedbreve", "0217",
+ "ukatakana", "30A6",
+ "ukatakanahalfwidth", "FF73",
+ "ukcyrillic", "0479",
+ "ukorean", "315C",
+ "umacron", "016B",
+ "umacroncyrillic", "04EF",
+ "umacrondieresis", "1E7B",
+ "umatragurmukhi", "0A41",
+ "umonospace", "FF55",
+ "underscore", "005F",
+ "underscoredbl", "2017",
+ "underscoremonospace", "FF3F",
+ "underscorevertical", "FE33",
+ "underscorewavy", "FE4F",
+ "union", "222A",
+ "universal", "2200",
+ "uogonek", "0173",
+ "uparen", "24B0",
+ "upblock", "2580",
+ "upperdothebrew", "05C4",
+ "upsilon", "03C5",
+ "upsilondieresis", "03CB",
+ "upsilondieresistonos", "03B0",
+ "upsilonlatin", "028A",
+ "upsilontonos", "03CD",
+ "uptackbelowcmb", "031D",
+ "uptackmod", "02D4",
+ "uragurmukhi", "0A73",
+ "uring", "016F",
+ "ushortcyrillic", "045E",
+ "usmallhiragana", "3045",
+ "usmallkatakana", "30A5",
+ "usmallkatakanahalfwidth", "FF69",
+ "ustraightcyrillic", "04AF",
+ "ustraightstrokecyrillic", "04B1",
+ "utilde", "0169",
+ "utildeacute", "1E79",
+ "utildebelow", "1E75",
+ "uubengali", "098A",
+ "uudeva", "090A",
+ "uugujarati", "0A8A",
+ "uugurmukhi", "0A0A",
+ "uumatragurmukhi", "0A42",
+ "uuvowelsignbengali", "09C2",
+ "uuvowelsigndeva", "0942",
+ "uuvowelsigngujarati", "0AC2",
+ "uvowelsignbengali", "09C1",
+ "uvowelsigndeva", "0941",
+ "uvowelsigngujarati", "0AC1",
+ "v", "0076",
+ "vadeva", "0935",
+ "vagujarati", "0AB5",
+ "vagurmukhi", "0A35",
+ "vakatakana", "30F7",
+ "vav", "05D5",
+ "vavdagesh", "FB35",
+ "vavdagesh65", "FB35",
+ "vavdageshhebrew", "FB35",
+ "vavhebrew", "05D5",
+ "vavholam", "FB4B",
+ "vavholamhebrew", "FB4B",
+ "vavvavhebrew", "05F0",
+ "vavyodhebrew", "05F1",
+ "vcircle", "24E5",
+ "vdotbelow", "1E7F",
+ "vecyrillic", "0432",
+ "veharabic", "06A4",
+ "vehfinalarabic", "FB6B",
+ "vehinitialarabic", "FB6C",
+ "vehmedialarabic", "FB6D",
+ "vekatakana", "30F9",
+ "venus", "2640",
+ "verticalbar", "007C",
+ "verticallineabovecmb", "030D",
+ "verticallinebelowcmb", "0329",
+ "verticallinelowmod", "02CC",
+ "verticallinemod", "02C8",
+ "vewarmenian", "057E",
+ "vhook", "028B",
+ "vikatakana", "30F8",
+ "viramabengali", "09CD",
+ "viramadeva", "094D",
+ "viramagujarati", "0ACD",
+ "visargabengali", "0983",
+ "visargadeva", "0903",
+ "visargagujarati", "0A83",
+ "vmonospace", "FF56",
+ "voarmenian", "0578",
+ "voicediterationhiragana", "309E",
+ "voicediterationkatakana", "30FE",
+ "voicedmarkkana", "309B",
+ "voicedmarkkanahalfwidth", "FF9E",
+ "vokatakana", "30FA",
+ "vparen", "24B1",
+ "vtilde", "1E7D",
+ "vturned", "028C",
+ "vuhiragana", "3094",
+ "vukatakana", "30F4",
+ "w", "0077",
+ "wacute", "1E83",
+ "waekorean", "3159",
+ "wahiragana", "308F",
+ "wakatakana", "30EF",
+ "wakatakanahalfwidth", "FF9C",
+ "wakorean", "3158",
+ "wasmallhiragana", "308E",
+ "wasmallkatakana", "30EE",
+ "wattosquare", "3357",
+ "wavedash", "301C",
+ "wavyunderscorevertical", "FE34",
+ "wawarabic", "0648",
+ "wawfinalarabic", "FEEE",
+ "wawhamzaabovearabic", "0624",
+ "wawhamzaabovefinalarabic", "FE86",
+ "wbsquare", "33DD",
+ "wcircle", "24E6",
+ "wcircumflex", "0175",
+ "wdieresis", "1E85",
+ "wdotaccent", "1E87",
+ "wdotbelow", "1E89",
+ "wehiragana", "3091",
+ "weierstrass", "2118",
+ "wekatakana", "30F1",
+ "wekorean", "315E",
+ "weokorean", "315D",
+ "wgrave", "1E81",
+ "whitebullet", "25E6",
+ "whitecircle", "25CB",
+ "whitecircleinverse", "25D9",
+ "whitecornerbracketleft", "300E",
+ "whitecornerbracketleftvertical", "FE43",
+ "whitecornerbracketright", "300F",
+ "whitecornerbracketrightvertical", "FE44",
+ "whitediamond", "25C7",
+ "whitediamondcontainingblacksmalldiamond", "25C8",
+ "whitedownpointingsmalltriangle", "25BF",
+ "whitedownpointingtriangle", "25BD",
+ "whiteleftpointingsmalltriangle", "25C3",
+ "whiteleftpointingtriangle", "25C1",
+ "whitelenticularbracketleft", "3016",
+ "whitelenticularbracketright", "3017",
+ "whiterightpointingsmalltriangle", "25B9",
+ "whiterightpointingtriangle", "25B7",
+ "whitesmallsquare", "25AB",
+ "whitesmilingface", "263A",
+ "whitesquare", "25A1",
+ "whitestar", "2606",
+ "whitetelephone", "260F",
+ "whitetortoiseshellbracketleft", "3018",
+ "whitetortoiseshellbracketright", "3019",
+ "whiteuppointingsmalltriangle", "25B5",
+ "whiteuppointingtriangle", "25B3",
+ "wihiragana", "3090",
+ "wikatakana", "30F0",
+ "wikorean", "315F",
+ "wmonospace", "FF57",
+ "wohiragana", "3092",
+ "wokatakana", "30F2",
+ "wokatakanahalfwidth", "FF66",
+ "won", "20A9",
+ "wonmonospace", "FFE6",
+ "wowaenthai", "0E27",
+ "wparen", "24B2",
+ "wring", "1E98",
+ "wsuperior", "02B7",
+ "wturned", "028D",
+ "wynn", "01BF",
+ "x", "0078",
+ "xabovecmb", "033D",
+ "xbopomofo", "3112",
+ "xcircle", "24E7",
+ "xdieresis", "1E8D",
+ "xdotaccent", "1E8B",
+ "xeharmenian", "056D",
+ "xi", "03BE",
+ "xmonospace", "FF58",
+ "xparen", "24B3",
+ "xsuperior", "02E3",
+ "y", "0079",
+ "yaadosquare", "334E",
+ "yabengali", "09AF",
+ "yacute", "00FD",
+ "yadeva", "092F",
+ "yaekorean", "3152",
+ "yagujarati", "0AAF",
+ "yagurmukhi", "0A2F",
+ "yahiragana", "3084",
+ "yakatakana", "30E4",
+ "yakatakanahalfwidth", "FF94",
+ "yakorean", "3151",
+ "yamakkanthai", "0E4E",
+ "yasmallhiragana", "3083",
+ "yasmallkatakana", "30E3",
+ "yasmallkatakanahalfwidth", "FF6C",
+ "yatcyrillic", "0463",
+ "ycircle", "24E8",
+ "ycircumflex", "0177",
+ "ydieresis", "00FF",
+ "ydotaccent", "1E8F",
+ "ydotbelow", "1EF5",
+ "yeharabic", "064A",
+ "yehbarreearabic", "06D2",
+ "yehbarreefinalarabic", "FBAF",
+ "yehfinalarabic", "FEF2",
+ "yehhamzaabovearabic", "0626",
+ "yehhamzaabovefinalarabic", "FE8A",
+ "yehhamzaaboveinitialarabic", "FE8B",
+ "yehhamzaabovemedialarabic", "FE8C",
+ "yehinitialarabic", "FEF3",
+ "yehmedialarabic", "FEF4",
+ "yehmeeminitialarabic", "FCDD",
+ "yehmeemisolatedarabic", "FC58",
+ "yehnoonfinalarabic", "FC94",
+ "yehthreedotsbelowarabic", "06D1",
+ "yekorean", "3156",
+ "yen", "00A5",
+ "yenmonospace", "FFE5",
+ "yeokorean", "3155",
+ "yeorinhieuhkorean", "3186",
+ "yerahbenyomohebrew", "05AA",
+ "yerahbenyomolefthebrew", "05AA",
+ "yericyrillic", "044B",
+ "yerudieresiscyrillic", "04F9",
+ "yesieungkorean", "3181",
+ "yesieungpansioskorean", "3183",
+ "yesieungsioskorean", "3182",
+ "yetivhebrew", "059A",
+ "ygrave", "1EF3",
+ "yhook", "01B4",
+ "yhookabove", "1EF7",
+ "yiarmenian", "0575",
+ "yicyrillic", "0457",
+ "yikorean", "3162",
+ "yinyang", "262F",
+ "yiwnarmenian", "0582",
+ "ymonospace", "FF59",
+ "yod", "05D9",
+ "yoddagesh", "FB39",
+ "yoddageshhebrew", "FB39",
+ "yodhebrew", "05D9",
+ "yodyodhebrew", "05F2",
+ "yodyodpatahhebrew", "FB1F",
+ "yohiragana", "3088",
+ "yoikorean", "3189",
+ "yokatakana", "30E8",
+ "yokatakanahalfwidth", "FF96",
+ "yokorean", "315B",
+ "yosmallhiragana", "3087",
+ "yosmallkatakana", "30E7",
+ "yosmallkatakanahalfwidth", "FF6E",
+ "yotgreek", "03F3",
+ "yoyaekorean", "3188",
+ "yoyakorean", "3187",
+ "yoyakthai", "0E22",
+ "yoyingthai", "0E0D",
+ "yparen", "24B4",
+ "ypogegrammeni", "037A",
+ "ypogegrammenigreekcmb", "0345",
+ "yr", "01A6",
+ "yring", "1E99",
+ "ysuperior", "02B8",
+ "ytilde", "1EF9",
+ "yturned", "028E",
+ "yuhiragana", "3086",
+ "yuikorean", "318C",
+ "yukatakana", "30E6",
+ "yukatakanahalfwidth", "FF95",
+ "yukorean", "3160",
+ "yusbigcyrillic", "046B",
+ "yusbigiotifiedcyrillic", "046D",
+ "yuslittlecyrillic", "0467",
+ "yuslittleiotifiedcyrillic", "0469",
+ "yusmallhiragana", "3085",
+ "yusmallkatakana", "30E5",
+ "yusmallkatakanahalfwidth", "FF6D",
+ "yuyekorean", "318B",
+ "yuyeokorean", "318A",
+ "yyabengali", "09DF",
+ "yyadeva", "095F",
+ "z", "007A",
+ "zaarmenian", "0566",
+ "zacute", "017A",
+ "zadeva", "095B",
+ "zagurmukhi", "0A5B",
+ "zaharabic", "0638",
+ "zahfinalarabic", "FEC6",
+ "zahinitialarabic", "FEC7",
+ "zahiragana", "3056",
+ "zahmedialarabic", "FEC8",
+ "zainarabic", "0632",
+ "zainfinalarabic", "FEB0",
+ "zakatakana", "30B6",
+ "zaqefgadolhebrew", "0595",
+ "zaqefqatanhebrew", "0594",
+ "zarqahebrew", "0598",
+ "zayin", "05D6",
+ "zayindagesh", "FB36",
+ "zayindageshhebrew", "FB36",
+ "zayinhebrew", "05D6",
+ "zbopomofo", "3117",
+ "zcaron", "017E",
+ "zcircle", "24E9",
+ "zcircumflex", "1E91",
+ "zcurl", "0291",
+ "zdot", "017C",
+ "zdotaccent", "017C",
+ "zdotbelow", "1E93",
+ "zecyrillic", "0437",
+ "zedescendercyrillic", "0499",
+ "zedieresiscyrillic", "04DF",
+ "zehiragana", "305C",
+ "zekatakana", "30BC",
+ "zero", "0030",
+ "zeroarabic", "0660",
+ "zerobengali", "09E6",
+ "zerodeva", "0966",
+ "zerogujarati", "0AE6",
+ "zerogurmukhi", "0A66",
+ "zerohackarabic", "0660",
+ "zeroinferior", "2080",
+ "zeromonospace", "FF10",
+ "zeropersian", "06F0",
+ "zerosuperior", "2070",
+ "zerothai", "0E50",
+ "zerowidthjoiner", "FEFF",
+ "zerowidthnonjoiner", "200C",
+ "zerowidthspace", "200B",
+ "zeta", "03B6",
+ "zhbopomofo", "3113",
+ "zhearmenian", "056A",
+ "zhebrevecyrillic", "04C2",
+ "zhecyrillic", "0436",
+ "zhedescendercyrillic", "0497",
+ "zhedieresiscyrillic", "04DD",
+ "zihiragana", "3058",
+ "zikatakana", "30B8",
+ "zinorhebrew", "05AE",
+ "zlinebelow", "1E95",
+ "zmonospace", "FF5A",
+ "zohiragana", "305E",
+ "zokatakana", "30BE",
+ "zparen", "24B5",
+ "zretroflexhook", "0290",
+ "zstroke", "01B6",
+ "zuhiragana", "305A",
+ "zukatakana", "30BA",
);
-$prog = $0;
+
+my $prog = $0;
$prog =~ s@.*/@@;
-$groff_sys_fontdir = "@FONTDIR@";
+my $groff_sys_fontdir = "@FONTDIR@";
+
+use Getopt::Std;
+getopts('a:d:e:i:mnsvx');
-do 'getopts.pl';
-do Getopts('a:d:e:i:mnsv');
+our ($opt_a, $opt_d, $opt_e, $opt_i, $opt_m, $opt_n, $opt_s, $opt_v, $opt_x);
if ($opt_v) {
print "GNU afmtodit (groff) version @VERSION@\n";
@@ -6054,24 +6060,36 @@ if ($opt_v) {
}
if ($#ARGV != 2) {
- die "usage: $prog [-mnsv] [-a angle] [-d DESC] [-e encoding]\n" .
+ die "usage: $prog [-mnsvx] [-a angle] [-d DESC] [-e encoding]\n" .
" [-i n] afmfile mapfile font\n";
}
-$afm = $ARGV[0];
-$map = $ARGV[1];
-$font = $ARGV[2];
-$desc = $opt_d || "DESC";
-$sys_map = $groff_sys_fontdir . "/devps/generate/" . $map;
-$sys_desc = $groff_sys_fontdir . "/devps/" . $desc;
+my $afm = $ARGV[0];
+my $map = $ARGV[1];
+my $font = $ARGV[2];
+my $desc = $opt_d || "DESC";
+my $sys_map = $groff_sys_fontdir . "/devps/generate/" . $map;
+my $sys_desc = $groff_sys_fontdir . "/devps/" . $desc;
# read the afm file
+my $psname;
+my $italic_angle = 0;
+my (@kern1, @kern2, @kernx);
+my (%italic_correction, %left_italic_correction);
+my %subscript_correction;
+# my %ligs
+my %ligatures;
+my (@encoding, %in_encoding);
+my (%width, %height, %depth);
+my (%left_side_bearing, %right_side_bearing);
+
open(AFM, $afm) || die "$prog: can't open \`$ARGV[0]': $!\n";
while (<AFM>) {
chop;
- @field = split(' ');
+ my @field = split(' ');
+ next if $#field < 0;
if ($field[0] eq "FontName") {
$psname = $field[1];
}
@@ -6080,9 +6098,9 @@ while (<AFM>) {
}
elsif ($field[0] eq "KPX") {
if ($#field == 3) {
- push(kern1, $field[1]);
- push(kern2, $field[2]);
- push(kernx, $field[3]);
+ push(@kern1, $field[1]);
+ push(@kern2, $field[2]);
+ push(@kernx, $field[3]);
}
}
elsif ($field[0] eq "italicCorrection") {
@@ -6097,18 +6115,19 @@ while (<AFM>) {
elsif ($field[0] eq "StartCharMetrics") {
while (<AFM>) {
@field = split(' ');
+ next if $#field < 0;
last if ($field[0] eq "EndCharMetrics");
if ($field[0] eq "C") {
- $c = -1;
- $wx = 0;
- $n = "";
- %ligs = ();
- $lly = 0;
- $ury = 0;
- $llx = 0;
- $urx = 0;
- $c = $field[1];
- $i = 2;
+ my $w;
+ my $wx = 0;
+ my $n = "";
+# %ligs = ();
+ my $lly = 0;
+ my $ury = 0;
+ my $llx = 0;
+ my $urx = 0;
+ my $c = $field[1];
+ my $i = 2;
while ($i <= $#field) {
if ($field[$i] eq "WX") {
$w = $field[$i + 1];
@@ -6125,10 +6144,10 @@ while (<AFM>) {
$ury = $field[$i + 4];
$i += 5;
}
- elsif ($field[$i] eq "L") {
- $ligs{$field[$i + 2]} = $field[$i + 1];
- $i += 3;
- }
+# elsif ($field[$i] eq "L") {
+# $ligs{$field[$i + 2]} = $field[$i + 1];
+# $i += 3;
+# }
else {
while ($i <= $#field && $field[$i] ne ";") {
$i++;
@@ -6145,9 +6164,9 @@ while (<AFM>) {
$depth{$n} = -$lly;
$left_side_bearing{$n} = -$llx;
$right_side_bearing{$n} = $urx - $w;
- while (($lig, $glyph2) = each %ligs) {
- $ligatures{$lig} = $n . " " . $glyph2;
- }
+# while ((my $lig, my $glyph2) = each %ligs) {
+# $ligatures{$lig} = $n . " " . $glyph2;
+# }
}
}
}
@@ -6156,6 +6175,7 @@ close(AFM);
# read the DESC file
+my ($sizescale, $resolution, $unitwidth);
$sizescale = 1;
open(DESC, $desc) || open(DESC, $sys_desc) ||
@@ -6163,24 +6183,32 @@ open(DESC, $desc) || open(DESC, $sys_desc) ||
while (<DESC>) {
next if /^#/;
chop;
- @field = split(' ');
+ my @field = split(' ');
+ next if $#field < 0;
last if $field[0] eq "charset";
- if ($field[0] eq "res") { $resolution = $field[1]; }
- if ($field[0] eq "unitwidth") { $unitwidth = $field[1]; }
- if ($field[0] eq "sizescale") { $sizescale = $field[1]; }
+ if ($field[0] eq "res") {
+ $resolution = $field[1];
+ }
+ elsif ($field[0] eq "unitwidth") {
+ $unitwidth = $field[1];
+ }
+ elsif ($field[0] eq "sizescale") {
+ $sizescale = $field[1];
+ }
}
close(DESC);
if ($opt_e) {
# read the encoding file
- $sys_opt_e = $groff_sys_fontdir . "/devps/" . $opt_e;
+ my $sys_opt_e = $groff_sys_fontdir . "/devps/" . $opt_e;
open(ENCODING, $opt_e) || open(ENCODING, $sys_opt_e) ||
die "$prog: can't open \`$opt_e' or \`$sys_opt_e': $!\n";
while (<ENCODING>) {
next if /^#/;
chop;
- @field = split(' ');
+ my @field = split(' ');
+ next if $#field < 0;
if ($#field == 1) {
if ($field[1] >= 0 && defined $width{$field[0]}) {
$encoding[$field[1]] = $field[0];
@@ -6193,29 +6221,41 @@ if ($opt_e) {
# read the map file
+my (%nmap, %map);
+
open(MAP, $map) || open(MAP, $sys_map) ||
die "$prog: can't open \`$map' or \`$sys_map': $!\n";
while (<MAP>) {
next if /^#/;
chop;
- @field = split(' ');
+ my @field = split(' ');
+ next if $#field < 0;
if ($#field == 1) {
- if (defined $mapped{$field[1]}) {
- warn "Both $mapped{$field[1]} and $field[0] map to $field[1]";
- }
- elsif ($field[1] eq "space") {
- # the PostScript character "space" is automatically mapped
- # to the groff character "space"; this is for grops
- warn "you are not allowed to map to the groff character `space'";
+ if ($field[1] eq "space") {
+ # The PostScript character "space" is automatically mapped
+ # to the groff character "space"; this is for grops.
+ warn "you are not allowed to map to " .
+ "the groff character \`space'";
}
elsif ($field[0] eq "space") {
- warn "you are not allowed to map the PostScript character `space'";
+ warn "you are not allowed to map " .
+ "the PostScript character \`space'";
}
else {
$nmap{$field[0]} += 0;
- $map{$field[0],$nmap{$field[0]}} = $field[1];
+ $map{$field[0], $nmap{$field[0]}} = $field[1];
$nmap{$field[0]} += 1;
- $mapped{$field[1]} = $field[0];
+
+ # There is more then one way to make a PS glyph name;
+ # let us try unicode names with `uni' and `u' prefixes.
+ my $utmp = $AGL_to_unicode{$field[0]};
+ if (defined $utmp && $utmp =~ /^[0-9A-F]{4}$/) {
+ foreach my $unicodepsname ("uni" . $utmp, "u" . $utmp) {
+ $nmap{$unicodepsname} += 0;
+ $map{$unicodepsname, $nmap{$unicodepsname}} = $field[1];
+ $nmap{$unicodepsname} += 1;
+ }
+ }
}
}
}
@@ -6223,32 +6263,142 @@ close(MAP);
$italic_angle = $opt_a if $opt_a;
-# add unencoded characters
-$i = ($#encoding > 256) ? ($#encoding + 1) : 256;
-while ($ch = each %width) {
- if (!$in_encoding{$ch}) {
- $encoding[$i] = $ch;
- $i++;
- if (!$nmap{$ch}) {
- $nmap{$ch} += 1;
- $u1 = $AGL_to_unicode{$ch};
- if ($u1) {
- $u2 = $unicode_decomposed{$u1};
- $u = $u2 ? $u2 : $u1;
+if (!$opt_x) {
+ my %mapped;
+ my $i = ($#encoding > 256) ? ($#encoding + 1) : 256;
+ while (my $ch = each %width) {
+ # add unencoded characters
+ if (!$in_encoding{$ch}) {
+ $encoding[$i] = $ch;
+ $i++;
+ }
+ if ($nmap{$ch}) {
+ for (my $j = 0; $j < $nmap{$ch}; $j++) {
+ if (defined $mapped{$map{$ch, $j}}) {
+ warn "both $mapped{$map{$ch, $j}} and $ch " .
+ "map to $map{$ch, $j}";
+ }
+ else {
+ $mapped{$map{$ch, $j}} = $ch;
+ }
}
- else {
- $u = "---";
+ }
+ else {
+ my $u = ""; # the resulting groff glyph name
+ my $ucomp = ""; # Unicode string before decomposition
+ my $utmp = ""; # temporary value
+ my $component = "";
+ my $nv = 0;
+
+ # Step 1:
+ # Drop all characters from the glyph name starting with the
+ # first occurrence of a period (U+002E FULL STOP), if any.
+ # ?? We avoid mapping of glyphs with periods, since they are
+ # likely to be variant glyphs, leading to a `many ps glyphs --
+ # one groff glyph' conflict.
+ #
+ # If multiple glyphs in the font represent the same character
+ # in the Unicode standard, as do `A' and `A.swash', for example,
+ # they can be differentiated by using the same base name with
+ # different suffixes. This suffix (the part of glyph name that
+ # follows the first period) does not participate in the
+ # computation of a character sequence. It can be used by font
+ # designers to indicate some characteristics of the glyph. The
+ # suffix may contain periods or any other permitted characters.
+ # Small cap A, for example, could be named `uni0041.sc' or `A.sc'.
+
+ next if $ch =~ /\./;
+
+ # Step 2:
+ # Split the remaining string into a sequence of components,
+ # using the underscore character (U+005F LOW LINE) as the
+ # delimiter.
+
+ while ($ch =~ /([^_]+)/g) {
+ $component = $1;
+
+ # Step 3:
+ # Map each component to a character string according to the
+ # procedure below:
+ #
+ # * If the component is in the Adobe Glyph List, then map
+ # it to the corresponding character in that list.
+
+ $utmp = $AGL_to_unicode{$component};
+ if ($utmp) {
+ $utmp = "U+" . $utmp;
+ }
+
+ # * Otherwise, if the component is of the form `uni'
+ # (U+0075 U+006E U+0069) followed by a sequence of
+ # uppercase hexadecimal digits (0 .. 9, A .. F, i.e.,
+ # U+0030 .. U+0039, U+0041 .. U+0046), the length of
+ # that sequence is a multiple of four, and each group of
+ # four digits represents a number in the set {0x0000 ..
+ # 0xD7FF, 0xE000 .. 0xFFFF}, then interpret each such
+ # number as a Unicode scalar value and map the component
+ # to the string made of those scalar values.
+
+ elsif ($component =~ /^uni([0-9A-F]{4})+$/) {
+ while ($component =~ /([0-9A-F]{4})/g) {
+ $nv = hex("0x" . $1);
+ if ($nv <= 0xD7FF || $nv >= 0xE000) {
+ $utmp .= "U+" . $1;
+ }
+ else {
+ $utmp = "";
+ last;
+ }
+ }
+ }
+
+ # * Otherwise, if the component is of the form `u' (U+0075)
+ # followed by a sequence of four to six uppercase
+ # hexadecimal digits {0 .. 9, A .. F} (U+0030 .. U+0039,
+ # U+0041 .. U+0046), and those digits represent a number
+ # in {0x0000 .. 0xD7FF, 0xE000 .. 0x10FFFF}, then
+ # interpret this number as a Unicode scalar value and map
+ # the component to the string made of this scalar value.
+
+ elsif ($component =~ /^u([0-9A-F]{4,6})$/) {
+ $nv = hex("0x" . $1);
+ if ($nv <= 0xD7FF || ($nv >= 0xE000 && $nv <= 0x10FFFF)) {
+ $utmp .= "U+" . $1;
+ }
+ }
+
+ # Finally, concatenate those strings; the result is the
+ # character string to which the glyph name is mapped.
+
+ $ucomp .= $utmp if $utmp;
+ }
+
+ # Unicode decomposition
+ while ($ucomp =~ /([0-9A-F]{4,6})/g) {
+ $component = $1;
+ $utmp = $unicode_decomposed{$component};
+ $u .= "_" . ($utmp ? $utmp : $component);
+ }
+ $u =~ s/^_/u/;
+ if ($u) {
+ if (defined $mapped{$u}) {
+ warn "both $mapped{$u} and $ch map to $u";
+ }
+ else {
+ $mapped{$u} = $ch;
+ }
+ $nmap{$ch} += 1;
+ $map{$ch, "0"} = $u;
}
- $map{$ch,"0"} = $u;
}
}
}
-# check explicitly for groff's standard ligatures -- many afm files don't
-# have proper `L' entries
+# Check explicitly for groff's standard ligatures -- many afm files don't
+# have proper `L' entries.
-%default_ligatures = (
+my %default_ligatures = (
"fi", "f i",
"fl", "f l",
"ff", "f f",
@@ -6256,7 +6406,7 @@ while ($ch = each %width) {
"ffl", "ff l",
);
-while (($lig, $components) = each %default_ligatures) {
+while (my ($lig, $components) = each %default_ligatures) {
if (defined $width{$lig} && !defined $ligatures{$lig}) {
$ligatures{$lig} = $components;
}
@@ -6271,17 +6421,17 @@ print("name $font\n");
print("internalname $psname\n") if $psname;
print("special\n") if $opt_s;
printf("slant %g\n", $italic_angle) if $italic_angle != 0;
-printf("spacewidth %d\n", do conv($width{"space"})) if defined $width{"space"};
+printf("spacewidth %d\n", conv($width{"space"})) if defined $width{"space"};
if ($opt_e) {
- $e = $opt_e;
+ my $e = $opt_e;
$e =~ s@.*/@@;
print("encoding $e\n");
}
if (!$opt_n && %ligatures) {
print("ligatures");
- while ($lig = each %ligatures) {
+ while (my $lig = each %ligatures) {
print(" $lig");
}
print(" 0\n");
@@ -6290,17 +6440,17 @@ if (!$opt_n && %ligatures) {
if ($#kern1 >= 0) {
print("kernpairs\n");
- for ($i = 0; $i <= $#kern1; $i++) {
- $c1 = $kern1[$i];
- $c2 = $kern2[$i];
+ for (my $i = 0; $i <= $#kern1; $i++) {
+ my $c1 = $kern1[$i];
+ my $c2 = $kern2[$i];
if ($nmap{$c1} != 0 && $nmap{$c2} != 0) {
- for ($j = 0; $j < $nmap{$c1}; $j++) {
- for ($k = 0; $k < $nmap{$c2}; $k++) {
+ for (my $j = 0; $j < $nmap{$c1}; $j++) {
+ for (my $k = 0; $k < $nmap{$c2}; $k++) {
if ($kernx[$i] != 0) {
printf("%s %s %d\n",
- $map{$c1,$j},
- $map{$c2,$k},
- do conv($kernx[$i]));
+ $map{$c1, $j},
+ $map{$c2, $k},
+ conv($kernx[$i]));
}
}
}
@@ -6308,17 +6458,22 @@ if ($#kern1 >= 0) {
}
}
+my ($asc_boundary, $desc_boundary, $xheight, $slant);
+
# characters not shorter than asc_boundary are considered to have ascenders
-$asc_boundary = $height{"t"} - 1;
+$asc_boundary = 0;
+$asc_boundary = $height{"t"} if defined $height{"t"};
+$asc_boundary -= 1;
# likewise for descenders
-$desc_boundary = $depth{"g"};
-$desc_boundary = $depth{"j"} if $depth{"j"} < $desc_boundary;
-$desc_boundary = $depth{"p"} if $depth{"p"} < $desc_boundary;
-$desc_boundary = $depth{"q"} if $depth{"q"} < $desc_boundary;
-$desc_boundary = $depth{"y"} if $depth{"y"} < $desc_boundary;
+$desc_boundary = 0;
+$desc_boundary = $depth{"g"} if defined $depth{"g"};
+$desc_boundary = $depth{"j"} if defined $depth{"g"} && $depth{"j"} < $desc_boundary;
+$desc_boundary = $depth{"p"} if defined $depth{"p"} && $depth{"p"} < $desc_boundary;
+$desc_boundary = $depth{"q"} if defined $depth{"q"} && $depth{"q"} < $desc_boundary;
+$desc_boundary = $depth{"y"} if defined $depth{"y"} && $depth{"y"} < $desc_boundary;
$desc_boundary -= 1;
if (defined $height{"x"}) {
@@ -6336,21 +6491,21 @@ $slant = sin($italic_angle)/cos($italic_angle);
$slant = 0 if $slant < 0;
print("charset\n");
-for ($i = 0; $i <= $#encoding; $i++) {
- $ch = $encoding[$i];
- if ($ch ne "" && $ch ne "space") {
- $map{$ch,"0"} = "---" if $nmap{$ch} == 0;
- $type = 0;
- $h = $height{$ch};
+for (my $i = 0; $i <= $#encoding; $i++) {
+ my $ch = $encoding[$i];
+ if (defined $ch && $ch ne "" && $ch ne "space") {
+ $map{$ch, "0"} = "---" if !defined $nmap{$ch} || $nmap{$ch} == 0;
+ my $type = 0;
+ my $h = $height{$ch};
$h = 0 if $h < 0;
- $d = $depth{$ch};
+ my $d = $depth{$ch};
$d = 0 if $d < 0;
$type = 1 if $d >= $desc_boundary;
$type += 2 if $h >= $asc_boundary;
- printf("%s\t%d", $map{$ch,"0"}, do conv($width{$ch}));
- $italic_correction = 0;
- $left_math_fit = 0;
- $subscript_correction = 0;
+ printf("%s\t%d", $map{$ch, "0"}, conv($width{$ch}));
+ my $italic_correction = 0;
+ my $left_math_fit = 0;
+ my $subscript_correction = 0;
if (defined $opt_i) {
$italic_correction = $right_side_bearing{$ch} + $opt_i;
$italic_correction = 0 if $italic_correction < 0;
@@ -6372,35 +6527,37 @@ for ($i = 0; $i <= $#encoding; $i++) {
$subscript_correction = $subscript_correction{$ch};
}
if ($subscript_correction != 0) {
- printf(",%d,%d", do conv($h), do conv($d));
- printf(",%d,%d,%d", do conv($italic_correction),
- do conv($left_math_fit),
- do conv($subscript_correction));
+ printf(",%d,%d", conv($h), conv($d));
+ printf(",%d,%d,%d", conv($italic_correction),
+ conv($left_math_fit),
+ conv($subscript_correction));
}
elsif ($left_math_fit != 0) {
- printf(",%d,%d", do conv($h), do conv($d));
- printf(",%d,%d", do conv($italic_correction),
- do conv($left_math_fit));
+ printf(",%d,%d", conv($h), conv($d));
+ printf(",%d,%d", conv($italic_correction),
+ conv($left_math_fit));
}
elsif ($italic_correction != 0) {
- printf(",%d,%d", do conv($h), do conv($d));
- printf(",%d", do conv($italic_correction));
+ printf(",%d,%d", conv($h), conv($d));
+ printf(",%d", conv($italic_correction));
}
elsif ($d != 0) {
- printf(",%d,%d", do conv($h), do conv($d));
+ printf(",%d,%d", conv($h), conv($d));
}
else {
# always put the height in to stop groff guessing
- printf(",%d", do conv($h));
+ printf(",%d", conv($h));
}
printf("\t%d", $type);
printf("\t%d\t%s\n", $i, $ch);
- for ($j = 1; $j < $nmap{$ch}; $j++) {
- printf("%s\t\"\n", $map{$ch,$j});
+ if (defined $nmap{$ch}) {
+ for (my $j = 1; $j < $nmap{$ch}; $j++) {
+ printf("%s\t\"\n", $map{$ch, $j});
+ }
}
}
- if ($ch eq "space" && defined $width{"space"}) {
- printf("space\t%d\t0\t%d\tspace\n", do conv($width{"space"}), $i);
+ if (defined $ch && $ch eq "space" && defined $width{"space"}) {
+ printf("space\t%d\t0\t%d\tspace\n", conv($width{"space"}), $i);
}
}
diff --git a/contrib/groff/src/utils/hpftodit/Makefile.sub b/contrib/groff/src/utils/hpftodit/Makefile.sub
index d83188c..6e80b47 100644
--- a/contrib/groff/src/utils/hpftodit/Makefile.sub
+++ b/contrib/groff/src/utils/hpftodit/Makefile.sub
@@ -2,5 +2,7 @@ PROG=hpftodit$(EXEEXT)
MAN1=hpftodit.n
XLIBS=$(LIBGROFF)
MLIB=$(LIBM)
-OBJS=hpftodit.$(OBJEXT)
-CCSRCS=$(srcdir)/hpftodit.cpp
+OBJS=hpftodit.$(OBJEXT) \
+ hpuni.$(OBJEXT)
+CCSRCS=$(srcdir)/hpftodit.cpp \
+ $(srcdir)/hpuni.cpp
diff --git a/contrib/groff/src/utils/hpftodit/hpftodit.cpp b/contrib/groff/src/utils/hpftodit/hpftodit.cpp
index fe512b6..5910fb2 100644
--- a/contrib/groff/src/utils/hpftodit/hpftodit.cpp
+++ b/contrib/groff/src/utils/hpftodit/hpftodit.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1994, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,21 +16,21 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
TODO
-put human readable font name in device file
devise new names for useful characters
-use --- for unnamed characters
option to specify symbol sets to look in
-make it work with TrueType fonts
put filename in error messages (or fix lib)
*/
#include "lib.h"
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
#include <math.h>
#include <errno.h>
#include "assert.h"
@@ -39,17 +39,31 @@ put filename in error messages (or fix lib)
#include "error.h"
#include "cset.h"
#include "nonposix.h"
+#include "unicode.h"
extern "C" const char *Version_string;
+extern const char *hp_msl_to_unicode_code(const char *);
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
+#define equal(a, b) (strcmp(a, b) == 0)
+// only valid if is_uname(c) has returned true
+#define is_decomposed(c) strchr(c, '_')
-const int MULTIPLIER = 3;
+#define NO 0
+#define YES 1
+
+#define MSL 0
+#define SYMSET 1
+#define UNICODE 2
+
+#define UNNAMED "---"
+
+static double multiplier = 3.0; // make Agfa-based unitwidth an integer
inline
int scale(int n)
{
- return n * MULTIPLIER;
+ return int(n * multiplier + 0.5);
}
// tags in TFM file
@@ -57,39 +71,67 @@ int scale(int n)
enum tag_type {
min_tag = 400,
type_tag = 400,
+ copyright_tag = 401,
+ comment_tag = 402,
+ charcode_tag = 403, // MSL for Intellifont, Unicode for TrueType
symbol_set_tag = 404,
- msl_tag = 403,
+ unique_identifier_tag = 405,
inches_per_point_tag = 406,
+ nominal_point_size_tag = 407,
design_units_per_em_tag = 408,
posture_tag = 409,
+ type_structure_tag = 410,
stroke_weight_tag = 411,
spacing_tag = 412,
slant_tag = 413,
appearance_width_tag = 414,
+ serif_style_tag = 415,
+ font_name_tag = 417,
+ typeface_source_tag = 418,
+ average_width_tag = 419,
+ max_width_tag = 420,
word_spacing_tag = 421,
+ recommended_line_spacing_tag = 422,
+ cap_height_tag = 423,
x_height_tag = 424,
+ max_ascent_tag = 425,
+ max_descent_tag = 426,
lower_ascent_tag = 427,
lower_descent_tag = 428,
+ underscore_depth_tag = 429,
+ underscore_thickness_tag = 430,
+ uppercase_accent_height_tag = 431,
+ lowercase_accent_height_tag = 432,
width_tag = 433,
+ vertical_escapement_tag = 434,
left_extent_tag = 435,
right_extent_tag = 436,
ascent_tag = 437,
descent_tag = 438,
pair_kern_tag = 439,
+ sector_kern_tag = 440,
+ track_kern_tag = 441,
typeface_tag = 442,
+ panose_tag = 443,
max_tag = 443
- };
+};
-// types in TFM file
+const char *tag_name[] = {
+ "Symbol Set",
+ "Font Type" // MSL for Intellifont, Unicode for TrueType
+};
+// types in TFM file
enum {
- ENUM_TYPE = 1,
- BYTE_TYPE = 2,
+ BYTE_TYPE = 1,
+ ASCII_TYPE = 2, // NUL-terminated string
USHORT_TYPE = 3,
- FLOAT_TYPE = 5,
- SIGNED_SHORT_TYPE = 17
- };
-
+ LONG_TYPE = 4, // unused
+ RATIONAL_TYPE = 5, // 8-byte numerator + 8-byte denominator
+ SIGNED_BYTE_TYPE = 16, // unused
+ SIGNED_SHORT_TYPE = 17,
+ SIGNED_LONG_TYPE = 18 // unused
+};
typedef unsigned char byte;
typedef unsigned short uint16;
@@ -103,6 +145,7 @@ public:
byte get_byte();
uint16 get_uint16();
uint32 get_uint32();
+ uint32 get_uint32(char *orig);
void seek(uint32 n);
private:
unsigned char *buf_;
@@ -115,11 +158,12 @@ struct entry {
uint16 type;
uint32 count;
uint32 value;
+ char orig_value[4];
entry() : present(0) { }
};
struct char_info {
- uint16 msl;
+ uint16 charcode;
uint16 width;
int16 ascent;
int16 descent;
@@ -129,6 +173,7 @@ struct char_info {
unsigned char code;
};
+const uint16 NO_GLYPH = 0xffff;
const uint16 NO_SYMBOL_SET = 0;
struct name_list {
@@ -146,43 +191,74 @@ struct symbol_set {
#define SYMBOL_SET(n, c) ((n) * 32 + ((c) - 64))
uint16 text_symbol_sets[] = {
- SYMBOL_SET(0, 'N'), // Latin 1
+ SYMBOL_SET(19, 'U'), // Windows Latin 1 ("ANSI", code page 1252)
+ SYMBOL_SET(9, 'E'), // Windows Latin 2, Code Page 1250
+ SYMBOL_SET(5, 'T'), // Code Page 1254
+ SYMBOL_SET(7, 'J'), // Desktop
SYMBOL_SET(6, 'J'), // Microsoft Publishing
- SYMBOL_SET(2, 'N'), // Latin 2
+ SYMBOL_SET(0, 'N'), // Latin 1 (subset of 19U,
+ // so we should never get here)
+ SYMBOL_SET(2, 'N'), // Latin 2 (subset of 9E,
+ // so we should never get here)
+ SYMBOL_SET(8, 'U'), // HP Roman 8
+ SYMBOL_SET(10, 'J'), // PS Standard
+ SYMBOL_SET(9, 'U'), // Windows 3.0 "ANSI"
+ SYMBOL_SET(1, 'U'), // U.S. Legal
+
+ SYMBOL_SET(12, 'J'), // MC Text
+ SYMBOL_SET(10, 'U'), // PC Code Page 437
+ SYMBOL_SET(11, 'U'), // PC Code Page 437N
+ SYMBOL_SET(17, 'U'), // PC Code Page 852
+ SYMBOL_SET(12, 'U'), // PC Code Page 850
+ SYMBOL_SET(9, 'T'), // PC Code Page 437T
0
- };
+};
uint16 special_symbol_sets[] = {
- SYMBOL_SET(8, 'M'),
- SYMBOL_SET(5, 'M'),
- SYMBOL_SET(15, 'U'),
+ SYMBOL_SET(8, 'M'), // Math 8
+ SYMBOL_SET(5, 'M'), // PS Math
+ SYMBOL_SET(15, 'U'), // Pi font
+ SYMBOL_SET(13, 'J'), // Ventura International
+ SYMBOL_SET(19, 'M'), // Symbol font
+ SYMBOL_SET(579, 'L'), // Wingdings
0
- };
+};
entry tags[max_tag + 1 - min_tag];
char_info *char_table;
-uint32 nchars;
+uint32 nchars = 0;
-unsigned int msl_name_table_size = 0;
-name_list **msl_name_table = 0;
+unsigned int charcode_name_table_size = 0;
+name_list **charcode_name_table = NULL;
-unsigned int n_symbol_sets;
symbol_set *symbol_set_table;
+unsigned int n_symbol_sets;
-static int special_flag = 0;
-static int italic_flag = 0;
+static int debug_flag = NO;
+static int special_flag = NO; // not a special font
+static int italic_flag = NO; // don't add italic correction
static int italic_sep;
-
-static void usage(FILE *stream);
+static int all_flag = NO; // don't include glyphs not in mapfile
+static int quiet_flag = NO; // don't suppress warnings about symbols not found
+
+static char *hp_msl_to_ucode_name(int);
+static char *unicode_to_ucode_name(int);
+static int is_uname(char *);
+static char *show_symset(unsigned int);
+static void usage(FILE *);
static void usage();
static const char *xbasename(const char *);
static void read_tags(File &);
-static void check_type();
-static void check_units(File &);
-static int read_map(const char *);
+static int check_type();
+static void check_units(File &, const int, double *, double *);
+static int read_map(const char *, const int);
static void require_tag(tag_type);
-static void dump_tags(File &f);
+static void dump_ascii(File &, tag_type);
+static void dump_tags(File &);
+static void dump_symbol_sets(File &);
+static void dump_symbols(int);
+static void output_font_name(File &);
static void output_spacewidth();
static void output_pclweight();
static void output_pclproportional();
@@ -192,8 +268,8 @@ static void output_slant();
static void output_ligatures();
static void read_symbol_sets(File &);
static void read_and_output_kernpairs(File &);
-static void output_charset();
-static void read_char_table(File &f);
+static void output_charset(const int);
+static void read_char_table(File &);
inline
entry &tag_info(tag_type t)
@@ -201,35 +277,44 @@ entry &tag_info(tag_type t)
return tags[t - min_tag];
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
program_name = argv[0];
int opt;
- int debug_flag = 0;
+ int res = 1200; // PCL unit of measure for cursor moves
+ int scalesize = 4; // LaserJet 4 only allows 1/4 point increments
+ int unitwidth = 6350;
+ double ppi; // points per inch
+ double upem; // design units per em
static const struct option long_options[] = {
{ "help", no_argument, 0, CHAR_MAX + 1 },
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((opt = getopt_long(argc, argv, "dsvi:", long_options, NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "adsqvi:", long_options, NULL)) != EOF) {
switch (opt) {
+ case 'a':
+ all_flag = YES;
+ break;
case 'd':
- debug_flag = 1;
+ debug_flag = YES;
break;
case 's':
- special_flag = 1;
+ special_flag = YES;
break;
case 'i':
- italic_flag = 1;
- italic_sep = atoi(optarg);
+ italic_flag = YES;
+ italic_sep = atoi(optarg); // design units
+ break;
+ case 'q':
+ quiet_flag = YES; // suppress warnings about symbols not found
break;
case 'v':
- {
- printf("GNU hpftodit (groff) version %s\n", Version_string);
- exit(0);
- }
+ printf("GNU hpftodit (groff) version %s\n", Version_string);
+ exit(0);
break;
case CHAR_MAX + 1: // --help
usage(stdout);
@@ -242,46 +327,72 @@ int main(int argc, char **argv)
assert(0);
}
}
- if (argc - optind != 3)
+
+ if (debug_flag && argc - optind < 1)
+ usage();
+ else if (!debug_flag && argc - optind != 3)
usage();
File f(argv[optind]);
- if (!read_map(argv[optind + 1]))
- exit(1);
- current_filename = 0;
- current_lineno = -1; // no line numbers
- if (freopen(argv[optind + 2], "w", stdout) == 0)
- fatal("cannot open `%1': %2", argv[optind + 2], strerror(errno));
- current_filename = argv[optind];
- printf("name %s\n", xbasename(argv[optind + 2]));
- if (special_flag)
- printf("special\n");
read_tags(f);
- check_type();
- check_units(f);
+ int tfm_type = check_type();
if (debug_flag)
dump_tags(f);
+ if (!debug_flag && !read_map(argv[optind + 1], tfm_type))
+ exit(1);
+ else if (debug_flag && argc - optind > 1)
+ read_map(argv[optind + 1], tfm_type);
+ current_filename = NULL;
+ current_lineno = -1; // no line numbers
+ if (!debug_flag && !equal(argv[optind + 2], "-"))
+ if (freopen(argv[optind + 2], "w", stdout) == NULL)
+ fatal("cannot open `%1': %2", argv[optind + 2], strerror(errno));
+ current_filename = argv[optind];
+
+ check_units(f, tfm_type, &ppi, &upem);
+ if (tfm_type == UNICODE) // don't calculate for Intellifont TFMs
+ multiplier = double(res) / upem / ppi * unitwidth / scalesize;
+ if (italic_flag)
+ // convert from thousandths of an em to design units
+ italic_sep = int(italic_sep * upem / 1000 + 0.5);
+
read_char_table(f);
- output_spacewidth();
- output_slant();
- read_and_output_pcltypeface(f);
- output_pclproportional();
- output_pclweight();
- output_pclstyle();
+ if (nchars == 0)
+ fatal("no characters");
+
+ if (!debug_flag) {
+ output_font_name(f);
+ printf("name %s\n", xbasename(argv[optind + 2]));
+ if (special_flag)
+ printf("special\n");
+ output_spacewidth();
+ output_slant();
+ read_and_output_pcltypeface(f);
+ output_pclproportional();
+ output_pclweight();
+ output_pclstyle();
+ }
read_symbol_sets(f);
- output_ligatures();
- read_and_output_kernpairs(f);
- output_charset();
+ if (debug_flag)
+ dump_symbols(tfm_type);
+ else {
+ output_ligatures();
+ read_and_output_kernpairs(f);
+ output_charset(tfm_type);
+ }
return 0;
}
-static
-void usage(FILE *stream)
+static void
+usage(FILE *stream)
{
- fprintf(stream, "usage: %s [-s] [-i n] tfm_file map_file output_font\n",
- program_name);
+ fprintf(stream,
+ "usage: %s [-s] [-a] [-q] [-i n] tfm_file map_file output_font\n"
+ " %s -d tfm_file [map_file]\n",
+ program_name, program_name);
}
-static
-void usage()
+
+static void
+usage()
{
usage(stderr);
exit(1);
@@ -310,28 +421,32 @@ File::File(const char *s)
end_ = buf_ + sb.st_size;
}
-void File::skip(int n)
+void
+File::skip(int n)
{
if (end_ - ptr_ < n)
fatal("unexpected end of file");
ptr_ += n;
}
-void File::seek(uint32 n)
+void
+File::seek(uint32 n)
{
- if ((uint32)(end_ - buf_) < n)
+ if (uint32(end_ - buf_) < n)
fatal("unexpected end of file");
ptr_ = buf_ + n;
}
-byte File::get_byte()
+byte
+File::get_byte()
{
if (ptr_ >= end_)
fatal("unexpected end of file");
return *ptr_++;
}
-uint16 File::get_uint16()
+uint16
+File::get_uint16()
{
if (end_ - ptr_ < 2)
fatal("unexpected end of file");
@@ -339,7 +454,8 @@ uint16 File::get_uint16()
return n + (*ptr_++ << 8);
}
-uint32 File::get_uint32()
+uint32
+File::get_uint32()
{
if (end_ - ptr_ < 4)
fatal("unexpected end of file");
@@ -349,8 +465,24 @@ uint32 File::get_uint32()
return n;
}
-static
-void read_tags(File &f)
+uint32
+File::get_uint32(char *orig)
+{
+ if (end_ - ptr_ < 4)
+ fatal("unexpected end of file");
+ unsigned char v = *ptr_++;
+ uint32 n = v;
+ orig[0] = v;
+ for (int i = 1; i < 4; i++) {
+ v = *ptr_++;
+ orig[i] = v;
+ n += v << i*8;
+ }
+ return n;
+}
+
+static void
+read_tags(File &f)
{
if (f.get_byte() != 'I' || f.get_byte() != 'I')
fatal("not an Intel format TFM file");
@@ -367,85 +499,149 @@ void read_tags(File &f)
p->present = 1;
p->type = f.get_uint16();
p->count = f.get_uint32();
- p->value = f.get_uint32();
+ p->value = f.get_uint32(p->orig_value);
}
}
-static
-void check_type()
+static int
+check_type()
{
require_tag(type_tag);
- if (tag_info(type_tag).value != 0) {
- if (tag_info(type_tag).value == 2)
- fatal("cannot handle TrueType tfm files");
- fatal("unknown type tag %1", int(tag_info(type_tag).value));
+ int tfm_type = tag_info(type_tag).value;
+ switch (tfm_type) {
+ case MSL:
+ case UNICODE:
+ break;
+ case SYMSET:
+ fatal("cannot handle Symbol Set TFM files");
+ break;
+ default:
+ fatal("unknown type tag %1", tfm_type);
}
+ return tfm_type;
}
-static
-void check_units(File &f)
+static void
+check_units(File &f, const int tfm_type, double *ppi, double *upem)
{
require_tag(design_units_per_em_tag);
f.seek(tag_info(design_units_per_em_tag).value);
uint32 num = f.get_uint32();
uint32 den = f.get_uint32();
- if (num != 8782 || den != 1)
+ if (tfm_type == MSL && (num != 8782 || den != 1))
fatal("design units per em != 8782/1");
+ *upem = double(num) / den;
require_tag(inches_per_point_tag);
f.seek(tag_info(inches_per_point_tag).value);
num = f.get_uint32();
den = f.get_uint32();
- if (num != 100 || den != 7231)
+ if (tfm_type == MSL && (num != 100 || den != 7231))
fatal("inches per point not 100/7231");
+ *ppi = double(den) / num;
}
-static
-void require_tag(tag_type t)
+static void
+require_tag(tag_type t)
{
if (!tag_info(t).present)
fatal("tag %1 missing", int(t));
}
-static
-void output_spacewidth()
+// put a human-readable font name in the file
+static void
+output_font_name(File &f)
+{
+ char *p;
+
+ if (!tag_info(font_name_tag).present)
+ return;
+ int count = tag_info(font_name_tag).count;
+ char *font_name = new char[count];
+
+ if (count > 4) { // value is a file offset to the string
+ f.seek(tag_info(font_name_tag).value);
+ int n = count;
+ p = font_name;
+ while (--n)
+ *p++ = f.get_byte();
+ }
+ else // orig_value contains the string
+ sprintf(font_name, "%.*s",
+ count, tag_info(font_name_tag).orig_value);
+
+ // remove any trailing space
+ p = font_name + count - 1;
+ while (csspace(*--p))
+ ;
+ *(p + 1) = '\0';
+ printf("# %s\n", font_name);
+ delete font_name;
+}
+
+static void
+output_spacewidth()
{
require_tag(word_spacing_tag);
printf("spacewidth %d\n", scale(tag_info(word_spacing_tag).value));
}
-static
-void read_symbol_sets(File &f)
+static void
+read_symbol_sets(File &f)
{
uint32 symbol_set_dir_length = tag_info(symbol_set_tag).count;
+ uint16 *symbol_set_selectors;
n_symbol_sets = symbol_set_dir_length/14;
symbol_set_table = new symbol_set[n_symbol_sets];
unsigned int i;
+
+ for (i = 0; i < nchars; i++)
+ char_table[i].symbol_set = NO_SYMBOL_SET;
+
for (i = 0; i < n_symbol_sets; i++) {
f.seek(tag_info(symbol_set_tag).value + i*14);
- (void)f.get_uint32();
- uint32 off1 = f.get_uint32();
- uint32 off2 = f.get_uint32();
- (void)f.get_uint16(); // what's this for?
+ (void)f.get_uint32(); // offset to symbol set name
+ uint32 off1 = f.get_uint32(); // offset to selection string
+ uint32 off2 = f.get_uint32(); // offset to symbol set index array
+
f.seek(off1);
+ uint16 kind = 0; // HP-GL "Kind 1" symbol set value
unsigned int j;
- uint16 kind = 0;
for (j = 0; j < off2 - off1; j++) {
unsigned char c = f.get_byte();
- if ('0' <= c && c <= '9')
+ if ('0' <= c && c <= '9') // value
kind = kind*10 + (c - '0');
- else if ('A' <= c && c <= 'Z')
+ else if ('A' <= c && c <= 'Z') // terminator
kind = kind*32 + (c - 64);
}
symbol_set_table[i].select = kind;
for (j = 0; j < 256; j++)
symbol_set_table[i].index[j] = f.get_uint16();
}
- for (i = 0; i < nchars; i++)
- char_table[i].symbol_set = NO_SYMBOL_SET;
- uint16 *symbol_set_selectors = (special_flag
- ? special_symbol_sets
- : text_symbol_sets);
+ symbol_set_selectors = (special_flag ? special_symbol_sets
+ : text_symbol_sets);
+ for (i = 0; symbol_set_selectors[i] != 0; i++) {
+ unsigned int j;
+ for (j = 0; j < n_symbol_sets; j++)
+ if (symbol_set_table[j].select == symbol_set_selectors[i])
+ break;
+ if (j < n_symbol_sets) {
+ for (int k = 0; k < 256; k++) {
+ uint16 idx = symbol_set_table[j].index[k];
+ if (idx != NO_GLYPH
+ && char_table[idx].symbol_set == NO_SYMBOL_SET) {
+ char_table[idx].symbol_set = symbol_set_table[j].select;
+ char_table[idx].code = k;
+ }
+ }
+ }
+ }
+
+ if (all_flag)
+ return;
+
+ symbol_set_selectors = (special_flag ? text_symbol_sets
+ : special_symbol_sets);
for (i = 0; symbol_set_selectors[i] != 0; i++) {
unsigned int j;
for (j = 0; j < n_symbol_sets; j++)
@@ -453,29 +649,30 @@ void read_symbol_sets(File &f)
break;
if (j < n_symbol_sets) {
for (int k = 0; k < 256; k++) {
- uint16 index = symbol_set_table[j].index[k];
- if (index != 0xffff
- && char_table[index].symbol_set == NO_SYMBOL_SET) {
- char_table[index].symbol_set = symbol_set_table[j].select;
- char_table[index].code = k;
+ uint16 idx = symbol_set_table[j].index[k];
+ if (idx != NO_GLYPH
+ && char_table[idx].symbol_set == NO_SYMBOL_SET) {
+ char_table[idx].symbol_set = symbol_set_table[j].select;
+ char_table[idx].code = k;
}
}
}
}
+ return;
}
-static
-void read_char_table(File &f)
+static void
+read_char_table(File &f)
{
- require_tag(msl_tag);
- nchars = tag_info(msl_tag).count;
+ require_tag(charcode_tag);
+ nchars = tag_info(charcode_tag).count;
char_table = new char_info[nchars];
- f.seek(tag_info(msl_tag).value);
+ f.seek(tag_info(charcode_tag).value);
uint32 i;
for (i = 0; i < nchars; i++)
- char_table[i].msl = f.get_uint16();
-
+ char_table[i].charcode = f.get_uint16();
+
require_tag(width_tag);
f.seek(tag_info(width_tag).value);
for (i = 0; i < nchars; i++)
@@ -508,8 +705,8 @@ void read_char_table(File &f)
char_table[i].right_extent = f.get_uint16();
}
-static
-void output_pclweight()
+static void
+output_pclweight()
{
require_tag(stroke_weight_tag);
int stroke_weight = tag_info(stroke_weight_tag).value;
@@ -527,30 +724,34 @@ void output_pclweight()
printf("pclweight %d\n", pcl_stroke_weight);
}
-static
-void output_pclproportional()
+static void
+output_pclproportional()
{
require_tag(spacing_tag);
printf("pclproportional %d\n", tag_info(spacing_tag).value == 0);
}
-static
-void read_and_output_pcltypeface(File &f)
+static void
+read_and_output_pcltypeface(File &f)
{
printf("pcltypeface ");
require_tag(typeface_tag);
- f.seek(tag_info(typeface_tag).value);
- for (uint32 i = 0; i < tag_info(typeface_tag).count; i++) {
- unsigned char c = f.get_byte();
- if (c == '\0')
- break;
- putchar(c);
+ if (tag_info(typeface_tag).count > 4) {
+ f.seek(tag_info(typeface_tag).value);
+ for (uint32 i = 0; i < tag_info(typeface_tag).count; i++) {
+ unsigned char c = f.get_byte();
+ if (c == '\0')
+ break;
+ putchar(c);
+ }
}
+ else
+ printf("%.4s", tag_info(typeface_tag).orig_value);
printf("\n");
}
-static
-void output_pclstyle()
+static void
+output_pclstyle()
{
unsigned pcl_style = 0;
// older tfms don't have the posture tag
@@ -569,8 +770,8 @@ void output_pclstyle()
printf("pclstyle %d\n", pcl_style);
}
-static
-void output_slant()
+static void
+output_slant()
{
require_tag(slant_tag);
int slant = int16(tag_info(slant_tag).value);
@@ -578,8 +779,8 @@ void output_slant()
printf("slant %f\n", slant/100.0);
}
-static
-void output_ligatures()
+static void
+output_ligatures()
{
// don't use ligatures for fixed space font
require_tag(spacing_tag);
@@ -592,14 +793,14 @@ void output_ligatures()
static const char *ligature_chars[] = {
"fi", "fl", "ff", "Fi", "Fl"
};
-
+
unsigned ligature_mask = 0;
unsigned int i;
for (i = 0; i < nchars; i++) {
- uint16 msl = char_table[i].msl;
- if (msl < msl_name_table_size
+ uint16 charcode = char_table[i].charcode;
+ if (charcode < charcode_name_table_size
&& char_table[i].symbol_set != NO_SYMBOL_SET) {
- for (name_list *p = msl_name_table[msl]; p; p = p->next)
+ for (name_list *p = charcode_name_table[charcode]; p; p = p->next)
for (unsigned int j = 0; j < SIZEOF(ligature_chars); j++)
if (strcmp(p->name, ligature_chars[j]) == 0) {
ligature_mask |= 1 << j;
@@ -616,8 +817,8 @@ void output_ligatures()
}
}
-static
-void read_and_output_kernpairs(File &f)
+static void
+read_and_output_kernpairs(File &f)
{
if (tag_info(pair_kern_tag).present) {
printf("kernpairs\n");
@@ -629,112 +830,512 @@ void read_and_output_kernpairs(File &f)
int16 val = int16(f.get_uint16());
if (char_table[i1].symbol_set != NO_SYMBOL_SET
&& char_table[i2].symbol_set != NO_SYMBOL_SET
- && char_table[i1].msl < msl_name_table_size
- && char_table[i2].msl < msl_name_table_size) {
- for (name_list *p = msl_name_table[char_table[i1].msl];
+ && char_table[i1].charcode < charcode_name_table_size
+ && char_table[i2].charcode < charcode_name_table_size) {
+ for (name_list *p = charcode_name_table[char_table[i1].charcode];
p;
p = p->next)
- for (name_list *q = msl_name_table[char_table[i2].msl];
+ for (name_list *q = charcode_name_table[char_table[i2].charcode];
q;
q = q->next)
- printf("%s %s %d\n", p->name, q->name, scale(val));
+ if (!equal(p->name, UNNAMED) && !equal(q->name, UNNAMED))
+ printf("%s %s %d\n", p->name, q->name, scale(val));
}
}
}
}
-static
-void output_charset()
+static void
+output_charset(const int tfm_type)
{
require_tag(slant_tag);
double slant_angle = int16(tag_info(slant_tag).value)*PI/18000.0;
double slant = sin(slant_angle)/cos(slant_angle);
- require_tag(x_height_tag);
+ if (italic_flag)
+ require_tag(x_height_tag);
require_tag(lower_ascent_tag);
require_tag(lower_descent_tag);
printf("charset\n");
unsigned int i;
for (i = 0; i < nchars; i++) {
- uint16 msl = char_table[i].msl;
- if (msl < msl_name_table_size
- && msl_name_table[msl]) {
- if (char_table[i].symbol_set != NO_SYMBOL_SET) {
- printf("%s\t%d,%d",
- msl_name_table[msl]->name,
- scale(char_table[i].width),
- scale(char_table[i].ascent));
- int depth = scale(- char_table[i].descent);
- if (depth < 0)
- depth = 0;
- int italic_correction = 0;
- int left_italic_correction = 0;
- int subscript_correction = 0;
- if (italic_flag) {
- italic_correction = scale(char_table[i].right_extent
- - char_table[i].width
- + italic_sep);
- if (italic_correction < 0)
- italic_correction = 0;
- subscript_correction = int((tag_info(x_height_tag).value
- * slant * .8) + .5);
- if (subscript_correction > italic_correction)
- subscript_correction = italic_correction;
- left_italic_correction = scale(italic_sep
- - char_table[i].left_extent);
- }
- if (subscript_correction != 0)
- printf(",%d,%d,%d,%d",
- depth, italic_correction, left_italic_correction,
- subscript_correction);
- else if (left_italic_correction != 0)
- printf(",%d,%d,%d", depth, italic_correction, left_italic_correction);
- else if (italic_correction != 0)
- printf(",%d,%d", depth, italic_correction);
- else if (depth != 0)
- printf(",%d", depth);
- // This is fairly arbitrary. Fortunately it doesn't much matter.
- unsigned type = 0;
- if (char_table[i].ascent > (int16(tag_info(lower_ascent_tag).value)*9)/10)
- type |= 2;
- if (char_table[i].descent < (int16(tag_info(lower_descent_tag).value)*9)/10)
- type |= 1;
- printf("\t%d\t%d\n",
- type,
- char_table[i].symbol_set*256 + char_table[i].code);
- for (name_list *p = msl_name_table[msl]->next; p; p = p->next)
- printf("%s\t\"\n", p->name);
+ uint16 charcode = char_table[i].charcode;
+
+ // the glyph is bound to one of the searched symbol sets
+ if (char_table[i].symbol_set != NO_SYMBOL_SET) {
+ // the character was in the map file
+ if (charcode < charcode_name_table_size && charcode_name_table[charcode])
+ printf("%s", charcode_name_table[charcode]->name);
+ else if (!all_flag)
+ continue;
+ else if (tfm_type == MSL)
+ printf(hp_msl_to_ucode_name(charcode));
+ else
+ printf(unicode_to_ucode_name(charcode));
+
+ printf("\t%d,%d",
+ scale(char_table[i].width), scale(char_table[i].ascent));
+
+ int depth = scale(-char_table[i].descent);
+ if (depth < 0)
+ depth = 0;
+ int italic_correction = 0;
+ int left_italic_correction = 0;
+ int subscript_correction = 0;
+
+ if (italic_flag) {
+ italic_correction = scale(char_table[i].right_extent
+ - char_table[i].width
+ + italic_sep);
+ if (italic_correction < 0)
+ italic_correction = 0;
+ subscript_correction = int((tag_info(x_height_tag).value
+ * slant * .8) + .5);
+ if (subscript_correction > italic_correction)
+ subscript_correction = italic_correction;
+ left_italic_correction = scale(italic_sep
+ - char_table[i].left_extent);
+ }
+
+ if (subscript_correction != 0)
+ printf(",%d,%d,%d,%d",
+ depth, italic_correction, left_italic_correction,
+ subscript_correction);
+ else if (left_italic_correction != 0)
+ printf(",%d,%d,%d", depth, italic_correction, left_italic_correction);
+ else if (italic_correction != 0)
+ printf(",%d,%d", depth, italic_correction);
+ else if (depth != 0)
+ printf(",%d", depth);
+ // This is fairly arbitrary. Fortunately it doesn't much matter.
+ unsigned type = 0;
+ if (char_table[i].ascent > int16(tag_info(lower_ascent_tag).value)*9/10)
+ type |= 2;
+ if (char_table[i].descent < int16(tag_info(lower_descent_tag).value)*9/10)
+ type |= 1;
+ printf("\t%d\t%d", type,
+ char_table[i].symbol_set*256 + char_table[i].code);
+
+ if (tfm_type == UNICODE) {
+ if (charcode >= 0xE000 && charcode <= 0xF8FF)
+ printf("\t-- HP PUA U+%04X", charcode);
+ else
+ printf("\t-- U+%04X", charcode);
}
else
- warning("MSL %1 not in any of the searched symbol sets", msl);
+ printf("\t-- MSL %4d", charcode);
+ printf(" (%3s %3d)\n",
+ show_symset(char_table[i].symbol_set), char_table[i].code);
+
+ if (charcode < charcode_name_table_size
+ && charcode_name_table[charcode])
+ for (name_list *p = charcode_name_table[charcode]->next;
+ p; p = p->next)
+ printf("%s\t\"\n", p->name);
+ }
+ // warnings about characters in mapfile not found in TFM
+ else if (charcode < charcode_name_table_size
+ && charcode_name_table[charcode]) {
+ char *name = charcode_name_table[charcode]->name;
+ // don't warn about Unicode or unnamed glyphs
+ // that aren't in the the TFM file
+ if (tfm_type == UNICODE && !quiet_flag && !equal(name, UNNAMED)
+ && !is_uname(name)) {
+ fprintf(stderr, "%s: warning: symbol U+%04X (%s",
+ program_name, charcode, name);
+ for (name_list *p = charcode_name_table[charcode]->next;
+ p; p = p->next)
+ fprintf(stderr, ", %s", p->name);
+ fprintf(stderr, ") not in any searched symbol set\n");
+ }
+ else if (!quiet_flag && !equal(name, UNNAMED) && !is_uname(name)) {
+ fprintf(stderr, "%s: warning: symbol MSL %d (%s",
+ program_name, charcode, name);
+ for (name_list *p = charcode_name_table[charcode]->next;
+ p; p = p->next)
+ fprintf(stderr, ", %s", p->name);
+ fprintf(stderr, ") not in any searched symbol set\n");
+ }
}
}
}
-static
-void dump_tags(File &f)
+#define em_fract(a) (upem >= 0 ? double(a)/upem : 0)
+
+static void
+dump_tags(File &f)
{
- int i;
- for (i = min_tag; i <= max_tag; i++) {
+ double upem = -1.0;
+
+ printf("TFM tags\n"
+ "\n"
+ "tag# type count value\n"
+ "---------------------\n");
+
+ for (int i = min_tag; i <= max_tag; i++) {
enum tag_type t = tag_type(i);
if (tag_info(t).present) {
- fprintf(stderr,
- "%d %d %d %d\n", i, tag_info(t).type, tag_info(t).count,
- tag_info(t).value);
- if (tag_info(t).type == FLOAT_TYPE
- && tag_info(t).count == 1) {
- f.seek(tag_info(t).value);
- uint32 num = f.get_uint32();
- uint32 den = f.get_uint32();
- fprintf(stderr, "(%u/%u = %g)\n", num, den, (double)num/den);
+ printf("%4d %4d %5d", i, tag_info(t).type, tag_info(t).count);
+ switch (tag_info(t).type) {
+ case BYTE_TYPE:
+ case USHORT_TYPE:
+ printf(" %5u", tag_info(t).value);
+ switch (i) {
+ case type_tag:
+ printf(" Font Type ");
+ switch (tag_info(t).value) {
+ case MSL:
+ case SYMSET:
+ printf("(Intellifont)");
+ break;
+ case UNICODE:
+ printf("(TrueType)");
+ }
+ break;
+ case charcode_tag:
+ printf(" Number of Symbols (%u)", tag_info(t).count);
+ break;
+ case symbol_set_tag:
+ printf(" Symbol Sets (%u): ",
+ tag_info(symbol_set_tag).count / 14);
+ dump_symbol_sets(f);
+ break;
+ case type_structure_tag:
+ printf(" Type Structure (%u)", tag_info(t).value);
+ break;
+ case stroke_weight_tag:
+ printf(" Stroke Weight (%u)", tag_info(t).value);
+ break;
+ case spacing_tag:
+ printf(" Spacing ");
+ switch (tag_info(t).value) {
+ case 0:
+ printf("(Proportional)");
+ break;
+ case 1:
+ printf("(Fixed Pitch: %u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ }
+ break;
+ case appearance_width_tag:
+ printf(" Appearance Width (%u)", tag_info(t).value);
+ break;
+ case serif_style_tag:
+ printf(" Serif Style (%u)", tag_info(t).value);
+ break;
+ case posture_tag:
+ printf(" Posture (%s)", tag_info(t).value == 0
+ ? "Upright"
+ : tag_info(t).value == 1
+ ? "Italic"
+ : "Alternate Italic");
+ break;
+ case max_width_tag:
+ printf(" Maximum Width (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case word_spacing_tag:
+ printf(" Interword Spacing (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case recommended_line_spacing_tag:
+ printf(" Recommended Line Spacing (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case x_height_tag:
+ printf(" x-Height (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case cap_height_tag:
+ printf(" Cap Height (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case max_ascent_tag:
+ printf(" Maximum Ascent (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case lower_ascent_tag:
+ printf(" Lowercase Ascent (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case underscore_thickness_tag:
+ printf(" Underscore Thickness (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case uppercase_accent_height_tag:
+ printf(" Uppercase Accent Height (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case lowercase_accent_height_tag:
+ printf(" Lowercase Accent Height (%u DU: %.2f em)", tag_info(t).value,
+ em_fract(tag_info(t).value));
+ break;
+ case width_tag:
+ printf(" Horizontal Escapement array");
+ break;
+ case vertical_escapement_tag:
+ printf(" Vertical Escapement array");
+ break;
+ case right_extent_tag:
+ printf(" Right Extent array");
+ break;
+ case ascent_tag:
+ printf(" Character Ascent array");
+ break;
+ case pair_kern_tag:
+ f.seek(tag_info(t).value);
+ printf(" Kern Pairs (%u)", f.get_uint16());
+ break;
+ case panose_tag:
+ printf(" PANOSE Classification array");
+ break;
+ }
+ break;
+ case SIGNED_SHORT_TYPE:
+ printf(" %5d", int16(tag_info(t).value));
+ switch (i) {
+ case slant_tag:
+ printf(" Slant (%.2f degrees)", double(tag_info(t).value) / 100);
+ break;
+ case max_descent_tag:
+ printf(" Maximum Descent (%d DU: %.2f em)", int16(tag_info(t).value),
+ em_fract(int16(tag_info(t).value)));
+ break;
+ case lower_descent_tag:
+ printf(" Lowercase Descent (%d DU: %.2f em)", int16(tag_info(t).value),
+ em_fract(int16(tag_info(t).value)));
+ break;
+ case underscore_depth_tag:
+ printf(" Underscore Depth (%d DU: %.2f em)", int16(tag_info(t).value),
+ em_fract(int16(tag_info(t).value)));
+ break;
+ case left_extent_tag:
+ printf(" Left Extent array");
+ break;
+ // The type of this tag has changed from SHORT to SIGNED SHORT
+ // in TFM version 1.3.0.
+ case ascent_tag:
+ printf(" Character Ascent array");
+ break;
+ case descent_tag:
+ printf(" Character Descent array");
+ break;
+ }
+ break;
+ case RATIONAL_TYPE:
+ printf(" %5u", tag_info(t).value);
+ switch (i) {
+ case inches_per_point_tag:
+ printf(" Inches per Point");
+ break;
+ case nominal_point_size_tag:
+ printf(" Nominal Point Size");
+ break;
+ case design_units_per_em_tag:
+ printf(" Design Units per Em");
+ break;
+ case average_width_tag:
+ printf(" Average Width");
+ break;
+ }
+ if (tag_info(t).count == 1) {
+ f.seek(tag_info(t).value);
+ uint32 num = f.get_uint32();
+ uint32 den = f.get_uint32();
+ if (i == design_units_per_em_tag)
+ upem = double(num) / den;
+ printf(" (%u/%u = %g)", num, den, double(num)/den);
+ }
+ break;
+ case ASCII_TYPE:
+ printf(" %5u ", tag_info(t).value);
+ switch (i) {
+ case comment_tag:
+ printf("Comment ");
+ break;
+ case copyright_tag:
+ printf("Copyright ");
+ break;
+ case unique_identifier_tag:
+ printf("Unique ID ");
+ break;
+ case font_name_tag:
+ printf("Typeface Name ");
+ break;
+ case typeface_source_tag:
+ printf("Typeface Source ");
+ break;
+ case typeface_tag:
+ printf("PCL Typeface ");
+ break;
+ }
+ dump_ascii(f, t);
+ }
+ putchar('\n');
+ }
+ }
+ putchar('\n');
+}
+#undef em_fract
+
+static void
+dump_ascii(File &f, tag_type t)
+{
+ putchar('"');
+ if (tag_info(t).count > 4) {
+ int count = tag_info(t).count;
+ f.seek(tag_info(t).value);
+ while (--count)
+ printf("%c", f.get_byte());
+ }
+ else
+ printf("%.4s", tag_info(t).orig_value);
+ putchar('"');
+}
+
+static void
+dump_symbol_sets(File &f)
+{
+ uint32 symbol_set_dir_length = tag_info(symbol_set_tag).count;
+ uint32 num_symbol_sets = symbol_set_dir_length / 14;
+
+ for (uint32 i = 0; i < num_symbol_sets; i++) {
+ f.seek(tag_info(symbol_set_tag).value + i * 14);
+ (void)f.get_uint32(); // offset to symbol set name
+ uint32 off1 = f.get_uint32(); // offset to selection string
+ uint32 off2 = f.get_uint32(); // offset to symbol set index array
+ f.seek(off1);
+ for (uint32 j = 0; j < off2 - off1; j++) {
+ unsigned char c = f.get_byte();
+ if ('0' <= c && c <= '9')
+ putchar(c);
+ else if ('A' <= c && c <= 'Z')
+ printf(i < num_symbol_sets - 1 ? "%c," : "%c", c);
+ }
+ }
+}
+
+static void
+dump_symbols(int tfm_type)
+{
+ printf("Symbols:\n"
+ "\n"
+ " glyph id# symbol set name(s)\n"
+ "----------------------------------\n");
+ for (uint32 i = 0; i < nchars; i++) {
+ uint16 charcode = char_table[i].charcode;
+ if (charcode < charcode_name_table_size
+ && charcode_name_table[charcode]) {
+ if (char_table[i].symbol_set != NO_SYMBOL_SET) {
+ printf(tfm_type == UNICODE ? "%4d (U+%04X) (%3s %3d) %s"
+ : "%4d (MSL %4d) (%3s %3d) %s",
+ i, charcode,
+ show_symset(char_table[i].symbol_set),
+ char_table[i].code,
+ charcode_name_table[charcode]->name);
+ for (name_list *p = charcode_name_table[charcode]->next;
+ p; p = p->next)
+ printf(", %s", p->name);
+ putchar('\n');
}
}
+ else {
+ printf(tfm_type == UNICODE ? "%4d (U+%04X) "
+ : "%4d (MSL %4d) ",
+ i, charcode);
+ if (char_table[i].symbol_set != NO_SYMBOL_SET)
+ printf("(%3s %3d)",
+ show_symset(char_table[i].symbol_set), char_table[i].code);
+ putchar('\n');
+ }
+ }
+ putchar('\n');
+}
+
+static char *
+show_symset(unsigned int symset)
+{
+ static char symset_str[8];
+
+ sprintf(symset_str, "%d%c", symset / 32, (symset & 31) + 64);
+ return symset_str;
+}
+
+static char *
+hp_msl_to_ucode_name(int msl)
+{
+ char codestr[8];
+
+ sprintf(codestr, "%d", msl);
+ const char *ustr = hp_msl_to_unicode_code(codestr);
+ if (ustr == NULL)
+ ustr = UNNAMED;
+ else {
+ char *nonum;
+ int ucode = int(strtol(ustr, &nonum, 16));
+ // don't allow PUA code points as Unicode names
+ if (ucode >= 0xE000 && ucode <= 0xF8FF)
+ ustr = UNNAMED;
+ }
+ if (!equal(ustr, UNNAMED)) {
+ const char *uname_decomposed = decompose_unicode(ustr);
+ if (uname_decomposed)
+ // 1st char is the number of components
+ ustr = uname_decomposed + 1;
+ }
+ char *value = new char[strlen(ustr) + 1];
+ sprintf(value, equal(ustr, UNNAMED) ? ustr : "u%s", ustr);
+ return value;
+}
+
+static char *
+unicode_to_ucode_name(int ucode)
+{
+ const char *ustr;
+ char codestr[8];
+
+ // don't allow PUA code points as Unicode names
+ if (ucode >= 0xE000 && ucode <= 0xF8FF)
+ ustr = UNNAMED;
+ else {
+ sprintf(codestr, "%04X", ucode);
+ ustr = codestr;
}
+ if (!equal(ustr, UNNAMED)) {
+ const char *uname_decomposed = decompose_unicode(ustr);
+ if (uname_decomposed)
+ // 1st char is the number of components
+ ustr = uname_decomposed + 1;
+ }
+ char *value = new char[strlen(ustr) + 1];
+ sprintf(value, equal(ustr, UNNAMED) ? ustr : "u%s", ustr);
+ return value;
+}
+
+static int
+is_uname(char *name)
+{
+ size_t i;
+ size_t len = strlen(name);
+ if (len % 5)
+ return 0;
+
+ if (name[0] != 'u')
+ return 0;
+ for (i = 1; i < 4; i++)
+ if (!csxdigit(name[i]))
+ return 0;
+ for (i = 5; i < len; i++)
+ if (i % 5 ? !csxdigit(name[i]) : name[i] != '_')
+ return 0;
+
+ return 1;
}
-static
-int read_map(const char *file)
+static int
+read_map(const char *file, const int tfm_type)
{
errno = 0;
FILE *fp = fopen(file, "r");
@@ -745,6 +1346,7 @@ int read_map(const char *file)
current_filename = file;
char buf[512];
current_lineno = 0;
+ char *nonum;
while (fgets(buf, int(sizeof(buf)), fp)) {
current_lineno++;
char *ptr = buf;
@@ -755,44 +1357,85 @@ int read_map(const char *file)
ptr = strtok(ptr, " \n\t");
if (!ptr)
continue;
- int n;
- if (sscanf(ptr, "%d", &n) != 1) {
- error("bad map file");
+
+ int msl_code = int(strtol(ptr, &nonum, 10));
+ if (*nonum != '\0') {
+ if (csxdigit(*nonum))
+ error("bad MSL map: got hex code (%1)", ptr);
+ else if (ptr == nonum)
+ error("bad MSL map: bad MSL code (%1)", ptr);
+ else
+ error("bad MSL map");
+ fclose(fp);
+ return 0;
+ }
+
+ ptr = strtok(NULL, " \n\t");
+ if (!ptr)
+ continue;
+ int unicode = int(strtol(ptr, &nonum, 16));
+ if (*nonum != '\0') {
+ if (ptr == nonum)
+ error("bad Unicode value (%1)", ptr);
+ else
+ error("bad Unicode map");
fclose(fp);
return 0;
}
- if (n < 0) {
- error("negative code");
+ if (strlen(ptr) != 4) {
+ error("bad Unicode value (%1)", ptr);
+ return 0;
+ }
+
+ int n = tfm_type == MSL ? msl_code : unicode;
+ if (tfm_type == UNICODE && n > 0xFFFF) {
+ // greatest value supported by TFM files
+ error("bad Unicode value (%1): greatest value is 0xFFFF", ptr);
fclose(fp);
return 0;
}
- if ((size_t)n >= msl_name_table_size) {
- size_t old_size = msl_name_table_size;
- name_list **old_table = msl_name_table;
- msl_name_table_size = n + 256;
- msl_name_table = new name_list *[msl_name_table_size];
+ else if (n < 0) {
+ error("negative code value (%1)", ptr);
+ fclose(fp);
+ return 0;
+ }
+
+ ptr = strtok(NULL, " \n\t");
+ if (!ptr) { // groff name
+ error("missing name(s)");
+ fclose(fp);
+ return 0;
+ }
+ // leave decomposed Unicode values alone
+ else if (is_uname(ptr) && !is_decomposed(ptr))
+ ptr = unicode_to_ucode_name(strtol(ptr + 1, &nonum, 16));
+
+ if (size_t(n) >= charcode_name_table_size) {
+ size_t old_size = charcode_name_table_size;
+ name_list **old_table = charcode_name_table;
+ charcode_name_table_size = n + 256;
+ charcode_name_table = new name_list *[charcode_name_table_size];
if (old_table) {
- memcpy(msl_name_table, old_table, old_size*sizeof(name_list *));
+ memcpy(charcode_name_table, old_table, old_size*sizeof(name_list *));
a_delete old_table;
}
- for (size_t i = old_size; i < msl_name_table_size; i++)
- msl_name_table[i] = 0;
+ for (size_t i = old_size; i < charcode_name_table_size; i++)
+ charcode_name_table[i] = NULL;
}
- ptr = strtok(0, " \n\t");
- if (!ptr) {
- error("missing names");
- fclose(fp);
- return 0;
+
+ // a '#' that isn't the first groff name begins a comment
+ for (int names = 1; ptr; ptr = strtok(NULL, " \n\t")) {
+ if (names++ > 1 && *ptr == '#')
+ break;
+ charcode_name_table[n] = new name_list(ptr, charcode_name_table[n]);
}
- for (; ptr; ptr = strtok(0, " \n\t"))
- msl_name_table[n] = new name_list(ptr, msl_name_table[n]);
}
fclose(fp);
return 1;
}
-static
-const char *xbasename(const char *s)
+static const char *
+xbasename(const char *s)
{
// DIR_SEPS[] are possible directory separator characters, see
// nonposix.h. We want the rightmost separator of all possible
diff --git a/contrib/groff/src/utils/hpftodit/hpftodit.man b/contrib/groff/src/utils/hpftodit/hpftodit.man
index c069752..429f516 100644
--- a/contrib/groff/src/utils/hpftodit/hpftodit.man
+++ b/contrib/groff/src/utils/hpftodit/hpftodit.man
@@ -1,5 +1,6 @@
+.tr ~
.ig
-Copyright (C) 1994-2000, 2001, 2003 Free Software Foundation, Inc.
+Copyright (C) 1994-2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -22,13 +23,22 @@ the original English.
.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
.el .TP "\\$1"
..
+.de CW
+.ie \\n(.$>2 \&\\$1\f(CR\\$2\fP\\$3
+.el \&\f(CR\\$1\fP\\$2
+..
+.tr ~
.TH HPFTODIT @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.\" --------------------------------------------------------------------------
.SH NAME
+.\" --------------------------------------------------------------------------
hpftodit \- create font description files for use with groff \-Tlj4
+.\" --------------------------------------------------------------------------
.SH SYNOPSIS
+.\" --------------------------------------------------------------------------
.B hpftodit
[
-.B \-sv
+.B \-adqsv
]
[
.BI \-i n
@@ -39,33 +49,91 @@ hpftodit \- create font description files for use with groff \-Tlj4
.PP
It is possible to have whitespace between the
.B \-i
-command line option and its parameter.
+option and its parameter.
+.\" --------------------------------------------------------------------------
.SH DESCRIPTION
+.\" --------------------------------------------------------------------------
.B hpftodit
-creates a font file for use with
-.B
-groff \-Tlj4\fR
-from an HP tagged font metric file.
+creates a font file for use with a Hewlett-Packard LaserJet~4\(enseries
+(or newer) printer with
+.BR "groff \-Tlj4" ,
+using data from an HP tagged font metric (TFM) file.
.I tfm_file
-is the name of the tagged font metric file for the font.
+is the name of the TFM file for the font; Intellifont and
+TrueType TFM files are supported, but symbol set TFM files are not.
.I map_file
-is a file giving the groff names for characters in the font;
-this file should consist of a sequence of lines of the form:
+is a file giving the groff names for characters in the font; this file
+should consist of a sequence of lines of the form:
.IP
.I
-n c1 c2 \fR.\|.\|.
+m u c1 c2 \fR.\|.\|. [
+.CW #
+.I comment
+]
.LP
where
-.I n
+.I m
is a decimal integer giving the MSL number of the character,
+.I u
+is a hexadecimal integer giving the Unicode value of the character,
and
.IR c1 ,
-.IR c2 ,.\|.\|.
+.IR c2 ", .\|.\|."
are the groff names of the character.
+The values can be separated by any whitespace; the Unicode value must
+use uppercase digits A\^\(en\^F, and must be without a leading
+.CW ` 0x ',
+.CW ` u ',
+or
+.CW ` U+ '.
+Unicode values corresponding to composite glyphs are decomposed; e.g.,
+.CW ` u00C0 '
+becomes
+.CW ` u0041_0300 '.
+The name for a glyph without a groff name may be given as
+.CW u \fIXXXX\fP
+if the glyph corresponds to a Unicode value, or as an unnamed glyph
+.CW ` --- '.
+If the given Unicode value is in the Private Use Area
+(0xE000\^\(en\^0xF8FF), the glyph is included as an unnamed glyph.
+Refer to
+.BR groff_diff (@MAN1EXT@)
+for additional information about unnamed glyphs and how to access them.
+.LP
+Blank lines and lines beginning with
+.CW ` # '
+are ignored.
+A
+.CW ` # '
+following one or more groff names begins a comment.
+Because
+.CW ` # '
+is a valid groff name, it must appear first in a list of
+groff names if a comment is included, e.g.,
+.IP
+.CW "3 0023 # # number sign"
+.LP
+or
+.IP
+.CW "3 0023 # sh # number sign"
+.LP
+rather than
+.IP
+.CW "3 0023 sh # # number sign"
+.LP
+which will treat the first
+.CW ` # '
+as the beginning of the comment.
+.LP
.I font
is the name of the groff font file.
The groff font file is written to
-.IR font .
+.IR font ;
+if
+.I font
+is specified as
+.CW ` - ',
+the output is written to the standard output.
.LP
The
.B \-s
@@ -75,7 +143,7 @@ option should be given if the font is special
if
.B troff
should search it whenever
-a character is not found in the current font.)
+a character is not found in the current font).
If the font is special,
it should be listed in the
.B fonts
@@ -88,33 +156,116 @@ If the
.B \-i
option is used,
.B hpftodit
-will automatically generate an italic correction,
+automatically will generate an italic correction,
a left italic correction and a subscript correction
for each character
(the significance of these parameters is explained in
.BR groff_font (@MAN5EXT@)).
+.\" --------------------------------------------------------------------------
.SH OPTIONS
+.\" --------------------------------------------------------------------------
+.TP
+.B \-a
+Include characters in the TFM file that are not included in the map
+file.
+A glyph with corresponding Unicode value is given the name
+.RI u XXXX ;
+a glyph without a Unicode value is included as an unnamed glyph
+\&`\-\^\-\^\-'.
+A glyph with a Unicode value in the Private Use Area
+(0xE000\^\(en\^0xF8FF) also is included as an unnamed glyph.
+.IP
+This option provides a simple means of adding Unicode-named and unnamed
+glyphs to a font without including them in the map file, but it affords
+little control over which glyphs are placed in a regular font and which
+are placed in a special font.
+The presence or absence of the
+.B \-s
+option has some effect on which glyphs are included: without the
+.B \-s
+option, only the \(lqtext\(rq symbol sets are searched for matching
+glyphs; with the
+.B \-s
+option, only the \(lqmathematical\(rq symbol sets
+are searched.
+Nonetheless, restricting the symbol sets searched isn't very
+selective\(emmany glyphs are placed in both regular and special fonts.
+Normally, the
+.B \-a
+option should be used only as a last resort.
+.\" --------------------------------------------------------------------------
+.TP
+.B \-d
+Dump information about the TFM file to the standard output; this option
+can be useful for ensuring that a TFM file is a proper match for a font,
+and that the contents of the TFM file are suitable.
+The information includes the values of important TFM tags, and a listing
+(by MSL number for Intellifont TFM files or by Unicode value for
+TrueType TFM files) of the glyphs included in the TFM file.
+The unit of measure `DU' for some tags indicates design units; there are
+8782 design units per em for Intellifont fonts, and 2048 design units
+per em for TrueType fonts.
+Note that the accessibility of a glyph depends on its inclusion in a
+symbol set; some TFM files list many glyphs but only a few symbol sets.
+.IP
+The glyph listing includes the glyph index within the TFM file, the MSL
+or Unicode value, and the symbol set and character code that will be
+used to print the glyph.
+If
+.I map_file
+is given,
+groff names are given for matching glyphs.
+If only the glyph index and MSL or Unicode value are given, the glyph
+does not appear in any supported symbol set and cannot be printed.
+.IP
+With the
+.B \-d
+option,
+.I map_file
+is optional, and
+.I font
+is ignored if given.
+.\" --------------------------------------------------------------------------
+.TP
+.B \-q
+Suppress warnings about characters in the map file that were not found
+in the TFM file.
+Warnings never are given for unnamed glyphs or by glyphs named by their
+Unicode values.
+This option is useful when sending the output of
+.B hpftodit
+to the standard output.
+.\" --------------------------------------------------------------------------
.TP
.B \-v
-Print the version number.
+Print the
+.B hpftodit
+version number.
+.\" --------------------------------------------------------------------------
.TP
.B \-s
The font is special.
-The effect of this option is to add the
+This option adds the
.B special
-command to the font file.
+command to the font file, and affects the order in which HP symbol sets
+are searched for each glyph.
+Without the
+.B \-s
+option, the \(lqtext\(rq sets are searched before
+the \(lqmathematical\(rq symbol sets.
+With the
+.B \-s
+option, the search order is reversed.
+.\" --------------------------------------------------------------------------
.TP
.BI \-i n
-Generate an italic correction for each character so that
-the character's width plus the character's italic correction
-is equal to
+Generate an italic correction for each character so that the character's
+width plus the character's italic correction is equal to
.I n
-design units
-plus the amount by which the right edge of the character's bounding
-is to the right of the character's origin.
-If this would result in a negative italic correction, use a zero
-italic correction instead.
-There are 8782 design units per em for Intellifont fonts.
+thousandths of an em plus the amount by which the right edge of the
+character's bounding is to the right of the character's origin.
+If this would result in a negative italic correction, use a zero italic
+correction instead.
.IP
Also generate a subscript correction equal to the
product of the tangent of the slant of the font and
@@ -126,33 +277,34 @@ instead.
Also generate a left italic correction for each character
equal to
.I n
-design units
-plus the amount by which the left edge of the character's bounding box
-is to the left of the character's origin.
+thousandths of an em plus the amount by which the left edge of the
+character's bounding box is to the left of the character's origin.
The left italic correction may be negative.
.IP
-This option is normally needed only with italic (or oblique) fonts.
+This option normally is needed only with italic or oblique fonts;
+a value of 50 (0.05 em) usually is a reasonable choice.
+.\" --------------------------------------------------------------------------
.SH FILES
-.Tp \w'\fB@FONTDIR@/devlj4/DESC'u+2n
+.\" --------------------------------------------------------------------------
+.ad 0
+.TP \w'\fB@FONTDIR@/devlj4/generate/\fP\fI*\fP.map'u+2n
.B @FONTDIR@/devlj4/DESC
Device description file.
.TP
.BI @FONTDIR@/devlj4/ F
Font description file for font
.IR F .
-.SH BUGS
-.LP
-This program was written without the benefit of complete, official
-documentation on the tagged font metric format.
-It is therefore likely that it will fail to work on tfm files that are
-dissimilar to those for the internal fonts on the Laserjet 4,
-with which it was tested.
-.LP
-TrueType tfm files are not supported.
+.TP
+.BI @FONTDIR@/devlj4/generate/ * .map
+Symbol mapping files
+.\" --------------------------------------------------------------------------
.SH "SEE ALSO"
+.\" --------------------------------------------------------------------------
.BR groff (@MAN1EXT@),
+.BR groff_diff (@MAN1EXT@),
.BR grolj4 (@MAN1EXT@),
-.BR groff_font (@MAN5EXT@)
+.BR groff_font (@MAN5EXT@),
+.BR lj4_font (@MAN5EXT@)
.
.\" Local Variables:
.\" mode: nroff
diff --git a/contrib/groff/src/utils/hpftodit/hpuni.cpp b/contrib/groff/src/utils/hpftodit/hpuni.cpp
new file mode 100644
index 0000000..23a1eb0
--- /dev/null
+++ b/contrib/groff/src/utils/hpftodit/hpuni.cpp
@@ -0,0 +1,698 @@
+// -*- C++ -*-
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Written by Jeff Conrad (jeff_conrad@msn.com)
+
+This file is part of groff.
+
+groff 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.
+
+groff 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 groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "lib.h"
+#include "stringclass.h"
+#include "ptable.h"
+
+#include "unicode.h"
+
+struct hp_msl_to_unicode {
+ char *value;
+};
+
+declare_ptable(hp_msl_to_unicode)
+implement_ptable(hp_msl_to_unicode)
+
+PTABLE(hp_msl_to_unicode) hp_msl_to_unicode_table;
+
+struct S {
+ const char *key;
+ const char *value;
+} hp_msl_to_unicode_list[] = {
+ { "1", "0021", }, // Exclamation Mark
+ { "2", "0022", }, // Neutral Double Quote
+ { "3", "0023", }, // Number Sign
+ { "4", "0024", }, // Dollar Sign
+ { "5", "0025", }, // Per Cent Sign
+ { "6", "0026", }, // Ampersand
+ { "8", "2019", }, // Single Close Quote (9)
+ { "9", "0028", }, // Left Parenthesis
+ { "10", "0029", }, // Right Parenthesis
+ { "11", "002A", }, // Asterisk
+ { "12", "002B", }, // Plus Sign
+ { "13", "002C", }, // Comma, or Decimal Separator
+ { "14", "002D", }, // Hyphen
+ { "15", "002E", }, // Period, or Full Stop
+ { "16", "002F", }, // Solidus, or Slash
+ { "17", "0030", }, // Numeral Zero
+ { "18", "0031", }, // Numeral One
+ { "19", "0032", }, // Numeral Two
+ { "20", "0033", }, // Numeral Three
+ { "21", "0034", }, // Numeral Four
+ { "22", "0035", }, // Numeral Five
+ { "23", "0036", }, // Numeral Six
+ { "24", "0037", }, // Numeral Seven
+ { "25", "0038", }, // Numeral Eight
+ { "26", "0039", }, // Numeral Nine
+ { "27", "003A", }, // Colon
+ { "28", "003B", }, // Semicolon
+ { "29", "003C", }, // Less Than Sign
+ { "30", "003D", }, // Equals Sign
+ { "31", "003E", }, // Greater Than Sign
+ { "32", "003F", }, // Question Mark
+ { "33", "0040", }, // Commercial At
+ { "34", "0041", }, // Uppercase A
+ { "35", "0042", }, // Uppercase B
+ { "36", "0043", }, // Uppercase C
+ { "37", "0044", }, // Uppercase D
+ { "38", "0045", }, // Uppercase E
+ { "39", "0046", }, // Uppercase F
+ { "40", "0047", }, // Uppercase G
+ { "41", "0048", }, // Uppercase H
+ { "42", "0049", }, // Uppercase I
+ { "43", "004A", }, // Uppercase J
+ { "44", "004B", }, // Uppercase K
+ { "45", "004C", }, // Uppercase L
+ { "46", "004D", }, // Uppercase M
+ { "47", "004E", }, // Uppercase N
+ { "48", "004F", }, // Uppercase O
+ { "49", "0050", }, // Uppercase P
+ { "50", "0051", }, // Uppercase Q
+ { "51", "0052", }, // Uppercase R
+ { "52", "0053", }, // Uppercase S
+ { "53", "0054", }, // Uppercase T
+ { "54", "0055", }, // Uppercase U
+ { "55", "0056", }, // Uppercase V
+ { "56", "0057", }, // Uppercase W
+ { "57", "0058", }, // Uppercase X
+ { "58", "0059", }, // Uppercase Y
+ { "59", "005A", }, // Uppercase Z
+ { "60", "005B", }, // Left Bracket
+ { "61", "005C", }, // Reverse Solidus, or Backslash
+ { "62", "005D", }, // Right Bracket
+ { "63", "005E", }, // Circumflex, Exponent, or Pointer
+ { "64", "005F", }, // Underline or Underscore Character
+ { "66", "2018", }, // Single Open Quote (6)
+ { "67", "0061", }, // Lowercase A
+ { "68", "0062", }, // Lowercase B
+ { "69", "0063", }, // Lowercase C
+ { "70", "0064", }, // Lowercase D
+ { "71", "0065", }, // Lowercase E
+ { "72", "0066", }, // Lowercase F
+ { "73", "0067", }, // Lowercase G
+ { "74", "0068", }, // Lowercase H
+ { "75", "0069", }, // Lowercase I
+ { "76", "006A", }, // Lowercase J
+ { "77", "006B", }, // Lowercase K
+ { "78", "006C", }, // Lowercase L
+ { "79", "006D", }, // Lowercase M
+ { "80", "006E", }, // Lowercase N
+ { "81", "006F", }, // Lowercase O
+ { "82", "0070", }, // Lowercase P
+ { "83", "0071", }, // Lowercase Q
+ { "84", "0072", }, // Lowercase R
+ { "85", "0073", }, // Lowercase S
+ { "86", "0074", }, // Lowercase T
+ { "87", "0075", }, // Lowercase U
+ { "88", "0076", }, // Lowercase V
+ { "89", "0077", }, // Lowercase W
+ { "90", "0078", }, // Lowercase X
+ { "91", "0079", }, // Lowercase Y
+ { "92", "007A", }, // Lowercase Z
+ { "93", "007B", }, // Left Brace
+ { "94", "007C", }, // Long Vertical Mark
+ { "95", "007D", }, // Right Brace
+ { "96", "007E", }, // One Wavy Line Approximate
+ { "97", "2592", }, // Medium Shading Character
+ { "99", "00C0", }, // Uppercase A Grave
+ { "100", "00C2", }, // Uppercase A Circumflex
+ { "101", "00C8", }, // Uppercase E Grave
+ { "102", "00CA", }, // Uppercase E Circumflex
+ { "103", "00CB", }, // Uppercase E Dieresis
+ { "104", "00CE", }, // Uppercase I Circumflex
+ { "105", "00CF", }, // Uppercase I Dieresis
+ { "106", "00B4", }, // Lowercase Acute Accent (Spacing)
+ { "107", "0060", }, // Lowercase Grave Accent (Spacing)
+ { "108", "02C6", }, // Lowercase Circumflex Accent (Spacing)
+ { "109", "00A8", }, // Lowercase Dieresis Accent (Spacing)
+ { "110", "02DC", }, // Lowercase Tilde Accent (Spacing)
+ { "111", "00D9", }, // Uppercase U Grave
+ { "112", "00DB", }, // Uppercase U Circumflex
+ { "113", "00AF", }, // Overline, or Overscore Character
+ { "114", "00DD", }, // Uppercase Y Acute
+ { "115", "00FD", }, // Lowercase Y Acute
+ { "116", "00B0", }, // Degree Sign
+ { "117", "00C7", }, // Uppercase C Cedilla
+ { "118", "00E7", }, // Lowercase C Cedilla
+ { "119", "00D1", }, // Uppercase N Tilde
+ { "120", "00F1", }, // Lowercase N Tilde
+ { "121", "00A1", }, // Inverted Exclamation
+ { "122", "00BF", }, // Inverted Question Mark
+ { "123", "00A4", }, // Currency Symbol
+ { "124", "00A3", }, // Pound Sterling Sign
+ { "125", "00A5", }, // Yen Sign
+ { "126", "00A7", }, // Section Mark
+ { "127", "0192", }, // Florin Sign
+ { "128", "00A2", }, // Cent Sign
+ { "129", "00E2", }, // Lowercase A Circumflex
+ { "130", "00EA", }, // Lowercase E Circumflex
+ { "131", "00F4", }, // Lowercase O Circumflex
+ { "132", "00FB", }, // Lowercase U Circumflex
+ { "133", "00E1", }, // Lowercase A Acute
+ { "134", "00E9", }, // Lowercase E Acute
+ { "135", "00F3", }, // Lowercase O Acute
+ { "136", "00FA", }, // Lowercase U Acute
+ { "137", "00E0", }, // Lowercase A Grave
+ { "138", "00E8", }, // Lowercase E Grave
+ { "139", "00F2", }, // Lowercase O Grave
+ { "140", "00F9", }, // Lowercase U Grave
+ { "141", "00E4", }, // Lowercase A Dieresis
+ { "142", "00EB", }, // Lowercase E Dieresis
+ { "143", "00F6", }, // Lowercase O Dieresis
+ { "144", "00FC", }, // Lowercase U Dieresis
+ { "145", "00C5", }, // Uppercase A Ring
+ { "146", "00EE", }, // Lowercase I Circumflex
+ { "147", "00D8", }, // Uppercase O Oblique
+ { "148", "00C6", }, // Uppercase AE Diphthong
+ { "149", "00E5", }, // Lowercase A Ring
+ { "150", "00ED", }, // Lowercase I Acute
+ { "151", "00F8", }, // Lowercase O Oblique
+ { "152", "00E6", }, // Lowercase AE Diphthong
+ { "153", "00C4", }, // Uppercase A Dieresis
+ { "154", "00EC", }, // Lowercase I Grave
+ { "155", "00D6", }, // Uppercase O Dieresis
+ { "156", "00DC", }, // Uppercase U Dieresis
+ { "157", "00C9", }, // Uppercase E Acute
+ { "158", "00EF", }, // Lowercase I Dieresis
+ { "159", "00DF", }, // Lowercase Es-zet Ligature
+ { "160", "00D4", }, // Uppercase O Circumflex
+ { "161", "00C1", }, // Uppercase A Acute
+ { "162", "00C3", }, // Uppercase A Tilde
+ { "163", "00E3", }, // Lowercase A Tilde
+ { "164", "00D0", }, // Uppercase Eth
+//{ "164", "0110", }, // Uppercase D-Stroke
+ { "165", "00F0", }, // Lowercase Eth
+ { "166", "00CD", }, // Uppercase I Acute
+ { "167", "00CC", }, // Uppercase I Grave
+ { "168", "00D3", }, // Uppercase O Acute
+ { "169", "00D2", }, // Uppercase O Grave
+ { "170", "00D5", }, // Uppercase O Tilde
+ { "171", "00F5", }, // Lowercase O Tilde
+ { "172", "0160", }, // Uppercase S Hacek
+ { "173", "0161", }, // Lowercase S Hacek
+ { "174", "00DA", }, // Uppercase U Acute
+ { "175", "0178", }, // Uppercase Y Dieresis
+ { "176", "00FF", }, // Lowercase Y Dieresis
+ { "177", "00DE", }, // Uppercase Thorn
+ { "178", "00FE", }, // Lowercase Thorn
+ { "180", "00B5", }, // Lowercase Greek Mu, or Micro
+ { "181", "00B6", }, // Pilcrow, or Paragraph Sign
+ { "182", "00BE", }, // Vulgar Fraction 3/4
+ { "183", "2212", }, // Minus Sign
+ { "184", "00BC", }, // Vulgar Fraction 1/4
+ { "185", "00BD", }, // Vulgar Fraction 1/2
+ { "186", "00AA", }, // Female Ordinal
+ { "187", "00BA", }, // Male Ordinal
+ { "188", "00AB", }, // Left Pointing Double Angle Quote
+ { "189", "25A0", }, // Medium Solid Square Box
+ { "190", "00BB", }, // Right Pointing Double Angle Quote
+ { "191", "00B1", }, // Plus Over Minus Sign
+ { "192", "00A6", }, // Broken Vertical Mark
+ { "193", "00A9", }, // Copyright Sign
+ { "194", "00AC", }, // Not Sign
+ { "195", "00AD", }, // Soft Hyphen
+ { "196", "00AE", }, // Registered Sign
+ { "197", "00B2", }, // Superior Numeral 2
+ { "198", "00B3", }, // Superior Numeral 3
+ { "199", "00B8", }, // Lowercase Cedilla (Spacing)
+ { "200", "00B9", }, // Superior Numeral 1
+ { "201", "00D7", }, // Multiply Sign
+ { "202", "00F7", }, // Divide Sign
+ { "203", "263A", }, // Open Smiling Face
+ { "204", "263B", }, // Solid Smiling Face
+ { "205", "2665", }, // Solid Heart, Card Suit
+ { "206", "2666", }, // Solid Diamond, Card Suit
+ { "207", "2663", }, // Solid Club, Card Suit
+ { "208", "2660", }, // Solid Spade, Card Suit
+ { "209", "25CF", }, // Medium Solid Round Bullet
+ { "210", "25D8", }, // Large Solid square with White Dot
+ { "211", "EFFD", }, // Large Open Round Bullet
+ { "212", "25D9", }, // Large Solid square with White Circle
+ { "213", "2642", }, // Male Symbol
+ { "214", "2640", }, // Female Symbol
+ { "215", "266A", }, // Musical Note
+ { "216", "266B", }, // Pair Of Musical Notes
+ { "217", "263C", }, // Compass, or Eight Pointed Sun
+ { "218", "25BA", }, // Right Solid Arrowhead
+ { "219", "25C4", }, // Left Solid Arrowhead
+ { "220", "2195", }, // Up/Down Arrow
+ { "221", "203C", }, // Double Exclamation Mark
+ { "222", "25AC", }, // Thick Horizontal Mark
+ { "223", "21A8", }, // Up/Down Arrow Baseline
+ { "224", "2191", }, // Up Arrow
+ { "225", "2193", }, // Down Arrow
+ { "226", "2192", }, // Right Arrow
+ { "227", "2190", }, // Left Arrow
+ { "229", "2194", }, // Left/Right Arrow
+ { "230", "25B2", }, // Up Solid Arrowhead
+ { "231", "25BC", }, // Down Solid Arrowhead
+ { "232", "20A7", }, // Pesetas Sign
+ { "233", "2310", }, // Reversed Not Sign
+ { "234", "2591", }, // Light Shading Character
+ { "235", "2593", }, // Dark Shading Character
+ { "236", "2502", }, // Box Draw Line, Vert. 1
+ { "237", "2524", }, // Box Draw Right Tee, Vert. 1 Horiz. 1
+ { "238", "2561", }, // Box Draw Right Tee, Vert. 1 Horiz. 2
+ { "239", "2562", }, // Box Draw Right Tee, Vert. 2 Horiz. 1
+ { "240", "2556", }, // Box Draw Upper Right Corner, Vert. 2 Horiz. 1
+ { "241", "2555", }, // Box Draw Upper Right Corner, Vert. 1 Horiz. 2
+ { "242", "2563", }, // Box Draw Right Tee, Vert. 2 Horiz. 2
+ { "243", "2551", }, // Box Draw Lines, Vert. 2
+ { "244", "2557", }, // Box Draw Upper Right Corner, Vert. 2 Horiz. 2
+ { "245", "255D", }, // Box Draw Lower Right Corner, Vert. 2 Horiz. 2
+ { "246", "255C", }, // Box Draw Lower Right Corner, Vert. 2 Horiz. 1
+ { "247", "255B", }, // Box Draw Lower Right Corner, Vert. 1 Horiz. 2
+ { "248", "2510", }, // Box Draw Upper Right Corner, Vert. 1, Horiz. 1
+ { "249", "2514", }, // Box Draw Lower Left Corner, Vert. 1, Horiz. 1
+ { "250", "2534", }, // Box Draw Bottom Tee, Vert. 1 Horiz. 1
+ { "251", "252C", }, // Box Draw Top Tee, Vert. 1 Horiz. 1
+ { "252", "251C", }, // Box Draw Left Tee, Vert. 1 Horiz. 1
+ { "253", "2500", }, // Box Draw Line, Horiz. 1
+ { "254", "253C", }, // Box Draw Cross, Vert. 1 Horiz. 1
+ { "255", "255E", }, // Box Draw Left Tee, Vert. 1 Horiz. 2
+ { "256", "255F", }, // Box Draw Left Tee, Vert. 2 Horz. 1
+ { "257", "255A", }, // Box Draw Lower Left Corner, Vert. 2 Horiz. 2
+ { "258", "2554", }, // Box Draw Upper Left Corner, Vert. 2 Horiz. 2
+ { "259", "2569", }, // Box Draw Bottom Tee, Vert. 2 Horiz. 2
+ { "260", "2566", }, // Box Draw Top Tee, Vert. 2 Horiz. 2
+ { "261", "2560", }, // Box Draw Left Tee, Vert. 2 Horiz. 2
+ { "262", "2550", }, // Box Draw Lines, Horiz. 2
+ { "263", "256C", }, // Box Draw Cross Open Center, Vert. 2 Horiz. 2
+ { "264", "2567", }, // Box Draw Bottom Tee, Vert. 1 Horiz. 2
+ { "265", "2568", }, // Box Draw Bottom Tee, Vert. 2 Horiz. 1
+ { "266", "2564", }, // Box Draw Top Tee, Vert. 1 Horiz. 2
+ { "267", "2565", }, // Box Draw Top Tee, Vert. 2 Horiz. 1
+ { "268", "2559", }, // Box Draw Lower Left Corner, Vert. 2 Horiz. 1
+ { "269", "2558", }, // Box Draw Lower Left Corner, Vert. 1 Horiz. 2
+ { "270", "2552", }, // Box Draw Upper Left Corner, Vert. 1 Horiz. 2
+ { "271", "2553", }, // Box Draw Upper Left Corner, Vert. 2 Horiz. 1
+ { "272", "256B", }, // Box Draw Cross, Vert. 2 Horiz. 1
+ { "273", "256A", }, // Box Draw Cross, Vert. 1 Horiz. 2
+ { "274", "2518", }, // Box Draw Lower Right Corner, Vert. 1 Horiz. 1
+ { "275", "250C", }, // Box Draw Upper Left Corner, Vert. 1, Horiz. 1
+ { "276", "2588", }, // Solid Full High/Wide
+ { "277", "2584", }, // Bottom Half Solid Rectangle
+ { "278", "258C", }, // Left Half Solid Rectangle
+ { "279", "2590", }, // Right Half Solid Rectangle
+ { "280", "2580", }, // Top Half Solid Rectangle
+ { "290", "2126", }, // Uppercase Greek Omega, or Ohms
+ { "292", "221E", }, // Infinity Symbol
+ { "295", "2229", }, // Set Intersection Symbol
+ { "296", "2261", }, // Exactly Equals Sign
+ { "297", "2265", }, // Greater Than or Equal Sign
+ { "298", "2264", }, // Less Than or Equal Sign
+ { "299", "2320", }, // Top Integral
+ { "300", "2321", }, // Bottom Integral
+ { "301", "2248", }, // Two Wavy Line Approximate Sign
+//{ "302", "00B7", }, // Middle Dot, or Centered Period (see 2219)
+//{ "302", "2219", }, // Centered Period, Middle Dot
+ { "302", "2219", }, // Math Dot, Centered Period
+ { "303", "221A", }, // Radical Symbol, Standalone Diagonal
+ { "305", "25AA", }, // Small Solid Square Box
+ { "306", "013F", }, // Uppercase L-Dot
+ { "307", "0140", }, // Lowercase L-Dot
+ { "308", "2113", }, // Litre Symbol
+ { "309", "0149", }, // Lowercase Apostrophe-N
+ { "310", "2032", }, // Prime, Minutes, or Feet Symbol
+ { "311", "2033", }, // Double Prime, Seconds, or Inches Symbol
+ { "312", "2020", }, // Dagger Symbol
+ { "313", "2122", }, // Trademark Sign
+ { "314", "2017", }, // Double Underline Character
+ { "315", "02C7", }, // Lowercase Hacek Accent (Spacing)
+ { "316", "02DA", }, // Lowercase Ring Accent (Spacing)
+ { "317", "EFF9", }, // Uppercase Acute Accent (Spacing)
+ { "318", "EFF8", }, // Uppercase Grave Accent (Spacing)
+ { "319", "EFF7", }, // Uppercase Circumflex Accent (Spacing)
+ { "320", "EFF6", }, // Uppercase Dieresis Accent (Spacing)
+ { "321", "EFF5", }, // Uppercase Tilde Accent (Spacing)
+ { "322", "EFF4", }, // Uppercase Hacek Accent (Spacing)
+ { "323", "EFF3", }, // Uppercase Ring Accent (Spacing)
+ { "324", "2215", }, // Vulgar Fraction Bar
+ { "325", "2014", }, // Em Dash
+ { "326", "2013", }, // En Dash
+ { "327", "2021", }, // Double Dagger Symbol
+ { "328", "0131", }, // Lowercase Undotted I
+ { "329", "0027", }, // Neutral Single Quote
+ { "330", "EFF2", }, // Uppercase Cedilla (Spacing)
+ { "331", "2022", }, // Small Solid Round Bullet
+ { "332", "207F", }, // Superior Lowercase N
+ { "333", "2302", }, // Home Plate
+ { "335", "0138", }, // Lowercase Kra
+ { "338", "0166", }, // Uppercase T-Stroke
+ { "339", "0167", }, // Lowercase T-Stroke
+ { "340", "014A", }, // Uppercase Eng
+ { "341", "014B", }, // Lowercase Eng
+ { "342", "0111", }, // Lowercase D-Stroke
+ { "400", "0102", }, // Uppercase A Breve
+ { "401", "0103", }, // Lowercase A Breve
+ { "402", "0100", }, // Uppercase A Macron
+ { "403", "0101", }, // Lowercase A Macron
+ { "404", "0104", }, // Uppercase A Ogonek
+ { "405", "0105", }, // Lowercase A Ogonek
+ { "406", "0106", }, // Uppercase C Acute
+ { "407", "0107", }, // Lowercase C Acute
+ { "410", "010C", }, // Uppercase C Hacek
+ { "411", "010D", }, // Lowercase C Hacek
+ { "414", "010E", }, // Uppercase D Hacek
+ { "415", "010F", }, // Lowercase D Hacek
+ { "416", "011A", }, // Uppercase E Hacek
+ { "417", "011B", }, // Lowercase E Hacek
+ { "418", "0116", }, // Uppercase E Overdot
+ { "419", "0117", }, // Lowercase E Overdot
+ { "420", "0112", }, // Uppercase E Macron
+ { "421", "0113", }, // Lowercase E Macron
+ { "422", "0118", }, // Uppercase E Ogonek
+ { "423", "0119", }, // Lowercase E Ogonek
+ { "428", "0122", }, // Uppercase G Cedilla
+ { "429", "0123", }, // Lowercase G Cedilla
+ { "432", "012E", }, // Uppercase I Ogonek
+ { "433", "012F", }, // Lowercase I Ogonek
+ { "434", "012A", }, // Uppercase I Macron
+ { "435", "012B", }, // Lowercase I Macron
+ { "438", "0136", }, // Uppercase K Cedilla
+ { "439", "0137", }, // Lowercase K Cedilla
+ { "440", "0139", }, // Uppercase L Acute
+ { "441", "013A", }, // Lowercase L Acute
+ { "442", "013D", }, // Uppercase L Hacek
+ { "443", "013E", }, // Lowercase L Hacek
+ { "444", "013B", }, // Uppercase L Cedilla
+ { "445", "013C", }, // Lowercase L Cedilla
+ { "446", "0143", }, // Uppercase N Acute
+ { "447", "0144", }, // Lowercase N Acute
+ { "448", "0147", }, // Uppercase N Hacek
+ { "449", "0148", }, // Lowercase N Hacek
+ { "450", "0145", }, // Uppercase N Cedilla
+ { "451", "0146", }, // Lowercase N Cedilla
+ { "452", "0150", }, // Uppercase O Double Acute
+ { "453", "0151", }, // Lowercase O Double Acute
+ { "454", "014C", }, // Uppercase O Macron
+ { "455", "014D", }, // Lowercase O Macron
+ { "456", "0154", }, // Uppercase R Acute
+ { "457", "0155", }, // Lowercase R Acute
+ { "458", "0158", }, // Uppercase R Hacek
+ { "459", "0159", }, // Lowercase R Hacek
+ { "460", "0156", }, // Uppercase R Cedilla
+ { "461", "0157", }, // Lowercase R Cedilla
+ { "462", "015A", }, // Uppercase S Acute
+ { "463", "015B", }, // Lowercase S Acute
+ { "466", "0164", }, // Uppercase T Hacek
+ { "467", "0165", }, // Lowercase T Hacek
+ { "468", "0162", }, // Uppercase T Cedilla
+ { "469", "0163", }, // Lowercase T Cedilla
+ { "470", "0168", }, // Uppercase U Tilde
+ { "471", "0169", }, // Lowercase U Tilde
+ { "474", "0170", }, // Uppercase U Double Acute
+ { "475", "0171", }, // Lowercase U Double Acute
+ { "476", "016E", }, // Uppercase U Ring
+ { "477", "016F", }, // Lowercase U Ring
+ { "478", "016A", }, // Uppercase U Macron
+ { "479", "016B", }, // Lowercase U Macron
+ { "480", "0172", }, // Uppercase U Ogonek
+ { "481", "0173", }, // Lowercase U Ogonek
+ { "482", "0179", }, // Uppercase Z Acute
+ { "483", "017A", }, // Lowercase Z Acute
+ { "484", "017B", }, // Uppercase Z Overdot
+ { "485", "017C", }, // Lowercase Z Overdot
+ { "486", "0128", }, // Uppercase I Tilde
+ { "487", "0129", }, // Lowercase I Tilde
+ { "500", "EFBF", }, // Radical, Diagonal, Composite
+ { "501", "221D", }, // Proportional To Symbol
+ { "502", "212F", }, // Napierian (italic e)
+ { "503", "03F5", }, // Alternate Lowercase Greek Epsilon
+//{ "503", "EFEC", }, // Alternate Lowercase Greek Epsilon
+ { "504", "2234", }, // Therefore Symbol
+ { "505", "0393", }, // Uppercase Greek Gamma
+ { "506", "2206", }, // Increment Symbol (Delta)
+ { "507", "0398", }, // Uppercase Greek Theta
+ { "508", "039B", }, // Uppercase Greek Lambda
+ { "509", "039E", }, // Uppercase Greek Xi
+ { "510", "03A0", }, // Uppercase Greek Pi
+ { "511", "03A3", }, // Uppercase Greek Sigma
+ { "512", "03A5", }, // Uppercase Greek Upsilon
+ { "513", "03A6", }, // Uppercase Greek Phi
+ { "514", "03A8", }, // Uppercase Greek Psi
+ { "515", "03A9", }, // Uppercase Greek Omega
+ { "516", "2207", }, // Nabla Symbol (inverted Delta)
+ { "517", "2202", }, // Partial Differential Delta Symbol
+ { "518", "03C2", }, // Lowercase Sigma, Terminal
+ { "519", "2260", }, // Not Equal To Symbol
+ { "520", "EFEB", }, // Underline, Composite
+ { "521", "2235", }, // Because Symbol
+ { "522", "03B1", }, // Lowercase Greek Alpha
+ { "523", "03B2", }, // Lowercase Greek Beta
+ { "524", "03B3", }, // Lowercase Greek Gamma
+ { "525", "03B4", }, // Lowercase Greek Delta
+ { "526", "03B5", }, // Lowercase Greek Epsilon
+ { "527", "03B6", }, // Lowercase Greek Zeta
+ { "528", "03B7", }, // Lowercase Greek Eta
+ { "529", "03B8", }, // Lowercase Greek Theta
+ { "530", "03B9", }, // Lowercase Greek Iota
+ { "531", "03BA", }, // Lowercase Greek Kappa
+ { "532", "03BB", }, // Lowercase Greek Lambda
+ { "533", "03BC", }, // Lowercase Greek Mu
+ { "534", "03BD", }, // Lowercase Greek Nu
+ { "535", "03BE", }, // Lowercase Greek Xi
+ { "536", "03BF", }, // Lowercase Greek Omicron
+ { "537", "03C0", }, // Lowercase Greek Pi
+ { "538", "03C1", }, // Lowercase Greek Rho
+ { "539", "03C3", }, // Lowercase Greek Sigma
+ { "540", "03C4", }, // Lowercase Greek Tau
+ { "541", "03C5", }, // Lowercase Greek Upsilon
+ { "542", "03C6", }, // Lowercase Greek Phi
+ { "543", "03C7", }, // Lowercase Greek Chi
+ { "544", "03C8", }, // Lowercase Greek Psi
+ { "545", "03C9", }, // Lowercase Greek Omega
+ { "546", "03D1", }, // Lowercase Greek Theta, Open
+ { "547", "03D5", }, // Lowercase Greek Phi, Open
+ { "548", "03D6", }, // Lowercase Pi, Alternate
+ { "549", "2243", }, // Wavy Over Straight Approximate Symbol
+ { "550", "2262", }, // Not Exactly Equal To Symbol
+ { "551", "21D1", }, // Up Arrow Double Stroke
+ { "552", "21D2", }, // Right Arrow Double Stroke
+ { "553", "21D3", }, // Down Arrow Double Stroke
+ { "554", "21D0", }, // Left Arrow Double Stroke
+ { "555", "21D5", }, // Up/Down Arrow Double Stroke
+ { "556", "21D4", }, // Left/Right Arrow Double Stroke
+ { "557", "21C4", }, // Right Over Left Arrow
+ { "558", "21C6", }, // Left Over Right Arrow
+ { "559", "EFE9", }, // Vector Symbol
+ { "560", "0305", }, // Overline, Composite
+ { "561", "2200", }, // For All Symbol, or Universal (inverted A)
+ { "562", "2203", }, // There Exists Symbol, or Existential (inverted E)
+ { "563", "22A4", }, // Top Symbol
+ { "564", "22A5", }, // Bottom Symbol
+ { "565", "222A", }, // Set Union Symbol
+ { "566", "2208", }, // Element-Of Symbol
+ { "567", "220B", }, // Contains Symbol
+ { "568", "2209", }, // Not-Element-Of Symbol
+ { "569", "2282", }, // Proper Subset Symbol
+ { "570", "2283", }, // Proper Superset Symbol
+ { "571", "2284", }, // Not Proper Subset Symbol
+ { "572", "2285", }, // Not Proper Superset Symbol
+ { "573", "2286", }, // Subset Symbol
+ { "574", "2287", }, // Superset Symbol
+ { "575", "2295", }, // Plus In Circle Symbol
+ { "576", "2299", }, // Dot In Circle Symbol
+ { "577", "2297", }, // Times In Circle Symbol
+ { "578", "2296", }, // Minus In Circle Symbol
+ { "579", "2298", }, // Slash In Circle Symbol
+ { "580", "2227", }, // Logical And Symbol
+ { "581", "2228", }, // Logical Or Symbol
+ { "582", "22BB", }, // Exclusive Or Symbol
+ { "583", "2218", }, // Functional Composition Symbol
+ { "584", "20DD", }, // Large Open Circle
+ { "585", "22A3", }, // Assertion Symbol
+ { "586", "22A2", }, // Backwards Assertion Symbol
+ { "587", "222B", }, // Integral Symbol
+ { "588", "222E", }, // Curvilinear Integral Symbol
+ { "589", "2220", }, // Angle Symbol
+ { "590", "2205", }, // Empty Set Symbol
+ { "591", "2135", }, // Hebrew Aleph
+ { "592", "2136", }, // Hebrew Beth
+ { "593", "2137", }, // Hebrew Gimmel
+ { "594", "212D", }, // Fraktur Uppercase C
+ { "595", "2111", }, // Fraktur Uppercase I
+ { "596", "211C", }, // Fraktur Uppercase R
+ { "597", "2128", }, // Fraktur Uppercase Z
+ { "598", "23A1", }, // Top Segment Left Bracket (Left Square Bracket Upper Corner)
+ { "599", "23A3", }, // Bottom Segment Left Bracket (Left Square Bracket Lower Corner)
+ { "600", "239B", }, // Top Segment Left Brace (Left Parenthesis Upper Hook)
+//{ "600", "23A7", }, // Top Segment Left Brace (Right Curly Bracket Upper Hook)
+ { "601", "23A8", }, // Middle Segment Left Brace (Right Curly Bracket Middle Piece)
+ { "602", "239D", }, // Bottom Segment LeftBrace (Left Parenthesis Lower Hook)
+//{ "602", "23A9", }, // Bottom Segment Left Brace (Right Curly Bracket Lower Hook)
+ { "603", "EFD4", }, // Middle Segment Curvilinear Integral
+ { "604", "EFD3", }, // Top Left Segment Summation
+ { "605", "2225", }, // Double Vertical Line, Composite
+ { "606", "EFD2", }, // Bottom Left Segment Summation
+ { "607", "EFD1", }, // Bottom Diagonal Summation
+ { "608", "23A4", }, // Top Segment Right Bracket (Right Square Bracket Upper Corner)
+ { "609", "23A6", }, // Bottom Segment Right Bracket (Right Square Bracket Lower Corner)
+ { "610", "239E", }, // Top Segment Right Brace (Right Parenthesis Upper Hook)
+//{ "610", "23AB", }, // Top Segment Right Brace (Right Curly Bracket Upper Hook)
+ { "611", "23AC", }, // Middle Segment Right Brace (Right Curly Bracket Middle Piece)
+ { "612", "23A0", }, // Bottom Segment Right ( Right Parenthesis Lower Hook)
+//{ "612", "23AD", }, // Bottom Segment Right Brace (Right Curly Bracket Lower Hook)
+ { "613", "239C", }, // Thick Vertical Line, Composite (Left Parenthesis Extension)
+//{ "613", "239F", }, // Thick Vertical Line, Composite (Right Parenthesis Extension)
+//{ "613", "23AA", }, // Thick Vertical Line, Composite (Curly Bracket Extension)
+//{ "613", "23AE", }, // Thick Vertical Line, Composite (Integral Extension)
+ { "614", "2223", }, // Thin Vertical Line, Composite
+ { "615", "EFDC", }, // Bottom Segment of Vertical Radical
+ { "616", "EFD0", }, // Top Right Segment Summation
+ { "617", "EFCF", }, // Middle Segment Summation
+ { "618", "EFCE", }, // Bottom Right Segment Summation
+ { "619", "EFCD", }, // Top Diagonal Summation
+ { "620", "2213", }, // Minus Over Plus Sign
+ { "621", "2329", }, // Left Angle Bracket
+ { "622", "232A", }, // Right Angle Bracket
+ { "623", "EFFF", }, // Mask Symbol
+ { "624", "2245", }, // Wavy Over Two Straight Approximate Symbol
+ { "625", "2197", }, // 45 Degree Arrow
+ { "626", "2198", }, // -45 Degree Arrow
+ { "627", "2199", }, // -135 Degree Arrow
+ { "628", "2196", }, // 135 Degree Arrow
+ { "629", "25B5", }, // Up Open Triangle
+ { "630", "25B9", }, // Right Open Triangle
+ { "631", "25BF", }, // Down Open Triangle
+ { "632", "25C3", }, // Left Open Triangle
+ { "633", "226A", }, // Much Less Than Sign
+ { "634", "226B", }, // Much Greater Than Sign
+ { "635", "2237", }, // Proportional To Symbol (4 dots)
+ { "636", "225C", }, // Defined As Symbol
+ { "637", "03DD", }, // Lowercase Greek Digamma
+ { "638", "210F", }, // Planck's Constant divided by 2 pi
+ { "639", "2112", }, // Laplace Transform Symbol
+ { "640", "EFFE", }, // Power Set
+ { "641", "2118", }, // Weierstrassian Symbol
+ { "642", "2211", }, // Summation Symbol (large Sigma)
+ { "643", "301A", }, // Left Double Bracket
+ { "644", "EFC9", }, // Middle Segment Double Bracket
+ { "645", "301B", }, // Right Double Bracket
+ { "646", "256D", }, // Box Draw Left Top Round Corner
+ { "647", "2570", }, // Box Draw Left Bottom Round Corner
+ { "648", "EFC8", }, // Extender Large Union/Product
+ { "649", "EFC7", }, // Bottom Segment Large Union
+ { "650", "EFC6", }, // Top Segment Large Intersection
+ { "651", "EFC5", }, // Top Segment Left Double Bracket
+ { "652", "EFC4", }, // Bottom Segment Left Double Bracket
+ { "653", "EFFC", }, // Large Open Square Box
+ { "654", "25C7", }, // Open Diamond
+ { "655", "256E", }, // Box Draw Right Top Round Corner
+ { "656", "256F", }, // Box Draw Right Bottom Round Corner
+ { "657", "EFC3", }, // Bottom Segment Large Bottom Product
+ { "658", "EFC2", }, // Top Segment Large Top Product
+ { "659", "EFC1", }, // Top Segment Right Double Bracket
+ { "660", "EFC0", }, // Bottom Segment Right Double Bracket
+ { "661", "EFFB", }, // Large Solid Square Box
+ { "662", "25C6", }, // Solid Diamond
+ { "663", "220D", }, // Such That Symbol (rotated lc epsilon)
+ { "664", "2217", }, // Math Asterisk
+ { "665", "23AF", }, // Horizontal Arrow Extender (Horizontal Line Extension)
+ { "666", "EFCB", }, // Double Horizontal Arrow Extender
+ { "667", "EFCC", }, // Inverted Complement of 0xEFCF or MSL 617
+ { "668", "221F", }, // Right Angle Symbol
+ { "669", "220F", }, // Product Symbol (large Pi)
+ { "684", "25CA", }, // Lozenge, Diamond
+ { "1000", "2070", }, // Superior Numeral 0
+ { "1001", "2074", }, // Superior Numeral 4
+ { "1002", "2075", }, // Superior Numeral 5
+ { "1003", "2076", }, // Superior Numeral 6
+ { "1004", "2077", }, // Superior Numeral 7
+ { "1005", "2078", }, // Superior Numeral 8
+ { "1006", "2079", }, // Superior Numeral 9
+ { "1017", "201C", }, // Double Open Quote (6)
+ { "1018", "201D", }, // Double Close Quote (9)
+ { "1019", "201E", }, // Double Baseline Quote (9)
+ { "1020", "2003", }, // Em Space
+ { "1021", "2002", }, // En Space
+ { "1023", "2009", }, // Thin Space
+ { "1028", "2026", }, // Ellipsis
+ { "1030", "EFF1", }, // Uppercase Ogonek (Spacing)
+ { "1031", "017E", }, // Lowercase Z Hacek
+ { "1034", "2120", }, // Service Mark
+ { "1036", "211E", }, // Prescription Sign
+//{ "1040", "F001", }, // Lowercase FI Ligature
+ { "1040", "FB01", }, // Lowercase FI Ligature
+//{ "1041", "F002", }, // Lowercase FL Ligature
+ { "1041", "FB02", }, // Lowercase FL Ligature
+ { "1042", "FB00", }, // Lowercase FF Ligature
+ { "1043", "FB03", }, // Lowercase FFI Ligature
+ { "1044", "FB04", }, // Lowercase FFL Ligature
+ { "1045", "EFF0", }, // Uppercase Double Acute Accent (Spacing)
+ { "1047", "0133", }, // Lowercase IJ Ligature
+ { "1060", "2105", }, // Care Of Symbol
+ { "1061", "011E", }, // Uppercase G Breve
+ { "1062", "011F", }, // Lowercase G Breve
+ { "1063", "015E", }, // Uppercase S Cedilla
+ { "1064", "015F", }, // Lowercase S Cedilla
+ { "1065", "0130", }, // Uppercase I Overdot
+ { "1067", "201A", }, // Single Baseline Quote (9)
+ { "1068", "2030", }, // Per Mill Sign
+ { "1069", "20AC", }, // Euro
+ { "1084", "02C9", }, // Lowercase Macron Accent (Spacing)
+ { "1086", "02D8", }, // Lowercase Breve Accent (Spacing)
+ { "1088", "02D9", }, // Lowercase Overdot Accent (Spacing)
+ { "1090", "0153", }, // Lowercase OE Ligature
+ { "1091", "0152", }, // Uppercase OE Ligature
+ { "1092", "2039", }, // Left Pointing Single Angle Quote
+ { "1093", "203A", }, // Right Pointing Single Angle Quote
+ { "1094", "25A1", }, // Medium Open Square Box
+ { "1095", "0141", }, // Uppercase L-Stroke
+ { "1096", "0142", }, // Lowercase L-Stroke
+ { "1097", "02DD", }, // Lowercase Double Acute Accent (Spacing)
+ { "1098", "02DB", }, // Lowercase Ogonek (Spacing)
+ { "1099", "21B5", }, // Carriage Return Symbol
+ { "1100", "EFDB", }, // Full Size Serif Registered
+ { "1101", "EFDA", }, // Full Size Serif Copyright
+ { "1102", "EFD9", }, // Full Size Serif Trademark
+ { "1103", "EFD8", }, // Full Size Sans Registered
+ { "1104", "EFD7", }, // Full Size Sans Copyright
+ { "1105", "EFD6", }, // Full Size Sans Trademark
+ { "1106", "017D", }, // Uppercase Z Hacek
+ { "1107", "0132", }, // Uppercase IJ Ligature
+ { "1108", "25AB", }, // Small Open Square Box
+ { "1109", "25E6", }, // Small Open Round Bullet
+ { "1110", "25CB", }, // Medium Open Round Bullet
+ { "1111", "EFFA", }, // Large Solid Round Bullet
+ { "3812", "F000", }, // Ornament, Apple
+};
+
+// global constructor
+static struct hp_msl_to_unicode_init {
+ hp_msl_to_unicode_init();
+} _hp_msl_to_unicode_init;
+
+hp_msl_to_unicode_init::hp_msl_to_unicode_init() {
+ for (unsigned int i = 0;
+ i < sizeof(hp_msl_to_unicode_list)/sizeof(hp_msl_to_unicode_list[0]);
+ i++) {
+ hp_msl_to_unicode *ptu = new hp_msl_to_unicode[1];
+ ptu->value = (char *)hp_msl_to_unicode_list[i].value;
+ hp_msl_to_unicode_table.define(hp_msl_to_unicode_list[i].key, ptu);
+ }
+}
+
+const char *hp_msl_to_unicode_code(const char *s)
+{
+ hp_msl_to_unicode *result = hp_msl_to_unicode_table.lookup(s);
+ return result ? result->value : 0;
+}
diff --git a/contrib/groff/src/utils/indxbib/Makefile.sub b/contrib/groff/src/utils/indxbib/Makefile.sub
index 7736e48..e8f1e6f 100644
--- a/contrib/groff/src/utils/indxbib/Makefile.sub
+++ b/contrib/groff/src/utils/indxbib/Makefile.sub
@@ -11,7 +11,7 @@ CSRCS=\
$(srcdir)/signal.c
NAMEPREFIX=$(g)
-install_data: eign
+install_data: $(srcdir)/eign
-test -d $(datadir) || $(mkinstalldirs) $(datadir)
-test -d $(dataprogramdir) || $(mkinstalldirs) $(dataprogramdir)
-test -d $(datasubdir) || $(mkinstalldirs) $(datasubdir)
diff --git a/contrib/groff/src/utils/indxbib/indxbib.cpp b/contrib/groff/src/utils/indxbib/indxbib.cpp
index 2a60c15..00e9944 100644
--- a/contrib/groff/src/utils/indxbib/indxbib.cpp
+++ b/contrib/groff/src/utils/indxbib/indxbib.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003
+/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
static char stderr_buf[BUFSIZ];
setbuf(stderr, stderr_buf);
- const char *basename = 0;
+ const char *base_name = 0;
typedef int (*parser_t)(const char *);
parser_t parser = do_file;
const char *directory = 0;
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
check_integer_arg('n', optarg, 0, &n_ignore_words);
break;
case 'o':
- basename = optarg;
+ base_name = optarg;
break;
case 't':
check_integer_arg('t', optarg, 1, &truncate_len);
@@ -202,33 +202,33 @@ int main(int argc, char **argv)
store_filename(ignore_fields);
key_buffer = new char[truncate_len];
read_common_words_file();
- if (!basename)
- basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME;
- const char *p = strrchr(basename, DIR_SEPS[0]), *p1;
+ if (!base_name)
+ base_name = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME;
+ const char *p = strrchr(base_name, DIR_SEPS[0]), *p1;
const char *sep = &DIR_SEPS[1];
while (*sep) {
- p1 = strrchr(basename, *sep);
+ p1 = strrchr(base_name, *sep);
if (p1 && (!p || p1 > p))
p = p1;
sep++;
}
size_t name_max;
if (p) {
- char *dir = strsave(basename);
- dir[p - basename] = '\0';
+ char *dir = strsave(base_name);
+ dir[p - base_name] = '\0';
name_max = file_name_max(dir);
a_delete dir;
}
else
name_max = file_name_max(".");
- const char *filename = p ? p + 1 : basename;
+ const char *filename = p ? p + 1 : base_name;
if (strlen(filename) + sizeof(INDEX_SUFFIX) - 1 > name_max)
fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX);
if (p) {
p++;
- temp_index_file = new char[p - basename + sizeof(TEMP_INDEX_TEMPLATE)];
- memcpy(temp_index_file, basename, p - basename);
- strcpy(temp_index_file + (p - basename), TEMP_INDEX_TEMPLATE);
+ temp_index_file = new char[p - base_name + sizeof(TEMP_INDEX_TEMPLATE)];
+ memcpy(temp_index_file, base_name, p - base_name);
+ strcpy(temp_index_file + (p - base_name), TEMP_INDEX_TEMPLATE);
}
else {
temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
@@ -281,8 +281,8 @@ int main(int argc, char **argv)
write_hash_table();
if (fclose(indxfp) < 0)
fatal("error closing temporary index file: %1", strerror(errno));
- char *index_file = new char[strlen(basename) + sizeof(INDEX_SUFFIX)];
- strcpy(index_file, basename);
+ char *index_file = new char[strlen(base_name) + sizeof(INDEX_SUFFIX)];
+ strcpy(index_file, base_name);
strcat(index_file, INDEX_SUFFIX);
#ifdef HAVE_RENAME
#ifdef __EMX__
@@ -293,7 +293,7 @@ int main(int argc, char **argv)
#ifdef __MSDOS__
// RENAME could fail on plain MSDOS filesystems because
// INDEX_FILE is an invalid filename, e.g. it has multiple dots.
- char *fname = p ? index_file + (p - basename) : 0;
+ char *fname = p ? index_file + (p - base_name) : 0;
char *dot = 0;
// Replace the dot with an underscore and try again.
diff --git a/contrib/groff/src/utils/indxbib/signal.c b/contrib/groff/src/utils/indxbib/signal.c
index fccd289..20dfd90 100644
--- a/contrib/groff/src/utils/indxbib/signal.c
+++ b/contrib/groff/src/utils/indxbib/signal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2001, 2003, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,11 +15,13 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* Unfortunately vendors seem to have problems writing a <signal.h>
that is correct for C++, so we implement all signal handling in C. */
+#include <stdlib.h>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -30,21 +32,26 @@ that is correct for C++, so we implement all signal handling in C. */
#include <unistd.h>
#endif
-#ifndef RETSIGTYPE
-#define RETSIGTYPE void
+#ifdef __cplusplus
+extern "C" {
#endif
-extern void cleanup();
+extern void cleanup(void);
-static RETSIGTYPE handle_fatal_signal(signum)
- int signum;
+static RETSIGTYPE handle_fatal_signal(int signum)
{
signal(signum, SIG_DFL);
cleanup();
+#ifdef HAVE_KILL
kill(getpid(), signum);
+#else
+ /* MS-DOS and Win32 don't have kill(); the best compromise is
+ probably to use exit() instead. */
+ exit(signum);
+#endif
}
-void catch_fatal_signals()
+void catch_fatal_signals(void)
{
#ifdef SIGHUP
signal(SIGHUP, handle_fatal_signal);
@@ -53,6 +60,10 @@ void catch_fatal_signals()
signal(SIGTERM, handle_fatal_signal);
}
+#ifdef __cplusplus
+}
+#endif
+
#ifndef HAVE_RENAME
void ignore_fatal_signals()
diff --git a/contrib/groff/src/utils/lkbib/lkbib.cpp b/contrib/groff/src/utils/lkbib/lkbib.cpp
index 42156ea..b44f245 100644
--- a/contrib/groff/src/utils/lkbib/lkbib.cpp
+++ b/contrib/groff/src/utils/lkbib/lkbib.cpp
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/utils/lkbib/lkbib.man b/contrib/groff/src/utils/lkbib/lkbib.man
index 81067d1..29831ee 100644
--- a/contrib/groff/src/utils/lkbib/lkbib.man
+++ b/contrib/groff/src/utils/lkbib/lkbib.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,17 +16,23 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
-.ds g \" empty
-.ds G \" empty
+.
+.
.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
+. ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
+. el .TP "\\$1"
..
+.
+.
.TH LKBIB @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
.SH NAME
lkbib \- search bibliographic databases
+.
+.
.SH SYNOPSIS
.B lkbib
[
@@ -42,13 +48,16 @@ lkbib \- search bibliographic databases
.BI \-t n
]
.IR key \|.\|.\|.
+.
.PP
It is possible to have whitespace between a command line option and its
parameter.
+.
+.
.SH DESCRIPTION
.B lkbib
searches bibliographic databases for references that contain the keys
-.IR key \|.\|.\|.
+.IR key \|.\|.\|.\&
and prints any references found on the standard output.
.B lkbib
will search any databases given by
@@ -68,10 +77,13 @@ created by
.BR @g@indxbib (@MAN1EXT@)
exists, then it will be searched instead;
each index can cover multiple databases.
+.
+.
.SH OPTIONS
.TP
.B \-v
Print the version number.
+.
.TP
.BI \-p filename
Search
@@ -79,11 +91,13 @@ Search
Multiple
.B \-p
options can be used.
+.
.TP
.BI \-i string
When searching files for which no index exists,
ignore the contents of fields whose names are in
.IR string .
+.
.TP
.BI \-t n
Only require the first
@@ -91,19 +105,27 @@ Only require the first
characters of keys to be given.
Initially
.I n
-is 6.
+is\~6.
+.
+.
.SH ENVIRONMENT
.TP \w'\fBREFER'u+2n
.SB REFER
Default database.
+.
+.
.SH FILES
.Tp \w'\fB@DEFAULT_INDEX@'u+2n
.B @DEFAULT_INDEX@
Default database to be used if the
.SB REFER
environment variable is not set.
+.
+.TP
.IB filename @INDEX_SUFFIX@
Index files.
+.
+.
.SH "SEE ALSO"
.BR @g@refer (@MAN1EXT@),
.BR @g@lookbib (@MAN1EXT@),
diff --git a/contrib/groff/src/utils/lookbib/lookbib.cpp b/contrib/groff/src/utils/lookbib/lookbib.cpp
index 65e89bc..a573c5f 100644
--- a/contrib/groff/src/utils/lookbib/lookbib.cpp
+++ b/contrib/groff/src/utils/lookbib/lookbib.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989-1992, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
@@ -33,6 +34,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* for isatty() */
#include "posix.h"
+#include "nonposix.h"
extern "C" {
const char *Version_string;
diff --git a/contrib/groff/src/utils/lookbib/lookbib.man b/contrib/groff/src/utils/lookbib/lookbib.man
index 3d8ba44..baade0f 100644
--- a/contrib/groff/src/utils/lookbib/lookbib.man
+++ b/contrib/groff/src/utils/lookbib/lookbib.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,9 +16,15 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.
.TH @G@LOOKBIB @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
.SH NAME
@g@lookbib \- search bibliographic databases
+.
+.
.SH SYNOPSIS
.B @g@lookbib
[
@@ -31,14 +37,19 @@ the original English.
.BI \-t n
]
.IR filename \|.\|.\|.
+.
.PP
It is possible to have whitespace between a command line option and its
parameter.
+.
+.
.SH DESCRIPTION
-@g@lookbib prints a prompt on the standard error (unless the standard input is not a terminal),
+.B @g@lookbib
+prints a prompt on the standard error (unless the standard input is not
+a terminal),
reads from the standard input a line containing a set of keywords,
searches the bibliographic databases
-.IR filename \|.\|.\|.
+.IR filename \|.\|.\|.\&
for references containing those keywords,
prints any references found on the standard output,
and repeats this process until the end of input.
@@ -51,15 +62,19 @@ created by
.BR @g@indxbib (@MAN1EXT@)
exists, then it will be searched instead;
each index can cover multiple databases.
+.
+.
.SH OPTIONS
.TP
.B \-v
Print the version number.
+.
.TP
.BI \-i string
When searching files for which no index exists,
ignore the contents of fields whose names are in
.IR string .
+.
.TP
.BI \-t n
Only require the first
@@ -67,11 +82,15 @@ Only require the first
characters of keys to be given.
Initially
.I n
-is 6.
+is\~6.
+.
+.
.SH FILES
.TP \w'\fIfilename\fB@INDEX_SUFFIX@'u+2n
.IB filename @INDEX_SUFFIX@
Index files.
+.
+.
.SH "SEE ALSO"
.BR @g@refer (@MAN1EXT@),
.BR lkbib (@MAN1EXT@),
diff --git a/contrib/groff/src/utils/pfbtops/Makefile.sub b/contrib/groff/src/utils/pfbtops/Makefile.sub
index a8ed92a..451b519 100644
--- a/contrib/groff/src/utils/pfbtops/Makefile.sub
+++ b/contrib/groff/src/utils/pfbtops/Makefile.sub
@@ -4,3 +4,4 @@ OBJS=pfbtops.$(OBJEXT)
CSRCS=$(srcdir)/pfbtops.c
XLIBS=$(LIBGROFF)
MLIB=$(LIBM)
+LINK.c=$(CCC) $(CCFLAGS) $(LDFLAGS)
diff --git a/contrib/groff/src/utils/pfbtops/pfbtops.c b/contrib/groff/src/utils/pfbtops/pfbtops.c
index 821d901..8b394d5 100644
--- a/contrib/groff/src/utils/pfbtops/pfbtops.c
+++ b/contrib/groff/src/utils/pfbtops/pfbtops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -15,7 +15,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This translates ps fonts in .pfb format to ASCII ps files. */
@@ -25,9 +25,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
#include <limits.h>
+#define __GETOPT_PREFIX groff_
+#include <getopt.h>
+
#include "nonposix.h"
/* Binary bytes per output line. */
@@ -35,10 +37,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define MAX_LINE_LENGTH 78
#define HEX_DIGITS "0123456789abcdef"
+extern const char *Version_string;
+
static char *program_name;
-static void error(s)
- char *s;
+static void error(const char *s)
{
fprintf(stderr, "%s: %s\n", program_name, s);
exit(2);
@@ -51,7 +54,7 @@ static void usage(FILE *stream)
static void get_text(int n)
{
- int c, c1;
+ int c = 0, c1;
int in_string = 0;
int is_comment = 0;
int count = 0;
@@ -67,19 +70,27 @@ static void get_text(int n)
else if (c == '\\' && in_string) {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
/* don't split octal character representations */
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
}
}
@@ -88,9 +99,13 @@ static void get_text(int n)
if (c == EOF)
error("end of file in text packet");
else if (c == '\r') {
+ if (n-- == 0)
+ break;
c1 = getchar();
- if (c1 != '\n')
+ if (c1 != '\n') {
ungetc(c1, stdin);
+ n++;
+ }
c = '\n';
}
if (c == '\n') {
@@ -112,6 +127,8 @@ static void get_text(int n)
/* split at the next whitespace character */
while (c != ' ' && c != '\t' && c != '\f') {
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
}
count = 0;
@@ -146,12 +163,9 @@ static void get_binary(int n)
putchar('\n');
}
-int main(argc, argv)
- int argc;
- char **argv;
+int main(int argc, char **argv)
{
int opt;
- extern int optind;
static const struct option long_options[] = {
{ "help", no_argument, 0, CHAR_MAX + 1 },
{ "version", no_argument, 0, 'v' },
@@ -163,12 +177,9 @@ int main(argc, argv)
while ((opt = getopt_long(argc, argv, "v", long_options, NULL)) != EOF) {
switch (opt) {
case 'v':
- {
- extern const char *Version_string;
- printf("GNU pfbtops (groff) version %s\n", Version_string);
- exit(0);
- break;
- }
+ printf("GNU pfbtops (groff) version %s\n", Version_string);
+ exit(0);
+ break;
case CHAR_MAX + 1: /* --help */
usage(stdout);
exit(0);
diff --git a/contrib/groff/src/utils/pfbtops/pfbtops.man b/contrib/groff/src/utils/pfbtops/pfbtops.man
index 627e5c5..c97a297 100644
--- a/contrib/groff/src/utils/pfbtops/pfbtops.man
+++ b/contrib/groff/src/utils/pfbtops/pfbtops.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-1995, 2001, 2003 Free Software Foundation, Inc.
+Copyright (C) 1989-1995, 2001, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -16,14 +16,25 @@ versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
..
+.
+.
.TH PFBTOPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
.SH NAME
pfbtops \- translate a PostScript font in .pfb format to ASCII
+.
+.
.SH SYNOPSIS
.B pfbtops
[
+.B \-v
+]
+[
.I pfb_file
]
+.
+.
.SH DESCRIPTION
.B pfbtops
translates a PostScript font in
@@ -37,10 +48,18 @@ The ASCII format PostScript font will be written on the standard output.
PostScript fonts for MS-DOS are normally supplied in
.B .pfb
format.
+.
.LP
The resulting ASCII format PostScript font can be used with groff.
It must first be listed in
.BR @FONTDIR@/devps/download .
+.
+.SH OPTIONS
+.TP
+.B \-v
+Print the version number.
+.
+.
.SH "SEE ALSO"
.BR grops (@MAN1EXT@)
.
diff --git a/contrib/groff/src/utils/tfmtodit/tfmtodit.cpp b/contrib/groff/src/utils/tfmtodit/tfmtodit.cpp
index 9fbbe25..ccf995a 100644
--- a/contrib/groff/src/utils/tfmtodit/tfmtodit.cpp
+++ b/contrib/groff/src/utils/tfmtodit/tfmtodit.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989-1992, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989-1992, 2000, 2001, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* I have tried to incorporate the changes needed for TeX 3.0 tfm files,
but I haven't tested them. */
@@ -412,7 +412,7 @@ int gf::load(const char *file)
};
int got_an_adjustment = 0;
int pending_adjustment = 0;
- int left_adj, right_adj;
+ int left_adj = 0, right_adj = 0; // pacify compiler
const int gf_id_byte = 131;
errno = 0;
FILE *fp = fopen(file, FOPEN_RB);
@@ -650,7 +650,7 @@ lig_chars table. `ch' gives the full-name of the character, `name'
gives the groff name of the character, `i' gives its index in
the encoding, which is filled in later (-1 if it does not appear). */
-struct {
+struct S {
const char *ch;
int i;
} lig_chars[] = {
@@ -670,7 +670,7 @@ enum { CH_f, CH_i, CH_l, CH_ff, CH_fi, CH_fl, CH_ffi, CH_ffl };
// Each possible ligature appears in this table.
-struct {
+struct S2 {
unsigned char c1, c2, res;
const char *ch;
} lig_table[] = {
diff --git a/contrib/groff/src/utils/xtotroff/Makefile.in b/contrib/groff/src/utils/xtotroff/Makefile.in
new file mode 100644
index 0000000..4b3a7e6
--- /dev/null
+++ b/contrib/groff/src/utils/xtotroff/Makefile.in
@@ -0,0 +1,62 @@
+# Copyright (C) 2004
+# Free Software Foundation, Inc.
+# Written by James Clark (jjc@jclark.com)
+#
+# This file is part of groff.
+#
+# groff 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.
+#
+# groff 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 groff; see the file COPYING. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+builddir=@abs_builddir@
+top_srcdir=@abs_top_srcdir@
+top_builddir=@abs_top_builddir@
+SHELL=@SHELL@
+
+devdir=$(top_builddir)/font
+driverdir=$(top_srcdir)/src/devices/xditview
+mkinstalldirs=$(SHELL) $(top_srcdir)/mkinstalldirs
+
+xtotroff=$(builddir)/xtotroff
+DPIS=75 100
+
+all:
+ @echo "Say \`make fonts' to generate fonts for gxditview."
+
+fonts: $(xtotroff) $(driverdir)/DESC.in $(driverdir)/FontMap
+ fonts=`sed -e 's/[ ].*//' $(driverdir)/FontMap`; \
+ for dpi in $(DPIS); do \
+ echo Making devX$$dpi; \
+ test -d $(devdir)/devX$$dpi || \
+ $(mkinstalldirs) $(devdir)/devX$$dpi; \
+ rm -f $(devdir)/devX$$dpi/DESC; \
+ sed -e "s/res 75/res $$dpi/" $(driverdir)/DESC.in \
+ >$(devdir)/devX$$dpi/DESC; \
+ (cd $(devdir)/devX$$dpi; \
+ rm -f Makefile.sub; \
+ echo DEV=X$$dpi >Makefile.sub; \
+ echo DEVFILES=DESC $$fonts >>Makefile.sub; \
+ $(xtotroff) -r $$dpi -s 10 $(driverdir)/FontMap); \
+ echo Making devX$$dpi-12; \
+ test -d $(devdir)/devX$$dpi-12 || \
+ $(mkinstalldirs) $(devdir)/devX$$dpi-12; \
+ rm -f $(devdir)/devX$$dpi-12/DESC; \
+ sed -e "s/res 75/res $$dpi/" \
+ -e 's/unitwidth 10/unitwidth 12/' $(driverdir)/DESC.in \
+ >$(devdir)/devX$$dpi-12/DESC; \
+ (cd $(devdir)/devX$$dpi-12; \
+ rm -f Makefile.sub; \
+ echo DEV=X$$dpi-12 >Makefile.sub; \
+ echo DEVFILES=DESC $$fonts >>Makefile.sub; \
+ $(xtotroff) -r $$dpi -s 12 $(driverdir)/FontMap); \
+ done
diff --git a/contrib/groff/src/utils/xtotroff/Makefile.sub b/contrib/groff/src/utils/xtotroff/Makefile.sub
new file mode 100644
index 0000000..fc0d76a
--- /dev/null
+++ b/contrib/groff/src/utils/xtotroff/Makefile.sub
@@ -0,0 +1,8 @@
+PROG=xtotroff$(EXEEXT)
+MAN1=xtotroff.n
+MLIB=$(LIBM)
+XLIBS=$(LIBXUTIL) $(LIBGROFF)
+EXTRA_CFLAGS=$(X_CFLAGS)
+EXTRA_LDFLAGS=$(X_LIBS) $(X_PRE_LIBS) -lXaw -lXt -lX11 $(X_EXTRA_LIBS)
+OBJS=xtotroff.$(OBJEXT)
+CSRCS=$(srcdir)/xtotroff.c
diff --git a/contrib/groff/src/utils/xtotroff/xtotroff.c b/contrib/groff/src/utils/xtotroff/xtotroff.c
new file mode 100644
index 0000000..dafff04
--- /dev/null
+++ b/contrib/groff/src/utils/xtotroff/xtotroff.c
@@ -0,0 +1,299 @@
+/*
+ * xtotroff
+ *
+ * convert X font metrics into troff font metrics
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <limits.h>
+
+#define __GETOPT_PREFIX groff_
+#include <getopt.h>
+
+#include "XFontName.h"
+#include "DviChar.h"
+
+#define charWidth(fi,c) \
+ ((fi)->per_char[(c) - (fi)->min_char_or_byte2].width)
+#define charHeight(fi,c) \
+ ((fi)->per_char[(c) - (fi)->min_char_or_byte2].ascent)
+#define charDepth(fi,c) \
+ ((fi)->per_char[(c) - (fi)->min_char_or_byte2].descent)
+#define charLBearing(fi,c) \
+ ((fi)->per_char[(c) - (fi)->min_char_or_byte2].lbearing)
+#define charRBearing(fi,c) \
+ ((fi)->per_char[(c) - (fi)->min_char_or_byte2].rbearing)
+
+extern const char *Version_string;
+static char *program_name;
+
+Display *dpy;
+unsigned resolution = 75;
+unsigned point_size = 10;
+
+int charExists(XFontStruct * fi, int c)
+{
+ XCharStruct *p;
+
+ /* `c' is always >= 0 */
+ if ((unsigned int) c < fi->min_char_or_byte2
+ || (unsigned int) c > fi->max_char_or_byte2)
+ return 0;
+ p = fi->per_char + (c - fi->min_char_or_byte2);
+ return p->lbearing != 0 || p->rbearing != 0 || p->width != 0
+ || p->ascent != 0 || p->descent != 0 || p->attributes != 0;
+}
+
+/* Canonicalize the font name by replacing scalable parts by *s. */
+
+static int CanonicalizeFontName(char *font_name, char *canon_font_name)
+{
+ unsigned int attributes;
+ XFontName parsed;
+
+ if (!XParseFontName(font_name, &parsed, &attributes)) {
+ fprintf(stderr, "not a standard name: %s\n", font_name);
+ return 0;
+ }
+
+ attributes &= ~(FontNamePixelSize | FontNameAverageWidth
+ | FontNamePointSize
+ | FontNameResolutionX | FontNameResolutionY);
+ XFormatFontName(&parsed, attributes, canon_font_name);
+ return 1;
+}
+
+static int
+FontNamesAmbiguous(const char *font_name, char **names, int count)
+{
+ char name1[2048], name2[2048];
+ int i;
+
+ if (count == 1)
+ return 0;
+
+ for (i = 0; i < count; i++) {
+ if (!CanonicalizeFontName(names[i], i == 0 ? name1 : name2)) {
+ fprintf(stderr, "bad font name: %s\n", names[i]);
+ return 1;
+ }
+ if (i > 0 && strcmp(name1, name2) != 0) {
+ fprintf(stderr, "ambiguous font name: %s\n", font_name);
+ fprintf(stderr, " matches %s\n", names[0]);
+ fprintf(stderr, " and %s\n", names[i]);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int MapFont(char *font_name, const char *troff_name)
+{
+ XFontStruct *fi;
+ int count;
+ char **names;
+ FILE *out;
+ unsigned int c;
+ unsigned int attributes;
+ XFontName parsed;
+ int j, k;
+ DviCharNameMap *char_map;
+ char encoding[256];
+ char *s;
+ int wid;
+ char name_string[2048];
+
+ if (!XParseFontName(font_name, &parsed, &attributes)) {
+ fprintf(stderr, "not a standard name: %s\n", font_name);
+ return 0;
+ }
+
+ attributes &= ~(FontNamePixelSize | FontNameAverageWidth);
+ attributes |= FontNameResolutionX;
+ attributes |= FontNameResolutionY;
+ attributes |= FontNamePointSize;
+ parsed.ResolutionX = resolution;
+ parsed.ResolutionY = resolution;
+ parsed.PointSize = point_size * 10;
+ XFormatFontName(&parsed, attributes, name_string);
+
+ names = XListFonts(dpy, name_string, 100000, &count);
+ if (count < 1) {
+ fprintf(stderr, "bad font name: %s\n", font_name);
+ return 0;
+ }
+
+ if (FontNamesAmbiguous(font_name, names, count))
+ return 0;
+
+ XParseFontName(names[0], &parsed, &attributes);
+ sprintf(encoding, "%s-%s", parsed.CharSetRegistry,
+ parsed.CharSetEncoding);
+ for (s = encoding; *s; s++)
+ if (isupper(*s))
+ *s = tolower(*s);
+ char_map = DviFindMap(encoding);
+ if (!char_map) {
+ fprintf(stderr, "not a standard encoding: %s\n", encoding);
+ return 0;
+ }
+
+ fi = XLoadQueryFont(dpy, names[0]);
+ if (!fi) {
+ fprintf(stderr, "font does not exist: %s\n", names[0]);
+ return 0;
+ }
+
+ printf("%s -> %s\n", names[0], troff_name);
+
+ { /* Avoid race while opening file */
+ int fd;
+ (void) unlink(troff_name);
+ fd = open(troff_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ out = fdopen(fd, "w");
+ }
+
+ if (!out) {
+ perror(troff_name);
+ return 0;
+ }
+ fprintf(out, "name %s\n", troff_name);
+ if (!strcmp(char_map->encoding, "adobe-fontspecific"))
+ fprintf(out, "special\n");
+ if (charExists(fi, ' ')) {
+ int w = charWidth(fi, ' ');
+ if (w > 0)
+ fprintf(out, "spacewidth %d\n", w);
+ }
+ fprintf(out, "charset\n");
+ for (c = fi->min_char_or_byte2; c <= fi->max_char_or_byte2; c++) {
+ const char *name = DviCharName(char_map, c, 0);
+ if (charExists(fi, c)) {
+ int param[5];
+
+ wid = charWidth(fi, c);
+
+ fprintf(out, "%s\t%d", name ? name : "---", wid);
+ param[0] = charHeight(fi, c);
+ param[1] = charDepth(fi, c);
+ param[2] = 0; /* charRBearing (fi, c) - wid */
+ param[3] = 0; /* charLBearing (fi, c) */
+ param[4] = 0; /* XXX */
+ for (j = 0; j < 5; j++)
+ if (param[j] < 0)
+ param[j] = 0;
+ for (j = 4; j >= 0; j--)
+ if (param[j] != 0)
+ break;
+ for (k = 0; k <= j; k++)
+ fprintf(out, ",%d", param[k]);
+ fprintf(out, "\t0\t0%o\n", c);
+
+ if (name) {
+ for (k = 1; DviCharName(char_map, c, k); k++) {
+ fprintf(out, "%s\t\"\n", DviCharName(char_map, c, k));
+ }
+ }
+ }
+ }
+ XUnloadFont(dpy, fi->fid);
+ fclose(out);
+ return 1;
+}
+
+static void usage(FILE *stream)
+{
+ fprintf(stream,
+ "usage: %s [-r resolution] [-s pointsize] FontMap\n",
+ program_name);
+}
+
+int main(int argc, char **argv)
+{
+ char troff_name[1024];
+ char font_name[1024];
+ char line[1024];
+ char *a, *b, c;
+ FILE *map;
+ int opt;
+ static const struct option long_options[] = {
+ { "help", no_argument, 0, CHAR_MAX + 1 },
+ { "version", no_argument, 0, 'v' },
+ { NULL, 0, 0, 0 }
+ };
+
+ program_name = argv[0];
+
+ while ((opt = getopt_long(argc, argv, "gr:s:v", long_options,
+ NULL)) != EOF) {
+ switch (opt) {
+ case 'g':
+ /* unused; just for compatibility */
+ break;
+ case 'r':
+ sscanf(optarg, "%u", &resolution);
+ break;
+ case 's':
+ sscanf(optarg, "%u", &point_size);
+ break;
+ case 'v':
+ printf("xtotroff (groff) version %s\n", Version_string);
+ exit(0);
+ break;
+ case CHAR_MAX + 1: /* --help */
+ usage(stdout);
+ exit(0);
+ break;
+ case '?':
+ usage(stderr);
+ exit(1);
+ break;
+ }
+ }
+ if (argc - optind != 1) {
+ usage(stderr);
+ exit(1);
+ }
+
+ dpy = XOpenDisplay(0);
+ if (!dpy) {
+ fprintf(stderr, "Can't connect to the X server.\n");
+ fprintf(stderr,
+ "Make sure the DISPLAY environment variable is set correctly.\n");
+ exit(1);
+ }
+
+ map = fopen(argv[optind], "r");
+ if (map == NULL) {
+ perror(argv[optind]);
+ exit(1);
+ }
+
+ while (fgets(line, sizeof(line), map)) {
+ for (a = line, b = troff_name; *a; a++, b++) {
+ c = (*b = *a);
+ if (c == ' ' || c == '\t')
+ break;
+ }
+ *b = '\0';
+ while (*a && (*a == ' ' || *a == '\t'))
+ ++a;
+ for (b = font_name; *a; a++, b++)
+ if ((*b = *a) == '\n')
+ break;
+ *b = '\0';
+ if (!MapFont(font_name, troff_name))
+ exit(1);
+ }
+ exit(0);
+}
diff --git a/contrib/groff/src/utils/xtotroff/xtotroff.man b/contrib/groff/src/utils/xtotroff/xtotroff.man
new file mode 100644
index 0000000..d21bb5c
--- /dev/null
+++ b/contrib/groff/src/utils/xtotroff/xtotroff.man
@@ -0,0 +1,109 @@
+.ig
+Copyright (C) 2004 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual 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.
+
+Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be included in
+translations approved by the Free Software Foundation instead of in
+the original English.
+..
+.
+.
+.TH XTOTROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
+.SH NAME
+xtotroff \- convert X font metrics into GNU troff font metrics
+.
+.
+.SH SYNOPSIS
+.B xtotroff
+[
+.BI \-r \%resolution
+]
+[
+.BI \-s \%point-size
+]
+[
+.B \-v
+]
+.I FontMap
+.
+.PP
+It is possible to have whitespace between a command line option and its
+parameter.
+.
+.
+.SH DESCRIPTION
+.B xtotroff
+takes a
+.IR FontMap ,
+which maps
+.B groff
+fonts to X11 fonts,
+creates GNU
+.B troff
+metric files for all fonts listed.
+Each line in
+.I FontMap
+consists of GNU
+.B troff
+font name and an X font name (XLFD) pattern, separated by whitespace.
+Example:
+.
+.PP
+.in +2n
+.nf
+TB -adobe-times-bold-r-normal--*-*-*-*-p-*-iso8859-1
+.fi
+.in
+.
+.PP
+The wildcards in the patterns are filled with the arguments to the
+.B \-r
+and
+.B \-s
+switches.
+If a font name is still ambiguous,
+.B xtotroff
+aborts.
+.
+.
+.SH OPTIONS
+.TP
+.BI \-r resolution
+Set the resolution for all font patterns in
+.IR FontMap .
+The value is used for both the horizontal and vertical resolution.
+If not specified, a resolution of 75dpi is assumed.
+.
+.TP
+.BI \-s point-size
+Set the point size for all font patterns in
+.IR FontMap .
+If not specified, a size of 10pt is assumed.
+.
+.TP
+.B \-v
+Print the version number.
+.
+.
+.SH BUGS
+The only supported font encodings are `iso8859-1' and `adobe-fontspecific'.
+.
+.
+.SH "SEE ALSO"
+.BR gxditview (@MAN1EXT@)
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
OpenPOWER on IntegriCloud