LinuxCommandLibrary

xtotroff

Convert X font descriptions to troff format

SYNOPSIS

xtotroff [options] [files...]

PARAMETERS

-help
    -help
Displays a concise help message and exits.

-version
    -version
Shows the version information of xtotroff and exits.

-file FILE
    -file FILE
Specifies the input file to be displayed. If no file is specified, xtotroff reads from standard input.

-dev DEVICE
    -dev DEVICE
Sets the output device for groff when processing raw troff source. For example, 'ps' for PostScript.

-page N
    -page N
Starts the display at the specified page number N.

-zoom N
    -zoom N
Sets the initial zoom factor for the displayed document.

-scale N
    -scale N
Sets the scaling factor for the rendered output.

-delay N
    -delay N
Sets a delay in milliseconds, primarily for internal or animated output processing.

-wait
    -wait
Causes xtotroff to wait for input on standard input before displaying.

-nofork
    -nofork
Prevents xtotroff from forking into the background, useful for debugging.

-debug
    -debug
Enables debugging output to the console, aiding in troubleshooting.

-Xgeometry GEOMETRY
    -Xgeometry GEOMETRY
Sets the initial size and position of the X window (e.g., 800x600+100+50).

-fg COLOR
    -fg COLOR
Specifies the foreground color of the X window.

-bg COLOR
    -bg COLOR
Specifies the background color of the X window.

-font FONT
    -font FONT
Sets the font for page number display or other UI elements within the window.

-rv
    -rv
Enables reverse video, swapping the foreground and background colors.

-title TITLE
    -title TITLE
Sets the title string that appears in the X window's title bar.

-name NAME
    -name NAME
Specifies the application name for X resource lookups.

-display DISPLAY
    -display DISPLAY
Connects to the specified X display (e.g., ':0.0').

-sync
    -sync
Forces synchronous X protocol requests, useful for debugging X applications but can slow performance.

files...
    files...
One or more input files. These can be raw groff source or pre-formatted output (e.g., PostScript). If no files are provided, input is read from standard input.

DESCRIPTION

xtotroff is a utility that displays formatted output from the groff document formatting system directly in an X Window System environment. It acts as a convenient viewer, allowing users to preview documents formatted with groff without needing to print them or convert them to other static formats like PDF first. Essentially, xtotroff can either take raw troff source files and pipe them through groff to generate output for display, or it can accept pre-formatted output, typically in PostScript format (produced by drivers like grops), and render it for viewing. It provides basic navigation and viewing capabilities within the X window, making it useful for interactive document development and proofreading.

CAVEATS

xtotroff is a relatively older utility primarily designed for the X Window System. It relies on groff for processing input and often uses drivers like grops or gxditview internally for rendering. Its functionality might be limited compared to modern PDF or DVI viewers, and it is not actively developed for new features, but rather maintained within the groff project.

INPUT FORMATS

Input Formats
xtotroff can accept various input types. It can process raw troff source files by piping them through the groff command. Alternatively, it can directly display pre-formatted device-independent files, such as PostScript output generated by grops. This flexibility allows it to be used both for live document development and for viewing already processed documents.

INTERNAL OPERATION

Internal Operation
When provided with troff source files, xtotroff internally invokes the groff command to format the document. The resulting output, often in PostScript format (using grops), is then rendered and displayed in the X window. For pre-formatted input, it directly uses its rendering capabilities or delegates to a suitable viewer like gxditview if available and configured.

HISTORY

xtotroff is part of the groff project, which is a free implementation of the troff text formatter. Its development aimed to provide a direct visual feedback mechanism for groff users within the X Window System environment, allowing for quick previewing of documents without requiring printing. While newer tools might offer more advanced features (like gxditview for GTK-based viewing or external PDF viewers for PostScript output), xtotroff continues to serve its original purpose as a lightweight X-based viewer for groff output.

SEE ALSO

groff(1), grops(1), gxditview(1), troff(1), X(7)

Copied to clipboard