Debian Codegraph @

texmf-dist/doc/support/installfont/installfont.tex

raw
1 \documentclass[10pt,a4paper]{scrartcl}
2 \usepackage[english]{babel}%
3 \usepackage[latin1]{inputenc}%
4 \usepackage[T1]{fontenc}%
5 \usepackage{textcomp}%
6 \usepackage{lmodern}%
7 \usepackage{bera}%
8 \usepackage{tabularx}
9 \usepackage{booktabs}
10 \usepackage{amsmath}
11 \usepackage[symbol]{footmisc}
12 \usepackage{endnotes}
13 \usepackage[svgnames,rgb]{xcolor}%
14 \usepackage{tikz}%
15 \usepackage{ragged2e}%
16 \usepackage{url}%
17 \usepackage[automark,nouppercase]{scrpage2}%
18 \usepackage{microtype}
19 \usepackage{hyperref}
20 \hypersetup{colorlinks=true,urlcolor=NavyBlue,linkcolor=NavyBlue,citecolor=CornflowerBlue,naturalnames=true,hypertexnames=false,breaklinks=true,pdfauthor={Josef Kleber},pdftitle={A bash script for installing a LaTeX font family},pdfsubject={Documentation for the installfont(-tl) script}}
21 \renewcommand{\arraystretch}{1.2}
22 \newcommand\Link[2]{\href{#1}{#2}\endnote{\href{#1}{\url{#1}}}}
23 \makeatletter
24 \setlength{\headheight}{1.1\baselineskip}%
25 %
26 \renewcommand{\maketitle}%
27 {%
28 \thispagestyle{empty}%
29 \pagecolor{Ivory}%
30 \begin{titlepage}%
31 \begin{tikzpicture}[remember picture,overlay]%
32 \node[yshift=-2cm] at (current page.north west)%
33 {%
34 \begin{tikzpicture}[remember picture, overlay]%
35 \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle%
36 (\paperwidth,2cm);%
37 \draw[anchor=west,yshift=-4cm,xshift=3cm,color=NavyBlue] (0,0) node%
38 {\parbox{15cm}{\RaggedRight\Huge\sffamily\textbf{\@title}}};%
39 \draw[anchor=west,yshift=-6cm,xshift=3cm,color=NavyBlue] (0,0) node%
40 {\parbox{15cm}{\huge\sffamily\textbf{\@fileversion}}};%
41 \draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node%
42 {\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};%
43 \draw[anchor=west,yshift=-14cm,xshift=3cm,color=NavyBlue] (0,0) node%
44 {\parbox{15cm}{\huge\sffamily\textbf{\@date}}};%
45 \draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node%
46 {\parbox{15cm}{\Large\sffamily{\@authorline\\\textbf{\@author}}}};%
47 \end{tikzpicture}%
48 };%
49 \node[yshift=0cm] at (current page.south west)%
50 {%
51 \begin{tikzpicture}[remember picture, overlay]%
52 \draw[fill=NavyBlue,color=NavyBlue,yshift=6cm,xshift=2cm] (0,0) rectangle (0.2cm,19cm);%
53 \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);%
54 \draw[anchor=west,yshift=1cm,xshift=3cm,color=NavyBlue] (0,0) node%
55 {\parbox{15cm}{\large\sffamily{\@refline}}};%
56 \end{tikzpicture}%
57 };%
58 \end{tikzpicture}%
59 \end{titlepage}%
60 \pagecolor{white}%
61 }%
62 %
63 \newcommand*{\@tikzhead}[1]%
64 {%
65 \begin{tikzpicture}[remember picture,overlay]%
66 \node[yshift=-2cm] at (current page.north west)%
67 {%
68 \begin{tikzpicture}[remember picture, overlay]%
69 \draw[fill=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);%
70 \draw[anchor=west,yshift=1cm,xshift=1.5cm,color=NavyBlue] (0,0) node%
71 {\parbox{15cm}{\LARGE\sffamily\textbf{\@title}}};%
72 \node[anchor=east,xshift=.9\paperwidth,rectangle,%
73 rounded corners=15pt,inner sep=11pt,fill=NavyBlue]%
74 {\color{white}\textsc{#1}};%
75 \end{tikzpicture}%
76 };%
77 \end{tikzpicture}%
78 }%
79 \clearscrheadings%
80 \ihead{\@tikzhead{\headmark}}%
81 \cfoot{\upshape\thepage}%
82 \pagestyle{scrheadings}%
83 %
84 %\newcommand*{\headline}[1]{\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}%
85 \newcommand*{\Headline}[1]{\@mkboth{#1}{#1}}%
86 %
87 \renewcommand{\headfont}{\normalfont\mdseries\scshape}
88 %
89 \gdef\@subtitle{}%
90 \providecommand*{\Subtitle}[1]{\gdef\@subtitle{#1}}%
91 \gdef\@fileversion{}%
92 \providecommand*{\Fileversion}[1]{\gdef\@fileversion{#1}}%
93 \gdef\@author{}%
94 \providecommand*{\Author}[1]{\gdef\@author{#1}}%
95 \gdef\@authorline{Package author:}%
96 \providecommand*{\Authorline}[1]{\gdef\@authorline{#1}}%
97 \gdef\@refline{}%
98 \providecommand*{\Refline}[1]{\gdef\@refline{#1}}%
99 \gdef\and{\unskip{}, }%
100 \newcommand\doubledash{-\kern0.5pt-}
101 \def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1em\leavevmode\llap{\makeenmark}}
102 \makeatother
103 \begin{document}
104 \setlength{\parindent}{0pt}
105 \setfnsymbol{wiley}
106 \renewcommand\notesname{Links}
107 \title{\texttt{installfont(-tl)}}
108 \Subtitle{A bash script for installing a \LaTeX{} font family}
109 \Fileversion{v1.7}
110 \Authorline{Package author:}
111 \Author{Josef Kleber}
112 \Refline{\href{mailto:[email protected]}{\texttt{[email protected]}}\\\href{https://bitbucket.org/kleberj/installfont/}{\texttt{https://bitbucket.org/kleberj/installfont/}}}
113 \maketitle
114 \Headline{Abstract}
115 \vspace*{3cm}
116 \begin{abstract}
117 With this script\footnote{This script automates the procedure described in 'Tutorial I
118 The Basics' in
119 \href{ftp://dante.ctan.org/tex-archive/info/Type1fonts/fontinstallationguide/fontinstallationguide.pdf}{fontinstallationguide.pdf}} (installfont for MiKTeX; installfont-tl for TeXLive), you can install a LaTeX font family (Postscript Type1, Truetype, Opentype). It supports font series from light to ultra bold + (faked) small caps + faked slanted, but no expert fonts. The script will rename the fonts automatically (optinal) or will otherwise expect *.afm files and the font files (in Postscript Type1 format!) named in the Karl Berry scheme (e.g. 5nar8a.pfb). After running the script, you should have a working font installation in your local TeX tree.
120 \end{abstract}
121 \clearpage
122 \Headline{Dependencies}
123 \section*{Dependencies}
124 For using this script the following programms have to be installed:
125 \begin{itemize}
126 \item Windows
127 \begin{itemize}
128 \item \Link{http://www.miktex.org/}{MiKTeX} or \Link{http://www.tug.org/texlive/}{TeXLive}
129 \item \Link{http://www.cygwin.com/}{cygwin} or any other *nix-like environment with the same funtionality
130
131 Download \texttt{setup.exe} and follow the instructions on the \texttt{cygwin} homepage
132 \item for installing fonts in other formats than Postscript Type1
133 \begin{itemize}
134 \item Truetype
135
136 Download the \Link{http://gnuwin32.sourceforge.net/packages/ttf2pt1.htm}{ttf2pt1 Installer}, install \texttt{ttf2pt1} and add the installation directory to your \texttt{PATH}
137 \item Opentype
138
139 Download the \Link{ftp://akagi.ms.u-tokyo.ac.jp/pub/TeX/win32/lcdf-typetools-w32.tar.xz}{LCDF Typetools} and run (bash/cygwin)\newline\texttt{unxz lcdf-typetools-w32.tar.xz} followed by \newline\texttt{tar -xf lcdf-typetools-w32.tar} and add the \texttt{bin} directory to the \texttt{PATH}. You need to install \Link{http://www.ghostscript.com/}{Ghostscript} if you are using TeXLive!
140 \end{itemize}
141 \end{itemize}
142 \item *nix
143 \begin{itemize}
144 \item \Link{http://www.tug.org/texlive/}{TeXLive}
145 \item Ghostscript (pf2afm)
146 \item for installing fonts in other formats than Postscript Type1
147 \begin{itemize}
148 \item Truetype
149
150 Install the \texttt{ttf2pt1} package with your distribution package manager or download a package from a \Link{http://packages.ubuntu.com/search?lang=en&keywords=ttf2pt1}{webpage}.
151 \item Opentype
152
153 Install the \texttt{lcdf-typetools} package with your distribution package manager or download a package from a \Link{http://packages.ubuntu.com/search?lang=en&keywords=lcdf-typetools}{webpage}. Should be available in recent versions of TeXLive!
154 \end{itemize}
155 \end{itemize}
156 \end{itemize}
157
158 You can also convert the font manually, e.g. with \Link{http://fontforge.sourceforge.net/}{Fontforge}. Load the font, reencode the font to 'Adobe Standard' and generate the font (PS Type1 (Binary)).
159 \clearpage
160 \Headline{The font(s)}
161 \section*{The font(s)}
162 The core part of the script needs the font(s) in Postscript Type1 format and named in Karl Berry scheme. It can try to convert and to rename the font(s) and afm files for you by analyzing the afm files. If it fails\footnote{feel free to contact the author, so that another search pattern can be added to \texttt{grep} command(s)} you will have to rename the font(s) and afm files on your own. The Karl Berry scheme expects a file to be named like this:
163
164 \begin{center}
165 \begin{tabular}{cccc}
166 $\underbrace{\text{\strut fxx}}_{\text{font family}}$ & $\underbrace{\text{\strut y(y)}}_{\text{font cut}}$ & $\underbrace{\text{\strut zz}}_{\text{font encoding}}$ & .pfb
167 \end{tabular}
168 \end{center}
169
170
171 with the following meaning:
172
173 \begin{center}
174 \begin{tabularx}{\linewidth}{rlX}
175 f & supplier (type foundry) & p (Adobe), l (Linotype), f (small foundries, free), ...\\
176 xx & typeface & tm (Times), ch (Charter), hv (Helvetica), ...\\
177 y(y) & weights/variants & r~(regular/medium), ri~(regular/medium italic), rc~(regular/medium small caps), b~(bold), bi~(bold italic), bc~(bold small caps), l~(light), li~(light italic), lc~(light small caps), s~(semi bold), si~(semi bold italic), sc~(semi bold small caps), d~(demi), di~(demi italic), dc~(demi small caps), x~(extra bold), xi~(extra bold italic), xc~(extra bold small caps), u~(ultra bold/heavy), ui~(ultra bold/heavy italic), uc~(ultra bold/heavy small caps)\\
178 zz & font encoding & 8a (AdobeStandardEncoding), 8r (\TeX\ base encoding), ...\\
179 \end{tabularx}
180 \end{center}
181
182 The script supports the cuts presented in the table. Don't copy more than these cuts into your working directory, otherwise the automatic renaming will quite likely fail! It will add faked slanted cuts and faked small caps, if there are no real small caps fonts. If you only have one font cut, it will be installed as regular font. If you want more information about Karl Berry scheme read:
183
184 \medskip\texttt{texdoc fontname}
185
186 \clearpage
187 \Headline{Options}
188 \section*{Options}
189
190 The style file created with this script offers the following options:
191
192 \begin{itemize}
193 \item scaled
194
195 You can use the option \texttt{scaled} for scaling the font to better match with other fonts.
196
197 \item leading
198
199 For some fonts it might be necessary to increase the leading between lines for a better optical impression, where 1.0 means 100\%.
200 \end{itemize}
201
202 \Headline{Usage}
203 \section*{Usage}
204
205 To install a font family simply call the script:
206
207 \bigskip
208 \texttt{kleberj@home \texttildelow{}/installfont\\\$ installfont -f 5na -n 'Softmaker Nashville' -c Nashville -P MF@Sna\\-v v1.0 -l /cygdrive/d/LocalTeXMF -s MyFonts/Nashville -p nashville\\-m nashville -O -d 2010/09/14}
209 \bigskip
210
211 You can also put a copy of the script in your working directory and change the default values of the script variables. Then you can simply call the script with
212
213 \bigskip
214 \texttt{kleberj@home \texttildelow{}/installfont\\\$ ./installfont}
215 \bigskip
216
217 After running the script the font(s) should be properly installed. You can use the font just with \texttt{\textbackslash{}usepackage\{PACKAGENAME\}} or \texttt{\textbackslash{}FONTCOMMAND}.
218
219 \clearpage
220 The script offers the following command line options:
221
222 \bigskip
223 \begin{tabularx}{\linewidth}{llX}
224 \texttt{-f} & \texttt{\doubledash fontfamily} & Name of the LaTeX font family, e.g. ptm (Adobe Times)\\
225 \texttt{-n} & \texttt{\doubledash fontname} & Font name, e.g. Adobe Times\\
226 \texttt{-c} & \texttt{\doubledash fontcommand} & Name of the command that will switch to the font\\
227 \texttt{-P} & \texttt{\doubledash fontscaleprefix} & prefix of the scale macro, which should be different for each font (no digits allowed)\\
228 \texttt{-t} & \texttt{\doubledash fonttype} & Font type (pst1(default)|ttf|otf)\\
229 \texttt{-p} & \texttt{\doubledash packagename} & Name of the LaTeX package\\
230 \texttt{-d} & \texttt{\doubledash packagedate} & Date of the LaTeX package\\
231 \texttt{-v} & \texttt{\doubledash packageversion} & Version of the LaTeX package\\
232 \texttt{-l} & \texttt{\doubledash localtexmf} & root of your local TeX tree, e.g. \newline\texttt{/cygdrive/c/LocalTeXMF}\newline (TeXLive version default: \texttt{\$TEXMFLOCAL)}\\
233 \texttt{-s} & \texttt{\doubledash fontsubdir} & location where the fonts and support files should be installed, e.g. \texttt{MyFonts/AdobeTimes}\\
234 \texttt{-e} & \texttt{\doubledash fontencoding} & encoding of the font (default: 8a (AdobeStandardEncoding))\\
235 \texttt{-o} & \texttt{\doubledash otffontfeatures} & choosing Opentype font features (default: -fkern -fliga)\\
236 \texttt{-m} & \texttt{\doubledash mapfilename} & file name of the map file (without .map)\\
237 \texttt{-u} & \texttt{\doubledash uninstall} & will uninstall the font family. You must specify \mbox{\texttt{\doubledash localtexmf}} and \texttt{\doubledash fontsubdir}\\
238 \texttt{-R} & \texttt{\doubledash rmdefault} & installs font family as roman (serif) font family (default)\\
239 \texttt{-S} & \texttt{\doubledash sfdefault} & installs font family as sans serif font family\\
240 \texttt{-T} & \texttt{\doubledash ttdefault} & installs font family as typewriter font family\\
241 \texttt{-O} & \texttt{\doubledash origfontname} & use original font names instead of Karl Berry names\\
242 \texttt{-a} & \texttt{\doubledash admin} & set administrative mode (MiKTeX v2.8+)\\
243 \texttt{-V} & \texttt{\doubledash version} & will print the version number of the script\\
244 \texttt{-L} & \texttt{\doubledash log} & will redirect the terminal output of the programms to the LOG file\\
245 \texttt{-h} & \texttt{\doubledash help} & will print this help statement\\
246 \end{tabularx}
247
248 \clearpage
249 \theendnotes
250 \end{document}