summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/fontinst/latinmtx/ltcmds.mtx
blob: 6e9f1455ba17f153205dec56cb1c5b160ecca758 (plain)
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
% hacked and maintained 1997, 1998 Sebastian Rahtz,
% copyright 1998, 1999 the fontinst maintenance team and any individual
% authors listed elsewhere in this file.  All rights reserved.
%
% This file is part of the fontinst system version 1.9.
% -----------------------------------------------------
%
% It may be distributed under the terms of the LaTeX Project Public
% License, as described in lppl.txt in the base LaTeX distribution.
% Either version 1.0 or, at your option, any later version.
%
%%% ====================================================================
%%%  @TeX-font-metrics-file{
%%%     author          = "Alan Jeffrey and Ulrik Vieth",
%%%     version         = "1.915",
%%%     date            = "2003-03-29",
%%%     time            = "16:07:18 +01:00",
%%%     filename        = "ltcmds.mtx",
%%%     email           = "fontinst@cogs.susx.ac.uk",
%%%     URL             = "http://www.tug.org/applications/fontinst/",
%%%     checksum        = "",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "metrics, TeX, PostScript",
%%%     supported       = "yes",
%%%     abstract        = "This is a font metrics file, for use with the
%%%                        fontinst utility. It provides the defaults
%%%                        used to install the Latin glyphs.",
%%%     package         = "fontinst",
%%%     dependencies    = "fontinst.sty, fontdoc.sty",
%%%  }
%%% ====================================================================

\relax

\documentclass[twocolumn]{article}
\usepackage{fontdoc}[1999/11/04]

