cont-log.mkxl /size: 11 Kb    last modification: 2024-01-16 09:02
1%D \module
2%D   [       file=cont-log,
3%D        version=1995.10.10,
4%D          title=\CONTEXT\ Miscellaneous Macros,
5%D       subtitle=\TEX\ Logos,
6%D         author=J. Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt TeX Logos}
15
16%D The system that is used to typeset this text is called \TEX, typeset with an
17%D lowered~E. From te beginning of \TEX, authors of macro packages adapted this
18%D raising and lowering style. In this module we define some of those logos.
19
20%D We define the uppercase logo commands as (unfrozen) instances because they can be
21%D redefined in the synonyms modules. We use old school definitions. Watch out: when
22%D a math font is used the \AMS\ logos can come out ugly but they are ugly anyway.
23
24\unprotect
25
26% \frozen\instance\protected\def\TeX
27%   {\dontleavehmode
28%    \begingroup
29%    T%
30%    \setbox\scratchbox\hbox{M}%
31%    \kern-.1667\wd\scratchbox
32%    \lower.5\exheight\hbox{E}%
33%    \kern-.125\wd\scratchbox
34%    X%
35%    \endgroup}
36
37\frozen\instance\protected\def\TeX
38  {\dontleavehmode
39   \begingroup
40   \scratchdimen\scaledfontcharwd\font`M%
41   T%
42   \kern-.1667\scratchdimen
43  %\lower.3183\scaledfontcharht\font`T\hbox{E}% .318316 but no exact match possible anyway
44   \lower.5\exheight\hbox{E}% but on the average this looks better
45   \kern-.125\scratchdimen
46   X%
47   \endgroup}
48
49\frozen\instance\protected\def\TeXsuffix{\wordboundary\TeX}
50\frozen\instance\protected\def\TeXprefix{\TeX\wordboundary}
51
52\def\syst_logos_context
53  {Con%
54   \wordboundary
55   \setbox\scratchboxone\hbox{T\kern\zeropoint e}%
56   \setbox\scratchboxtwo\hbox{Te}%
57   \discretionary{-}{}{\kern\dimexpr\wd\scratchboxtwo-\wd\scratchboxone\relax}%
58   \TeX t}
59
60\frozen\instance\protected\def\ConTeXt
61  {\dontleavehmode
62   \begingroup
63   \ifcase\getcharactercasingcategory % todo: also other logos
64     \syst_logos_context
65   \or % 1 uppercase
66     \syst_logos_context
67   \or % 2 lowercase
68     \resetcharactercasing
69     con\-text
70   \else
71     Con\-text
72   \fi
73   \endgroup}
74
75\frozen\instance\protected\def\PPCHTeX{ppch\TeX}
76
77\frozen\instance\protected\def\LaTeX % requested by erik frambach
78  {\dontleavehmode
79   \begingroup
80   \setbox\scratchbox\hbox{L}%
81   \scratchdimen\ht\scratchbox
82   \setbox\scratchbox\hbox{\doresetattribute{case}\txx A}%
83   L\kern-.55\wd\scratchbox
84   \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}%
85   \kern-.2\wd\scratchbox\TeX
86   \endgroup}
87
88\frozen\instance\protected\def\TaBlE
89  {T%
90   \kern-.27\emwidth\lower.5\exheight\hbox{A}%
91   \kern-.18\emwidth B%
92   \kern-.1\emwidth\lower.5\exheight\hbox{L}%
93   \kern-.075\emwidth E}
94
95\frozen\instance\protected\def\PiCTeX
96  {P%
97   \kern-.12\emwidth\lower.5\exheight\hbox{I}%
98   \kern-.075\emwidth C%
99   \kern-.11\emwidth\TeX}
100
101\def\syst_logos_ams_script#1%
102  {\normalstartimath
103   \cal\ifdim\bodyfontsize>1.1\emwidth\scriptstyle\fi#1%
104   \normalstopimath}
105
106\frozen\instance\protected\def\AmSTeX
107  {\dontleavehmode
108   \syst_logos_ams_script A%
109   \kern-.5\emwidth\lower.5\exheight\hbox{\syst_logos_ams_script M}% was .1667 for old math
110   \kern-.125\emwidth\syst_logos_ams_script S%
111   -\TeX}
112
113\frozen\instance\protected\def\LamSTeX
114  {L%
115   \kern-.4\emwidth\raise.4\exheight\hbox{\syst_logos_ams_script A}% was .4 .3 for old math
116   \kern-.5\emwidth\lower.3\exheight\hbox{\syst_logos_ams_script M}% was .25 for old math
117   \kern-.125\emwidth{\syst_logos_ams_script S}%
118   -\TeX}
119
120%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version:
121%D
122%D \def\Context
123%D   {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern
124%D    -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}}
125%D
126%D I changed this into one that adapts itself:
127
128\frozen\instance\protected\def\Context % wrong usage of \getscaledglyph
129  {\dontleavehmode
130   \begingroup
131   C%
132   \kern -.0667\emwidth
133   \getscaledglyph{.8}\empty{%
134     O\kern-.0667\emwidth
135     N%
136     \discretionary{-}{}{\kern-.0549\emwidth}%
137     T%
138     \doifelseitalic{\kern-.1\emwidth}{\kern-.1667\emwidth}%
139     \lower.5\exheight\hbox{E}%
140     \doifelseitalic\empty{\kern-.11em}%
141     X%
142     \kern-.055\emwidth
143     T%
144   }%
145   \endgroup}
146
147%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the current fontsize, an
148%D ugly but usefull hack.
149
150\mutable\let\logofont\nullfont
151
152% \loadmapfile[original-base.map] % stil needed? not if we assume afm
153
154\permanent\protected\def\setMFPfont% more sensitive for low level changes
155  {\font\logofont=logo%
156     \ifx\fontalternative\s!bf\s!bf\orelse
157     \ifx\fontalternative\s!it\s!sl\orelse
158     \ifx\fontalternative\s!sl\s!sl\orelse
159     \ifx\fontalternative\s!bi\s!bf\orelse
160     \ifx\fontalternative\s!bs\s!bf\fi
161     10 at \currentfontscale\bodyfontsize % there is no afm in the minimals yet
162   \logofont}
163
164\def\syst_logos_meta_hyphen % there is no hyphenchar in this font
165  {\discretionary{\vrule\s!height.33\emwidth\s!depth-.27\emwidth\s!width.33\emwidth}{}{}}
166
167\frozen\instance\protected\def\MetaFontLogo
168  {\dontleavehmode
169   \begingroup
170   \setMFPfont META\syst_logos_meta_hyphen FONT%
171   \endgroup}
172
173\protected\def\MetaPostLogo
174  {\dontleavehmode
175   \begingroup
176   \setMFPfont META\syst_logos_meta_hyphen POST%
177   \endgroup}
178
179% \protected\def\MetaFunLogo
180%   {\dontleavehmode
181%    \begingroup
182%    \setMFPfont META\syst_logos_meta_hyphen FUN%
183%    \endgroup}
184
185% As decided on the ConText Meeting 2013 the logo has been simplified:
186
187\instance\protected\def\MetaFont{MetaFont}
188\instance\protected\def\MetaPost{MetaPost}
189\instance\protected\def\MetaFun {MetaFun}
190
191%D \macros
192%D  {TEX, METAFONT, METAPOST, METAFUN,
193%D   PICTEX, TABLE,
194%D   CONTEXT, PPCHTEX,
195%D   AMSTEX, LATEX, LAMSTEX}
196%D
197%D We define the funny written ones as well as the less error prone upper case names
198%D (in \CONTEXT\ we tend to write all user defined commands, like abbreviations, in
199%D uppercase.)
200
201\instance\protected\def\METAFONT{\MetaFont}
202\instance\protected\def\METAPOST{\MetaPost}
203\instance\protected\def\PPCHTEX {\PPCHTeX}
204\instance\protected\def\CONTEXT {\ConTeXt}
205\instance\protected\def\METAFUN {\MetaFun}
206
207\instance\protected\def\TEX     {\TeX}
208\instance\protected\def\LATEX   {\LaTeX}
209\instance\protected\def\PICTEX  {\PiCTeX}
210\instance\protected\def\TABLE   {\TaBlE}
211\instance\protected\def\AMSTEX  {\AmSTeX}
212\instance\protected\def\LAMSTEX {\LamSTeX}
213\instance\protected\def\INRSTEX {inrs\TeX}
214
215\instance\protected\def\PRAGMA  {Pragma ADE}
216\instance\protected\def\LUA     {\Lua} % below
217
218%D And this is how they show up: \TeX, \MetaFont, \MetaPost, \PiCTeX, \TaBlE, \ConTeXt,
219%D \PPCHTeX, \AmSTeX, \LaTeX, \LamSTeX.
220
221%D Some placeholders:
222
223%frozen\instance\protected\def\eTeX      {\mathematics{\varepsilon}-\TeX}
224\frozen\instance\protected\def\eTeX      {{\tf \nocap $\varepsilon$}-\TeX} % compact mode hack for epsilon
225\frozen\instance\protected\def\pdfTeX    {pdf\wordboundary\TeX}
226\frozen\instance\protected\def\pdfeTeX   {pdfe-\wordboundary\TeX}
227\frozen\instance\protected\def\luaTeX    {lua\wordboundary\TeX}
228\frozen\instance\protected\def\Lua       {Lua}
229\frozen\instance\protected\def\luajitTeX {lua\wordboundary jit\wordboundary\TeX}
230\frozen\instance\protected\def\luametaTeX{lua\wordboundary meta\wordboundary\TeX}
231\frozen\instance\protected\def\XeTeX     {X\lower.5\exheight\hbox{\kern-.15\emwidth\mirror{E}}\kern-.1667\emwidth\TeX}
232
233
234% % Adapted from a patch by Mojca:
235%
236% \def\syst_logos_xetex_e
237%   {\setbox\scratchbox\hbox{E}%
238%    \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
239%
240% \frozen\instance\protected\def\XeTeX
241%   {X\lower.5\exheight
242%    \hbox
243%      {\kern-.15\emwidth
244%       \iffontchar\font"018E\relax
245%         \char"018E%
246%       \else
247%         \ifx\fontalternative\s!bf         \mirror{E}\orelse
248%         \ifx\fontalternative\s!it\syst_logos_xetex_e\orelse
249%         \ifx\fontalternative\s!sl\syst_logos_xetex_e\orelse
250%         \ifx\fontalternative\s!bi\syst_logos_xetex_e\orelse
251%         \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
252%                                           \mirror{E}\fi
253%       \fi}%
254%    \kern-.1667\emwidth\TeX}
255
256% This is good enough for th efew times that we need it:
257
258\def\syst_logos_xe
259  {X\lower.5\exheight
260   \hbox\bgroup
261     \kern-.15\emwidth
262     \iffontchar\font"018E\relax
263       \char"018E%
264     \else
265       \mirror{E}%
266     \fi
267   \egroup}
268
269\frozen\instance\protected\def\XeTeX  {\syst_logos_xe\kern-.1667\emwidth\TeX}
270\frozen\instance\protected\def\XeLaTeX{\syst_logos_xe\LaTeX}
271
272\instance\protected\def\ETEX      {\eTeX}
273\instance\protected\def\PDFTEX    {\pdfTeX}
274\instance\protected\def\PDFETEX   {\pdfeTeX}
275\instance\protected\def\LUATEX    {\luaTeX}
276\instance\protected\def\LUAJITTEX {\luajitTeX}
277\instance\protected\def\LuaTeX    {\luaTeX}
278\instance\protected\def\LuaMetaTeX{\luametaTeX}
279\instance\protected\def\LUAMETATEX{\luametaTeX}
280\instance\protected\def\XETEX     {\XeTeX}
281
282\frozen\instance\protected\def\LuaTeX
283  {\dontleavehmode
284   \begingroup
285     Lua%
286     % hope for kerning, try aT
287     \setbox0\hbox{aT}%
288     \setbox2\hbox{a\kern\zeropoint T}%
289     \ifdim\wd0=\wd2 % kerns can go two ways
290       % no aT kerning, try oT as a is not symmetrical
291       \setbox0\hbox{oT}%
292       \setbox2\hbox{o\kern\zeropoint T}%
293       \ifdim\wd0=\wd2 % kerns can go two ways
294         % no aT and oT kerning, try To
295         \setbox0\hbox{To}%
296         \setbox2\hbox{T\kern\zeropoint o}%
297         % maybe we need to compensate for the angle (sl/it/bs/bi)
298       \fi
299       \ifdim\wd0=\wd2\else
300         \kern\dimexpr\wd0-\wd2\relax
301       \fi
302     \fi
303     \TeX
304   \endgroup}
305
306\frozen\instance\protected\def\LuajitTeX
307  {\dontleavehmode
308   \begingroup
309     % at this moment there is no real need for kerning tT
310     Luajit\kern\zeropoint\TeX
311   \endgroup}
312
313\frozen\instance\let\luaTeX   \LuaTeX
314\frozen\instance\let\luajitTeX\LuajitTeX
315
316\instance\protected\def\LUATEX   {\LuaTeX}
317\instance\protected\def\LUAJITTEX{\LuajitTeX}
318
319\instance\protected\def\MKII{MkII} % MarkTwo
320\instance\protected\def\MKIV{MkIV} % MarkFour   : MKIV
321\instance\protected\def\MKVI{MkVI} % MarkSix    : MKIV
322\instance\protected\def\MKXL{MkXL} % MarkFourty : LMTX
323\instance\protected\def\MKLX{MkLX} % MarkSixty  : LMTX
324\instance\protected\def\MKIX{MkIX} %            : MKIV / LMTX
325\instance\protected\def\MKXI{MkXI} %            : MKIV / LMTX
326
327\instance\protected\def\MPII{MpII} % MarkTwo
328\instance\protected\def\MPIV{MpIV} % MarkFour   : MetaFun
329\instance\protected\def\MPVI{MpVI} % MarkSix    : MetaFun
330\instance\protected\def\MPXL{MpXL} % MarkFourty : LuaMetaFun
331\instance\protected\def\MPLX{MpLX} % MarkSixty  : LuaMetaFun
332
333\instance\protected\def\LMTX{LMTX} % for LuaMetaTeX
334
335\appendtoks
336    \enforced\instance\def\ConTeXt   {ConTeXt}%
337    \enforced\instance\def\MetaPost  {MetaPost}%
338    \enforced\instance\def\MetaFont  {MetaFont}%
339    \enforced\instance\def\MetaFun   {MetaFun}%
340    \enforced\instance\def\TeX       {TeX}%
341    \enforced\instance\let\TeXsuffix \TeX
342    \enforced\instance\let\TeXprefix \TeX
343    \enforced\instance\def\LuaTeX    {LuaTeX}%
344    \enforced\instance\def\LuajitTeX {LuajitTeX}%
345    \enforced\instance\def\LuaMetaTeX{LuaMetaTeX}%
346\to \everysimplifycommands
347
348\protect \endinput
349