This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
u2ps.1
165 lines (159 loc) · 6.17 KB
/
u2ps.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
.TH u2ps 1
'''
.SH NAME
u2ps \- unicode text to PostScript converter
'''
.SH SYNOPSIS
u2ps [\fIoptions\fR] [\fIinput-file\fR [\fIoutput-file\fR]]
'''
.SH DESCRIPTION
\fBu2ps\fR produces printable PostScript document from supplied text,
handling arbitrary Unicode characters.
'''
.SH USAGE
Typically u2ps should be run with \fIinputname\fR but without \fIoutputname\fR,
in which case the output will be written to \fIinputname\fR.ps.
.SS General options
.IP "\fB-T\fR/\fB--tab=\fIn\fR" 4
Spaces per tab.
.IP "\fB-a\fR/\fB--no-ansi\fR" 4
Do not interpret ANSI terminal control sequences.
.IP "\fB-P\fR/\fB--paper=name\fR" 4
Paper name, or size in mm (WxH)
.IP "\fB-M\fR/\fB--margins=values\fR" 4
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.
.IP "\fB-r\fR/\fB--landscape\fR" 4
Rotate to landscape orientation
.IP "\fB-w\fR/\fB--wrap\fR" 4
Wrap long lines
.IP "\fB-W\fR/\fB--mark\fR" 4
Wrap long lines and set wrap marks
.IP "\fB-i\fR/\fB--inverse\fR" 4
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.
'''
.SS 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.
'''
.IP "\fB-f\fIname\fR/\fB--font=\fIname\fR" 4
Primary font set [FreeMono].
.IP "\fB-f\fIK\fB:\fIname\fR" 4
Font name for key \fIK\fR; possible key values are: \fBR\fRegular, \fBI\fRtalic,
\fBB\fRold, b\fBO\fRld italic, \fBC\fRJK characters, \fBT\fRhai.
.IP "\fB--aux-font=\fIname\fR" 4
Auxilliary font, for headings and line numbers [Times-Roman].
.IP "\fB--aux-size=\fIn\fR" 4
Auxilliary font size (pt).
'''
.SS Aspect ratio adjustments
Most monospace fonts have aspect ratio of 0.6, which means printing M in
10pt font advances caret right by 6pt.
.IP "\fB-2\fR" 4
Scale fonts so that terminal cell aspect ratio is 0.5.
.IP "\fB-1\fR" 4
Same, for aspect ratio of 1.0 (square characters).
.P
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.
'''
.SS Font size selection
Use only one of these options.
Paper size will be used to determine the other two.
.IP "\fB-s\fR/\fB--font-size=\fIn\fR" 4
Font size (pt)
.IP "\fB-C\fR/\fB--columns=\fIn\fR" 4
Columns per line.
.IP "\fB-L\fR/\fB--lines=\fIn\fR" 4
Lines per page
'''
.SS Output control options:
.IP "\fB-l\fR/\fB--numbers\fR" 4
Print line numbers
.IP "\fB--start-line=\fIn\fR" 4
First line number, instead of default 1.
.IP "\fB-b\fR/\fB--bookish\fR" 4
Swap left and right headings on even pages.
.IP "\fB-H\fR/\fB--no-headings\fR" 4
Do not print default headings
.IP "\fB--header=\fR..." 4
.IP "\fB--header-left=\fR..." 4
.IP "\fB--header-right=\fR..." 4
Page headings: centered, left and right aligned.
.IP "\fB--footer=\fR..." 4
.IP "\fB--footer-left=\fR..." 4
.IP "\fB--footer-right=\fR..." 4
Page footers.
.IP "\fB-t\fR/\fB--title=\fIstring\fR" 4
Page title (DSC only, not printed anywhere).
.P
Use \fB#\fR in \fB--header\fR or \fB--footer\fR strings to get
current page number. Set --header="@" to get input file name.
'''
.SS Postscript options
.IP "\fB-R\fR/\fB--noreduce\fR" 4
Do not reduce resources, embed everything as is
(see \fB-r\fR in \fBpsfrem\fR(1)).
.IP "\fB-A\fR/\fB--allfonts\fR" 4
Embed/reduce all fonts, including standard postscript 35
.IP "\fB-E\fR/\fB--noembed\fR"
Do not embed resources; see below on how to use the output.
.IP "\fB--keep\fR" 4
Do not delete temporary files
'''
.SH NOTES
.SS 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.
'''
.SS PostScript printers
u2ps relies on non-standard \fBglyphwidth\fR operator to center and right-align
headings. In case postscript interpreter in your printer lacks this operator,
you are likely to get misaligned headings.
'''
.SS 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 (\fB-A\fR option).
'''
.SS 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.
'''
.SS 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.
'''
.SH AUTHOR
Written by Alex Suykov \fT<alex.suykov@gmail.com>\fR
.br
Feel free to send bug reports and suggestions.
'''
.SH SEE ALSO
\fBgs(1)\fR, \fBhighlight(1)\fR, \fBpsnup(1)\fR, \fBpsbook(1)\fR,
\fBpsselect(1)\fR, \fBepstopdf(1)\fR, \fBps2pdf\fR.
Similar utilities: \fBa2ps(1)\fR, \fBpaps(1)\fR, \fBtexttops\fR from cups
package.