\title{The file \texttt{ltcmds.mtx}}
\author{Alan Jeffrey\and Ulrik Vieth\and Lars Hellstr\"om}
\date{20 October 2000\\Version 1.915}

\showbranches

\begin{document}
\maketitle

\metrics

\needsfontinstversion{1.917}
\ProvidesMtxPackage{ltcmds}

\begincomment
\section{Some commands for making latin glyphs}

\endcomment

% \unfakable is a glyph which can't be faked.
\setcommand\unfakable#1{
   \setglyph{#1}
      \glyphrule{\int{xheight}}{\int{xheight}}
      \glyphwarning{missing glyph `#1'}
   \endsetglyph
}
\begincomment\medskip
An \textbf{Unfakable} is a glyph which can't be faked. An 
``\textbf{Unfakable `\#1'}\,'' is equivalent to
\begin{quotation}\unfakable{\macroparameter{1}}\end{quotation}

\resetcommand\unfakable#1{%
   \Aheading{Unfakable `\TypesetStringExpression{#1}'}%
}
\endcomment


\setcommand\topaccent#1#2#3{
   \push
      \moveup{\max{0}{\sub{\height{#1}}{\int{xheight}}}}
      \movert{\add{\sub{\scale{\width{#1}}{#3}}{\half{\width{#2}}}}
         {\scale{\sub{\height{#1}}{\int{xheight}}}{\int{italicslant}}}}
      \glyph{#2}{1000}
   \pop
   \glyph{#1}{1000}
}
\begincomment\medskip
A \textbf{Top accent} is built by placing the center of the accent at 
the given position along the width of the letter, raised up by the 
difference between the height of the letter and the xheight. This is 
the algorithm used by the \TeX\ \verb|\accent| primitive. 
A ``\textbf{Top accent} `\#1' with `\#2' at \#3'' is equivalent to
\begin{quotation}
  \topaccent{\macroparameter{1}}{\macroparameter{2}}{\macroparameter{3}}
\end{quotation}
\resetcommand\topaccent#1#2#3{%
   \Bheading{Top accent} `\TypesetStringExpression{#1}' with 
   `\TypesetStringExpression{#2}' at $\TypesetIntegerExpression{#3}$%
}
\endcomment


\setcommand\topaccentas#1#2#3#4{
   \push
      \moveup{\sub{\height{#4}}{\height{#2}}}
      \movert{\add{
         \sub{\scale{\width{#1}}{#3}}{\half{\width{#2}}}
      }{
         \scale{\sub{\height{#4}}{\height{#2}}}{\int{italicslant}}
      }}
      \glyph{#2}{1000}
   \pop
   \glyph{#1}{1000}
}
\begincomment\medskip
A \textbf{Top accent \dots\ as} is built by placing the center of the 
accent at the given position along the width of the letter, raised up 
by the difference between the height of the accent and the height of 
the model glyph. A ``\textbf{Top accent} `\#1' with `\#2' at \#3 as 
\#4'' is equivalent to
\begin{quotation}
  \topaccentas{\macroparameter{1}}{\macroparameter{2}}
    {\macroparameter{3}}{\macroparameter{4}}
\end{quotation}
\resetcommand\topaccentas#1#2#3#4{%
   \Bheading{Top accent} `\TypesetStringExpression{#1}' with 
   `\TypesetStringExpression{#2}' at $\TypesetIntegerExpression{#3}$ 
   as `\TypesetStringExpression{#4}'%
}
\endcomment


\setcommand\botaccent#1#2#3{
   \push
      \movert{\sub{\scale{\width{#1}}{#3}}{\half{\width{#2}}}}
      \glyph{#2}{1000}
   \pop
   \glyph{#1}{1000}
}
\begincomment\medskip
A \textbf{Bottom accent} is built by placing the center of the accent at 
the given position along the width of the letter. A ``\textbf{Bottom 
accent} `\#1' with `\#2' at \#3'' is equivalent to
\begin{quotation}
   \botaccent{\macroparameter{1}}{\macroparameter{2}}{\macroparameter{3}}
\end{quotation}
\resetcommand\botaccent#1#2#3{%
   \Bheading{Bottom accent} `\TypesetStringExpression{#1}' with 
   `\TypesetStringExpression{#2}' at $\TypesetIntegerExpression{#3}$%
}
\endcomment


\setcommand\unfakabletopaccent#1{
   \setglyph{#1}
      \moveup{\add{\int{xheight}}{50}}
      \glyphrule{\half{\int{xheight}}}{\half{\int{xheight}}}
      \glyphwarning{missing glyph `#1'}
      \moveup{\neg{\add{\int{xheight}}{50}}}
   \endsetglyph
}
\begincomment\medskip
An \textbf{Unfakable top accent} is the same as an 
\textbf{Unfakable}, except that the rule is smaller and has a more 
accent-like position. An ``\textbf{Unfakable top accent `\#1'}\,'' 
is equivalent to
\begin{quotation}\unfakabletopaccent{\macroparameter{1}}\end{quotation}

\resetcommand\unfakabletopaccent#1{%
   \Aheading{Unfakable top accent `\TypesetStringExpression{#1}'}%
}
\endcomment



% A c&sc top accent glyph is placed using the small glyphs if
% available, and otherwise by shrinking the equivalent capital.

\setcommand\csctopaccent#1#2#3{
%    \ifareglyphs{#1small,#2small}\then
%       \topaccent{#1small}{#2small}{#3}
%    \Else
      \cscglyph{#1#2}
%    \Fi
}

% A c&sc bot accent glyph is placed using the small glyphs if
% available, and otherwise by shrinking the equivalent capital.

\setcommand\cscbotaccent#1#2#3{
%    \ifisglyph{#1small}\then
%       \botaccent{#1small}{#2small}{#3}
%    \Else
      \cscglyph{#1#2}
%    \Fi
}

% A c&sc accent is created by moving a shrunk accent up by the
% difference between a scaled x and a scaled X.

\setcommand\cscaccent#1{
   \moveup{\scale{\int{xheight}}{\sub{1000}{\int{smallcapsscale}}}}
   \cscglyph{#1}
   \moveup{\scale{\int{xheight}}{\sub{\int{smallcapsscale}}{1000}}}
}


\begincomment
\section{Default values}
\endcomment

\setint{italicslant}{0}

\ifisglyph{x}\then
   \setint{xheight}{\height{x}}
\Else
   \setint{xheight}{500}
\Fi

\ifisglyph{A}\then
   \setint{capheight}{\height{A}}
   \comment{\texttt{t1.etx} has traditionally measured the capheight 
     on \texttt{X}, whereas \texttt{latin.mtx} measured it on 
     \texttt{A}. There is probably no good reason for this 
     difference.}
\Else\ifisglyph{X}\then
   \setint{capheight}{\height{X}}
\Else
   \setint{capheight}{750}
\Fi\Fi

\ifisglyph{d}\then
   \setint{ascender}{\height{d}}
\Else
   \setint{ascender}{\int{capheight}}
\Fi

\ifisint{descender_neg}\then
   \setint{descender}{\neg{\int{descender_neg}}}
\Else\ifisglyph{g}\then
   \setint{descender}{\depth{g}}
   \comment{Similarly, \texttt{t1.etx} has traditionally measured 
     the descender depth on \texttt{p}, whereas \texttt{latin.mtx} 
     measured it on \texttt{g}.}
\Else\ifisglyph{p}\then
   \setint{descender}{\depth{p}}
\Else
   \setint{descender}{250}
\Fi\Fi\Fi

\setint{underlinethickness}{40}
\setint{visiblespacedepth}{200}
\setint{visiblespacewidth}{400}
\setint{visiblespacesurround}{50}


\ifisglyph{parenleft}\then
   \setint{vaxis}{\half{\sub{\height{parenleft}}{\depth{parenleft}}}}
\Else
   \setint{vaxis}{\half{\int{xheight}}}
\Fi


\endmetrics





\section{Changes}

1999/10/25: Added \verb|\setglyphs| for \texttt{Macronsmall} and
\texttt{macronsmall}. (LH)

1999/10/25: Simplified definition of \verb|\unfakable|. (UV\&LH)
Rationale: It is thoroughly confusing if the size of the black box
created by \verb|\unfakable| depends on the metrics of an unencoded
glyph that isn't accessible and therefore unavailable for all pratical
purposes.

2000/10/20--2003/03/15: File split off from \texttt{latin.mtx} and 
reorganised into a separate package. (LH) (It took until the last of 
these dates before all the useless code had been removed.) Also made 
special typeset definitions of many commands and modernized the 
conditionals.

2003/03/15: Made the \verb|\unfakable| a square with side 
$\TypesetIntegerExpression{\int{xheight}}$ and added the 
\verb|\unfakabletopaccent| command. (LH) Rationale: That the glyph is 
unavailable doesn't mean the rule replacing it has to look bad. This 
should make them blend in better with any glyphs that are actually 
available.

2003/03/15: Added \verb|\topaccentas|. (LH) It is based on a command 
|\idotaccent| defined by Walter Schmidt.

2003/03/15: Added calculation of a vertical symmetry axis position 
$\TypesetIntegerExpression{\int{vaxis}}$. (LH) It is based on some 
code by Walter Schmidt.

2004/08/07: Fixed typo in vertical symmetry axis code. (LH)

2005/05/21: Moved default for 
$\TypesetIntegerExpression{\int{capspacing}}$ to \texttt{lubuild.mtx}, 
which is where it is used. (LH)

\end{document}