summaryrefslogtreecommitdiff
path: root/src/devices
Commit message (Collapse)AuthorAgeFilesLines
* * src/include/font.h (font): Use `int' for ch_index.wlemb2004-04-196-25/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/libs/libgroff/font.cpp (font::alloc_ch_index, font::compact): Updated. * src/roff/groff/pipeline.c (run_pipeline) [_WIN32]: Fix compiler warnings. * src/roff/troff/div.cpp (begin_page), src/roff/troff/env.cpp (hyphen_word): Fix compiler warnings. * src/roff/troff/input.cpp (get_char_for_escape_name): Return `char'. Update all callers. (get_delim_number, get_line_arg): Change second argument type to `unsigned char'. (macro_header::copy, token::next, do_define_string, do_define_character, substring_request, asciify_macro, unformat_macro, read_size, non_interpreted_node::interpret, while_request, main: Fix compiler warnings. (read_color_draw_node): Initialize `col'. * src/preproc/tbl/table.cpp (horizontal_span, table_entry): Make `start_col' and `end_col' of type `int'. (vertical_rule): Make `col' of type `int'. * src/preproc/grn/hdb.cpp (DBRead): Protect call to getc with check for EOF. * src/preproc/refer/label.y (uppercase_array, lowercase_array): New arrays. (format_serial): Use them to remove dependency on ASCII. * src/devices/grops/ps.cpp (ps_printer::define_encoding): Fix compiler warning. * src/devices/grops/psrm.cpp (resource_manager::supply_resource): Ditto. * src/devices/grotty/tty.cpp (tty_font::load_tty_font): Fix compiler warnings. (glyph): Change type of `hpos' to `int'. * src/devices/lbp/lbp.cpp (strsep): Removed. Unused. * src/devices/lbp/lbp.h (splinerel): Fix compiler warnings. * src/utils/tfmtodit.cpp (gf::load): Fix compiler warnings. * src/utils/pfbtops/pfbtops.c (get_text): Fix compiler warning.
* * src/devices/grolbp/lbp.h, src/preproc/grn/gprint.h,wlemb2004-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | src/preproc/grn/hgraph.cpp, src/preproc/grn/hpoint.cpp, src/preproc/html/pushback.cpp, src/preproc/html/pushback.h: Use `double' instead of `float' everywhere. * src/preproc/grn/main.cpp: Use `double' instead of `float' everywhere. (main): Add return value. * src/preproc/grn/hdb.cpp: Use `double' instead of `float' everywhere. Update all user functions. * src/include/search.h, src/include/ptable.h, src/include/printer.h, src/preproc/eqn/box.h, src/preproc/pic/object.h, src/preproc/refer/refer.h, src/preproc/tbl/table.h, src/preproc/tbl/table.cpp, src/roff/troff/env.h, src/roff/troff/div.h, src/roff/troff/token.h, src/roff/troff/node.h, src/roff/troff/input.cpp, src/roff/troff/request.h, src/roff/troff/node.cpp: Don't mix `struct' and `class' in forward declarations. * src/utils/indxbib/signal.c: Include stdlib.h.
* * src/libs/libgroff/glyphuni.cpp (glyph_to_unicode_list),wlemb2004-04-087-172/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/libs/libgroff/uniglyph.cpp (unicode_to_glyph_list), src/libs/libgroff/uniuni.cpp (unicode_decompose_list), src/preproc/eqn/box.cpp (param_table), src/preproc/grn/hgraph.cpp (polyfill), src/preproc/grn/main.cpp (polyfill), src/preproc/refer/command.cpp (command_table), src/utils/tfmtodit.cpp (lig_table): Don't use anonymous types (which gcc 3.5 doesn't like). Removing many compiler warnings. groff should now compile with a C++ compiler used for C files also. [Simple variable renamings to avoid shadowing aren't logged in detail.] * src/devices/grodvi/dvi.cpp: Some local variable renamings. (draw_dvi_printer::draw) ['c']: Enclose in block. * src/devices/grohtml/post-html.cpp: Some local variable renamings. (page::add_line): Fix typos. * src/devices/grohtml/html-text.cpp: Some local variable renamings. * src/devices/grolbp/lbp.cpp: Don't define _GNU_SOURCE. Some local variable renamings. * src/devices/grolbp/lbp.h: Some local variable renamings. * src/devices/grolj4/lj4.cpp, src/devices/grotty/tty.cpp: Some local variable renamings. * src/libs/libbib/index.cpp (index_search_item_iterator::get_tag): Remove redundant local variable declaration. * src/libs/libbib/map.c (mapread, unmap): Don't use K&R style. Don't use `caddr_t' but `void *'. Enclose functions with `extern "C"' for C++. * src/libs/libdriver/input.cpp (remember_filename, remember_source_filename): Use cast for string constant. * src/libs/libgroff/font.cpp, src/libs/libgroff/fontfile.cpp, src/libs/libgroff/nametoindex.cpp, src/libs/libgroff/paper.cpp, src/libs/libgroff/geometry.cpp: Some local variable renamings. * src/libs/libgroff/iftoa.c, src/libs/libgroff/itoa.c: Don't use K&R style. Enclose functions with `extern "C"' for C++. * src/libs/libgroff/quotearg.c (TRUE,FALSE): Define as macros. (needs_quoting): Return `int'. (quote_arg): Add proper casts to malloc and realloc. * src/libs/libgroff/spawnvp.c: Compile code only for MS-DOS and various MS Windows environments. (spawnvp_wrapper): Add proper cast to malloc. * src/preproc/eqn/box.h: Remove redundant declarations of `make_script_box', `make_mark_box' and `make_lineup_box'. * src/preproc/eqn/eqn.y: Remove redundant declaration of `strsave'. * src/preproc/eqn/script.cpp, src/preproc/eqn/pile.cpp: Some local variable renamings. * src/preproc/grn/hpoint.cpp: Some local variable renamings. * src/preproc/grn/hgraph.cpp: Some local variable renamings. (dx, dy): Renamed functions to... (deltax, deltay): This. * src/preproc/grn/main.cpp: Some local variable renamings. (deffont): Add `const'. (initpic, conv): Use cast for string constant. * src/preproc/html/pre-html.cpp: Some local variable renamings. (makeFileName, alterDeviceTo, addZ): Use cast for string constant. (char_buffer::run_output_filter): Second argument is unused. * src/preproc/html/pushback.cpp: Some local variable renamings. * src/preproc/pic/pic.y: Remove redundant declaration of `do_copy'. * src/preproc/pic/object.cpp: Some local variable renamings. * src/preproc/refer/label.y (lookup_label): Remove redundant declaration of local variable. * src/preproc/soelim.cpp: Remove redundant declaration of `interpret_lf_args'. * src/preproc/tbl/main.cpp: Some local variable renamings. * src/roff/groff/groff.cpp (main): Use cast for string constant. * src/roff/groff/pipeline.c: Enclose declarations of `error', `c_fatal', and `i_to_a' with `extern "C"' for C++. Don't use C++-style comments. * src/roff/troff/env.h: Remove redundant declaration of `title'. * src/roff/troff/node.h, src/roff/troff/env.cpp, src/roff/troff/div.cpp, src/roff/troff/node.cpp: Some local variable renamings. * src/roff/troff/div.h: Remove redundant declaration of `end_diversions'. * src/roff/troff/troff.h: Remove redundant declaration of `cleanup_and_exit' * src/roff/troff/input.cpp: Remove redundant declaration of `handle_first_page_transition' and `process_input_stack'. * src/utils/hpftodit.cpp: Some local variable renamings. * src/utils/indxbib/signal.c: Enclose functions with `extern "C"' for C++. Don't define RETSIGTYPE. * src/utils/indxbib/indxbib.cpp: Some local variable renamings. * src/utils/pfbtops/pfbtops.cpp: Don't use K&R style. (error): Use `const' in argument. (main): Remove redundant declaration of `optind'. Move declaration of `Version_string' to top-level. * PROBLEMS: Document difficulties compiling signal.c if a C++ compiler is used for C. * Makefile.sub (DISTCLEANFILES): Add `test-groff'.
* * src/devices/grolj4/lj4.cpp (main): Fix argument of getopt_long.wlemb2004-03-011-8/+7
| | | | | | | | | | | s/operand/argument/ in error message. * src/roff/groff/groff.cpp (main): Don't allow option -o if -Thtml is in use. * tmac/s.tmac (XE): Fix error message.
* * src/devices/grolbp/lbp.h (vmdvarc): Fix formatting string.wlemb2004-02-181-2/+2
|
* * font/devlj4/generate/Makefile (SYMBOL): Use 9nb28703.tfm.wlemb2004-01-181-13/+16
| | | | | | | * font/devlj4/generate/wingdings.map, font/devlj4/generate/symbol.map: Include unnamed glyphs. Use groff glyph names where possible. * src/devices/lj4_font.man: Minor updates.
* * tmac/www.tmac (DC): Handle TTY devices.wlemb2004-01-153-1/+167
| | | | | | | | | | | | | | | | | | | | | | | | * doc/webpage.ms: Document viewCVS from ffii.org. * NEWS, README: Updated. * src/roff/groff/groff.man: Mention lj4_font man page. * font/devlj4/generate/Makefile (SYMBOLMAP, WINGDINGSMAP): New variables. (FONTS): Add SYMBOL and WINGDINGS. (SYMBOL, WINGDINGS): New targets. * src/devices/grolj4/lj4_font.man: New man page. * src/devices/grolj4/Makefile.sub (MAN5): New variable. * src/devices/grolj4.man: Mention lj4_font man page. * src/utils/hpftodit/hpftodit.cpp (read_map): Handle line comments. * src/utils/hpftodit/hpftodit.man: Document it. (CW): New macro. Remove details about fonts (which are now in lj4_font.man). * font/devlj4/generate/symbol.map, font/devlj4/generate/wingdings.map: New files.
* * src/roff/troff/nroff.cpp (space_node::get_breakpoints,wlemb2004-01-051-1/+1
| | | | | | space_node::nbreaks): Protect against zero `next' field. Update copyright years.
* * src/devices/grops/ps.cc (ps_output::put_float): Fix line lengthwlemb2003-12-181-3/+2
| | | | computation.
* * src/devices/grops/ps.cc (ps_output::put_float): Revert changewlemb2003-12-181-2/+8
| | | | | from 2001-10-04. Remove trailing zeros.
* LynxOS 4.0.0 has snprintf (without declaration) but no vsnprintf.wlemb2003-11-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Check for vsnprintf. * src/include/lib.h: Handle `NEED_DECLARATION_VSNPRINTF' and `HAVE_VSNPRINTF'. * src/include/config.hin: Regenerated. * aclocal.m4: Updated syntax to autoconf 2.59. (GROFF_HTML_PROGRAMS): Use AC_FOREACH. Don't check for gsos2. (GROFF_SRCDIR, GROFF_BUILDDIR): Removed. autoconf 2.59 provides working abs_top_srcdir and abs_top_builddir. * configure.ac: Updated syntax to autoconf 2.59. Don't call GROFF_SRCDIR and GROFF_BUILDDIR. Replace call to AC_DECL_SYS_SIGLIST with call to AC_CHECK_DECLS. * configure: Regenerated. * Makefile.in, doc/Makefile.in: s/@top_srcdir@/@abs_top_srcdir@/, s/@groff_top_builddir@/@abs_top_builddir@/. * src/roff/groff/pipeline.c (xstrsignal): s/SYS_SIGLIST_DECLARED/HAVE_DECL_SYS_SIGLIST/. * src/devices/grodvi/dvi.cpp (draw_dvi_printer::draw) ['a']: Always make start angle smaller than end angle to circumvent a bug in tpic handling of some versions of dvipdfm (and dvipdfmx).
* * src/devices/grops/grops.man: Improve section on creating EPS.wlemb2003-10-311-9/+4
| | | | | * contrib/pic2graph/pic2graph.sh: Fix typo (-P-letter -> -P-pletter).
* * src/roff/groff/groff.cpp (help), src/devices/grops/ps.cpp (usage),wlemb2003-10-138-7/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/roff/troff/input.cc (usage): Updated. * NEWS, doc/groff.texinfo: Updated. * src/libs/libgroff/searchpath.cpp (search_path::open_file_cautious): New function which also handles `-' as stdin and stdout depending on the access mode. * src/include/searchpath.h (search_path): Updated. * src/devices/grops/ps.cpp (main): Handle new `-I' switch. * src/devices/grops/ps.h: Include `searchpath.h'. * src/devices/grops/psrm.cpp (resource_manager::supply_resource): Open resource file with `include_search_path.open_file_cautious'. * src/devices/grops/grops.man: Document new `-I' switch. * src/devices/grodvi/dvi.cpp (main), src/devices/grolbp/lbp.cpp (main), src/devices/grolj4/lj4.cpp (main), src/devices/grotty/tty.cpp (main): Ignore new `-I' switch. * src/preproc/soelim/soelim.cpp (include_list_length, include_list): Replaced with... (include_search_path): New global variable. (include_path_append): Removed. (main): Use `include_search_path.command_line_dir' to handle `-I'. (do_file): Simplify, using new `include_search_path.open_file_cautious'. * src/roff/groff/groff.cpp (print_commands): Accept file handle as parameter. (main): Pass arguments to `-I' to both troff and devices. Improve handling of `-V'. * src/roff/groff/groff.man: Document changes to -I and -V. * src/roff/troff/input.cpp (include_search_path): New global variable. (next_file, source, ps_bbox_request, transparent_file, process_input_file): Use new `include_search_path.open_file_cautious'. (main) Handle `-I' switch. * src/roff/troff/node.cpp (troff_output_file::really_copy_file): Use new `include_search_path.open_file_cautious'. * src/roff/troff/node.h: New extern symbol `include_search_path'. * src/roff/troff/troff.man: Document new `-I' switch.
* * NEWS, src/devices/grops/grops.man: -b16 is necessary to producewlemb2003-08-051-0/+34
| | | | EPS (using eps2eps or similar programs to compute the bounding box).
* Add option -G to .MPIMG to insert a gap between text and the image.wlemb2003-07-231-3/+2
| | | | | | | | | | | | | | | * 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.
* * *.man: Switch to non-compatibility mode temporarily if GNUwlemb2003-07-183-1/+14
| | | | | | syntax extensions are used in the particular man page. * PROBLEMS: Add solutions for SGR problems.
* Don't ignore grotty's command line options if \X'tty: sgr ...' iswlemb2003-07-181-21/+38
| | | | | | | | | | | | used to change the drawing scheme. * src/devives/grotty/tty.cpp (bold_flag_option, underline_flag_option, italic_flag_option, reverse_flag_option, bold_underline_mode_option): New global variables. (update_options): New function. (tty_printer::special): Call update_options. (main): Don't set xxx_flag but xxx_flag_option, then call update_options.
* Make grotty emit proper Unicode box drawing character for -Tutf8.wlemb2003-07-151-6/+58
| | | | | | | | | | | | * src/devices/grotty/tty.cpp (START_LINE, END_LINE): New enum values. (hline_char, vline_char): New global variables. (tty_printer::tty_printer): Initialize them. (tty_printer::draw): Emit START_LINE and END_LINE flags for both horizontal and vertical lines. (crossings): New global array. (tty_printer::end_page): Use it to determine the proper crossing character for -Tutf8.
* Make grotty work on platforms which have unsigned char as thewlemb2003-07-073-58/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default for char. Based on a patch by Thomas Klausner <wiz@netbsd.org>. * src/devices/grotty/tty.cpp (schar): New typedef. Updated calls to declare_ptable and implement_ptable. (glyph): Use schar for back_color_idx and fore_color_idx. (tty_printer): Use schar for curr_fore_idx and curr_back_idx. (tty_printer::tty_color, tty_printer::tty_printer, tty_printer::color_to_idx, tty_printer::put_color): Updated. * src/roff/nroff/nroff.sh: Add option -d for completeness. * src/roff/nroff/nroff.man: Updated. * NEWS, tmac/groff_www.man: Updated. * doc/Makefile.sub: Updated. Implement support for multiple HTML output files. * src/preproc/html/pre-html.cpp (scanArguments): Dummy handling for -j command line option. * src/devices/grohtml/post-html.cpp (job_name, multiple_files): New global variables. (file): New fields `new_output_file', `require_links', `output_file_name'. (file::file): Updated. (files::set_file_name, files::set_links_required, files::are_links_required, files::is_new_output_file, files::file_name, files::next_file_name): New functions. (header_desc): New fields `no_of_level_one_headings', `header_filename'. (header_desc::header_desc): Updated. (header_desc::write_headings): Handle multiple files. (html_printer::write_header): Save file name in which header occurs. (html_printer::determine_header_level): Possibly split files on level one headings. (html_printer::do_links, html_printer::troff_tag): Updated. (html_printer::insert_split_file, html_printer::do_job_name, html_printer::emit_link, html_printer::write_navigation, html_printer::do_file_components): New functions. (html_printer::~html_printer): Handle multiple files. (main): Handle command line option `-j'. * src/devices/grohtml/grohtml.man: Updated. * doc/Makefile.sub (pic.html), doc/Makefile.in (pic.html): New rule which splits file. * tmac/www.tmac (JOBNAME): New macro. * tmac/s.tmac (SH-NO-TAG): New macro. (@SH): Call SH-NO-TAG. (@NH): Updated.
* * VERSION: Set to 1.19.wlemb2003-04-291-1/+4
| | | | | | | | | | * REVISION: Set to 0. * doc/groff.texinfo, doc/webpage.ms, NEWS: Updated. * src/devices/grohtml/post-html.cpp (html_printer::~html_printer): Define charset as `US-ASCII' in html output. * tmac/www.tmac (ULE): Add missing scaling indicator.
* * src/devices/grohtml/post-html.cpp (html_printer::~html_printer):wlemb2003-04-251-5/+3
| | | | | | | | | Use a loose DTD. * src/preproc/pic/pic.man, doc/pic.ms: Explain how to get a vbox with positive height and zero depth if in TeX mode. * NEWS: Document glyph name changes for grodvi and grolj4.
* * src/devices/grohtml/post-html.cpp (text_glob::text_glob):wlemb2003-04-166-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `const' to second argument. (html_printer::add_table_end): Add `const' to argument. * src/devices/grohtml/html-text.cpp (html_text::issue_tag): Add `const' to arguments. * src/devices/grohtml/html-text.h: Updated. * src/devices/grolbp/charset.h (symset): Use `unsigned char'. * src/devices/grolbp/lbp.h (lbpputc): Use `unsigned char' for argument. * src/devices/grotty/tty.cpp (tty_printer::make_rgb_string): Use cast for integer constant. * src/preproc/html/pre-html.cpp (image_device): Use `const'. (writeNbytes): Add `const' to first argument. (writeString): Add `const' to argument. (char_buffer::can_see): Add `const' to third argument. * src/preproc/html/pushback.cpp (pushBackBuffer::isString): Add `const' to argument. * src/preproc/html/pushback.h: Updated. * src/preproc/soelim/soelim.cpp (include_list): Add `const'. (include_path_append): Add `const' to argument. (do_file): Updated. * src/roff/troff/uniglyph.cpp (unicode_to_glyph_list): Use `const' for `value'. (unicode_to_glyph_init::unicode_to_glyph_init): Updated. * src/roff/troff/uniuni.cpp (unicode_decompose_list): Use `const' for `value'. (unicode_decompose_init::unicode_decompose_init): Updated. * src/roff/troff/glyphuni.cpp (glyph_to_unicode_list): Use `const' for `value'. (glyph_to_unicode_init::glyph_to_unicode_init): Updated. * src/roff/troff/input.cc (process_startup_file): Add `const' to argument.
* Renamed all `*.cc' files to `*.cpp'.wlemb2003-04-1518-24/+24
| | | | Updated all configuration files, makefiles, and documentation.
* Fix handling of &nbsp; in grohtml. To do this, troff emits `N'wlemb2003-04-041-9/+51
| | | | | | | | | | | | | | with a negative value, representing the width of the unbreakable space (only for -Thtml). grohtml then converts this back to &nbsp; and uses the value of N as its width. * src/roff/troff/node.cc (space_char_hmotion_node::tprint, unbreakable_space_node::tprint): Emit `N-<width>'. * src/include/printer.h (printer::set_numbered_char): Make it virtual. Make members `font_table' and `nfonts' protected instead of private. * src/devices/grohtml/post-html.cc (html_printer::set_numbered_char): New member function.
* * doc/groff.texinfo: Change dir category to `Typesetting'.wlemb2003-04-041-4/+4
| | | | | | * src/libs/libdriver/printer.cc, src/devices/grotty/tty.cc (*printer::change_color, *printer::change_fill_color): Add missing `const'.
* Make groff independent from locale's numeric settings.wlemb2003-04-033-0/+3
| | | | | | | | | | | | | | | | | * configure.ac: Check for `setlocale'. * configure, src/include/config.hin: Regenerated. * src/include/lib.h: Handle HAVE_SETLOCALE. * src/devices/grodvi/dvi.cc (main), src/devices/grolj4/lj4.cc (main), src/devices/grops/ps.cc (main), src/preproc/grn/main.cc (main), src/preproc/pic/main.cc (main): Call `setlocale'. * doc/groff.texinfo (Man font macros): Mention that there is no space between arguments of .BI and friends. * man/roff.man: Small fixes.
* * src/devices/grohtml/html-table.cc (html_table::emit_col,wlemb2003-04-032-7/+18
| | | | | | | | html_table::is_gap): Compute table widths after converting border positions to avoid rounding errors. * src/devices/grohtml/html-text.cc (html_text::do_space): Handle `space_emitted' properly.
* * src/devices/grohtml/html-table.cc: Fix column width calculation.wlemb2003-04-011-7/+7
| | | | | | | | | | | | | | | | | | (html_table::set_linelength): Don't add 1. (html_table::add_indent): Don't subtract 1. * tmac/html.tmac: Set default page offset to zero. Make groff emit `&nbsp;' for `\ ' and `\~' if `-Thtml' is used. * src/roff/troff/node.cc (space_char_hmotion_node::tprint, unbreakable_space_node::tprint): New functions. (troff_output_file): Make space_char_hmotion_mode::tprint and unbreakable_space_node::tprint to friends. * src/roff/troff/node.h: Updated. * font/devhtml/R.proto: Add `&nbsp' at position 0xA0 (as defined in the HTML standard).
* * src/roff/troff/env.cc (point_size): Fix emission of html tag.wlemb2003-03-313-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, the following code .di xxx .ps 10 a .br .di x\*[xxx] produces `x a' instead of `xa'. This is a temporary fix, disabling font changes in diversions for -Thtml. * tmac/an-old.tmac (TH, SH): Use `HTML-TAG-NS' instead of `HTML-TAG'. (an-do-tag-html): Merge with ... (an-do-tag): This macro. Change code slightly to circumvent grohtml bug. * tmac/troffrc-end: Define dummy for HTML-TAG-NS. * src/devices/grohtml/html-table.cc (html_table::emit_col, html_table::is_gap): Round `width' properly. * tmac/html.tmac: Provide some default layout parameters for grohtml. * font/devhtml/DESC.proto: Don't use discrete values for `sizes' command. src/devices/grops/ps.cc (ps_printer::do_import): Fix error message. * tmac/an-old.tmac (BT): Don't call .tl if register `ps4html' is defined.
* * src/roff/groff/groff.man: Mention groff_trace man page.wlemb2003-03-191-4/+4
|
* * src/devices/grops/ps.cc (ps_printer::media_set,wlemb2003-03-151-12/+20
| | | | ps_printer::~ps_printer): Handle zero paper width and length.
* Add options -p and -l to grodvi.wlemb2003-03-144-142/+162
| | | | | | | | | | | | | | | | | | | | * src/devices/grodvi/dvi.cc: Include paper.h. (landscape_flag, user_paper_length, user_paper_width): New global variables. (dvi_printer::begin_page): Emit `papersize' special. Set color after initialization of `cur_h' and `cur_v'. (main): Add options `-l' and `-p'. * font/devdvi/Makefile.sub (DESC): Set `papersize'. * src/devices/grodvi/grodvi.man, NEWS: Updated. * src/devices/grops/psrm.cc (valid_input_table): Fixed. * src/devices/grops/grops.man: Move documentation of .PSPIC to... * man/groff_tmac.man: This man page. * man/groff_font.man: Declare `paperwidth' and `paperlength' as deprecated. * tmac/X.tmac: Don't load pspic.tmac.
* Make variable `pr' local to libdriver/input.cc. Based on a patchwlemb2003-03-126-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by Bernd Warken <bwarken@mayn.de>. * src/include/driver.h (pr): Removed. * src/libs/libdriver/input.cc (pr): New global variable. (do_file): Deallocate `pr'. * src/libs/libdriver/printer.cc (pr): Removed. * src/devices/grodvi/dvi.cc (main), src/devices/grohtml/post-html.cc (main), src/devices/grolbp/lbp.cc (main), src/devices/grolj4/lj4.cc (main), src/devices/grops/ps.cc (main), src/devices/grotty/tty.cc (main): Don't delete `pr'. * tmac/a4.tmac, tmac/composite.tmac: Use `.do'. * tmac/papersize.tmac: New file. * tmac/troffrc: Include `papersize.tmac'. * tmac/Makefile.sub (NORMALFILES): Add `papersize.tmac'. * tmac/an-old.tmac: Set LT to LL by default. * NEWS, MANIFEST, tmac/groff_man.man, man/groff_tmac.man, doc/groff.texinfo: Updated. * src/libs/libgroff/paper.cc (add_iso_paper): Fix very embarassing bug which caused all odd iso papers to have wrong dimensions. * src/devices/grops/ps.cc (user_paper_width): New global variable. (main) <'p'>: Set `user_paper_width' also. (ps_printer::media_width, ps_printer::media_height): Use values given with option `-p'.
* * src/include/nonposix.h: Provide default for SET_BINARY.wlemb2003-03-114-8/+0
| | | | | | | | | * src/devices/grodvi/dvi.cc, src/devices/grolbp/lbp.cc, src/devices/grolj4/lj4.cc, src/devices/grops/ps.cc: Call SET_BINARY unconditionally. * src/utils/pfbtops/pfbtops.c: Call SET_BINARY unconditionally. (main): Treat \r\n as \n.
* * tmac/an-old.tmac: Use register `HY' to control hyphenation.wlemb2003-03-104-133/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS, tmac/groff_man.man, doc/groff.texinfo: Document it. Added support to access more than 256 glyphs in Type 1 fonts. * src/devices/grops/ps.cc (subencoding): New structure. (style): Add `sub' field. Updated all users. (ps_printer): Add `subencodings' and `next_subencoding_index' fields. Add `set_subencoding', `get_subfont' and `encode_subfont' member functions. Updated all users. (ps_printer::set_char): Use `set_subencoding'. (make_subencoding_name): New function. (ps_printer::set_style): Handle case where `sty.sub' is not zero. (ps_printer::~ps_printer): Emit subencoding definitions. * src/devices/grops/psrm.cc (valid_input_table): New array to properly support EBCDIC. (white_space): Add `\f'. (ps_get_line): Change first argument to be of type `string &'. Updated all callers. This allows to get lines of arbitrary length. Use `valid_input_table'. Remove warning about non-conforming PS line length. This seems not to be of great importance -- for example, dvips don't emit a warning either. (PS_LINE_MAX): Removed. (matches_comment): Change first argument to be of type `string &'. * src/devices/grops/grops.man, src/devices/grops/TODO: Updated. * src/utils/afmtodit/afmtodit.pl (%unicode_decomposed, %AGL_to_unicode, %default_ligatures): New hash tables. Read all map entries. Add unencoded characters. Check for default ligatures if there are no `L' entries. Print all kern entries. Print all characters in charset. * src/utils/afmtodit/afmtodit.man: Updated. * font/devps/*: Regerated all fonts. * tmac/latin[129].tmac, tmac/cp1047.tmac: Don't test for existence of characters, just use `.trin'. Otherwise the mapping is depending on the font encoding. * tmac/ps.tmac: Add `fi' and `fl'. Improve `Fi' and `Fl'. * tmac/X.tmac, tmac/lbp.tmac, tmac/tty.tmac: Improve `Fi' and `Fl'. * tmac/Xps.tmac: Fix `em'. * NEWS: Updated.
* * src/libs/libgroff/font.cc (font::load): Fix error message forwlemb2003-03-031-7/+20
| | | | | | | | | | bad character type. * src/devices/grops/grops.man: Improve documentation of the -b flag. * tmac/tty.tmac: Load latin1.tmac for all TTY devices except `ascii' and `cp1047'.
* * doc/texinfo.tex: New version 2003-02-11.06.wlemb2003-02-273-10/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tmac/doc-common (Dt): Don't emit warning for unknown section. * tmac/groff_mdoc.man: Fix description of `Dt'. * font/devps/prologue.ps: Fix for included Postscript that does a setpagedevice -- which is now safely ignored. * NEWS: Updated. * src/devices/grops/ps.cc: Now sets the page size in the generated document. This is done in two ways: Via a %%-comment for gv and the like, and via a PageSize and setpagedevice for programs that understands Postscript proper, like ps2pdf. * src/devices/grops/ps.h: New broken-flag to avoid page size definition, if required. * src/devices/grops/grops.man: New broken-flag 16 mentioned. * doc/Makefile.in: Added -nosetpage flag (via @pnmtops_nosetpage@). Not really necessary due to the fix in prologue.ps, but cleaner: Such information does not belong in an .eps file. * doc/Makefile.sub: See doc/Makefile.in. * aclocal.m4 (GROFF_PNMTOPS_NOSETPAGE): Use P2 format for testing instead of P1 since the latter is broken in some versions of netpbm. * configure: Updated.
* Make man pages more customizable.wlemb2003-02-261-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tmac/an-old.tmac (FT): New register holding footer distance from bottom. (HF): New string holding the default heading font. (TH): Handle registers `IN' and `SN' set on the command line. Use `FT'. (PT, BT): New strings to customize header and footer lines. (an-header, an-footer): Use them. (SH, SS): Use `HF'. * tmac/groff_man.man: Document changes. * doc/groff.texinfo: Document man changes. Document Ultrix extensions of man. * src/roff/troff/input.cc (do_width, do_if_request): Reset `have_input' after changing back to old environment. * src/devices/grolbp/lbp.cc (lbp_printer::set_line_thickness): Move function up to be defined before first call. This is necessary to avoid a compilation problem with Sun's WorkShop 6 C++ compiler. * src/utils/afmtodit/afmtodit.pl: Make script search for files in the default font directory also. Based on a patch from James J. Ramsey <jjramsey_6x9eq42@yahoo.com>. * src/utils/afmtodit/Makefile.sub (afmtodit): Handle @FONTDIR@. * src/utils/afmtodit/afmtodit.man: Document it. * NEWS: Updated. * tmac/groff_man.man, doc/groff.texinfo: Many minor fixes.
* * aclocal.m4 (GROFF_HTML_PROGRAMS): Add test for pnmtops.wlemb2003-02-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | (GROFF_PNMTOPS_NOSETPAGE): New macro. * configure.ac: Use it. * configure: Regenerated. * Makefile.in: Updated. * tmac/Makefile.sub (NORMALFILES): Remove www.tmac. (CLEANADD): Add www.tmac-sed. (pnmtops_nosetpage): Define default. (install_data): Handle www.tmac-sed and substitute @PNMTOPS_NOSETPAGE@. (stamp-sed): Add www.tmac. * tmac/www.tmac: Rewritten, based on a patch by Bernd Warken. It now breaks URLs at suitable places. (www:substring_ok): New register set by... (www:@test_substring): New macro. (www:error): New alias to www-error. (www:lenstr, www:splitstr, www:url_breaks, www:url_breaks_splitted): New macros. (URL): Use www:url_breaks. (PIMG, MPIMG): Use @PNMTOPS_NOSETPAGE@. (CDS, CDE): New macros. * src/devices/grops/ps.cc (ps_printer::define_encoding): Avoid buffer overflow.
* Contrary to the PCL5 Developer's Guide, the ascenders in TFM fileswlemb2003-02-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can be negative also. * src/utils/hpftodit/hpftodit.cc (char_info): `ascent' must be `int16'. (read_char_table): Avoid negative ascenders. (output_charset): Add cast. * font/devlj4/*: Regenerated. Replace unnamed glyphs for DVI fonts with `uXXXX' glyph names where possible. * font/devdvi/generate/{tc,texttt,ec,texmi,texsy,textex}.map: Do it. * font/devdvi/generate/textex.map: Map glyph 23 to `u21C6' instead of `<>'. * font/devdvi/*: Regenerated. Map `la' and `ra' to U+27E8 and U+27E9. These two characters have normal width, while the previously used characters (U+2329 and U+232A) are classified as wide due to canonical equivalence with the CJK punctuation characters U+3008 and U+3009. * font/devutf8/R.proto: Updated. * src/roff/troff/uniglyph.cc, src/roff/troff/glyphuni.cc: Ditto. * man/groff_char.man: Simplify handling of table traps by introducing `start block' and `end block' macros. (Ns, Ne, 2s, 2e, Ds, De): New macros. (DL): Make it work with Unix troff also. Fix code values of `la' and `ra'. * tmac/dvi.tmac: Define `<>' for CW and CWI.
* Valgrind fixes.wlemb2003-02-223-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/devices/grohtml/html-table.cc (html_table::~html_table): Deallocate `columns' list. * src/devices/grohtml/post-html.cc (char_block::~char_block): New destructor. (text_glob::text_glob_html, text_glob::text_glob_special, text_glob::text_glob_line, text_glob::text_glob_auto_image, text_glob::text_glob_tag): Avoid memory leaks. (text_glob::remember_table): Free memory before reassigning. Add glyph `+e', greek lunate epsilon symbol, and `-h' (with the alias `hbar'), the Planck constant over two pi. * font/devdvi/generate/texmi.map: Use `*e' for position 15 and `+e' for position 34. * font/devdvi/generate/texsy.map: Replace `DI' and `HE' with `u2662' and `u2661'. * font/devdvi/{MI,S}: Regenerated. * font/devhtml/R.proto, font/devutf8/R.proto: Add `+e', `-h', `hbar'. * font/devlbp/*: Add `hbar' alias. * font/devlj4/generate/special.map: Ditto. * font/devlj4/S: Regenerated. * font/devps/generate/symbolchars: Add `+e'. * font/devps/generate/textmap: Fix PS name for `-h'. Add `hbar' alias. * font/devps/symbolmap: Regenerated. * src/devices/grops/ps.cc (transform_fill): Removed since unused. * src/roff/troff/glyphuni.cc (glyph_to_unicode_list): Add `+e', `-h', `hbar'. * src/roff/troff/uniglyph.cc (unicode_to_glyph_list): Add `+e', `-h'. * tmac/X.tmac, tmac/ps.tmac: Provide definitions for `-h' and `hbar'. * tmac/tty-char.tmac: Add `+e'.
* Another round trying to really fix problems with `have_input'.wlemb2003-02-171-7/+9
| | | | | | | | | | | * src/roff/troff/input.cc (input_stack::get): Handle `have_input'. (token::next) <'\n'>, <\'\n'>: Don't handle `have_input'. * src/devices/grotty/tty.cc (tty_printer::put_color): Fix color handling if both foreground and background colors are default. * doc/groff.texinfo (Debugging): Document .lf differences to AT&T troff.
* * src/devices/grotty/tty.cc (tty_printer::make_rgb_string): Avoidwlemb2003-02-161-2/+9
| | | | | | | | | | | | | | | | | | | null-bytes in created string. * src/roff/troff/input.cc (lookup_color, interpolate_macro, alias_macro, lookup_request): Improve warning messages. * src/roff/troff/node.cc (suppress_node::tprint): Use `strsave', not `strdup'. Free `last_image_filename'. * src/preproc/html/pre-html.cc (char_block::char_block): Initialize `buffer'. (imageList::createPage, imageList::createImage): Use `free', not `a_delete'. (imageItem::~imageItem): Free `imageName'. (addRegDef): Use `strsave', not `strdup'. (get_resolution): Free `pathp'.
* * src/devices/grotty/tty.cc (tty_printer::tty_printer): Fix pointerwlemb2003-02-151-9/+9
| | | | to `dummy'.
* Add memory management for colors to deallocate unnamed colorswlemb2003-02-158-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | properly. * src/include/color.h (color): New members `free_list' and `next'. New member functions `new' and `delete'. Add deconstructor. * src/libs/libgroff/color.cc: Implement it. * src/libs/libgroff/font.cc (font::add_kern): Use integer cast for array size of new operator. * src/libs/libdriver/input.cc (IntArray::operator[]): Remove redundant comparison. * src/roff/troff/input.cc (word_space_node::reread, hmotion_node::reread): Avoid warning about unused parameter. (reset_output_registers): Remove redundant parameter. (define_color): Undo change 2003-02-12. * src/roff/troff/reg.h: Updated. * src/roff/troff/node.cc (troff_output_file::really_print_line, output_file::put_filename, real_output_file::really_put_filename, ascii_output_file::really_print_line, break_char_node::get_hyphen_list): Avoid warning about unused parameter. (suppress_node::tprint): Updated. * configure.ac: Check declaration for rand() and srand(). * configure: Regenerated. * src/preproc/pic/pic.h: Declare fmod(), rand(), and srand() conditionally. * src/preproc/pic/pic.y: Remove declaration of fmod(), rand(), and srand(). * src/preproc/eqn/delim.cc (delim_table): Add missing initializers to avoid compiler warnings. * src/preproc/grn/hgraph.cc (HGPrintElt): Second parameter is unused. * src/devices/grops/ps.cc (ps_printer::set_char): Last parameter is unused. * src/devices/grops/psrm.cc (skip_possible_newline): Remove first (unused) parameter. Updated all callers. * src/devices/grotty/tty.cc (tty_printer::set_char): Last parameter is unused. * src/devices/grodvi/dvi.cc (dvi_printer::set_char): Ditto. * src/devices/grolj4/lj4.cc (lj4_printer::set_char): Ditto. * src/devices/grohtml/post-html.cc (html_printer::emit_line): Parameter is unused. (html_printer::add_table_end): Define parameter conditionally. * src/devices/grohtml/output.cc (simple_output::special): Parameter is unused. * src/devices/grolbp/lbp.cc: Define _GNU_SOURCE conditionally. (lbp_printer::set_char): Last parameter is unused. * src/utils/indxbib/indxbib.cc (main): Remove redundant comparison.
* Improve error messages for `x F' (and `F') commands.wlemb2003-02-112-43/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/include/error.h: Add declaration for `current_source_filename'. * src/libs/libgroff/filename.cc: Add `current_source_filename'. * src/libs/libgroff/error.cc (do_error_with_file_and_line): Add parameter for source file string. Updated all callers. * src/libs/libdriver/input.cc: Add `current_source_filename'. (remember_source_filename): New function. (parse_x_command <'F'>, do_file <'F'>): Use it. Make grotty not emit warnings about unknown colors more than necessary. * src/devices/grotty/tty.cc: Include `ptable.h'. (TTY_MAX_COLORS): Removed. (DEFAULT_COLOR_IDX): Defined to -1. (glyph): Change `back_color_idx' and `fore_color_idx' to `char'. (tty_printer): Change `curr_back_idx' and `curr_fore_idx' to `char'. Change `tty_colors' to be a ptable. First arg of `put_color' is now `char'. New functions `make_rgb_string' and `tty_color'. (tty_printer::tty_printer): Use `tty_color'. (tty_printer::color_to_idx): Return value is now `char'. Use `tty_color'. * src/include/color.h (color): Add `print_color' member function. * src/libs/libgroff/color.cc (color::print_color): Implement it. Valgrind fixes. * src/devices/grops/ps.cc (ps_printer::define_encoding): Close encoding file. * src/include/ptable.h (PTABLE::~PTABLE, PTABLE::define): Always assume that value has been allocated with `new[]', thus use `a_delete' for deallocation. * src/libs/libdriver/input.cc (get_integer_arg, get_possibly_int_args, parse_x_command, do_file): Use `a_delete' where appropriate. * src/libs/libgroff/new.cc (delete) [!COOKIE_BUG]: Define. * src/libs/libgroff/nametoindex.cc (character_indexer::named_char_index): Use `new <type>[1]'. * src/preproc/eqn/lex.cc (init_table, do_definition): Use `new <type>[1]'. * src/preproc/eqn/text.cc (set_special_char_type): Ditto. (split_text): Use `a_delete'. * src/preproc/pic/pic.y (define_label, define_variable): Use `new <type>[1]'. * src/roff/troff/env.cc (environment::choose_breakpoint): Avoid harmless memory leak. (hyphen_trie::read_patterns_file): Initialize `buf'. * src/roff/troff/node.cc (troff_output_file::troff_output_file): Initialize `current_fill_color'and `current_glyph_color'. * src/roff/troff/glyphuni.cc (glyph_to_unicode_init::glyph_to_unicode_init): Use `new <type>[1]'. * src/roff/troff/uniuni.cc (unicode_decompose_init::unicode_decompose_init): Ditto. * src/roff/troff/uniglyph.cc (unicode_to_glyph_init::unicode_to_glyph_init): Ditto.
* * src/devices/grops/ps.cc (cmyk_flag): New global variable.wlemb2002-10-201-6/+12
| | | | | | | | (ps_printer::set_color): Set `cmyk_flag' for CMY and CMYK colors. (ps_printer::~ps_printer): Emit `%%Extensions: CMYK' if `cmyk_flag' is set. * font/devps/prologue.ps (Fk, Ck): Enclose definitions with a `where' construction since `cmyksetcolor' is a PS Level 2 operator.
* Add the new -r option to grotty. It is similar to the -i optionwlemb2002-10-132-4/+31
| | | | | | | | | | | | | except it tells grotty(1) to use the "reverse video" attribute to render italic fonts. * src/devices/grotty/tty.cc (reverse_flag): New global variable. (SGR_REVERSE, SGR_NO_REVERSE): New macros. (tty_printer::make_underline, tty_printer::put_color, tty_printer::end_page): Use it. (main): Add -r switch. (usage): Updated. * src/devices/grotty/grotty.man: Document it.
* Redesigning color support in troff. Colors are no longerwlemb2002-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | represented as separate nodes but are now part of glyph nodes and friends. This fixes the current formatting misbehaviour due to the changes introduced on 2002-09-20. Some extra code is necessary for proper grotty support: Without adding color variables to space-related nodes, the background color would be changed too late. * src/roff/troff/node.h, src/roff/troff/node.cc: s/current_pagecolor/current_fill_color/. s/current_glyphcolor/current_glyph_color/. (glyph_color_node, fill_color_node): Removed. (node::get_glyph_color, node::get_fill_color): New virtual member functions. (space_node::col): New variable. Updated constructors of space_node and derived classes accordingly. (hmotion_node::col): New variable. Updated constructors of hmotion_node and space_char_hmotion_node accordingly. (vmotion_node::col): New variable. Updated constructor accordingly. (draw_node::gcol, draw_node::fcol): New variables. Updated constructor accordingly. (special_node::gcol, special_node::fcol): New variables. Updated constructors accordingly. (troff_output_file::put_char, troff_output_file::put_charwidth, troff_output_file::draw): Set glyph and fill color. (troff_output_file::start_special): Set glyph and fill color. Always set current font. (troff_output_file::fill_color, troff_output_file::glyph_color): Don't call `do_motion'. (glyph_node::gcol, glyph_node::fcol): New variables. Updated constructors of glyph_node and ligature_node accordingly. (glyph_node::get_glyph_color, glyph_node::get_fill_color): New member functions. (glyph_node::merge_glyph_node, kern_pair_node::add_discretionary_hyphen, node::add_discretionary_hyphen): Updated. (break_char_node::merge_self): Updated. (word_space_node::tprint, space_node::tprint, hmotion_node::tprint, vmotion_node::tprint): Handle color. (make_glyph_node, make_node, node::add_char): Updated. * src/roff/troff/env.cc (environment::space_newline, environment::space, environment::output_line, environment::do_break, environment::make_tab_node, environment::add_padding, title): Updated. (environment_switch, environment_copy): Don't add color nodes. * src/roff/troff/input.cc (do_glyph_color, do_fill_color): Return nothing. (token::next): Updated. \m and \M now are as transparent as \s. (process_input_stack, token::add_to_node_list, token::process, read_draw_node): Updated. (charinfo_to_node_list): Don't add color nodes. * doc/groff.texinfo: Updated.
* * src/devices/grolbp/lbp.cc: Replace `300' with `font::res' wherewlemb2002-09-232-38/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | appropriate. (DEFAULT_LINEWIDTH_FACTOR): New macro. (linewidth_factor): New global variable. (lbp_printer::set_line_thickness): Fix case for size < 0, using linewidth_factor. (long_options): Add -w/--linewidth option. (usage): Updated. (main): Handle -w option to set linewidth_factor. (lbp_printer::lbp_printer): Initialize req_linethickness, not line_thickness. * src/devices/grolbp/grolbp.man, NEWS, doc/webpage.ms: Updated. Fixed a bug in the line thickness setting code. * src/devices/grolbp/lbp.cc (lbp_printer::req_linethickness): New variable. (lbp_printer::set_line_thickness): Pass environment as second parameter. Implement it actually. (lpb_printer::set_char, lbp_printer::draw): Use `req_linethickness' and `set_line_thickness, depending on the current font size.