u2ps(1)
β¨ u2ps(1) β unicode text to PostScript converter π
(General Commands Manual)
πΈ NAME πΈ
u2ps β unicode text to PostScript converter. periodt.
π SYNOPSIS π
u2ps [options] [input-file [output-file]]
π¦ DESCRIPTION π¦
okay so u2ps produces a printable PostScript document from the text you give it, and it handles arbitrary Unicode characters. iconic behavior, honestly π
π USAGE π
Typically u2ps should be run with inputname but without outputname, and in that case the output will be written to inputname.ps. iykyk β¨
π 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, orV:H, orT:R:B:L. Heads up: the margins are for the text area only. Headings, line numbers and wrap marks will be printed outside of the 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 chosen to match base font names closely.
-fname/--font=nameβ Primary font set [FreeMono].-fK:nameβ Font name for keyK; 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 is0.5.-1β Same, for aspect ratio of1.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 default1.-b,--bookishβ Swap left and right headings on even pages.-H,--no-headingsβ Do not print default headings.--header=...β Page heading, centered.--header-left=...β Page heading, left aligned.--header-right=...β Page heading, right aligned.--footer=...β Page footers.--footer-left=...β Page footers.--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-rinpsfrem(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 issued 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.
and that's the u2ps(1) page, bestie β footer says just u2ps(1), no extra version/date tea. stay iconic π
β¨
π¦ where this page comes from
- nixos 26.05: u2ps 1.2
- nixpkgs unstable: u2ps 1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms