Debian Codegraph @

texmf-dist/doc/fonts/nimbus15/nimbus15-doc.tex

raw
1 % !TEX TS-program = pdflatexmk
2 \documentclass[11pt]{article}
3 \usepackage[margin=1in]{geometry}
4 \usepackage[parfill]{parskip}% Begin paragraphs with an empty line rather than an indent
5 %\pdfmapfile{+nimbus15.map}
6 \usepackage{booktabs}
7 \usepackage{graphicx}
8 \usepackage[OT2,LGR,T2A,T1]{fontenc}
9 \usepackage[utf8]{inputenc}
10 \usepackage{substitutefont}
11 \usepackage[greek,russian,english]{babel}
12 \usepackage[largesc,p]{newtxtext} %
13 \usepackage[varqu,varl]{zi4}
14 %\usepackage{nimbusmononarrow}% Courier Narrow
15 \usepackage{nimbussans}% Helvetica as sans serif
16 \usepackage[vvarbb]{newtxmath}
17 \useosf % must come immediately after newtxmath
18 \substitutefont{LGR}{\rmdefault}{NimbusSerif}
19 %\substitutefont{LGR}{\sfdefault}{NimbusSans}
20 \substitutefont{T2A}{\rmdefault}{NimbusSerif}
21 \substitutefont{OT2}{\rmdefault}{NimbusSerif}
22 \usepackage{fonttable}
23 \newcommand\cyrtext{\fontencoding{OT2}\selectfont} % declaration
24 \DeclareTextFontCommand{\textcyr}{\cyrtext} %macro with argument
25 %
26 \title{The Nimbus15 package}
27 \author{Michael Sharpe}
28 \date{\today}
29 \begin{document}
30 \maketitle
31 {\tt Nimbus15} is derived from the Nimbus fonts, metric clones of Courier, Helvetica and Times, issued in 2015 by URW++ by way of Artifex, makers of Ghostscript. (The latest versions for 2015 appeared with an update to the {\tt gs} distribution in October, 2015.) The novelty here is that there are now Greek and Cyrillic glyphs in all the Nimbus fonts. To summarize the changes from those supplied by Artifex and those in this distribution, aside from the trivial addition of {\tt cyrbreve (uniF6D4)}, {\tt low asterisk (uni204E)} ({\tt zco} only), {\tt visiblespace (uni2423)} and {\tt dotlessj (uni0237)} so in each typewritten font {\tt *} is correctly rendered and the {\tt ot1} and {\tt ot2} encodings are complete in all cases:
32 \begin{itemize}
33 \item{\tt Courier clone:}
34 \begin{verbatim}
35 NimbusMono-Regular->zco-Light
36 NimbusMono-Bold->zco-Bold
37 NimbusMono-Oblique->zco-LightOblique
38 NimbusMono-BoldOblique->zco-BoldOblique
39 \end{verbatim}
40 A new weight, intermediate between {\tt Light} and {\tt Bold}, was created with names\\
41 \verb|zco-Regular|, \verb|zco-Oblique|\\
42 The glyphs in Light, Regular and Bold have stem widths {\tt 41em}, {\tt64em} and {\tt 100em} respectively. A few glyphs required modification prior to and following the thickening process. The Greek glyphs support only monotonic Greek typography. Several Greek glyphs were modified from the originals, most importantly {\tt alpha} (less fish-like), {\tt nu} (curved, not v-shaped) and {\tt Phi} (less tall.) Thanks are due to Dimitrios Filippou for his important feedback on Greek typographic issues. Additionally, \verb|zco-Regular| was modified to a narrow version, \verb|zcoN-Regular|, starting with some FontForge transformations and finishing with manual adjustments to shorten serifs where necessary and make circular outlines narrower.
43 \item{\tt Helvetica clone:}
44 \begin{verbatim}
45 NimbusSanL*->zhv-*
46 \end{verbatim}
47 The upright tonos accent in the originals was modified to a slanted form, along with the prebuilt letters with tonos and tonosdieresis accents. Only a few modifications were made to the spacing and kerning tables. The Greek glyphs support only monotonic Greek typography.
48
49 \item{\tt Times clone:}
50 \begin{verbatim}
51 NimbusRomNo9L*->ztm-*
52 \end{verbatim}
53 The original fonts' Greek glyph coverage was relatively modest, supporting only monotonic Greek. This distribution adds glyphs to cover polytonic and some ancient forms. Three Cyrillic glyphs were changed substantially, and the spacing and kerning tables were modified considerably. (The Cyrillic part covers all but eight glyphs in T$2$A encoding, but has serious gaps in T$2$B and T$2$C.) In addition, slanted versions were created for the benefit of those switching from other font families like Latin Modern, where both \emph{italic} and {\usefont{T1}{NimbusSerif}{m}{sl}slanted} are available and may have different semantic connotations.
54
55 The glyphs missing from T$2$A are:
56 \begin{verbatim}
57 134 ("86) uni0498 CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
58 138 ("8A) uni04A0 CYRILLIC CAPITAL LETTER BASHKIR KA
59 140 ("8C) uni04D4 CYRILLIC CAPITAL LIGATURE A IE
60 142 ("8E) uni04A4 CYRILLIC CAPITAL LIGATURE EN GHE
61 166 ("A6) uni0499 CYRILLIC SMALL LETTER ZE WITH DESCENDER
62 170 ("AA) uni04A1 CYRILLIC SMALL LETTER BASHKIR KA
63 172 ("AC) uni04D5 CYRILLIC SMALL LIGATURE A IE
64 174 ("AE) uni04A5 CYRILLIC SMALL LIGATURE EN GHE
65 \end{verbatim}
66 \end{itemize}
67
68 This package is intended to be an add-on to a comprehensive Times-like text font package, such as {\tt newtxtext} or {\tt tgtermes}, adding the possibility of writing parts in Greek (monotonic, polytonic and ancient) and Cyrillic. (Note that the Courier and Helvetica clones support only monotonic Greek.) All \LaTeX\ support files are provided in encodings T$1$, TS$1$, LGR, T$2$A, T$2$B, T$2$C, OT$1$ and OT$2$. The OT$2$ encoding and its usage is described in the last section of this document.
69
70 Another option for serifed Greek and Cyrillic in a font matching Times is the recently released Tempora package.
71
72 \section*{The Courier clone}
73 All weights of {\tt zco} have an advance width of {\tt 600em}. When used at {\tt 12pt}, this amounts to {\tt 10} characters per inch. While Courier and its clones don't seem very interesting as typewriter fonts because they appear to be too wide and too light (see however the narrower version {\tt NimbusMonoN} below), they are essential to screenwriters who choose to make use of \LaTeX. Unlike John Pate's {\tt screenplay} package, {\tt screenplay-pkg} (Alan Munn's reworked version) does not hard-code the {\tt courier} package for use as its output font, but allows the use of whatever \verb|\ttdefault| is defined to be when {\tt screenplay-pkg} is loaded. So, to write a screenplay using {\tt 10cpi} Courier, as the screenplay rules require, you could set it up with preamble
74 \begin{verbatim}
75 \documentclass[12pt]{article}
76 \usepackage{nimbusserif} %Times for roman text, if any
77 \usepackage{nimbusmono} %Courier at 10cpi, regular (medium) weight
78 \usepackage{screenplay-pkg}
79 \end{verbatim}
80 The following three lines illustrate the three weights provided by {\tt zco}.\\
81 {\usefont{T1}{NimbusMono}{l}{n}zco-Light---the default weight of traditional Courier;}\\
82 {\usefont{T1}{NimbusMono}{m}{n}zco-Regular---the default Courier medium weight in this package;}\\
83 {\usefont{T1}{NimbusMono}{b}{n}zco-BoldBold---the default weight of traditional Bold Courier.}
84
85 The next two lines show for comparison {\tt NimbusMonoN} (the narrower version of {\tt zco-Regular}) and {\tt cmtt10}.
86 {\usefont{T1}{NimbusMonoN}{m}{n} NimbusMonoN (Narrow)---a new, narrower Courier. (Regular weight, upright and {\usefont{T1}{NimbusMonoN}{m}{sl}oblique} shapes only.)}\\
87 {\usefont{OT1}{cmtt}{m}{n} Computer Modern Typewriter (cmtt)---the traditional {\tt tt for} TeX users.}
88
89 {\tt NimbusMonoN} is more compact (advance widths {\tt 500em} vs.\ {\tt 525em}) but a bit lighter ({\tt 64em} stems vs.\ {\tt 69em} stems) than Computer Modern Typewriter. IMO, both are good for rendering lines of code in \TeX.
90
91 Note that the {\tt courier} package brings up the old URW courier clone (unless you have the Adobe version of the PS35 and have chosen to prefer them to URW), which is essentially the same for basic Latin glyphs as {\tt zco} and so it renders in this case the same as {\tt Light}.
92
93 The package {\tt nimbusmono} has a {\tt scaled} (or, equivalently, {\tt scale}) option. It has four other options that may be used to select the weights that \LaTeX\ will render as {\tt medium} and {\tt bold}. These are:
94 \begin{itemize}
95 \item
96 {\tt light}---\LaTeX\ medium renders with {\tt zco-Light};
97 \item
98 {\tt regular}---\LaTeX\ medium renders with {\tt zco-Regular};
99 \item
100 {\tt semibold}---\LaTeX\ bold renders with {\tt zco-Regular};
101 \item
102 {\tt bold}---\LaTeX\ bold renders with {\tt zco-Bold}.
103 \end{itemize}
104 Unless specified otherwise, {\tt nimbusmono} sets the options {\tt regular, bold}.
105
106 The package {\tt nimbusmononarrow} has a {\tt scaled} (or, equivalently, {\tt scale}) option, but no others, and offers only one weight (regular) in two styles style---upright and oblique. It is illustrated above. As for advance widths, {\tt nimbusmono} is {\tt600em}, {\tt nimbusmononarrow} is {\tt500em} and {\tt cmtt10} is {\tt525em}.
107
108 \subsection*{A comparison of widths of some free Typewriter fonts} This list is not meant to be exhaustive or even extensive.
109 \def\mystr{A sample of 46 characters to illustrate width.}
110 \font\zin=t1-zi4nr-0 at 11 pt
111 \font\cmtt=ec-lmtt12 at 11 pt
112 \font\cmttc=ec-lmtlc10 at 11 pt
113 \font\ntxtt=t1xtt at 11 pt
114 \font\cor=zco-Regular-t1 at 11 pt
115 %\font\corn=zcon-Regular-t1 at 11 pt
116 \begin{center}
117 \begin{tabular}{@{} ll @{}}
118 \toprule
119 Font & The same 46 characters \\
120 \midrule
121 Inconsolata & \texttt{\mystr} \\
122 InconsolataNarrow & {\zin\mystr} \\
123 cmtt (lmtt) & {\cmtt\mystr} \\
124 lmtt condensed & {\cmttc\mystr} \\
125 ntxtt & {\ntxtt\mystr} \\
126 nimbusmono & {\cor\mystr} \\
127 nimbusmononarrow & {\usefont{T1}{NimbusMonoN}{m}{n}\mystr} \\
128 \bottomrule
129 \end{tabular}
130 \end{center}
131 It appears that {\tt lmtt condensed} is the narrowest free monospace font, but is very light and not so easy to read. Of the regular weight free monospaced fonts, the narrowest is {\tt InconsolataN} (sans serif), followed by {\tt nimbusmononarrow} (serifed.)
132 \newpage
133 \section*{Some Font tables}
134 \def\tfmname{zco-Regular-t1}
135 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
136 \fonttable{\tfmname}
137
138
139 \newpage
140 \def\tfmname{zcoN-Regular-t1}
141 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
142 \fonttable{\tfmname}
143
144 \newpage
145 \def\tfmname{zcoN-Regular-ot1}
146 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
147 \fonttable{\tfmname}
148
149 Mimics {\tt cmtt} layout very closely.
150 \newpage
151 \def\tfmname{ztm-Reg-ot2}
152 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
153 \fonttable{\tfmname}
154
155 \newpage
156 \def\tfmname{ztm-Reg-lgr}
157 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
158 \fonttable{\tfmname}
159
160 Example: \foreignlanguage{greek}{χοίρος}.
161
162 \newpage
163 \def\tfmname{zhv-Reg-lgr}
164 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
165 \fonttable{\tfmname}
166
167 \newpage
168 \def\tfmname{ztm-Reg-t2a}
169 \textbf{\tfmname} \textsc{glyph table}:\hspace{.3in}
170 \fonttable{\tfmname}
171
172 Example: \foreignlanguage{russian}{который}.
173 \newpage
174 \section*{Usage}
175 There are two basic pathways that can be followed, one based on {\tt fontspec} (XeLaTeX or LuaLaTeX), the other on traditional LaTeX ({\tt pdflatex} or {\tt latex/dvips}).
176 \subsection*{Fontspec} With {\tt fontspec}, the setup is fairly simple. Nimbus15 supplies a file named {\tt ztm.fontspec} for Times with content
177 \begin{verbatim}
178 \defaultfontfeatures[ztm]
179 {
180 Extension = .otf ,
181 UprightFont = *-Reg,
182 BoldFont = *-Med,
183 ItalicFont = *-Ita,
184 BoldItalicFont = *-MedIta,
185 SlantedFont = *-RegObl,
186 BoldSlantedFont = *-MedObl,
187 }
188 \end{verbatim}
189 This file will be read by {\tt fontspec} whenever {\tt ztm} is loaded as a font, thereby simplifying the information you have to provide. (There are similar files {\tt zco.fontspec} for Courier, {\tt zcoN.fontspec} for Courier Narrow and {\tt zhv.fontspec} for Helvetica.)
190
191 \textsc{Example:}
192 \begin{verbatim}
193 \usepackage{fontspec}
194 \defaultfontfeatures{Mapping=tex-text}
195 \setmainfont{TeX Gyre Termes}% assumes it to be in one of your fonts folders
196 \newfontfamily{\nim}{ztm} % reads ztm.fontspec
197 \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
198 \setmonofont{zco}[Scale=MatchLowercase]% reads zco.fontspec
199 \end{verbatim}
200 so that {\tt utf8}-encoded text within a \verb|\nim{}| container will be rendered using {\tt ztm} and, by default, all other text will be rendered using {\tt TeX Gyre Termes}. You will most likely also wish to load the {\tt polyglossia} package to replace {\tt babel}.
201 \subsection*{LaTeX} The loading order of packages is important here. See the documentation of the {\tt newtx} package for details. Here's an example of using {\tt newtx} text and math, set up to allow the use of Greek, Russian and English as the main language.
202 \begin{verbatim}
203 \usepackage[OT2,LGR,T2A,T1]{fontenc} % spell out all text encodings to be used
204 \usepackage[utf8]{inputenc} %
205 \usepackage{substitutefont} % so we can use fonts other than those specified in babel
206 \usepackage[greek,russian,english]{babel}
207 \usepackage[largesc]{newtxtext} %
208 \usepackage{nimbusmononarrow} % Courier Narrow
209 \usepackage{nimbussans} % Helvetica
210 \usepackage[bigdelims,vvarbb]{newtxmath}
211 \useosf % use oldstyle figures except in math
212 \substitutefont{LGR}{\rmdefault}{NimbusSerif} % use nimbusserif to render Greek text
213 \substitutefont{T2A}{\rmdefault}{NimbusSerif} % use nimbusserif to render Russian
214 \substitutefont{OT2}{\rmdefault}{NimbusSerif} % poor man's version
215 \end{verbatim}
216 Any {\tt utf8}-encoded text typed outside of a \verb|\foreignlanguage{}{}| block will be rendered as T$1$-encoded {\tt newtxtext}, while that within \verb|\foreignlanguage{greek}{}| will be rendered as LGR-encoded polytonic Greek, and that within \verb|\foreignlanguage{russian}{}| will render as T$2$A-encoded Cyrillic.
217
218
219 The macro \verb|\textgreek| made available by {\tt babel-greek} may be used to avoid unicode. For example, \verb+\textgreek{>agaj\~{h}| t'uqh|?}+ renders as \textgreek{>agaj\~{h}| t'aqh|?}.
220
221 The macro \verb|\LGCscale| can be set if you wish to rescale the {\tt NimbusSerif} text. For example, \verb|\def\LGCscale{1.05}| will scale it up by 5\%. This is handled automatically for you by {\tt newtxtext} if you set its scale using the {\tt scaled} option. (In fact, there is another macro that takes priority over {\tt LGCscale}, named {\tt NimbusSerifscale}---it is automatically set if you load the package {\tt nimbusserif}, which should not be loaded if you also use {\tt newtxtext}.)
222
223 \section{The OT2 encoding}
224 Though OT$2$ is considered obsolete, as an essentially $7$-bit encoding, it is quite useful to those who work with a non-Cyrillic keyboard but wish to produce documents containing a limited amount of Cyrillic text, Latin characters being appropriately transliterated to Cyrillic, and with predefined macros available for each Cyrillic character. These are specified in {\tt ot2enc.def} in your \TeX\ distribution.
225
226 The following table, taken from a document on OT$2$ by Walter Schmidt that seems not to be publicly available at the moment, shows the transliteration scheme specified by ligatures in the {\tt OT2} encoding.
227 In each column of this table, each row shows first a Cyrillic character pair (upper and lower case), then the pair of keys or key sequences required on the input side. In some cases alternatives are also specified.
228
229 \includegraphics{ot2trans}
230
231 To use OT$2$ transliterated from Latin characters, accented characters and ligatures doesn't require {\tt babel}. For example:
232 \begin{verbatim}
233 \documentclass{article}
234 \usepackage[OT2,T1]{fontenc} % loads ot2enc.def
235 \newcommand\cyrtext{\fontencoding{OT2}\selectfont} % declaration
236 \DeclareTextFontCommand{\textcyr}{\cyrtext} %macro with argument
237 \end{verbatim}
238 The Russian part of the following sentence is entered as \verb|\textcyr{a e1to --- po-russki}|.
239
240 This is text in English, then Russian:
241 \textcyr{a e1to --- po-russki}.
242
243 \end{document}