cont-log.mkiv /size: 9182 b    last modification: 2023-12-21 09:44
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\unprotect
21
22\unexpanded\def\TeX
23  {\dontleavehmode
24   \begingroup
25   T%
26   \setbox\scratchbox\hbox{M}%
27   \kern-.1667\wd\scratchbox
28   \lower.5\exheight\hbox{E}%
29   \kern-.125\wd\scratchbox
30   X%
31   \endgroup}
32
33\unexpanded\def\TeXsuffix{\wordboundary\TeX}
34\unexpanded\def\TeXprefix{\TeX\wordboundary}
35
36\unexpanded\def\ConTeXt
37  {\dontleavehmode
38   \begingroup
39   Con%
40   \wordboundary
41   \setbox\scratchboxone\hbox{T\kern\zeropoint e}%
42   \setbox\scratchboxtwo\hbox{Te}%
43   \discretionary{-}{}{\kern\dimexpr\wd\scratchboxtwo-\wd\scratchboxone\relax}%
44   \TeX t%
45   \endgroup}
46
47\unexpanded\def\PPCHTeX{ppch\TeX}
48\unexpanded\def\PRAGMA {Pragma ADE}
49
50\unexpanded\def\LaTeX % requested by erik frambach
51  {\dontleavehmode
52   \begingroup
53   \setbox\scratchbox\hbox{L}%
54   \scratchdimen\ht\scratchbox
55   \setbox\scratchbox\hbox{\doresetattribute{case}\txx A}%
56   L\kern-.55\wd\scratchbox
57   \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}%
58   \kern-.2\wd\scratchbox\TeX
59   \endgroup}
60
61\unexpanded\def\TaBlE
62  {T%
63   \kern-.27\emwidth\lower.5\exheight\hbox{A}%
64   \kern-.18\emwidth B%
65   \kern-.1\emwidth\lower.5\exheight\hbox{L}%
66   \kern-.075\emwidth E}
67
68\unexpanded\def\PiCTeX
69  {P%
70   \kern-.12\emwidth\lower.5\exheight\hbox{I}%
71   \kern-.075\emwidth C%
72   \kern-.11\emwidth\TeX}
73
74\def\syst_logos_ams_script#1%
75  {\normalstartimath
76   \cal\ifdim\bodyfontsize>1.1\emwidth\scriptstyle\fi#1%
77   \normalstopimath}
78
79\unexpanded\def\AmSTeX
80  {\dontleavehmode
81   \syst_logos_ams_script A%
82   \kern-.1667\emwidth\lower.5\exheight\hbox{\syst_logos_ams_script M}%
83   \kern-.125\emwidth\syst_logos_ams_script S%
84   -\TeX}
85
86\unexpanded\def\LamSTeX
87  {L%
88   \kern-.4\emwidth\raise.3\exheight\hbox{\syst_logos_ams_script A}%
89   \kern-.25\emwidth\lower.4\exheight\hbox{\syst_logos_ams_script M}%
90   \kern-.1\emwidth{\syst_logos_ams_script S}%
91   -\TeX}
92
93% \unexpanded\def\AmSLaTeX
94%   {\dontleavehmode
95%    \syst_logos_ams_script A%
96%    \kern-.1667\emwidth\lower.5\exheight\hbox{\syst_logos_ams_script M}%
97%    \kern-.125\emwidth{\syst_logos_ams_script S}%
98%    -\LaTeX}
99
100%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version:
101%D
102%D \def\Context
103%D   {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern
104%D    -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}}
105%D
106%D I changed this into one that adapts itself:
107
108\unexpanded\def\Context % wrong usage of \getscaledglyph
109  {\dontleavehmode
110   \begingroup
111   C%
112   \kern -.0667\emwidth
113   \getscaledglyph{.8}\empty{%
114     O\kern-.0667\emwidth
115     N%
116     \discretionary{-}{}{\kern-.0549\emwidth}%
117     T%
118     \doifelseitalic
119       {\kern-.1\emwidth}%
120       {\kern-.1667\emwidth}%
121     \lower.5\exheight\hbox{E}%
122     \doifelseitalic
123       \empty
124       {\kern-.11em}%
125     X%
126     \kern-.055\emwidth
127     T%
128   }%
129   \endgroup}
130
131%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the current fontsize, an
132%D ugly but usefull hack.
133
134\let\logofont\nullfont
135
136% \loadmapfile[original-base.map] % stil needed? not if we assume afm
137
138\unexpanded\def\setMFPfont% more sensitive for low level changes
139  {\font\logofont=logo%
140     \ifx\fontalternative\s!bf\s!bf\else
141     \ifx\fontalternative\s!it\s!sl\else
142     \ifx\fontalternative\s!sl\s!sl\else
143     \ifx\fontalternative\s!bi\s!bf\else
144     \ifx\fontalternative\s!bs\s!bf\else
145     \fi\fi\fi\fi\fi
146     10 at \currentfontscale\bodyfontsize % there is no afm in the minimals yet
147   \logofont}
148
149\def\syst_logos_meta_hyphen % there is no hyphenchar in this font
150  {\discretionary{\vrule\s!height.33\emwidth\s!depth-.27\emwidth\s!width.33\emwidth}{}{}}
151
152\unexpanded\def\MetaFontLogo
153  {\dontleavehmode
154   \begingroup
155   \setMFPfont META\syst_logos_meta_hyphen FONT%
156   \endgroup}
157
158\unexpanded\def\MetaPostLogo
159  {\dontleavehmode
160   \begingroup
161   \setMFPfont META\syst_logos_meta_hyphen POST%
162   \endgroup}
163
164% \protected\def\MetaFunLogo
165%   {\dontleavehmode
166%    \begingroup
167%    \setMFPfont META\syst_logos_meta_hyphen FUN%
168%    \endgroup}
169
170% As decided on the ConText Meeting 2013 the logo has been simplified:
171
172\unexpanded\def\MetaFont{MetaFont}
173\unexpanded\def\MetaPost{MetaPost}
174\unexpanded\def\MetaFun {MetaFun}
175
176%D \macros
177%D  {TEX, METAFONT, METAPOST, METAFUN,
178%D   PICTEX, TABLE,
179%D   CONTEXT, PPCHTEX,
180%D   AMSTEX, LATEX, LAMSTEX}
181%D
182%D We define the funny written ones as well as the less error prone upper case names
183%D (in \CONTEXT\ we tend to write all user defined commands, like abbreviations, in
184%D uppercase.)
185
186\unexpanded\def\METAFONT {\MetaFont}
187\unexpanded\def\METAPOST {\MetaPost}
188\unexpanded\def\PPCHTEX  {\PPCHTeX}
189\unexpanded\def\CONTEXT  {\ConTeXt}
190\unexpanded\def\METAFUN  {\MetaFun}
191
192\unexpanded\def\TEX      {\TeX}
193\unexpanded\def\LATEX    {\LaTeX}
194\unexpanded\def\PICTEX   {\PiCTeX}
195\unexpanded\def\TABLE    {\TaBlE}
196\unexpanded\def\AMSTEX   {\AmSTeX}
197\unexpanded\def\LAMSTEX  {\LamSTeX}
198\unexpanded\def\INRSTEX  {inrs\TeX}
199
200%D And this is how they show up: \TeX, \MetaFont, \MetaPost, \PiCTeX, \TaBlE, \ConTeXt,
201%D \PPCHTeX, \AmSTeX, \LaTeX, \LamSTeX.
202
203%D Some placeholders:
204
205\unexpanded\def\eTeX      {\mathematics{\varepsilon}-\TeX}
206\unexpanded\def\pdfTeX    {pdf\wordboundary\TeX}
207\unexpanded\def\pdfeTeX   {pdfe-\wordboundary\TeX}
208\unexpanded\def\luaTeX    {lua\wordboundary\TeX}
209\unexpanded\def\Lua       {Lua}
210\unexpanded\def\LUA       {\Lua}
211\unexpanded\def\luajitTeX {lua\wordboundary jit\wordboundary\TeX}
212\unexpanded\def\luametaTeX{lua\wordboundary meta\wordboundary\TeX}
213%unexpanded\def\XeTeX     {X\lower.5\exheight\hbox{\kern-.15\emwidth\mirror{E}}\kern-.1667\emwidth\TeX}
214
215% Adapted from a patch by Mojca:
216
217\def\syst_logos_xetex_e
218  {\setbox\scratchbox\hbox{E}%
219   \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
220
221\unexpanded\def\XeTeX
222  {X\lower.5\exheight
223   \hbox
224     {\kern-.15\emwidth
225      \iffontchar\font"018E\relax
226        \char"018E%
227      \else
228        \ifx\fontalternative\s!bf         \mirror{E}\else
229        \ifx\fontalternative\s!it\syst_logos_xetex_e\else
230        \ifx\fontalternative\s!sl\syst_logos_xetex_e\else
231        \ifx\fontalternative\s!bi\syst_logos_xetex_e\else
232        \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
233                                          \mirror{E}\fi\fi\fi\fi\fi
234      \fi}%
235   \kern-.1667\emwidth\TeX}
236
237\let\ETEX      \eTeX
238\let\PDFTEX    \pdfTeX
239\let\PDFETEX   \pdfeTeX
240\let\LUATEX    \luaTeX
241\let\LUAJITTEX \luajitTeX
242\let\LuaTeX    \luaTeX
243\let\LuaMetaTeX\luametaTeX
244\let\LUAMETATEX\luametaTeX
245\let\XETEX     \XeTeX
246
247\unexpanded\def\LuaTeX
248  {\dontleavehmode
249   \begingroup
250     Lua%
251     % hope for kerning, try aT
252     \setbox0\hbox{aT}%
253     \setbox2\hbox{a\kern\zeropoint T}%
254     \ifdim\wd0=\wd2 % kerns can go two ways
255       % no aT kerning, try oT as a is not symmetrical
256       \setbox0\hbox{oT}%
257       \setbox2\hbox{o\kern\zeropoint T}%
258       \ifdim\wd0=\wd2 % kerns can go two ways
259         % no aT and oT kerning, try To
260         \setbox0\hbox{To}%
261         \setbox2\hbox{T\kern\zeropoint o}%
262         % maybe we need to compensate for the angle (sl/it/bs/bi)
263       \fi
264       \ifdim\wd0=\wd2\else
265         \kern\dimexpr\wd0-\wd2\relax
266       \fi
267     \fi
268     \TeX
269   \endgroup}
270
271\unexpanded\def\LuajitTeX
272  {\dontleavehmode
273   \begingroup
274     % at this moment there is no real need for kerning tT
275     Luajit\kern\zeropoint\TeX
276   \endgroup}
277
278\let\luaTeX   \LuaTeX
279\let\luajitTeX\LuajitTeX
280\let\LUATEX   \LuaTeX
281\let\LUAJITTEX\LuajitTeX
282
283\unexpanded\def\MKII{MkII} % MarkTwo
284\unexpanded\def\MKIV{MkIV} % MarkFour   : MKIV
285\unexpanded\def\MKVI{MkVI} % MarkSix    : MKIV
286\unexpanded\def\MKXL{MkXL} % MarkFourty : LMTX
287\unexpanded\def\MKLX{MkLX} % MarkSixty  : LMTX
288\unexpanded\def\MKIX{MkIX} %            : MKIV / LMTX
289\unexpanded\def\MKXI{MkXI} %            : MKIV / LMTX
290
291\unexpanded\def\MPII{MpII} % MarkTwo
292\unexpanded\def\MPIV{MpIV} % MarkFour   : MetaFun
293\unexpanded\def\MPVI{MpVI} % MarkSix    : MetaFun
294\unexpanded\def\MPXL{MpXL} % MarkFourty : LuaMetaFun
295\unexpanded\def\MPLX{MpLX} % MarkSixty  : LuaMetaFun
296
297\unexpanded\def\LMTX{LMTX} % for LuaMetaTeX
298
299\appendtoks
300    \def\ConTeXt   {ConTeXt}%
301    \def\MetaPost  {MetaPost}%
302    \def\MetaFont  {MetaFont}%
303    \def\MetaFun   {MetaFun}%
304    \def\TeX       {TeX}%
305    \def\TeXsuffix {TeX}%
306    \def\TeXprefix {TeX}%
307    \def\LuaTeX    {LuaTeX}%
308    \def\LuajitTeX {LuajitTeX}%
309    \def\LuaMetaTeX{LuaMetaTeX}%
310   %\let\wordboundary\empty % primitive so we need to promote it to frozen (orjust preroll)
311\to \everysimplifycommands
312
313\protect \endinput
314