From fbd6cbb8ac7a42fdf219ff087b5b1e98cdeb7c68 Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Sun, 30 Apr 2000 05:12:51 +0000 Subject: [PATCH] * src/devices/grotty/grotty.man: Add cp1047 device. * src/preproc/eqn/eqn.man, src/preproc/eqn/neqn.sh, tmac/eqnrc: Ditto. * src/roff/groff/groff.man: Ditto. * src/roff/nroff/nroff.sh, src/roff/nroff/nroff.man: Ditto. * doc/groff.texinfo: Ditto. * tmac/troffrc: Fix mapping of latin-1 char 160 (non-breakable space) for cp1047. * man/groff_char.man: Add `pc' glyph. * tmac/tmac.latin1: Replacing `md' glyph with `pc'. * tmac/tmac.tty: Add `pc' glyph. * tmac/tmac.tty-char: Use/add `pc' glyph. Don't call tmac.latin1 if we use cp1047 output device. * Makefile.in, aclocal.m4: Don't build utf8 on EBCDIC hosts since there are still hardcoded latin1->unicode values in utf8's font definition files. * configure: Updated. * NEWS: Minor clarification. Updated. * PROBLEMS: Formatted. Added info about C++ fix pack for OS/390 Unix. --- ChangeLog | 29 +++++++ Makefile.in | 5 +- NEWS | 9 +- PROBLEMS | 188 +++++++++++++++++++++++++++++++----------- aclocal.m4 | 2 +- configure | 2 +- doc/groff.texinfo | 9 ++ man/groff_char.man | 1 + src/devices/grotty/grotty.man | 25 +++++- src/preproc/eqn/eqn.man | 5 +- src/preproc/eqn/neqn.sh | 2 +- src/roff/groff/groff.man | 14 ++++ src/roff/nroff/nroff.man | 5 +- src/roff/nroff/nroff.sh | 165 ++++++++++++++++++------------------ tmac/eqnrc | 1 + tmac/tmac.latin1 | 2 +- tmac/tmac.tty | 3 +- tmac/tmac.tty-char | 12 ++- tmac/troffrc | 4 +- 19 files changed, 332 insertions(+), 151 deletions(-) rewrite src/roff/nroff/nroff.sh (67%) diff --git a/ChangeLog b/ChangeLog index 3998509d..dc99837a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2000-04-30 Werner LEMBERG + + * src/devices/grotty/grotty.man: Add cp1047 device. + * src/preproc/eqn/eqn.man, src/preproc/eqn/neqn.sh, tmac/eqnrc: + Ditto. + * src/roff/groff/groff.man: Ditto. + * src/roff/nroff/nroff.sh, src/roff/nroff/nroff.man: Ditto. + * doc/groff.texinfo: Ditto. + + * tmac/troffrc: Fix mapping of latin-1 char 160 (non-breakable space) + for cp1047. + +2000-04-29 Werner LEMBERG + + * man/groff_char.man: Add `pc' glyph. + * tmac/tmac.latin1: Replacing `md' glyph with `pc'. + * tmac/tmac.tty: Add `pc' glyph. + * tmac/tmac.tty-char: Use/add `pc' glyph. Don't call tmac.latin1 if + we use cp1047 output device. + + * Makefile.in, aclocal.m4: Don't build utf8 on EBCDIC hosts since + there are still hardcoded latin1->unicode values in utf8's font + definition files. + * configure: Updated. + * NEWS: Minor clarification. Updated. + + * PROBLEMS: Formatted. Added info about C++ fix pack for OS/390 + Unix. + 2000-04-28 Werner LEMBERG Adding EBCDIC code page 1047. diff --git a/Makefile.in b/Makefile.in index 3ca10d4d..532ee034 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,8 +48,8 @@ BROKEN_SPOOLER_FLAGS=@BROKEN_SPOOLER_FLAGS@ # DEVICE is the default device. DEVICE=ps -# TTYDEVDIRS is either `font/devascii font/devlatin1' (for ASCII) or -# `font/devcp1047' (for EBCDIC). +# TTYDEVDIRS is either `font/devascii font/devlatin1 font/devutf8' (for +# ASCII) or `font/devcp1047' (for EBCDIC). TTYDEVDIRS=@TTYDEVDIRS@ # PSPRINT is the command to use for printing a PostScript file, @@ -332,7 +332,6 @@ DEVDIRS=\ font/devps \ font/devdvi \ $(TTYDEVDIRS) \ - font/devutf8 \ font/devX75 \ font/devX75-12 \ font/devX100 \ diff --git a/NEWS b/NEWS index 168de719..2f1204e7 100644 --- a/NEWS +++ b/NEWS @@ -38,8 +38,9 @@ better support of HTML output: A new switch `-g' for calling `grn' is available. EBCDIC support for tty devices has been added. On such hosts, IBM code page -1047 is available with -Tcp1047 instead of -Tascii and -Tlatin1. Note that -other devices are not yet supported. +1047 is available with -Tcp1047 instead of -Tascii and -Tlatin1 (and, for +the moment, -Tutf8). Note that non-tty devices are not yet supported (but +installed). Troff ----- @@ -82,6 +83,10 @@ tmac.html; thus no need for users to specify -mhtml anymore. The soft hyphen character now has a glyph name: `shc'. +The latin-1 character 173 (PS name `periodcentered') has got the troff glyph +name `ps' and is no longer intermixed with the symbol character `md' (PS +name `mathdot'). + Grotty ------ diff --git a/PROBLEMS b/PROBLEMS index 59e9c0eb..67307cff 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -2,6 +2,8 @@ This file describes various problems that have been encountered in compiling, installing and running groff. Suggestions for additions or other improvements to this file are welcome. +---------------------------------------------------------------------- + * My document says that the current year is 19100, not 2000. In groff, as in traditional troff, the yr number register yields the @@ -24,20 +26,27 @@ or, if you want to be portable to older troff versions, as follows: .nr y4 1900+\n(yr This document was formatted in \n(y4. +---------------------------------------------------------------------- + * I get lots of `numeric overflow' error messages whenever I run -groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler. + groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler. Make sure -DCFRONT_ANSI_BUG is included in DEFINES in the top-level Makefile. If that doesn't solve the problem, define INT_MIN as -INT_MAX in libgroff/lib.h. -* I get errors when I try to compile groff with Sun C++ version 5.0 or 5.1. +---------------------------------------------------------------------- + +* I get errors when I try to compile groff with Sun C++ version 5.0 + or 5.1. This is a known problem; see Sun bug #4301919. As of this writing, no patch is available. Use GCC 2.95.2 or later instead. +---------------------------------------------------------------------- + * I get errors when I try to compile groff with Sun C++ version 3 or -earlier. + earlier. Groff requires header files that are moderately compatible with AT&T C++ and ANSI C. With some versions of Sun C++, the supplied header @@ -46,21 +55,31 @@ files need some of the following changes to meet this requirement: ' to ); the first argument to fopen and freopen should be declared as `const char *'; the first argument to fread should be declared as `void *'; the first argument to fwrite should be -declared as `const void *'; malloc should be declared to return `void -*'; in , the declaration `extern "C" { void +declared as `const void *'; malloc should be declared to return +`void *'; in , the declaration `extern "C" { void *__builtin_alloca(int); }' should be added; in the -return type and the second argument type of signal() should be -changed to be `void (*)(int)'. +return type and the second argument type of signal() should be changed +to be `void (*)(int)'. You can either change them in place, or copy them to some other directory and include that directory with a -I option. +---------------------------------------------------------------------- + +* The configure script fails on OS/390 Unix. + +You must apply fix pack PTF UQ42006 which fixes a C++ compiler bug. + +---------------------------------------------------------------------- + * I get errors when I try to compile groff with DEC C++. Fix the declaration of write() in so that the second argument is a const char *. Fix the declaration of open() in so that the first argument is a const char *. +---------------------------------------------------------------------- + * On Ultrix, the make stops with the message *** Error code 1 @@ -71,6 +90,8 @@ for no apparent reason. Use GNU make. +---------------------------------------------------------------------- + * I'm having problems compiling groff on 386BSD 0.1. If you're using ash as /bin/sh, you'll need the following patch. @@ -99,12 +120,16 @@ If you're using ash as /bin/sh, you'll need the following patch. You'll also need to change dirnamemax.c so that it doesn't use pathconf(). +---------------------------------------------------------------------- + * While compiling on Xenix, ranlib libgroff.a fails. The system ranlib can't handle externals longer than 40 characters. Use the ranlib included in demon.co.uk:/pub/xenix/g++-1.40.3a.v1 instead. +---------------------------------------------------------------------- + * Groff can't handle my troff document. It works fine with AT&T troff. Read the section on incompatibilities in gtroff(1). Try using the -C @@ -112,20 +137,27 @@ option. Alternatively there's the sed script in tmac/fixmacros.sed which will attempt to edit a file of macros so that it can be used with groff without the -C flag. -* groff -Tdvi produces dvi files that use fonts at weird magnifications. +---------------------------------------------------------------------- + +* groff -Tdvi produces dvi files that use fonts at weird + magnifications. Yes, it does. You may need to compile fonts with Metafont at these -magnifications. The CompileFonts script in the devdvi/generate -directory may help you to do this. (It will take a *long* time.) +magnifications. The CompileFonts script in the devdvi/generate +directory may help you to do this. (It will take a *long* time.) + +---------------------------------------------------------------------- * pic output is not centered horizontally; pictures sometimes run off -the bottom of the page. + the bottom of the page. -The macro package you are using is not supplying appropriate definitions -of PS and PE. Give groff a -mpic option. +The macro package you are using is not supplying appropriate +definitions of PS and PE. Give groff a -mpic option. -* I'm having problems including PostScript illustrations using the PSPIC -macro. +---------------------------------------------------------------------- + +* I'm having problems including PostScript illustrations using the + PSPIC macro. A PostScript document must meet three requirements in order to be included with the PSPIC macro: it must comply with the Adobe Document @@ -145,18 +177,24 @@ specification of Encapsulated PostScript format. (This is available from the Adobe file server; send a message with a body of `help' to ps-file-server@adobe.com.) +---------------------------------------------------------------------- + * I've configured groff for A4 paper, but gtroff still seems to think -that the length of a page (as returned by \n(.p) is 11 inches. + that the length of a page (as returned by \n(.p) is 11 inches. This is intentional. The PAGE option is used only by grops. For compatibility with ditroff, the default page length in gtroff is always 11 inches. The page length can be changed with the `pl' request. +---------------------------------------------------------------------- + * Groff doesn't use the font names I'm used to. Use the `ftr' request. See gtroff(1). +---------------------------------------------------------------------- + * I get errors using the Unix -ms macros with groff -e -C. Apply this change: @@ -184,51 +222,66 @@ Apply this change: .nr ZN \\n(dn .if \\n(ZN>0 .if \\n(YE=0 .LP +---------------------------------------------------------------------- -* gpic doesn't accept the syntax `chop N M' for chopping both ends of a -line. +* gpic doesn't accept the syntax `chop N M' for chopping both ends of + a line. The correct syntax is `chop N chop M'. -* With gpic -t, when I print `line ->; box' using a dvi to ps -program, the arrow head sticks through into the inside of the box. +---------------------------------------------------------------------- -The dvi to ps program should be modified to set the line cap and -line join parameters to 1 while printing tpic specials. +* With gpic -t, when I print `line ->; box' using a dvi to ps program, + the arrow head sticks through into the inside of the box. + +The dvi to ps program should be modified to set the line cap and line +join parameters to 1 while printing tpic specials. + +---------------------------------------------------------------------- * When I print the output groff -Tps, the output is always shifted up -by about 0.7 inches; I'm using 8.5x11 inch paper. + by about 0.7 inches; I'm using 8.5x11 inch paper. Make sure that PAGE is defined to be `letter' in the top-level Makefile. +---------------------------------------------------------------------- + * When I try to print the output of groff -Tps, I get no output at all -from the printer, and the log file shows the error -%%[ error: undefined; offendingcommand: BP ]%% -I'm using TranScript spooling software. + from the printer, and the log file shows the error + %%[ error: undefined; offendingcommand: BP ]%% + I'm using TranScript spooling software. This is a bug in the page reversal filter in early versions of TranScript. Change the `broken' parameter in /usr/local/lib/groff/font/devps/DESC to 7. -* When I preview groff -Tps output using the Sun OpenWindows 2.0 pageview -program, all the pages are displayed on top of each other. +---------------------------------------------------------------------- + +* When I preview groff -Tps output using the Sun OpenWindows 2.0 + pageview program, all the pages are displayed on top of each other. This is a defect in pageview. Change the `broken' parameter in /usr/local/lib/groff/font/devps/DESC to 2. +---------------------------------------------------------------------- + * With groff -TX75, -TX100 or -X, I can only view the first page. The left mouse button brings up a menu that allows you to view other pages. +---------------------------------------------------------------------- + * When I print the output of groff -Tdvi, I just get a black dot in -upper left corner. + upper left corner. Some dvi drivers (notably early versions of xtex) do not correctly handle dvi files that use a resolution different from that used by dvi files produced by TeX. Try getting a more up to date driver. +---------------------------------------------------------------------- + * I get lots of errors when I use groff with the AT&T -mm macros. The AT&T -mm macros need a few changes to work with groff; `make @@ -237,57 +290,80 @@ and make the necessary changes. You may need to edit the commands for the install.mm target in the Makefile. Alternatively use the groff -mm macros. +---------------------------------------------------------------------- + * gtroff doesn't understand lines like `.ce99' with no space between -the name of the request or macro and the arguments. + the name of the request or macro and the arguments. -Gtroff requires a space between macro or request and its arguments +gtroff requires a space between macro or request and its arguments because it allows the use of long names for macros and requests. You can use the -C option or the `cp' request to put gtroff into a compatibility mode in which it is not possible to use long names for macros but in which no space is required between macros and their arguments. The use of compatibility mode is strongly discouraged. +---------------------------------------------------------------------- + * gtroff gives warnings about lines like .ev \" a comment -(with a tab after the .ev). + (with a tab after the .ev). A tab character cannot be used as a substitute for a space character (except in one case: between a control character at the beginning of a line and the name of a macro or request). For example, in Unix troff + .ps \" restore the previous point size + (with a tab after the .ps) will NOT restore the previous point-size; instead it will be silently ignored. Since this is very likely to be an error, gtroff can give a warning about it. If you want to align comments, you can do it like this: + .ev\" \" a comment +---------------------------------------------------------------------- + * I don't like the page headers and footers produced by groff -man. There seem to be many different styles of page header and footer produced by different versions of the -man macros. You will need to modify macros/tmac.an to suit your personal taste. For example, if you want the center of the page header to say + System Programmer's Manual + you will need to change the line + .el .ds an-extra3 \"System Programmer's Manual + to + .el .ds an-extra3 System Programmer's Manual -* While formatting a manual page, groff complains about not being able to -break lines. The problem seems to be caused by a line like: +---------------------------------------------------------------------- + +* While formatting a manual page, groff complains about not being able + to break lines. The problem seems to be caused by a line like: .TP \w'label'+2 The -man documentation says that the default scale indicator for TP macro is `n'. The groff -man macros implement this correctly, so that the argument will be evaluated as if it were + \w'label'n+2n + The Unix -man macros don't implement this correctly (probably because it's hard to do in Unix troff); they just append `n' to the entire argument, so that it will be evaluated as if it were + \w'label'u+2n + The solution is to fix the manual page: + .TP \w'label'u+2 +---------------------------------------------------------------------- + * I'm having problems formatting Ultrix man pages with groff -man. The Ultrix man pages use a number of non-standard extensions to the @@ -320,6 +396,8 @@ Frank Wortner): Another possible solution is to install tmac/man.ultrix as /usr/local/lib/groff/tmac/man.local. +---------------------------------------------------------------------- + * I'm having problems formatting HP-UX 9.0 man pages with groff -man. Rename /usr/local/lib/groff/tmac/tmac.an to (for example) @@ -328,8 +406,10 @@ Rename /usr/local/lib/groff/tmac/tmac.an to (for example) beginning or filter it (and any files it .so's) through tmac/fixmacros.sed. +---------------------------------------------------------------------- + * I'm having problems formatting man pages produced by the perl -wrapman script. + wrapman script. Some versions of wrapman have a superfluous blank line before the .TH line. This must be deleted. Then either use groff -C, or apply the @@ -408,22 +488,28 @@ following patch: .SH SYNOPSIS -* When I preview documents using -TX75 or -TX100, the layout is not the same -as when I print the document with -Tps: the line and page breaks come -in different places. +---------------------------------------------------------------------- + +* When I preview documents using -TX75 or -TX100, the layout is not + the same as when I print the document with -Tps: the line and page + breaks come in different places. Use groff -X -Tps. +---------------------------------------------------------------------- + * When I try to run gxditview, I get the error: -Error: Widget viewport has zero width and/or height + Error: Widget viewport has zero width and/or height This error means you haven't correctly installed the application defaults file, GXditview.ad; ``make install'' does this for you automatically, so either you didn't do ``make install'', or you don't have imake configured correctly. +---------------------------------------------------------------------- + * groff uses up an enormous amount of memory processing large files. -I'm using 386BSD 0.1. + I'm using 386BSD 0.1. 386BSD includes an old version of g++, 1.39, which has a bug that causes a major memory leak in gtroff. Apply the following fix to g++ @@ -457,14 +543,18 @@ and recompile groff: else exprstmt = 0; +---------------------------------------------------------------------- + * Where can I get grap? Ted Faber has written a freely available grap: http://www.lunabase.org/~faber/Vault/software/grap/ +---------------------------------------------------------------------- + * How can I use groff with an old LaserJet printer that doesn't work -with groff -Tlj4? + with groff -Tlj4? You have at least 3 options: @@ -473,11 +563,13 @@ You have at least 3 options: - use groff -Tdvi with a TeX .dvi to Laserjet driver; - use groff with the LaserJet driver in Chris Lewis' psroff package -(available for ftp from: -ftp.uunet.ca:/distrib/chris_lewis/psroff3.0pl17). + (available for ftp from: + ftp.uunet.ca:/distrib/chris_lewis/psroff3.0pl17). + +---------------------------------------------------------------------- * Groff seems to generate level 3 Postscript, but my printer is only a -level 1 or 2 PostScript printer. + level 1 or 2 PostScript printer. In fact groff generates only level 1 PostScript. The `%!PS-Adobe-3.0' comment at the beginning of PostScript output generated by groff @@ -486,9 +578,11 @@ Structuring Conventions. The output generated by groff should be printable on any PostScript printer. Problems with groff output's not printing are most often caused by the spooling system. +---------------------------------------------------------------------- + * The \n(st and \n(sb registers don't seem to work. I thought \w set -them to the height and depth of its argument, but the registers always -seem to be 0. + them to the height and depth of its argument, but the registers + always seem to be 0. \n(st and \n(sb aren't supposed to give the height and depth of the string rather they give the minimum and maximum vertical displacement @@ -496,6 +590,8 @@ of the baseline. For example for \v'2u'\v'-3u', \n(st will be 1 and \n(sb will be -2. The height and depth of the string is available in the \n[rst] and \n[rsb] registers: these are groff extensions. +---------------------------------------------------------------------- + * On an SGI system, how can I make the man command use groff? From David Hinds (some of these steps diff --git a/aclocal.m4 b/aclocal.m4 index 030fbcd7..58612989 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -456,7 +456,7 @@ groff_cv_ebcdic="yes" AC_MSG_RESULT(yes) AC_DEFINE(IS_EBCDIC_HOST), groff_cv_ebcdic="no" - TTYDEVDIRS="font/devascii font/devlatin1" + TTYDEVDIRS="font/devascii font/devlatin1 font/devutf8" AC_MSG_RESULT(no)) AC_SUBST(TTYDEVDIRS)])dnl dnl diff --git a/configure b/configure index d32c191b..c0701776 100755 --- a/configure +++ b/configure @@ -1023,7 +1023,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* groff_cv_ebcdic="no" - TTYDEVDIRS="font/devascii font/devlatin1" + TTYDEVDIRS="font/devascii font/devlatin1 font/devutf8" echo "$ac_t""no" 1>&6 fi rm -f conftest* diff --git a/doc/groff.texinfo b/doc/groff.texinfo index 14177396..88b095c8 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -1049,6 +1049,12 @@ character set. @item utf8 For typewriter-like devices which use the Unicode (@w{ISO 10646}) character set with @w{UTF-8} encoding. +@item cp1047 +@cindex @acronym{EBCDIC} encoding +@cindex cp1047 +@cindex IBM cp1047 +For typewriter-like devices which use the @acronym{EBCDIC} encoding IBM +cp1047. @item lj4 For an HP LaserJet4-compatible (or other PCL5-compatible) printer. @item lbp @@ -2166,6 +2172,7 @@ character (at the end of a line), append @code{\&}. @cindex tab character @cindex character, tabulator +@cindex @acronym{EBCDIC} encoding @code{gtroff} translates @dfn{tabulator characters}, also called @dfn{tabs} (normally code point @acronym{ASCII} @code{0x09} resp.@: @acronym{EBCDIC} @code{0x05}), in the input into movements to the next @@ -2500,6 +2507,7 @@ Whitespace characters (space, tabs, and newlines). @cindex character, backspace @cindex backspace character @item +@cindex @acronym{EBCDIC} encoding Backspace (@acronym{ASCII}@w{ }@code{0x08} resp.@: @acronym{EBCDIC}@w{ }@code{0x16}) and character code @code{0x01}. @cindex illegal input characters @@ -3782,6 +3790,7 @@ Disable no-space mode. @cindex tabs and fields @cindex fields and tabs +@cindex @acronym{EBCDIC} encoding A tab character (@acronym{ASCII} char@w{ }9, @acronym{EBCDIC} char@w{ }5) causes a horizontal movement to the next tab stop (which is much like that on a typewriter). diff --git a/man/groff_char.man b/man/groff_char.man index b6f0644e..cf895ab9 100644 --- a/man/groff_char.man +++ b/man/groff_char.man @@ -381,6 +381,7 @@ Output Input Input PostScript Notes .C2 OK \& "check mark, tick" .C2 Of ordfeminine .C2 Om ordmasculine +.C2 pc periodcentered .C2 S1 onesuperior .C2 S2 twosuperior .C2 S3 threesuperior diff --git a/src/devices/grotty/grotty.man b/src/devices/grotty/grotty.man index cb396228..51c6a498 100644 --- a/src/devices/grotty/grotty.man +++ b/src/devices/grotty/grotty.man @@ -47,7 +47,9 @@ with a .B \-Tlatin1 or .B \-Tutf8 -option. +option on ASCII based systems, and with +.B \-Tcp1047 +on EBCDIC based hosts. If no files are given, .B grotty will read the standard input. @@ -124,9 +126,10 @@ for font and device description files; .I name is the name of the device, usually .BR ascii , -.B latin1 +.BR latin1 , +.BR utf8 , or -.BR utf8 . +.BR cp1047 . .TP .B \-h Use horizontal tabs in the output. @@ -209,6 +212,18 @@ of .B utf8 device. .TP +.B @FONTDIR@/devcp1047/DESC +Device description file for +.B cp1047 +device. +.TP +.BI @FONTDIR@/devcp1047/ F +Font description file for font +.I F +of +.B cp1047 +device. +.TP .B @MACRODIR@/tmac.tty Macros for use with .BR grotty . @@ -216,6 +231,10 @@ Macros for use with .B @MACRODIR@/tmac.tty-char Additional klugey character definitions for use with .BR grotty . +.LP +Note that on EBCDIC hosts, only files for the +.B cp1047 +device will be installed. .SH BUGS .LP .B grotty diff --git a/src/preproc/eqn/eqn.man b/src/preproc/eqn/eqn.man index 77bafc10..e194ecf4 100644 --- a/src/preproc/eqn/eqn.man +++ b/src/preproc/eqn/eqn.man @@ -740,9 +740,10 @@ The default value is 0 .B eqnrc file for the .BR ascii , -.B latin1 +.BR latin1 , +.BR utf8 , and -.B utf8 +.B cp1047 devices.) .LP A more precise description of the role of many of these diff --git a/src/preproc/eqn/neqn.sh b/src/preproc/eqn/neqn.sh index a979ebcb..6a60d138 100644 --- a/src/preproc/eqn/neqn.sh +++ b/src/preproc/eqn/neqn.sh @@ -1,5 +1,5 @@ #!/bin/sh # Provision of this shell script should not be taken to imply that use of -# GNU eqn with groff -Tascii|-Tlatin1|-Tutf8 is supported. +# GNU eqn with groff -Tascii|-Tlatin1|-Tutf8|-Tcp1047 is supported. exec @g@eqn -Tascii ${1+"$@"} diff --git a/src/roff/groff/groff.man b/src/roff/groff/groff.man index c5c390da..a09a71e9 100644 --- a/src/roff/groff/groff.man +++ b/src/roff/groff/groff.man @@ -92,6 +92,10 @@ For typewriter-like devices using the ISO Latin-1 (ISO 8859-1) character set. .B utf8 For typewriter-like devices using the Unicode (ISO 10646) character set with UTF-8 encoding. +.TP +.B cp1047 +For typewriter-like devices which use the EBCDIC code page IBM cp1047 +(e.g. OS/390 Unix). .TP .B lj4 For an HP LaserJet4-compatible (or other PCL5-compatible) printer. @@ -373,6 +377,16 @@ Font file for font .I F of device .IR name . +.LP +Note that on EBCDIC hosts, output devices +.BR ascii , +.BR latin1 , +and +.B utf8 +aren't available. +Similarly, +.B cp1047 +is not available on ASCII based operating systems. .SH EXAMPLE To print the man page .B foo.1 diff --git a/src/roff/nroff/nroff.man b/src/roff/nroff/nroff.man index d4877871..a01ea59d 100644 --- a/src/roff/nroff/nroff.man +++ b/src/roff/nroff/nroff.man @@ -50,9 +50,10 @@ The .B \-T option with an argument other than .BR ascii , -.B latin1 +.BR latin1 , +.BR utf8 , or -.B utf8 +.B cp1047 will be ignored. The .B \-h diff --git a/src/roff/nroff/nroff.sh b/src/roff/nroff/nroff.sh dissimilarity index 67% index a199541d..095c047b 100644 --- a/src/roff/nroff/nroff.sh +++ b/src/roff/nroff/nroff.sh @@ -1,83 +1,82 @@ -#!/bin/sh -# Emulate nroff with groff. - -prog="$0" -# Default device. -# First try the "locale charmap" command, because it's most reliable. -# On systems where it doesn't exist, look at the environment variables. -case "`locale charmap 2>/dev/null`" in - UTF-8 ) T=-Tutf8 ;; - ISO-8859-1 ) T=-Tlatin1 ;; - *) - case "${LC_ALL-${LC_CTYPE-${LANG}}}" in - *.UTF-8 ) T=-Tutf8 ;; - iso_8859_1 | *.ISO-8859-1 ) T=-Tlatin1 ;; - *) - case "$LESSCHARSET" in - utf-8 ) T=-Tutf8 ;; - latin1 ) T=-Tlatin1 ;; - *) T=-Tascii ;; - esac - ;; - esac - ;; -esac -opts= -safer=-S - -for i -do - case $1 in - -h) - opts="$opts -P-h" - ;; - -[eq]|-s*) - # ignore these options - ;; - -[mrnoT]) - echo "$prog: option $1 requires an argument" >&2 - exit 1 - ;; - -i|-[mrno]*) - opts="$opts $1"; - ;; - - -Tascii|-Tlatin1|-Tutf8) - T=$1 - ;; - -T*) - # ignore other devices - ;; - -S) - # safer behaviour - safer=-S - ;; - -U) - # unsafe behaviour - safer=-U - ;; - -u*) - # Solaris 2.2 `man' uses -u0; ignore it, - # since `less' and `more' can use the emboldening info. - ;; - --) - shift - break - ;; - -) - break - ;; - -*) - echo "$prog: invalid option $1" >&2 - exit 1 - ;; - *) - break - ;; - esac - shift -done - -# This shell script is intended for use with man, so warnings are -# probably not wanted. Also load nroff-style character definitions. -exec groff $safer -Wall -mtty-char $T $opts ${1+"$@"} +#!/bin/sh +# Emulate nroff with groff. + +prog="$0" +# Default device. +# First try the "locale charmap" command, because it's most reliable. +# On systems where it doesn't exist, look at the environment variables. +case "`locale charmap 2>/dev/null`" in + UTF-8) + T=-Tutf8 ;; + ISO-8859-1) + T=-Tlatin1 ;; + IBM-1047) + T=-Tcp1047 ;; + *) + case "${LC_ALL-${LC_CTYPE-${LANG}}}" in + *.UTF-8) + T=-Tutf8 ;; + iso_8859_1 | *.ISO-8859-1) + T=-Tlatin1 ;; + *.IBM-1047) + T=-Tcp1047 ;; + *) + case "$LESSCHARSET" in + utf-8) + T=-Tutf8 ;; + latin1) + T=-Tlatin1 ;; + cp1047) + T=-Tcp1047 ;; + *) + T=-Tascii ;; + esac ;; + esac ;; +esac +opts= +safer=-S + +for i; do + case $1 in + -h) + opts="$opts -P-h" ;; + -[eq] | -s*) + # ignore these options + ;; + -[mrnoT]) + echo "$prog: option $1 requires an argument" >&2 + exit 1 ;; + -i | -[mrno]*) + opts="$opts $1" ;; + -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047) + T=$1 ;; + -T*) + # ignore other devices + ;; + -S) + # safer behaviour + safer=-S ;; + -U) + # unsafe behaviour + safer=-U ;; + -u*) + # Solaris 2.2 `man' uses -u0; ignore it, + # since `less' and `more' can use the emboldening info. + ;; + --) + shift + break ;; + -) + break ;; + -*) + echo "$prog: invalid option $1" >&2 + exit 1 ;; + *) + break ;; + esac + shift +done + +# This shell script is intended for use with man, so warnings are +# probably not wanted. Also load nroff-style character definitions. +exec groff $safer -Wall -mtty-char $T $opts ${1+"$@"} diff --git a/tmac/eqnrc b/tmac/eqnrc index 6642a2d0..cfdbf3f9 100644 --- a/tmac/eqnrc +++ b/tmac/eqnrc @@ -52,6 +52,7 @@ ifdef ps|X|html ! set draw_lines 1 ! ifdef ascii ! define n %1% ! ifdef latin1 ! define n %1% ! ifdef utf8 ! define n %1% ! +ifdef cp1047 ! define n %1% ! ifdef n ! set nroff 1 ! diff --git a/tmac/tmac.latin1 b/tmac/tmac.latin1 index e2d70363..b9c74735 100755 --- a/tmac/tmac.latin1 +++ b/tmac/tmac.latin1 @@ -25,7 +25,7 @@ .latin1-tr \[char180] \(aa .latin1-tr \[char181] \(*m .latin1-tr \[char182] \(ps -.latin1-tr \[char183] \(md +.latin1-tr \[char183] \(pc .latin1-tr \[char184] \(ac .latin1-tr \[char185] \(S1 .latin1-tr \[char186] \(Om diff --git a/tmac/tmac.tty b/tmac/tmac.tty index a4d89693..115c9d30 100755 --- a/tmac/tmac.tty +++ b/tmac/tmac.tty @@ -8,7 +8,8 @@ .de tty-char .if !c\\$1 .char \\$1 "\\$2 .. -.if c\(md .tr \(bu\(md +.ie c\(pc .tr \(bu\(pc +.el .if c\(md .tr \(bu\(md .tty-char \(bu \z+o .tty-char \(14 1/4 .tty-char \(12 1/2 diff --git a/tmac/tmac.tty-char b/tmac/tmac.tty-char index 8dc1aee7..e8a45f9f 100755 --- a/tmac/tmac.tty-char +++ b/tmac/tmac.tty-char @@ -1,8 +1,8 @@ .\" This file defines standard troff characters and some groff characters for -.\" use with -Tascii, -Tlatin1 and -Tutf8. +.\" use with -Tascii, -Tlatin1, -Tutf8, and -Tcp1047. .\" .\" These definitions are chosen so that, as far as possible, they: -.\" - work with all of -Tascii, -Tlatin1 and -Tutf8. +.\" - work with all of -Tascii, -Tlatin1, -Tutf8, and -Tcp1047. .\" - work on devices that display only the last overstruck character .\" as well as on devices that support overstriking .\" - represent the character's graphical shape (not its meaning) @@ -85,7 +85,9 @@ .tty-char \(OR v .tty-char \(uA \z=^ .tty-char \(dA \z=v -.if c\(md .tty-char \(a. \(md +.if c\(md .tty-char \(pc \(md +.if c\(pc .tty-char \(md \(pc +.if c\(pc .tty-char \(a. \(pc .tty-char \(Im I .tty-char \(Re R .tty-char \(/L \z/L @@ -128,6 +130,7 @@ .tty-char \(S3 3 .tty-char \(ps 9| .tty-char \(md . +.tty-char \(pc . .tty-char \(ac , .tty-char \(S1 1 .tty-char \(Om \z_o @@ -195,4 +198,5 @@ .\"tty-char \(:y \ij .tty-char \[arrowvertex] | .cp \n(_C -.do mso tmac.latin1 +.if !'\*(.T'cp1047' \ +. do mso tmac.latin1 diff --git a/tmac/troffrc b/tmac/troffrc index 1fa055d7..e61319d0 100644 --- a/tmac/troffrc +++ b/tmac/troffrc @@ -13,6 +13,7 @@ .do ds troffrc!ascii tmac.tty .do ds troffrc!latin1 tmac.tty .do ds troffrc!utf8 tmac.tty +.do ds troffrc!cp1047 tmac.tty .do ds troffrc!lj4 tmac.lj4 .do ds troffrc!lbp tmac.lbp .do ds troffrc!html tmac.arkup @@ -20,7 +21,8 @@ . do mso \*[troffrc!\*[.T]] .do rm troffrc!ps troffrc!Xps troffrc!dvi troffrc!X75 troffrc!X75-12 \ troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html -.do tr \[char160] +.ie '\*(.T'cp1047' .do tr \[char65] +.el .do tr \[char160] .\" Set the hyphenation language to `us'. .do hla us .\" Load hyphenation patterns from `hyphen.us' (in the tmac directory). -- 2.11.4.GIT