grotty(1)
โจ NAME โจ
grotty(1) โ General Commands Manual. Bestie, this is the page for grotty: groff's output driver for typewriter-like (terminal) devices. ๐
๐ป SYNOPSIS ๐ป
grotty [-dfhot] [-i|-r] [-F font-directory] [file ...]
grotty -c [-bBdfhouU] [-F font-directory] [file ...]
grotty --help
grotty -v
grotty --version
๐ DESCRIPTION ๐
Okay so the GNU roff TTY (โTeletypeโ) output driver translates the output of troff(1) into a form suitable for typewriter-like devices, including video terminal emulators. Normally, grotty is invoked by groff(1) when the latter is given one of the โ-T asciiโ, โ-T latin1โ, or โ-T utf8โ options. (In this installation, ps is the default output device.) Use groff's -P option to pass any options shown above to grotty. If no file arguments are given, or if file is -, grotty reads the standard input stream. It writes to the standard output stream. ๐ซถ
By default, grotty emits SGR escape sequences (from ISO 6429, popularly called โANSI escapesโ) to change text attributes (bold, italic, underline, reverse video [โnegative imageโ] and colors). Devices supporting SGR 30โ37 and 40โ47 sequences can view roff documents using eight different background and foreground colors. grotty's tty.tmac file defines the eight color names of ISO 6429: black, white, red, green, blue, yellow, magenta, and cyan. Unrecognized colors map to the default color, the value of which depends on the settings of the terminal. Also see the -t option below.
By default, grotty produces OSC 8 hyperlinks on devices employing SGR escape sequences. ๐
In accord with long-standing practice and terminals (emulators) that lack support for slanted (oblique or italic) faces, grotty marks italicized character cells with underlines instead by defaultโbut see the -i option below.
โจ SGR and OSC support in pagers โจ
When paging grotty's output with less(1), the latter program must be instructed to pass SGR and OSC sequences through to the device; its -R option is one way to achieve this (less version 566 or later is required for OSC 8 support). Consequently, programs like man(1) that page roff documents with less must call it with an appropriate option.
๐ธ Legacy output format ๐ธ
The -c option tells grotty to use an output format compatible with paper terminals, like the Teletype machines for which roff and nroff were first developed but which are no longer in wide use. SGR escape sequences are not emitted; bold, italic, and underlining character attributes are thus not manipulated. Instead, grotty overstrikes, representing a bold character c with the sequence โc BACKSPACE cโ, an italic character c with the sequence โ_ BACKSPACE cโ, and bold italics with โ_ BACKSPACE c BACKSPACE cโ. This rendering is inherently ambiguous when the character c is itself the underscore.
The legacy output format can be rendered on a video terminal (or emulator) by piping grotty's output through ul(1), which may render bold italics as reverse video. Some implementations of more(1) also are able to display these sequences; you may wish to experiment with that command's -b option. less renders legacy bold and italics without requiring options. In contrast to the terminal output drivers of some other roff implementations, grotty never outputs reverse line feeds. You need not filter its output through col(1) to remove them. ๐
๐ฆ Device extension commands ๐ฆ
grotty recognizes a device extension command produced by the groff request device or roff \X escape sequence.
\X'tty: link [uri [key=value] ...]'โ Embed a hyperlink using the OSC 8 terminal escape sequence. Specifying uri starts hyperlinked text, and omitting it ends the hyperlink. When uri is present, any number of additional key/value pairs can be specified; their interpretation is the responsibility of the pager or terminal. Spaces or tabs cannot appear literally in uri, key, or value; they must be represented in an alternate form.
๐ง Device description files ๐ง
If the DESC file for the character encoding contains the โunicodeโ directive, grotty emits Unicode characters in UTF-8 encoding. Otherwise, it emits characters in a single-byte encoding depending on the data in the font description files. See groff_font(5).
A font description file may contain a directive โinternalname nโ where n is a decimal integer. If the 01 bit in n is set, grotty treats the font as slanted; if the 02 bit is set, grotty treats the font as bold.
๐ Typefaces ๐
grotty supports the standard four styles: R (roman), I (italic), B (bold), and BI (bold-italic). Because the output driver operates in nroff mode, attempts to set or change the font family or type size are ignored.
grotty shares a naming scheme for East Asian typefaces with grohtml(1), gropdf(1), and grops(1).
CSHโ Simplified Chinese, Hei styleCSSโ Simplified Chinese, Song styleCTHโ Traditional Chinese, Hei styleCTSโ Traditional Chinese, Song styleJPGโ Japanese, Gothic styleJPMโ Japanese, Mincho styleKOGโ Korean, Gothic styleKOMโ Korean, Mincho style
๐ OPTIONS ๐
--help displays a usage message, while -v and --version show version information; all exit afterward.
-bโ Suppress the use of overstriking for bold characters in legacy output format.-Bโ Use only overstriking for bold-italic characters in legacy output format.-cโ Usegrotty's legacy output format (see subsection โLegacy output formatโ above). SGR and OSC escape sequences are not emitted.-dโ Ignore all drawing commands in the input. By default,grottyrenders โD lโ commands that have at least one zero argument (and so are either horizontal or vertical) using Unicode box drawing characters (for theutf8device) or the-,|, and+characters (for all other devices).grottyhandles โD pโ commands that consist entirely of horizontal and vertical lines similarly. Seegroff_out(5).-fโ Emit a form feed at the end of each page having no output on its last line.-Fdir โ Prepend directorydir/devnameto the search path for font and device description files; name describes the output device's character encoding, one ofascii,latin1, orutf8.-hโ Use literal horizontal tab characters in the output. Tabs are assumed to be set every 8 columns.-iโ Render fonts marked as slanted with the SGR attribute for italic text rather than underlined text. Many terminals don't support this attribute; however,xterm(1), since patch #314 (2014-12-28), does. Ignored if-cis also specified.-oโ Suppress overstriking (other than for bold and/or underlined characters when the legacy output format is in use; see options-band-u).-rโ Render fonts marked as slanted with the SGR attribute for reverse video text rather than underlined text. Ignored if-cor-iis also specified.-tโ Assume that the output device supports SGR 38 and 48 escape sequences, which permit specification of character cell foreground and background colors in the RGB color space with 8 bits per channel.-uโ Suppress the use of underlining for italic characters in legacy output format.-Uโ Use only underlining for bold-italic characters in legacy output format.
๐ EXIT STATUS ๐
grotty exits with status 0 on successful operation, status 2 if the program cannot interpret its command-line arguments, and status 1 if it encounters an error during operation.
๐ ENVIRONMENT ๐
GROFF_FONT_PATHโ A list of directories in which to seek the selected output device's directory of device and font description files. Seetroff(1)andgroff_font(5).GROFF_NO_SGRโ If set,grotty's legacy output format is used just as if the-coption were specified; see subsection โLegacy output formatโ above.
๐ FILES ๐
/usr/share/groff/1.24.2/font/devascii/DESCโ describes theasciioutput device./usr/share/groff/1.24.2/font/devascii/Fโ describes the font known asFon deviceascii./usr/share/groff/1.24.2/font/devlatin1/DESCโ describes thelatin1output device./usr/share/groff/1.24.2/font/devlatin1/Fโ describes the font known asFon devicelatin1./usr/share/groff/1.24.2/font/devutf8/DESCโ describes theutf8output device./usr/share/groff/1.24.2/font/devutf8/Fโ describes the font known asFon deviceutf8./usr/share/groff/1.24.2/tmac/tty.tmacโ defines macros for use with theascii,latin1, andutf8output devices. It is automatically loaded bytroffrcwhen any of those output devices is selected./usr/share/groff/1.24.2/tmac/tty-char.tmacโ defines fallback characters for use withgrotty. Seenroff(1).
๐ LIMITATIONS ๐
grotty is intended only for simple documents.
- There is no support for horizontal or vertical motions smaller than a character cell.
- Drawing commands producing anything other than horizontal and vertical lines are not supported.
- Color handling differs from other output drivers. The GNU troff output commands produced by requests and escape sequences that set the stroke and fill colors instead set the foreground and background character cell colors, respectively.
The commands generated by the \l and \L escape sequences on one hand, and the \D'l' line-drawing escape sequence on the other, make different compromises due to the first two factors. Specifically, (1) \l draws horizontal lines with underscore characters; \D'l' uses ACS or Unicode line-drawing characters if possible, and hyphen-minus signs if not. (2) \D'l' draws vertical lines an extra character cell high, and horizontal lines an extra cell to the right. grotty does this to detect intersecting lines so that it can replace them with glyphs of appropriate appearance (like โ+โ). Observe the difference below.
The input
Hello,\L'1v'
world.\l'1n'
.sp 2v
Hello,\D'l 0 1v'
world.\D'l 1n 0'
.pl \n(nlu \" truncate page for convenience
rendered with โnroff -T asciiโ produces the following output.
Hello,
| world._
Hello,|
|world.--
โจ EXAMPLES โจ
Okay bestie, this next bit is a whole mood board of test material ๐ โ here's a groff document that flexes several features where output device support varies (translation: your terminal might not be as versatile as the document is, no cap):
- bold style
- italic (underline) style
- bold-italic style
- character composition by overstriking (as in โcoรถperateโ)
- foreground color
- background color
- horizontal and vertical line drawing
And here's the document itself, literally copied exactly so go off ๐
You might see \f[B]bold\f[] and \f[I]italic\f[].
Some people see \f[BI]both at once\f[].
If the output device does (not) co\z\[ad]operate,
you might see \m[red]red\m[].
Black on cyan can have a \M[cyan]\m[black]prominent\m[]\M[]
\D'l 1i 0'\D'l 0 2i'\D'l 1i 0' look.
.\" If in nroff mode, end page now.
.if n .pl \n[nl]u
So like, given all that input up there, compare and contrast the output of the following, bestie โ run them all, it's giving science experiment ๐งช:
$ groff -T ascii file
$ groff -T utf8 -P -i file
$ groff -T utf8 -P -c file | ul
๐ SEE ALSO ๐
- โControl Functions for Coded Character Setsโ (ECMA-48) 5th edition, Ecma International, June 1991. It's a gratis version of ISO 6429, and it's iconic because it includes a normative description of SGR escape sequences โ iykyk ๐ซถ
- โHyperlinks in Terminal Emulatorsโ, Egmont Koblinger.
groff(1),troff(1),groff_out(5),groff_font(5),groff_char(7),ul(1),more(1),less(1),man(1)
โจ that's the whole page, bestie, you ate it up โจ This one's from groff 1.24.2, dated 2026-10-01 โ go forth and make your terminal pretty ๐๐๐ฆ
๐ฆ where this page comes from
- alpine 3.24: groff-doc 1.24.2-r0 ยท GPL-3.0-or-later
- Copyright 1989-2025 Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms