From 68dcd72428a7a074e3d69d4b63f2a6de9150c8f0 Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Wed, 23 Jul 2003 09:39:13 +0000 Subject: [PATCH] Add option -G to .MPIMG to insert a gap between text and the image. * tmac/www.tmac (www-finish-left-po, www-finish-right-ll, www-finish-left-ll): Updated. (www-image-just, www-image-gap, www-htmlimage-gap): New variables. (MPIMG): Make option -L and -R optional. Implement option -G. * src/devices/grohtml/post-html.cpp (html_printer::do_file_components): Don't use `stdout' as lvalue since it can be a macro. * src/libs/libgroff/strerror.c: Include errno.h to be in sync with the corresponding test in aclocal.m4. --- ChangeLog | 24 ++++++++++++++ doc/groff.texinfo | 23 ++++++++++++- src/devices/grohtml/post-html.cpp | 5 ++- src/libs/libgroff/strerror.c | 1 + src/preproc/pic/common.cpp | 2 +- tmac/www.tmac | 68 ++++++++++++++++++++++++++++----------- 6 files changed, 99 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a9a9a28..e6a0babb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,33 @@ +2003-07-22 Heinz-Jürgen Oertel + + Add option -G to .MPIMG to insert a gap between text and the image. + + * tmac/www.tmac (www-finish-left-po, www-finish-right-ll, + www-finish-left-ll): Updated. + (www-image-just, www-image-gap, www-htmlimage-gap): New variables. + (MPIMG): Make option -L and -R optional. + Implement option -G. + +2003-07-22 Gaius Mulley + + * src/devices/grohtml/post-html.cpp + (html_printer::do_file_components): Don't use `stdout' as lvalue + since it can be a macro. + +2003-07-22 Werner LEMBERG + + * src/libs/libgroff/strerror.c: Include errno.h to be in sync with + the corresponding test in aclocal.m4. + 2003-07-21 Werner LEMBERG * src/preproc/html/pre-html.cpp (TRANSPARENT): Don't use colour names but RGB values directly. Otherwise pnmtopng depends on an external file `rgb.txt' which maps colour names to values. + * tmac/an-old.tmac [cR] (bp): Pass arguments to an-bp. + Do a break to properly propagateRedefine `bp' to avoid empty lines. + 2003-07-20 Werner LEMBERG * aclocal.m4 (GROFF_SYS_ERRLIST): Include stdlib.h for MinGW. diff --git a/doc/groff.texinfo b/doc/groff.texinfo index 834692dd..8f7e4503 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -12703,6 +12703,27 @@ appended to the lines. With no arguments the margin character is turned off. If this occurs before a break, no margin character is printed. +For compatibility with @acronym{AT&T} @code{troff}, a call to @code{mc} +to set the margin character can't be undone immediately; at least one +line gets a margin character. Thus + +@Example +.ll 1i +.mc \[br] +.mc +xxx +.br +xxx +@endExample + +@noindent +produces + +@Example +xxx | +xxx +@endExample + @cindex @code{tl} request, and @code{mc} For empty lines and lines produced by the @code{tl} request no margin character is emitted. @@ -12715,7 +12736,7 @@ The margin character is associated with the current environment This is quite useful for indicating text that has changed, and, in fact, there are programs available for doing this (they are called @code{nrchbar} and @code{changebar} and can be found in any -@samp{comp.sources.unix} archive. +@samp{comp.sources.unix} archive). @Example .ll 3i diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp index 380ac4e5..83382f1e 100644 --- a/src/devices/grohtml/post-html.cpp +++ b/src/devices/grohtml/post-html.cpp @@ -3851,11 +3851,10 @@ void html_printer::do_file_components (void) current = next; next = file_list.next_file_name(); next += '\0'; - fclose(stdout); string split_file = file_list.file_name(); split_file += '\0'; - stdout = fopen(split_file.contents(), "w"); - html.set_file(stdout); + fflush(stdout); + freopen(split_file.contents(), "w", stdout); fragment_no++; write_navigation(top, prev, next, current); } diff --git a/src/libs/libgroff/strerror.c b/src/libs/libgroff/strerror.c index cc9482d0..15dfa6bf 100644 --- a/src/libs/libgroff/strerror.c +++ b/src/libs/libgroff/strerror.c @@ -23,6 +23,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #include +#include #include /* for MinGW */ #define INT_DIGITS 19 /* enough for 64 bit integer */ diff --git a/src/preproc/pic/common.cpp b/src/preproc/pic/common.cpp index a2dfe921..e86f058c 100644 --- a/src/preproc/pic/common.cpp +++ b/src/preproc/pic/common.cpp @@ -119,7 +119,7 @@ void common_output::ellipse_arc(const position ¢, } } -// output a dashed ellipse as a series of straight lines +// output a dashed ellipse as a series of arcs void common_output::dashed_ellipse(const position ¢, const distance &dim, const line_type <) diff --git a/tmac/www.tmac b/tmac/www.tmac index 35bb82bf..e23695e1 100644 --- a/tmac/www.tmac +++ b/tmac/www.tmac @@ -191,7 +191,7 @@ www functionality. It should work with any macro set. .\" Arguments: >=2: [...] .\" .de www:url_breaks_splitted -. nr \\$0:min 5 \" minimal number of characters for next line +. nr \\$0:min 5 \" minimal number of characters for next line . if (\\n[.$] < 2) \ . www:error .\\$0 expects at least 2 arguments. . ds \\$0:res \\$1\" @@ -465,13 +465,14 @@ www functionality. It should work with any macro set. .nr www-right-ll-trap 0 . .de www-finish-left-po -. po -\\n[www-left-indent]u +. po -(\\n[www-left-indent]u + \\n[www-image-gap]u) . wh \\n[www-left-po-trap]u . nr www-left-indent 0 .. . +.\" called when the -R picture is finished .de www-finish-right-ll -. ll +\\n[www-right-indent]u +. ll +(\\n[www-right-indent]u + \\n[www-image-gap]u) . \" now see whether we need to inline www-finish-left-ll . if (\\n[www-left-ll-trap]u > 0) \ . if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\ @@ -502,51 +503,78 @@ www functionality. It should work with any macro set. . mk www-left-po-trap . nr www-left-po-trap +1v . wh \\n[www-left-po-trap]u www-finish-left-po -. ll +\\n[www-left-indent]u +. ll +(\\n[www-left-indent]u + \\n[www-image-gap]u) . wh \\n[www-left-ll-trap]u . nr www-left-ll-trap 0 .. .\" -------------------------------------------------------------------- -.\" MPIMG [-R|-L] filename [width] [height] +.\" MPIMG [-R|-L] [-G gap] filename [width [height]] .\" .\" Include a png image and wrap text around it. It will work for .\" -Tps and -Thtml. The default value for WIDTH is 1i; default value .\" for HEIGHT is WIDTH; the default alignment is left (-L). +.\" -G is used to insert a gap between the text and the image. .\" .\" Note: This macro can only be used with the `-U' option of groff, .\" activating unsafe mode, if not used with -Thtml; the PNG image .\" is then converted to the EPS format using netpbm utilities. .\" .de MPIMG +. nr www-image-just 1 +. nr www-image-gap 0 +. while (\\n[.$] > 0) \{\ +. if '-L'\\$1' \{\ +. nr www-image-just 1 +. shift +. continue +. \} +. if '-R'\\$1' \{\ +. nr www-image-just 0 +. shift +. continue +. \} +. if '-G'\\$1' \{\ +. nr www-image-gap \\$2 +. nr www-htmlimage-gap (\\$2 * 100 / 240) +. shift 2 +. continue +. \} +. break +. \} . nr www-width 1i -. if !'\\$3'' \ -. nr www-width \\$3 +. if !'\\$2'' \ +. nr www-width \\$2 . nr www-height \\n[www-width] -. if !'\\$4'' \ -. nr www-height \\$4 +. if !'\\$3'' \ +. nr www-height \\$3 . nr www-width (\\n[www-width] * 100 / 240) . nr www-height (\\n[www-height] * 100 / 240) +. . ie \\n[www-html] \{\ -. ie '\\$1'-R' \ -. HTML +. ie !\\n[www-image-just] \ +. HTML . el \ -. HTML +. HTML . \} . el \{\ . if !r ps4html \{\ . www-make-unique-name -. sy pngtopnm \\$2 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps -. ie '\\$1'-R' \{\ +. sy pngtopnm \\$1 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps +. ie !\\n[www-image-just] \{\ . \" we must now disable a possible left image trap . sp -1 . if (\\n[www-left-ll-trap] > 0) \ . wh \\n[www-left-ll-trap]u . if (\\n[www-left-po-trap] > 0) \ . wh \\n[www-left-po-trap]u -. PSPIC -R \\*[www-unique-name].eps \\$3 \\$4 +. PSPIC -R \\*[www-unique-name].eps \\$2 \\$3 . sp -\\n[ps-desht]u . nr www-right-indent \\n[ps-deswid]u -. ll -\\n[www-right-indent]u +. \" we want to have some space between text and image, +. \" so the line length must be shorter +. ll -(\\n[www-right-indent]u + \\n[www-image-gap]u) . mk www-right-ll-trap . nr www-right-ll-trap +(\\n[ps-desht]u - 1v) . wh \\n[www-right-ll-trap]u www-finish-right-ll @@ -560,11 +588,13 @@ www functionality. It should work with any macro set. . \" we must now disable a possible right image trap . if (\\n[www-right-ll-trap] > 0) \ . wh \\n[www-right-ll-trap]u -. PSPIC -L \\*[www-unique-name].eps \\$3 \\$4 +. PSPIC -L \\*[www-unique-name].eps \\$2 \\$3 . sp -\\n[ps-desht]u . nr www-left-indent \\n[ps-deswid]u -. po +\\n[www-left-indent]u -. ll -\\n[www-left-indent]u +. \" increase offset by gap +. po +(\\n[www-left-indent]u + \\n[www-image-gap]u) +. \" decrease line length by gap +. ll -(\\n[www-left-indent]u + \\n[www-image-gap]u) . mk www-left-ll-trap . nr www-left-ll-trap +(\\n[ps-desht]u - 1v) . wh \\n[www-left-ll-trap]u www-finish-left-ll -- 2.11.4.GIT