diff options
author | wlemb <wlemb> | 2000-10-18 23:02:18 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2000-10-18 23:02:18 +0000 |
commit | faf6c7cd34b4a7823f7b61cad13f70877bf4a315 (patch) | |
tree | d0310bda90e997e4b611af2de1ce48bf13e95af0 | |
parent | 41431055288f6236f3018a07e5382ff1d9e7f064 (diff) | |
download | groff-faf6c7cd34b4a7823f7b61cad13f70877bf4a315.tar.gz |
* src/roff/troff/node.cc: Fixed calculation of opminx and fixed
non-intrusive eol marker.
(troff_output_file::determine_line_limits): New function.
(troff_output_file::draw): Use it.
* src/roff/troff/env.cc (environment::add_html_tag): Use output() +
output_pending_lines() instead of output_line().
* src/preproc/eqn/main.cc (do_file): Fix graphic_end().
* src/preproc/html2/pre-html.cc (char_buffer::write_file_troff,
createImage): Small fixes.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/preproc/eqn/main.cc | 2 | ||||
-rwxr-xr-x | src/preproc/html2/pre-html.cc | 13 | ||||
-rw-r--r-- | src/roff/troff/env.cc | 5 | ||||
-rw-r--r-- | src/roff/troff/node.cc | 51 |
5 files changed, 67 insertions, 16 deletions
@@ -1,3 +1,15 @@ +2000-10-17 Gaius Mulley <gaius@glam.ac.uk> + + * src/roff/troff/node.cc: Fixed calculation of opminx and fixed + non-intrusive eol marker. + (troff_output_file::determine_line_limits): New function. + (troff_output_file::draw): Use it. + * src/roff/troff/env.cc (environment::add_html_tag): Use output() + + output_pending_lines() instead of output_line(). + * src/preproc/eqn/main.cc (do_file): Fix graphic_end(). + * src/preproc/html2/pre-html.cc (char_buffer::write_file_troff, + createImage): Small fixes. + 2000-10-14 Werner LEMBERG <wl@gnu.org> Replace tmac.safer with a real secure solution. diff --git a/src/preproc/eqn/main.cc b/src/preproc/eqn/main.cc index c0f40206..c51bcfa8 100644 --- a/src/preproc/eqn/main.cc +++ b/src/preproc/eqn/main.cc @@ -110,8 +110,8 @@ void do_file(FILE *fp, const char *filename) } restore_compatibility(); printf(".lf %d\n", current_lineno); - graphic_end(); put_string(linebuf, stdout); + graphic_end(); } else if (start_delim != '\0' && linebuf.search(start_delim) >= 0 && inline_equation(fp, linebuf, str)) diff --git a/src/preproc/html2/pre-html.cc b/src/preproc/html2/pre-html.cc index 872e7270..79943e4a 100755 --- a/src/preproc/html2/pre-html.cc +++ b/src/preproc/html2/pre-html.cc @@ -267,7 +267,7 @@ void char_buffer::write_file_troff (void) char_block *t=head; int r; - writeString(".nr html2enable 1\n"); + writeString(".nr html2enable 0\n"); writeString(".nr htmlflip 0\n"); if (t != 0) { do { @@ -383,14 +383,17 @@ static void createImage (imageItem *i) image_device, image_res, psFileName, - i->X1*image_res/POSTSCRIPTRES, + i->X1*image_res/POSTSCRIPTRES-IMAGE_BOARDER_PIXELS, i->Y1*image_res/POSTSCRIPTRES-IMAGE_BOARDER_PIXELS, - (i->X2-i->X1)*image_res/POSTSCRIPTRES+IMAGE_BOARDER_PIXELS, - (i->Y2-i->Y1)*image_res/POSTSCRIPTRES+IMAGE_BOARDER_PIXELS, + (i->X2-i->X1)*image_res/POSTSCRIPTRES+2*IMAGE_BOARDER_PIXELS, + (i->Y2-i->Y1)*image_res/POSTSCRIPTRES+2*IMAGE_BOARDER_PIXELS, TRANSPARENT, i->imageName); - fprintf(stderr, buffer); + // fprintf(stderr, buffer); system(buffer); + } else { + fprintf(stderr, "ignoring image as x1 coord is -1\n"); + fflush(stderr); } } diff --git a/src/roff/troff/env.cc b/src/roff/troff/env.cc index b5e1ed74..cd5c45c9 100644 --- a/src/roff/troff/env.cc +++ b/src/roff/troff/env.cc @@ -1946,8 +1946,9 @@ void environment::add_html_tag (const char *name) if (!illegal_input_char((unsigned char)*p)) m->append(*p); output_pending_lines(); - output_line(new special_node(*m), 0); - } + output(new special_node(*m), !fill, 0, 0, 0); + output_pending_lines(); + } } void environment::do_break() diff --git a/src/roff/troff/node.cc b/src/roff/troff/node.cc index 3c0d936e..a114a40e 100644 --- a/src/roff/troff/node.cc +++ b/src/roff/troff/node.cc @@ -752,6 +752,7 @@ public: void really_on(); void really_off(); void draw(char, hvpair *, int, font_size); + void determine_line_limits (char code, hvpair *point, int npoints); int get_hpos() { return hpos; } int get_vpos() { return vpos; } }; @@ -896,6 +897,9 @@ void troff_output_file::flush_tbuf() put(tbuf_kern); put(' '); } + + check_output_limits(output_hpos, output_vpos); + for (int i = 0; i < tbuf_len; i++) put(tbuf[i]); put('\n'); @@ -1061,6 +1065,42 @@ void troff_output_file::set_font(tfont *tf) current_tfont = tf; } +/* + * 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, int npoints) +{ + int i, x, y; + + switch (code) { + + case 'c': + case 'C': + /* only the h field is used when defining a circle */ + check_output_limits(output_hpos, output_vpos-point[0].h.to_units()/2); + check_output_limits(output_hpos+point[0].h.to_units(), output_vpos+point[0].h.to_units()/2); + break; + case 'E': + case 'e': + check_output_limits(output_hpos, output_vpos-point[1].v.to_units()/2); + check_output_limits(output_hpos+point[0].h.to_units(), output_vpos+point[1].v.to_units()/2); + break; + default: + /* + * remember this doesn't work for arc.. + */ + x=output_hpos; + y=output_vpos; + for (i=0; i<npoints; i++) { + x += point[i].h.to_units(); + y += point[i].v.to_units(); + check_output_limits(x, y); + } + } +} + void troff_output_file::draw(char code, hvpair *point, int npoints, font_size fsize) { @@ -1088,6 +1128,9 @@ void troff_output_file::draw(char code, hvpair *point, int npoints, put(' '); put(point[i].v.to_units()); } + + determine_line_limits(code, point, npoints); + for (i = 0; i < npoints; i++) output_hpos += point[i].h.to_units(); hpos = output_hpos; @@ -1324,14 +1367,6 @@ void real_output_file::print_line(hunits x, vunits y, node *n, { if (printing && output_on) really_print_line(x, y, n, before, after, width); - - if (before.to_units() < after.to_units()) { - check_output_limits(x.to_units() , y.to_units()+before.to_units()); - check_output_limits(x.to_units()+width.to_units(), y.to_units()+after.to_units()+n->size()); - } else { - check_output_limits(x.to_units() , y.to_units()+after.to_units()); - check_output_limits(x.to_units()+width.to_units(), y.to_units()+before.to_units()+n->size()); - } delete_node_list(n); } |