summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/fontinst/latinmtx/lsfake.mtx
blob: 9062e376a1c1709cd8166911b8a832fed24311c2 (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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
%%% ====================================================================
%%%  @TeX-font-metrics-file{
%%%     author          = "Lars Hellstr{\"o}m",
%%%     version         = "1.923",
%%%     date            = "2005-04-15",
%%%     time            = "12:13:38 +02:00",
%%%     filename        = "lsfake.mtx",
%%%     email           = "fontinst@tug.org",
%%%     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 fakes latin smallcaps.",
%%%     package         = "fontinst",
%%%     dependencies    = "fontinst.sty, fontdoc.sty, lubuild.mtx",
%%%  }
%%% ====================================================================

\relax

\documentclass[twocolumn]{article}

\usepackage{fontdoc}[2002/03/01]
\showbranches

\newcommand{\IEint}[1]{\ensuremath{\TypesetIntegerExpression{\int{#1}}}}

\title{Faking smallcaps}
\author{Lars Hellstr\"om}
\date{5 January 2003\\Version 1.923}

\begin{document}
\maketitle

\section{Introduction}

This file is used to fake small capitals (the \texttt{s} case) for a 
font by shrinking the full capitals (the \texttt{u} case) by a 
certain factor (\IEint{smallcapsscale}). This effectively changes the 
weight of the font so that it becomes lighter, but that effect is 
(for scaling factors near the default value) not too large, even 
though it is quite visible. 

Optimal distance between two letters generally grows slower than the 
dimensions of the letters themself. Conversely, to linearly shrink a 
line of text usually places the letters a bit too close. To counteract 
that, the \textbf{Small glyph} commands used below insert a bit of 
extra space (\IEint{smallcapsextraspace}) before and after the actual 
glyph.

Besides the letters, there is also manufactured a special set of 
diacritical marks (skrunk by the same factor as the letters), with 
names such as \texttt{Acutesmall}. These are meant to be used as 
accent characters in a font where the fake small capitals are used as 
small letters, so that clashes within a single character when \TeX's 
\verb|\accent| primitive is used can be less pronounced. 
\textsf{Fontinst} users should however be aware that this is not 
necessarily the right thing to do; some fonts might look better with 
the \texttt{acute} etc.\@ glyphs as \texttt{Acutesmall} and friends.


\metrics

\needsfontinstversion{1.910}
\usemtxpackage{lubuild}

\ProvidesMtxPackage{lsfake}


\begincomment
\section{Some commands and default values}

\endcomment



% A c&sc glyph is created by shrinking the cap glyph, and adding extra
% space.

\setcommand\cscglyph#1{
   \movert{\int{smallcapsextraspace}}
   \glyph{#1}{\int{smallcapsscale}}
   \movert{\int{smallcapsextraspace}}
}
\begincomment
A \textbf{Small glyph} is mainly the special case of a \textbf{Glyph} 
when the glyph is scaled 
$\TypesetIntegerExpression{\int{smallcapsscale}}$. This is used to 
fake smallcaps from full capitals. The exact meaning of 
``\textbf{Small glyph} `\#1'\,'' is
\begin{quotation}\cscglyph{\macroparameter{1}}\end{quotation}

\resetcommand\cscglyph#1{%
   \Bheading{Small glyph} `\TypesetStringExpression{#1}'%
}
\endcomment

\setcommand\fakecscglyph#1#2{
   \setglyph{#1small}
      \cscglyph{#2}
      \setleftrightkerning{#1small}{#2}{\int{smallcapskerning}}
   \endsetglyph
}
% If you supply a definition of \fakecscglyph which has #1medium
% instead of #1small, then you can use this file to fake medium
% capitals instead of small capitals.


\setint{smallcapsscale}{800}
\setint{smallcapskerning}{900}

\ifisint{monowidth}\then
   \setint{smallcapsextraspace}
      {\half{\scale{\width{x}}{\sub{1000}{\int{smallcapsscale}}}}}
\Else
   \setint{smallcapsextraspace}{25}
\Fi



\begincomment
\section{Unaccented letters}
\endcomment

\fakecscglyph{A}{A}
\fakecscglyph{AE}{AE}
\fakecscglyph{B}{B}
\fakecscglyph{C}{C}
\fakecscglyph{D}{D}
\fakecscglyph{Eth}{Eth}
\fakecscglyph{E}{E}
\fakecscglyph{F}{F}
\fakecscglyph{G}{G}
\fakecscglyph{H}{H}
\fakecscglyph{I}{I}
\fakecscglyph{J}{J}
\fakecscglyph{K}{K}
\fakecscglyph{Lslash}{Lslash}
\fakecscglyph{L}{L}
\fakecscglyph{M}{M}
\fakecscglyph{N}{N}
\fakecscglyph{Ng}{Ng}
\fakecscglyph{O}{O}
\fakecscglyph{OE}{OE}
\fakecscglyph{Oslash}{Oslash}
\fakecscglyph{P}{P}
\fakecscglyph{Q}{Q}
\fakecscglyph{R}{R}
\fakecscglyph{S}{S}
\fakecscglyph{T}{T}
\fakecscglyph{Thorn}{Thorn}
\fakecscglyph{U}{U}
\fakecscglyph{V}{V}
\fakecscglyph{W}{W}
\fakecscglyph{X}{X}
\fakecscglyph{Y}{Y}
\fakecscglyph{Z}{Z}

\setglyph{Dbarsmall}
   \glyph{Ethsmall}{1000}
   \setleftrightkerning{Dbarsmall}{Ethsmall}{1000}
\endsetglyph




\begincomment
\section{Accented letters}
\endcomment


\fakecscglyph{Aacute}{Aacute}
\fakecscglyph{Abreve}{Abreve}
\fakecscglyph{Acircumflex}{Acircumflex}
\fakecscglyph{Adieresis}{Adieresis}
\fakecscglyph{Agrave}{Agrave}
\fakecscglyph{Aogonek}{Aogonek}
\fakecscglyph{Aring}{Aring}
\fakecscglyph{Atilde}{Atilde}
\fakecscglyph{Cacute}{Cacute}
\fakecscglyph{Ccaron}{Ccaron}
\fakecscglyph{Ccedilla}{Ccedilla}
\fakecscglyph{Dcaron}{Dcaron}
\fakecscglyph{Eacute}{Eacute}
\fakecscglyph{Ecaron}{Ecaron}
\fakecscglyph{Ecircumflex}{Ecircumflex}
\fakecscglyph{Edieresis}{Edieresis}
\fakecscglyph{Egrave}{Egrave}
\fakecscglyph{Eogonek}{Eogonek}
\fakecscglyph{Gbreve}{Gbreve}
\fakecscglyph{Iacute}{Iacute}
\fakecscglyph{Icircumflex}{Icircumflex}
\fakecscglyph{Idieresis}{Idieresis}
\fakecscglyph{Idotaccent}{Idotaccent}
\fakecscglyph{Igrave}{Igrave}
\fakecscglyph{Lacute}{Lacute}
\fakecscglyph{Lcaron}{Lcaron}
\fakecscglyph{Nacute}{Nacute}
\fakecscglyph{Ncaron}{Ncaron}
\fakecscglyph{Ntilde}{Ntilde}
\fakecscglyph{Oacute}{Oacute}
\fakecscglyph{Ocircumflex}{Ocircumflex}
\fakecscglyph{Odieresis}{Odieresis}
\fakecscglyph{Ograve}{Ograve}
\fakecscglyph{Ohungarumlaut}{Ohungarumlaut}
\fakecscglyph{Otilde}{Otilde}
\fakecscglyph{Racute}{Racute}
\fakecscglyph{Rcaron}{Rcaron}
\fakecscglyph{Sacute}{Sacute}
\fakecscglyph{Scaron}{Scaron}
\fakecscglyph{Scedilla}{Scedilla}
\fakecscglyph{Tcaron}{Tcaron}
\fakecscglyph{Tcedilla}{Tcedilla}
\fakecscglyph{Uacute}{Uacute}
\fakecscglyph{Ucircumflex}{Ucircumflex}
\fakecscglyph{Udieresis}{Udieresis}
\fakecscglyph{Ugrave}{Ugrave}
\fakecscglyph{Uhungarumlaut}{Uhungarumlaut}
\fakecscglyph{Uring}{Uring}
\fakecscglyph{Yacute}{Yacute}
\fakecscglyph{Ydieresis}{Ydieresis}
\fakecscglyph{Zacute}{Zacute}
\fakecscglyph{Zcaron}{Zcaron}
\fakecscglyph{Zdotaccent}{Zdotaccent}


\begincomment
\section{Shrunk accents}
\endcomment

% 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\medskip
A \textbf{Shrunk accent} is a \textbf{Small glyph} whose vertical 
position has been adjusted so that the 
$\TypesetIntegerExpression{\int{xheight}}$ position of the original 
accent coincides with that of the shrunk accent. Without this 
adjustment, it would instead be the baselines that would coincide, 
but such an accent would be too low. The exact meaning of 
``\textbf{Shrunk accent} `\#1'\,'' is
\begin{quotation}\cscaccent{\macroparameter{1}}\end{quotation}

\resetcommand\cscaccent#1{%
   \Bheading{Shrunk accent} `\TypesetStringExpression{#1}'%
}
\endcomment


\setglyph{Acutesmall}
   \cscaccent{Acute}
\endsetglyph

\setglyph{Gravesmall}
   \cscaccent{Grave}
\endsetglyph

\setglyph{Circumflexsmall}
   \cscaccent{Circumflex}
\endsetglyph

\setglyph{Tildesmall}
   \cscaccent{Tilde}
\endsetglyph

\setglyph{Dieresissmall}
   \cscaccent{Dieresis}
\endsetglyph

\setglyph{Brevesmall}
   \cscaccent{Breve}
\endsetglyph

\setglyph{Dotaccentsmall}
   \cscaccent{Dotaccent}
\endsetglyph

\setglyph{Caronsmall}
   \cscaccent{Caron}
\endsetglyph

\setglyph{Hungarumlautsmall}
   \cscaccent{Hungarumlaut}
\endsetglyph

\setglyph{Ringsmall}
   \cscaccent{Ring}
\endsetglyph

\setglyph{Macronsmall}
   \cscaccent{Macron}
\endsetglyph

\setglyph{Cedillasmall}
   \cscglyph{Cedilla}
\endsetglyph

\setglyph{Ogoneksmall}
   \cscglyph{Ogonek}
\endsetglyph



\endmetrics

\section{Notes}

An important, but rather obscure, difference between what is done by 
this file and what is done by the old \texttt{latin.mtx} concerns the 
manner in which the letters are spaced. In this file, spacing of 
smallcaps is consistently done using the \IEint{smallcapsextraspace} 
parameter, but \texttt{latin.mtx} only uses this mechanism in 
monowidth fonts. For proportional fonts, the default was instead to 
use the \IEint{letterspacing} parameter to space the entire 
font---the same amount for non-faked as for faked letters.


\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: File split off from \texttt{latin.mtx}.

2003/01/02--05: File heavily reorganised. (LH)

2005/04/15: Removed section on \emph{Miscellaneous glyphs}, since 
that should be handled by \texttt{lsmisc.mtx}, and moreover prevented 
the code there from working correctly. (LH) Thanks to Michael Zedler 
for drawing my attention to this error.


\end{document}

% 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.
%