u2ps(1)

NAME
u2ps - unicode text to PostScript converter

SYNOPSIS
u2ps [options] [input-file [output-file]]

DESCRIPTION
u2ps produces printable PostScript document from supplied text, handling arbitrary Unicode characters.

USAGE
Typically u2ps should be run with inputname but without outputname, in which case the output will be written to inputname.ps.

  General options

-T/--tab=n
    Spaces per tab.

-a/--no-ansi
    Do not interpret ANSI terminal control sequences.

-P/--paper=name
    Paper name, or size in mm (WxH)

-M/--margins=values
    Margins, in pt; a single number, or V:H, or T:R:B:L. Note the margins are for the text area only. Headings, line numbers and wrap marks will be printed outside of specified region.

-r/--landscape
    Rotate to landscape orientation

-w/--wrap
    Wrap long lines

-W/--mark
    Wrap long lines and set wrap marks

-i/--inverse
    Inverse (white text on black background) mode. Does not change other colors, so red will still be red. Use this to make the page look as close to a real terminal as possible. Can be useful for making "terminal screenshots" or rendering ASCII art, but hardly suitable for printing.

  Fonts setup
u2ps can switch between regular/bold/italic fonts, and if instructed so, between fonts providing different Unicode areas. Fonts are always loaded via Ghostscript, and the font names used are PostScript names. In addition to that, u2ps keeps a built-in list of common font variants. For instance, -f FreeMono sets regular, bold and italic fonts at once. Still, fontset names are choosen to match base font names closely.

-fname/--font=name
    Primary font set [FreeMono].

-fK:name
    Font name for key K; possible key values are: Regular, Italic, Bold, bOld italic, CJK characters, Thai.

--aux-font=name
    Auxilliary font, for headings and line numbers [Times-Roman].

--aux-size=n
    Auxilliary font size (pt).

  Aspect ratio adjustments
Most monospace fonts have aspect ratio of 0.6, which means printing M in 10pt font advances caret right by 6pt.

-2  Scale fonts so that terminal cell aspect ratio is 0.5.

-1  Same, for aspect ratio of 1.0 (square characters).

Aspect ratio is calculated for single-width characters. Double-width glyphs naturally have double that, so -2 mode should be used to get square CJK ideographs in the output.

  Font size selection
Use only one of these options. Paper size will be used to determine the other two.

-s/--font-size=n
    Font size (pt)

-C/--columns=n
    Columns per line.

-L/--lines=n
    Lines per page

  Output control options:

-l/--numbers
    Print line numbers

--start-line=n
    First line number, instead of default 1.

-b/--bookish
    Swap left and right headings on even pages.

-H/--no-headings
    Do not print default headings

--header=...

--header-left=...

--header-right=...
    Page headings: centered, left and right aligned.

--footer=...

--footer-left=...

--footer-right=...
    Page footers.

-t/--title=string
    Page title (DSC only, not printed anywhere).

Use # in --header or --footer strings to get current page number. Set --header="@" to get input file name.

  Postscript options

-R/--noreduce
    Do not reduce resources, embed everything as is (see -r in psfrem(1)).

-A/--allfonts
    Embed/reduce all fonts, including standard postscript 35

-E/--noembed
    Do not embed resources; see below on how to use the output.

--keep
    Do not delete temporary files

NOTES

  Font reduction
To allow large fontsets and at the same time produce files of reasonable size, u2ps embeds only fonts and glyphs actually used into the final document. This is done by passing initial document through gs -sDEVICE=nullpage, collecting glyph usage statistics and dumping relevant parts of the fonts loaded by gs. Ghostscript run is the most complicated and cpu-intensive part of u2ps operation. Embedding fonts into document is not, in fact, necessary if gs knows where to look for them. In such case you can make u2ps run much faster by using -E option. Just make sure to pass -I/usr/share/u2ps/ps to gs when handling files produced by u2ps -E, or otherwise make u2ps resources available.

  PostScript printers
u2ps relies on non-standard glyphwidth operator to center and right-align headings. In case postscript interpreter in your printer lacks this operator, you are likely to get misaligned headings.

  Standard PostScript fonts
Unless told otherwise, u2ps does not embed standard fonts (Times-Roman, Courier and such). Most of the time it works well. However, range coverage outside of basic Latin1 is not guaranteed for standard fonts, and the fonts bundled with Ghostscript tend to have more glyphs than fonts in a typically printer. In case you get notdef marks on printouts that weren't there in Ghostscript, consider embedding standard fonts as well (-A option).

  TrueType fonts
Normally u2ps relies on Ghostscript to load TT fonts. However, Ghostscript can not handle TrutType fonts without "post" table properly. When loaded directly by Ghostscript, such fonts get non-standard (and non-usable) glyph names, which makes them useless for u2ps.

  Font licensing
When embedding fonts, u2ps assumes you have the rights to do so. No checks are performed and no warnings are issues even for protected fonts.

AUTHOR
Written by Alex Suykov <alex.suykov@gmail.com>
Feel free to send bug reports and suggestions.

SEE ALSO
gs(1), highlight(1), psnup(1), psbook(1), psselect(1), epstopdf(1), ps2pdf. Similar utilities: a2ps(1), paps(1), texttops from cups package.