diff options
Diffstat (limited to 'tex/context/base/core-fnt.tex')
-rw-r--r-- | tex/context/base/core-fnt.tex | 261 |
1 files changed, 132 insertions, 129 deletions
diff --git a/tex/context/base/core-fnt.tex b/tex/context/base/core-fnt.tex index c51f07103..1187774fe 100644 --- a/tex/context/base/core-fnt.tex +++ b/tex/context/base/core-fnt.tex @@ -8,8 +8,8 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. \writestatus{loading}{Context Core Macros / Font Support} @@ -29,7 +29,7 @@ \bgroup \catcode`\|=\@@active \gdef\compound#1{|#1|} \egroup %D Here we hook some code into the clean up mechanism needed -%D for verbatim data. +%D for verbatim data. \appendtoks \disablecompoundcharacters @@ -70,14 +70,14 @@ %D %D This at first sight unusual capitilization is completely %D legal. -%D +%D %D \showsetup{\y!kap} %D \showsetup{\y!Kap} %D \showsetup{\y!KAP} %D \showsetup{\y!Kaps} %D \showsetup{\y!nokap} %D -%D The difference between pseudo and real caps is demonstrated +%D The difference between pseudo and real caps is demonstrated %D below: %D %D \startbuffer @@ -86,11 +86,11 @@ %D \stopbuffer %D %D \typebuffer -%D +%D %D \haalbuffer %D -%D The \type {\bgroup} trickery below is needed because of -%D \type {\groupedcommand}. +%D The \type {\bgroup} trickery below is needed because of +%D \type {\groupedcommand}. \def\usepseudocaps% {\def\cap@@uppercase{\the\everyuppercase\uppercased}% @@ -130,31 +130,31 @@ \unexpanded\def\Kap#1% {\KAP{\\#1}} -\unexpanded\def\Kaps% - {\let\processword=\Kap +\unexpanded\def\Kaps + {\let\processword\Kap \processwords} %D Sure: \let\normalkap\kap -%D Some precautions for a \PLAIN\ \TEX\ definition. +%D Some precautions for a \PLAIN\ \TEX\ definition. \let\normalcap\cap -\def\cap% +\def\cap {\ifmmode \expandafter\normalcap \else \expandafter\kap \fi} -%D \macros +%D \macros %D {setupcapitals} %D %D By default we use pseudo small caps in titles. This can be %D set up with: -%D +%D %D \showsetup{setupcapitals} \def\setupcapitals% @@ -168,7 +168,7 @@ \let\kap\normalkap} {\definealternativestyle[\v!kapitaal][\normalkap][\uppercased]% \definealternativestyle[\v!smallcaps][\sc][\uppercased]% - \def\kap{\doconvertfont{\v!kapitaal}}}% + \def\kap{\doconvertfont{\v!kapitaal}}}% \doifelse{\@@kksc}{\v!ja} {\userealcaps} {\usepseudocaps}} @@ -176,16 +176,16 @@ \ifx\uppercased\undefined \let\uppercased\uppercase \fi \ifx\lowercased\undefined \let\lowercased\lowercase \fi -% pretty tricky stuff: +% pretty tricky stuff: % % \usemodule[abr-01] \TEX \METAPOST \PPCHTEX \LATEX % \usemodule[abr-02] \TEX \METAPOST \PPCHTEX \LATEX -\def\uppercased#1% - {{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap} +%def\uppercased#1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap} +%def\lowercased#1{{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap} -\def\lowercased#1% - {{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap} +\def\uppercased#1{{\forceunexpanded\xdef\@@expanded{\uppercase{#1}}}\@@expanded} +\def\lowercased#1{{\forceunexpanded\xdef\@@expanded{\lowercase{#1}}}\@@expanded} \setupcapitals [\c!titel=\v!ja, @@ -228,7 +228,7 @@ \unexpanded\def\Word#1% {\doWord#1} -\def\doprocesswords#1 #2\od% +\def\doprocesswords#1 #2\od {\ConvertToConstant\doifnot{#1}{} {\processword{#1} % \doprocesswords#2 \od}} @@ -238,19 +238,21 @@ \let\processword\relax -\unexpanded\def\Words% - {\let\processword=\Word +\unexpanded\def\Words + {\let\processword\Word \processwords} \unexpanded\def\WORD#1% {\bgroup \the\everyuppercase - \def\kap##1{##1}% - \def\WORD##1{##1}% + %\def\kap##1{##1}% + %\def\WORD##1{##1}% + \let\kap\firstofoneargument + \let\WORD\firstofoneargument \uppercase{#1}% No expansion here, otherwise \getvalue problems! -% \edef\next{#1}% -% \uppercase\expandafter{\next}% - \egroup} + %\edef\next{#1}% keep this to prevent roll back + %\uppercase\expandafter{\next}% keep this to prevent roll back + \egroup} \unexpanded\def\WORDS#1% {\WORD{#1}} @@ -276,9 +278,9 @@ %D %D \showsetup{\y!stretched} -\def\stretched% +\def\stretched#1% {\ifvmode\hbox to \hsize\else\ifinner\else\hbox\fi\fi - \processtokens\relax\hss\relax{\hss\hss}}% \normalspace} + \bgroup\processtokens\relax\hss\relax{\hss\hss}{#1}\egroup} %D \startbuffer %D \stretched{Unknown Box} @@ -286,13 +288,13 @@ %D \vbox to 2cm{\stretched{A Vertical Box}} %D \hbox to 3cm{\stretched{sp{\'e}c{\`\i}{\"a}l}} %D \stopbuffer -%D -%D \haalbuffer -%D +%D +%D \haalbuffer +%D %D The first line of this macros takes care of boxing. Normally %D one will use an \type{\hbox} specification. The last line -%D shows how special characters should be passed. -%D +%D shows how special characters should be passed. +%D %D \typebuffer %D \macros @@ -306,7 +308,7 @@ %D %D \typebuffer %D -%D this one uses fixed skips and kerns. +%D this one uses fixed skips and kerns. %D %D \startvoorbeeld %D \haalbuffer @@ -315,7 +317,7 @@ %D The default skip can be set with: % \def\stretchedspacefactor{4} -% \def\stretchedspaceamount{.25em} +% \def\stretchedspaceamount{.25em} % % \unexpanded\def\stretcheduppercase#1% % {\bgroup @@ -334,29 +336,31 @@ % \fi % \egroup} +%D Given the following settings, the space is 1em by default: + \def\stretchedspacefactor{4} -\def\stretchedspaceamount{.25em} +\def\stretchedspaceamount{.25em} \def\stretchedbreaktokens{.@/} -\unexpanded\def\stretchednormalcase% +\unexpanded\def\stretchednormalcase {\stretchedsomecase\firstofoneargument} -\unexpanded\def\stretcheduppercase +\unexpanded\def\stretcheduppercase {\stretchedsomecase{\the\everyuppercase\uppercase}} -\unexpanded\def\stretchedlowercase +\unexpanded\def\stretchedlowercase {\stretchedsomecase{\the\everylowercase\lowercase}} -\def\stretchedsomecase#1#2% +\def\stretchedsomecase#1#2% {\bgroup #1{\def\textstring{#2}}% \ifdim\stretchedspaceamount>\zeropoint \def\textkern##1% - {% beware: ##1 may not be \box\somebox -) + {% beware: ##1 may not be \box\somebox -) \determinemidwordbreak{##1}{\stretchedbreaktokens}% \kern\stretchedspaceamount##1\domidwordbreak}% - \def\textskip% - {\scratchdimen=\stretchedspaceamount + \def\textskip + {\scratchdimen\stretchedspaceamount \hskip\stretchedspacefactor\scratchdimen}% \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA \textskip\@EA{\textstring}% @@ -365,26 +369,26 @@ \fi \egroup} -%D An auxiliary macro, see for usage \type {\stretcheduppercase}. +%D An auxiliary macro, see for usage \type {\stretcheduppercase}. \let\domidwordbreak\relax \def\setmidwordbreaktoken#1% - {\sfcode`#1=5000\relax} + {\sfcode`#1=5000\relax} \def\determinemidwordbreak#1#2% {\edef\midwordbreaktokens{#2}% - \ifx\midwordbreaktokens\empty + \ifx\midwordbreaktokens\empty \global\let\domidwordbreak\relax - \else - \setbox\scratchbox=\hbox + \else + \setbox\scratchbox\hbox {\expandafter\handletokens\midwordbreaktokens\with\setmidwordbreaktoken a\space \!!dimena=\the\lastskip - #1\space\!!dimenb=\the\lastskip \relax % needed + #1\space\!!dimenb=\the\lastskip \relax % needed \ifdim\!!dimena=\!!dimenb - \global\let\domidwordbreak\relax + \globallet\domidwordbreak\relax \else - \global\let\domidwordbreak\allowbreak + \globallet\domidwordbreak\allowbreak \fi}% \fi} @@ -392,61 +396,61 @@ %D {underbar,underbars, %D overbar,overbars, %D overstrike,overstrikes, -%D setupunderbar} +%D setupunderbar} %D %D In the rare case that we need undelined words, for instance %D because all font alternatives are already in use, one can %D use \type{\underbar} and \type{\overstrike} and their plural -%D forms. -%D +%D forms. +%D %D \startbuffer %D \underbars{drawing \underbar{bars} under words is a typewriter leftover} -%D \overstrikes{striking words makes them \overstrike{unreadable} but +%D \overstrikes{striking words makes them \overstrike{unreadable} but %D sometimes even \overbar{top lines} come into view.} %D \stopbuffer -%D +%D %D \typebuffer -%D +%D %D \startvoorbeeld %D \startregels %D \haalbuffer %D \stopregels %D \stopvoorbeeld -%D -%D The next macros are derived from the \PLAIN\ \TEX\ one, but -%D also supports nesting. The \type{$} keeps us in horizontal -%D mode and at the same time applies grouping. +%D +%D The next macros are derived from the \PLAIN\ \TEX\ one, but +%D also supports nesting. The \type{$} keeps us in horizontal +%D mode and at the same time applies grouping. %D %D \showsetup{\y!underbar} %D \showsetup{\y!underbars} %D \showsetup{\y!overbar} %D \showsetup{\y!overbars} %D \showsetup{\y!overstrike} -%D \showsetup{\y!overstrikes} +%D \showsetup{\y!overstrikes} %D -%D Although underlining is ill advised, we permit some -%D alternatives, that can be set up by: +%D Although underlining is ill advised, we permit some +%D alternatives, that can be set up by: %D %D \showsetup{\y!setupunderbar} %D -%D The alternatives show up as +%D The alternatives show up as %D {\setupunderbar [variant=a]\underbar{alternative a}}, %D {\setupunderbar [variant=b]\underbar{alternative b}}, %D {\setupunderbar [variant=c]\underbar{alternative c}} -%D and +%D and %D {\setupunderbar [lijndikte=1pt]\underbar{1pt width}}, -%D {\setupunderbar [lijndikte=2pt]\underbar{2pt width}}, -%D or whatever. Because \type{\overstrike} uses the same -%D method, the settings also apply to that macro. +%D {\setupunderbar [lijndikte=2pt]\underbar{2pt width}}, +%D or whatever. Because \type{\overstrike} uses the same +%D method, the settings also apply to that macro. \newcounter\underbarlevel -\def\underbarmethoda#1#2#3% RULE +\def\underbarmethoda#1#2#3% RULE {\hbox to #1{\vrule\!!width#1\!!height#2\!!depth#3}} -\def\underbarmethodb#1#2#3% DASH +\def\underbarmethodb#1#2#3% DASH {\hbox to #1 - {\hskip-.25em + {\hskip-.25em \xleaders \hbox{\hskip.25em\vrule\!!width.25em\!!height#2\!!depth#3} \hfil}} @@ -454,19 +458,19 @@ \def\underbarmethodc#1#2#3% PERIOD {\hbox to #1 {\dimen4=#3 - \advance\dimen4 .2ex - \hskip-.25em + \advance\dimen4 .2ex + \hskip-.25em \xleaders \hbox{\hskip.25em\lower\dimen4\hbox{.}} \hfil}} -\def\dododounderbar#1#2#3% +\def\dododounderbar#1#2#3% {\startmathmode \setbox0\hbox{#3}% \setbox2\hbox{\color[\@@onlijnkleur]{\getvalue{underbarmethod\@@onvariant}{\wd0}{#1}{#2}}}% \wd0\zeropoint - \ht2\ht0 - \dp2\dp0 + \ht2\ht0 + \dp2\dp0 \box0\box2 \stopmathmode} @@ -475,7 +479,7 @@ \dimen0=\@@ononderoffset \dimen0=\underbarlevel\dimen0 \ifdone \else - %\advance\dimen0 -1pt + %\advance\dimen0 -1pt \advance\dimen0 -\strutht \fi \dimen2\dimen0 @@ -483,7 +487,7 @@ \dododounderbar{-\dimen0}{\dimen2}{#1}% \egroup} -\def\betweenunderbarwords% +\def\betweenunderbarwords {\bgroup \setbox0\hbox {\dodounderbar{\hskip\fontdimen2\font}}% @@ -492,7 +496,7 @@ \discretionary{}{}{\box0}% \egroup} -\def\betweenunderbarspaces% +\def\betweenunderbarspaces {\hskip\currentspaceskip} \unexpanded\def\dounderbar#1#2% @@ -500,25 +504,25 @@ \processisolatedwords{#2}\dodounderbar \egroup} -\unexpanded\def\underbar% +\unexpanded\def\underbar {\bgroup \increment\underbarlevel \donetrue \dounderbar\betweenunderbarwords} -\unexpanded\def\underbars% +\unexpanded\def\underbars {\bgroup \increment\underbarlevel \donetrue \dounderbar\betweenunderbarspaces} -\unexpanded\def\overbar% +\unexpanded\def\overbar {\bgroup \decrement\underbarlevel \donefalse \dounderbar\betweenunderbarwords} -\unexpanded\def\overbars% +\unexpanded\def\overbars {\bgroup \decrement\underbarlevel \donefalse @@ -532,9 +536,9 @@ \dododounderbar{\dimen2}{-\dimen0}{#1}% \egroup} -\def\betweenoverstrikewords% +\def\betweenoverstrikewords {\bgroup - \setbox0=\hbox + \setbox0\hbox {\dooverstrike{\hskip\fontdimen2\font}}% \nobreak \hskip\zeropoint\!!minus\fontdimen4\font @@ -552,48 +556,47 @@ \processisolatedwords{#1}\dooverstrike \egroup} -\def\setupunderbar% +\def\setupunderbar {\dodoubleargument\getparameters[\??on]} %D \macros %D {low, high, lohi} -%D +%D %D Although \TEX\ is pretty well aware of super- and -%D subscripts, its mechanism is mainly tuned for math mode. -%D The next few commands take care of script texts both modes. -%D +%D subscripts, its mechanism is mainly tuned for math mode. +%D The next few commands take care of script texts both modes. +%D %D \startbuffer %D The higher\high{one goes} the lower\low{one drops}, or\lohi{yes}{no}? %D \stopbuffer -%D +%D %D \typebuffer -%D +%D %D \haalbuffer %D -%D Note the different placement of \type {\lohi}, where we -%D need a bit more space. The implementation looks a bit -%D fuzzy, since some \type {\fontdimen}'s are involved to -%D determine the optimal placement. +%D Note the different placement of \type {\lohi}, where we +%D need a bit more space. The implementation looks a bit +%D fuzzy, since some \type {\fontdimen}'s are involved to +%D determine the optimal placement. -\def\dodohighlow% +\def\dodohighlow {\ifx\fontsize\empty \ifmmode \ifnum\fam<0 \tx \else \holamathfont \fi \else - \tx + \tx \fi \else - \tx + \tx \fi} \def\dohighlow#1#2#3#4#5% {\dontleavehmode \bgroup - \scratchdimen= - \ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi - \advance\scratchdimen by #4ex + \scratchdimen\ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi + \advance\scratchdimen #4ex \kern.1ex - \setbox\scratchbox=\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}% + \setbox\scratchbox\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}% \ht\scratchbox\strutheight \dp\scratchbox\strutdepth \box\scratchbox @@ -613,14 +616,14 @@ % \wd6=\zeropoint\box6\box4 % \fi}} -\unexpanded\def\lohi% +\unexpanded\def\lohi {\dosingleempty\dolohi} \def\dolohi[#1]#2#3% {\dontleavehmode \hbox - {\setbox4=\hbox{\dohighlow\lower{16}{.48}{.1}{#2}}% - \setbox6=\hbox{\dohighlow\raise{14}{.86}{.1}{#3}}% + {\setbox4\hbox{\dohighlow\lower{16}{.48}{.1}{#2}}% + \setbox6\hbox{\dohighlow\raise{14}{.86}{.1}{#3}}% \doif{#1}{\v!links} {\ifdim\wd4<\wd6 \setbox4\hbox to \wd6{\hss\box4}% @@ -636,38 +639,38 @@ %D You can provide an optional keyword \type {left}, in which %D case the super and subscripts will be aligned in a way that %D permits placement at the left of a word (which means that -%D it will be right aligned). -%D +%D it will be right aligned). +%D %D \startbuffer -%D \lohi{aha}{ah} test \lohi{aha}{ah} test -%D \lohi[links]{aha}{ah} test \lohi[links]{aha}{ah} test -%D \lohi{aha}{ah} test\lohi{aha}{ah} test -%D \lohi[links]{aha}{ah}test \lohi[links]{aha}{ah}test +%D \lohi{aha}{ah} test \lohi{aha}{ah} test +%D \lohi[links]{aha}{ah} test \lohi[links]{aha}{ah} test +%D \lohi{aha}{ah} test\lohi{aha}{ah} test +%D \lohi[links]{aha}{ah}test \lohi[links]{aha}{ah}test %D \stopbuffer -%D +%D %D \typebuffer -%D +%D %D \haalbuffer %D \macros %D {setupinitial,placeinitial,checkinitial} -%D +%D %D {\em To be documented.} %D %D \starttypen -%D \setupinitial[state=start] \placeinitial \input tufte -%D \stoptypen +%D \setupinitial[state=start] \placeinitial \input tufte +%D \stoptypen %D -%D and +%D and %D %D \starttypen %D \def\bpar{\ifvmode\checkinitial\fi} %D \def\epar{\ifhmode\par\fi\checkinitial} -%D \stoptypen +%D \stoptypen -% to do: more fine tuning +% to do: more fine tuning -\def\setupinitial% +\def\setupinitial {\dodoubleempty\getparameters[\??dc]} \definefontsynonym[Initial][Regular] % prefered initial identifier @@ -679,9 +682,9 @@ \c!n=3, \s!font=initial] -\def\placeinitial% - {\doifelse\@@dcplaats\v!marge{\chardef\DropMode1}{\chardef\DropMode0}% - \doif\@@dcstatus\v!start{\ifnum\@@dcn>0 \AutoDroppedCaps\fi}} +\def\placeinitial + {\doifelse\@@dcplaats\v!marge{\chardef\DropMode\plusone}{\chardef\DropMode\zerocount}% + \doif \@@dcstatus\v!start{\ifnum\@@dcn>0 \AutoDroppedCaps\fi}} \let\checkinitial\CheckDroppedCaps @@ -693,5 +696,5 @@ \c!onderoffset=1.5pt, \c!bovenoffset=2.5pt, \c!lijnkleur=] - -\protect \endinput + +\protect \endinput
\ No newline at end of file |