diff options
author | Hans Hagen <pragma@wxs.nl> | 2001-04-30 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2001-04-30 00:00:00 +0200 |
commit | 661f9f4a789474b20056f6bd4855c66d9791b301 (patch) | |
tree | 72af7bff285d69032c64b5c4d62667aa34b983f9 | |
parent | c710c4ab57f84965c89205af58bc4fe204dfb79c (diff) | |
download | context-661f9f4a789474b20056f6bd4855c66d9791b301.tar.gz |
stable 2001.04.30
33 files changed, 1312 insertions, 458 deletions
diff --git a/context/perltk/mptopdf.pl b/context/perltk/mptopdf.pl index 5e9e5b093..0f33fad66 100644 --- a/context/perltk/mptopdf.pl +++ b/context/perltk/mptopdf.pl @@ -17,11 +17,15 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ # use File::Copy ; # not in every perl -$program = "MPtoPDF 1.0" ; +use Config ; + +$program = "MPtoPDF 1.1" ; $pattern = $ARGV[0] ; $done = 0 ; $report = '' ; +my $dosish = ($Config{'osname'} =~ /dos|win/i) ; + sub CopyFile # agressive copy, works for open files like in gs { my ($From,$To) = @_ ; return unless open(INP,"<$From") ; binmode INP ; @@ -51,12 +55,15 @@ else foreach $file (@files) { $_ = $file ; if (s/\.(\d+)$// && -e $file) - { system ("pdftex \&mptopdf \\relax $file") ; - rename ("$_.pdf", "$_-$1.pdf") ; - if (-e "$_.pdf") { CopyFile ("$_.pdf", "$_-$1.pdf") } - if ($done) { $report .= " +" } - $report .= " $_-$1.pdf" ; - ++$done } } + { if ($dosish) + { system ("pdftex -progname=pdftex -fmt=mptopdf \\relax $file") } + else + { system ("pdftex -progname=pdftex -fmt=mptopdf \\\\relax $file") } + rename ("$_.pdf", "$_-$1.pdf") ; + if (-e "$_.pdf") { CopyFile ("$_.pdf", "$_-$1.pdf") } + if ($done) { $report .= " +" } + $report .= " $_-$1.pdf" ; + ++$done } } if ($done) { print "\n$program: $pattern is converted to$report\n" } diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex index 989c79846..8f608fb67 100644 --- a/tex/context/base/cont-log.tex +++ b/tex/context/base/cont-log.tex @@ -50,10 +50,18 @@ \def\PRAGMA% {Pragma ADE} -\def\LaTeX% - {L% - \kern-.30em\raise.3ex\hbox{\txx A}% - \kern-.18em\TeX} +%\def\LaTeX% +% {L% +% \kern-.30em\raise.3ex\hbox{\txx A}% +% \kern-.18em\TeX} + +\def\LaTeX% requested by erik frambach + {{\setbox\scratchbox\hbox{L}% + \scratchdimen=\ht\scratchbox + \setbox\scratchbox\hbox{\txx A}% + L\kern-.55\wd\scratchbox + \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}% + \kern-.2\wd\scratchbox\TeX}} \def\TaBlE% {T% diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index c04c6ce80..41ece979b 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -13,7 +13,7 @@ \catcode`\{=1 \catcode`\}=2 -\def\contextversion{2001.4.23} +\def\contextversion{2001.4.30} %D Welcome to the main module. When this module is ran through %D \type{initex} or \type{tex -i} or \type{whatevertex} using @@ -113,7 +113,8 @@ %D load additional definition modules when needed. \input enco-ini.tex -\input regi-ini.tex % new +\input hand-ini.tex +\input regi-ini.tex \input lang-ini.tex \input colo-ini.tex @@ -218,7 +219,7 @@ \input type-ini.tex -\input math-ini.tex +\input math-ini.tex % after enco-ini.tex %D Now we're ready for more core modules. diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex index ada4d147b..bf4f0ac49 100644 --- a/tex/context/base/core-lst.tex +++ b/tex/context/base/core-lst.tex @@ -445,7 +445,8 @@ {\doassign[\??li#1][\c!interactie=\v!alles]}% \makelijstelement\v!alles {\hbox to \hsize - {\!!widthb=\hsize + {\dostartattributes{\??li#1}\c!letter\c!kleur{}% new + \!!widthb=\hsize \setbox2=\hbox \ifdim\!!widtha>\!!zeropoint to \!!widtha \fi {\makelijstelement\v!sectienummer {\dolistattributes{#1}\c!nummerletter\c!nummerkleur @@ -498,7 +499,8 @@ \box4\relax \relax \fi}% - \hss}}% + \hss + \dostopattributes}}% new \nointerlineskip % anders verkeerde spatiering bij multi-line \endgraf \allowbreak diff --git a/tex/context/base/core-pag.tex b/tex/context/base/core-pag.tex index 8a175b972..e6371100d 100644 --- a/tex/context/base/core-pag.tex +++ b/tex/context/base/core-pag.tex @@ -496,10 +496,20 @@ {\doifelse{#2}{\v!oneven} {\dorecurse{\@@ipn} {\ifodd\recurselevel\relax\dofilterpage{#1}{\recurselevel}\fi}} - {\def\docommando##1{\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}% + {\def\dodocommando##1% + {\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}% + \def\docommando##1% + {\dowithrange{##1}\dodocommando}% \processcommalist[#2]\docommando}}% \egroup} +\def\dowithrange#1#2% #2 takes number + {\beforesplitstring#1\at :\to\fromrange + \aftersplitstring #1\at :\to\torange + \ifx\torange\empty\let\torange\fromrange\fi + \dostepwiserecurse{\fromrange}{\torange}{1} + {#2{\recurselevel}}} + \def\dofilterpage#1#2% {\hbox to \tekstbreedte {\ifdubbelzijdig\ifdim\@@ipbreedte>\!!zeropoint\relax\ifodd\realpageno\else diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex index fa40f6888..7f8ea7b10 100644 --- a/tex/context/base/core-pos.tex +++ b/tex/context/base/core-pos.tex @@ -795,6 +795,23 @@ fi ; \newcounter\currentmarginpos +% \def\dopositionmarginbox#1% +% {\bgroup +% \ifrepositionmarginbox +% \doglobal\increment\currentmarginpos +% \setposition{\s!margin:\currentmarginpos}% +% \scratchdimen=\MPy{\s!margin:\currentmarginpos}% +% \doglobal\increment\currentmarginpos +% \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}% +% \advance\scratchdimen by -\dp\strutbox +% \setbox#1=\hbox +% {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}% +% \dp#1=\!!zeropoint +% \ht#1=\!!zeropoint +% \fi +% \vadjust{\box#1}% +% \egroup} + \def\dopositionmarginbox#1% {\bgroup \ifrepositionmarginbox @@ -804,6 +821,12 @@ fi ; \doglobal\increment\currentmarginpos \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}% \advance\scratchdimen by -\dp\strutbox + % new + \setbox#1=\hbox + {\hskip-\MPx{\s!margin:\currentmarginpos}% + \hskip\MPx{head:\realfolio}% + \box#1}% + % so far \setbox#1=\hbox {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}% \dp#1=\!!zeropoint diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex index 44531a39a..1d6d19d6d 100644 --- a/tex/context/base/core-rul.tex +++ b/tex/context/base/core-rul.tex @@ -2221,6 +2221,8 @@ \ht\scratchbox=\ht\strutbox \dp\scratchbox=\dp\strutbox \noindent\box\scratchbox +%\nobreak\vbox{\strut}\kern-\lineheight +% evt \witruimte \egroup} \def\dotoptextrule#1% @@ -2280,7 +2282,7 @@ \def\dounknowntextrule{\domiddletextrule} \dotoptextrule{#1} \bgroup - \switchtobodyfont[\@@tlkorps]} + \doifsomething{\@@tlkorps}{\switchtobodyfont[\@@tlkorps]}} \def\stoptextrule% {\par diff --git a/tex/context/base/enco-ans.tex b/tex/context/base/enco-ans.tex index 4e8063f63..38f07f130 100644 --- a/tex/context/base/enco-ans.tex +++ b/tex/context/base/enco-ans.tex @@ -58,9 +58,19 @@ \definecharacter dotlessi 105 +\definecharacter Lstroke 128 + +\definecharacter Scaron 138 + \definecharacter OEligature 140 +\definecharacter Zcaron 141 + +\definecharacter lstroke 144 + +\definecharacter scaron 154 \definecharacter oeligature 156 +\definecharacter zcaron 157 \definecharacter Ydiaeresis 159 @@ -94,7 +104,7 @@ \definecharacter Ucircumflex 219 \definecharacter Udiaeresis 220 \definecharacter Yacute 221 - +\definecharacter Thorn 222 \definecharacter ssharp 223 \definecharacter agrave 224 \definecharacter aacute 225 @@ -126,11 +136,13 @@ \definecharacter ucircumflex 251 \definecharacter udiaeresis 252 \definecharacter yacute 253 - +\definecharacter thorn 254 \definecharacter ydiaeresis 255 \stopencoding +% will be replaced by math collection, fails anyway + \startencoding[texnansi] \definecharacter mathgrave "7060 diff --git a/tex/context/base/enco-def.tex b/tex/context/base/enco-def.tex index 37f108b60..6a0c0789a 100644 --- a/tex/context/base/enco-def.tex +++ b/tex/context/base/enco-def.tex @@ -259,10 +259,10 @@ \definecharacter Lslash {\Lstroke} \definecharacter lslash {\lstroke} -\definecharacter Dslash {\Lstroke} -\definecharacter dslash {\lstroke} -\definecharacter Oslash {\Lstroke} -\definecharacter oslash {\lstroke} +\definecharacter Dslash {\Dstroke} +\definecharacter dslash {\dstroke} +\definecharacter Oslash {\Ostroke} +\definecharacter oslash {\ostroke} \definecharacter Eszett {\Ssharp} \definecharacter eszett {\ssharp} @@ -272,6 +272,18 @@ \stopencoding +%D Also handy: + +\startencoding[default] + +\definecharacter leftupperninequote 92 +\definecharacter rightupperninequote 34 +\definecharacter endash 123 +\definecharacter emdash 124 +\definecharacter hyphen 45 + +\stopencoding + %D We also use symbolic names for math accents. \startencoding[default] diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex index af9bfc7c6..065cbfe11 100644 --- a/tex/context/base/enco-ec.tex +++ b/tex/context/base/enco-ec.tex @@ -154,7 +154,7 @@ \definecharacter Ucircumflex 219 \definecharacter Udiaeresis 220 \definecharacter Yacute 221 -%definecharacter THorn 222 +\definecharacter Thorn 222 \definecharacter Ssharp 223 \definecharacter agrave 224 \definecharacter aacute 225 diff --git a/tex/context/base/enco-il2.tex b/tex/context/base/enco-il2.tex index 5b447bf8c..dd94b7401 100644 --- a/tex/context/base/enco-il2.tex +++ b/tex/context/base/enco-il2.tex @@ -55,7 +55,7 @@ \definecharacter textcedilla 24 \definecharacter textcircumflex 94 \definecharacter textdotaccent 95 -\definecharacter texthunagrumlaut 125 +\definecharacter texthungarumlaut 125 \definecharacter texttilde 126 \definecharacter textdiaeresis 127 diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex index a65fa843b..ce1b17572 100644 --- a/tex/context/base/enco-ini.tex +++ b/tex/context/base/enco-ini.tex @@ -896,18 +896,40 @@ %D command to redefine accent handling commands too. \def\redefinecommand#1 % - {%{\def\!!stringa{\nocharacterencoding#1}% - % \doifundefined{\!!stringa} - % {\doifundefined{#1}{\letvalue{#1}\relax}% - % \@EA\letvalue\@EA\!!stringa\csname#1\endcsname}% - % no \unexpanded, else pdfdoc fails + {% no \unexpanded, else pdfdoc fails \setvalue{\string#1}{\dohandlecommand{#1}}}% -\unexpanded\def\dohandlecommand#1% - {\doifdefinedelse{\characterencoding#1} - {\def\next{\getvalue{\characterencoding#1}}} - {\def\next{\getvalue{\nocharacterencoding#1}}}% - \next} +% \unexpanded\def\dohandlecommand#1% +% {\doifdefinedelse{\characterencoding#1} +% {\def\next{\getvalue{\characterencoding#1}}} +% {\def\next{\getvalue{\nocharacterencoding#1}}}% +% \next} + +\beginETEX \ifcsname + +\def\dohandlecommand#1% + {\csname + \ifcsname\characterencoding#1\endcsname + \characterencoding + \else + \nocharacterencoding + \fi + #1\endcsname} + +\endETEX + +\beginTEX + +\def\dohandlecommand#1% + {\csname + \expandafter\ifx\csname\characterencoding#1\endcsname\relax + \nocharacterencoding + \else + \characterencoding + \fi + #1\endcsname} + +\endTEX % %D \macros % %D {redefinecharacter} @@ -964,109 +986,7 @@ \fetchruntimecommand \showaccents {\f!encodingprefix\s!run} \fetchruntimecommand \showcharacters {\f!encodingprefix\s!run} \fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run} - -%D {\em The next section is experimental and implements font -%D specific features, like hanging punctuation.} - -\let\fonthandling\empty - -\def\startfonthandling[#1]% - {\def\fonthandling{#1}% - \doifundefined{\@fha@\fonthandling} - {\expanded{\newtoks\csname\@fha@\fonthandling\endcsname}}} - -\def\stopfonthandling% - {\let\fonthandling\empty} - -\def\setfonttoks% - {\@EA\let\@EA\fonttoks\csname\@fha@\fonthandling\endcsname} - -\def\definefonthandling% - {\dotripleempty\dodefinefonthandling} - -\def\dodefinefonthandling[#1][#2][#3]% - {\setvalue{\@fha@\@fha@#1}{#2}% - \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} - -\def\setupfonthandling% - {\dodoubleempty\dosetupfonthandling} - -\def\dosetupfonthandling[#1][#2]% - {\getparameters[\@fha@\@fha@#1][#2]} - -\def\doenablehandling#1% - {\doifdefined{\@fha@#1}{\@EA\the\csname\@fha@#1\endcsname}} - -\def\enablehandling[#1]% - {\doifdefinedelse{\@fha@\@fha@#1}% - {\setprotrudingfactor - {\getvalue{\@fha@\@fha@#1\c!links}} - {\getvalue{\@fha@\@fha@#1\c!rechts}}% - \edef\fonthandling{\getvalue{\@fha@\@fha@#1}}% - \@EA\rawprocesscommalist\@EA[\fonthandling]\doenablehandling} - {\edef\fonthandling{#1}% new - \doenablehandling{#1}}} - -\ifx\undefined\pdfprotrudechars % we don't use pdftex - - \def\defineprotrudefactor#1 #2 #3 {} - \def\setprotrudingfactor #1#2{} - \def\enableprotruding {} - \def\disableprotruding {} - -\else - - \newdimen\lproddimen - \newdimen\rproddimen - \let\prodfont\font - - \def\enableprotruding {\pdfprotrudechars=2 } - \def\disableprotruding{\pdfprotrudechars=0 } - - \appendtoks \disableprotruding \to \everyforgetall % Here or not here? - - \def\setprotrudingfactor#1#2% - {\lproddimen=#1pt\multiply\lproddimen\!!thousand\divide\lproddimen \!!maxcard\relax - \rproddimen=#2pt\multiply\rproddimen\!!thousand\divide\rproddimen \!!maxcard\relax} - - \setprotrudingfactor{1}{1} - - \def\dodefineprotrudefactor#1 #2 #3 % - {\scratchdimen=#2\lproddimen\lpcode\prodfont#1=\number\scratchdimen - \scratchdimen=#3\rproddimen\rpcode\prodfont#1=\number\scratchdimen} - - \def\dodefinefonthandling[#1][#2][#3]% - {\setvalue{\@fha@\@fha@#1}{#2}% - \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} - - \def\defineprotrudefactor#1 #2 #3 % - {\setfonttoks - \doifnumberelse{\string#1} - {\appendtoks\dodefineprotrudefactor #1 #2 #3 \to\fonttoks} % - {\appendtoks\dodefineprotrudefactor`#1 #2 #3 \to\fonttoks}}% - - \def\defineprotrudefactor#1 #2 #3 % - {\setfonttoks - \doifnumberelse{\string#1} - {\appendtoks\dodefineprotrudefactor #1 #2 #3 \to\fonttoks} - {\doifcharactercodeelse{#1} - {\@EA\appendtoks\@EA\dodefineprotrudefactor\charactercode #2 #3 \to\fonttoks} - {\appendtoks\dodefineprotrudefactor`#1 #2 #3 \to\fonttoks}}} - -\fi - -%D {\em Another experiment: named glyphs. Incomplete yet.} - -\def\definecharactercode#1 #2 % - {\setvalue{\characterencoding-#1}{#2}} - -\def\doifcharactercodeelse#1#2#3% - {\doifdefinedelse{\characterencoding-\string#1} - {\edef\charactercode{\getvalue{\characterencoding-#1}\space}#2} - {#3}} - -%D {\em So far for the experiment.} - + %D \macros %D {everyuppercase, EveryUppercase, %D everyuppercase, EveryUppercase} diff --git a/tex/context/base/enco-pro.tex b/tex/context/base/enco-pro.tex deleted file mode 100644 index b245554e3..000000000 --- a/tex/context/base/enco-pro.tex +++ /dev/null @@ -1,72 +0,0 @@ -%D \module -%D [ file=enco-pro, -%D version=2000.29.9, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Protruding Factors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is an experimental definition file. The protruding -%D values we use here are those found from \THANH's thesis. - -\unprotect - -\definecharactercode leftupperninequote 92 -\definecharactercode rightupperninequote 34 -\definecharactercode endash 123 -\definecharactercode emdash 124 - -\startfonthandling[defpunc] - - \defineprotrudefactor ! 0 .2 - \defineprotrudefactor ' 0 .7 - \defineprotrudefactor ` .7 0 - \defineprotrudefactor ( .05 0 - \defineprotrudefactor ) 0 .05 - \defineprotrudefactor , 0 .7 - \defineprotrudefactor - 0 .7 - \defineprotrudefactor . 0 .7 - \defineprotrudefactor : 0 .5 - \defineprotrudefactor ; 0 .5 - - \defineprotrudefactor rightupperninequote 0 .5 - \defineprotrudefactor leftupperninequote .5 0 - \defineprotrudefactor endash 0 .3 - \defineprotrudefactor emdash 0 .2 - -\stopfonthandling - -\startfonthandling[defalph] - - \defineprotrudefactor A .05 .05 - \defineprotrudefactor F 0 .05 - \defineprotrudefactor J .05 0 - \defineprotrudefactor K 0 .05 - \defineprotrudefactor L 0 .05 - \defineprotrudefactor T .05 .05 - \defineprotrudefactor V .05 .05 - \defineprotrudefactor W .05 .05 - \defineprotrudefactor X .05 .05 - \defineprotrudefactor Y .05 .05 - - \defineprotrudefactor k 0 .05 - \defineprotrudefactor r 0 .05 - \defineprotrudefactor t 0 .05 - \defineprotrudefactor v .05 .05 - \defineprotrudefactor w .05 .05 - \defineprotrudefactor x .05 .05 - \defineprotrudefactor y .05 .05 - -\stopfonthandling - -\definefonthandling [normal] [defpunc,defalph] -\definefonthandling [slanted] [defpunc] [\c!rechts=1.5] -\definefonthandling [bold] [defpunc,defalph] -\definefonthandling [boldslanted] [defpunc] [\c!links=1.5] - -\protect \endinput diff --git a/tex/context/base/enco-run.tex b/tex/context/base/enco-run.tex index 082d89050..c278b6870 100644 --- a/tex/context/base/enco-run.tex +++ b/tex/context/base/enco-run.tex @@ -1,8 +1,8 @@ %D \module -%D [ file=enco-inf, +%D [ file=enco-run, %D version=2000.27.12, % moved to runtime module %D title=\CONTEXT\ Encoding Macros, -%D subtitle=Ending Related Tracing, +%D subtitle=Runtime Macros, %D author=Hans Hagen, %D date=\currentdate, %D copyright=Hans Hagen \& Ton Otten] @@ -31,20 +31,23 @@ \gdef\showaccents% {\bgroup - \savefont - \setuptextrules[\c!letter=] + %\savefont + \setuptextrules[\c!korps=,\c!letter=] \starttextrule{\visualizecharacterslegend} - \restorefont\stelinterliniein + \witruimte + %\restorefont\stelinterliniein \visualizecharacters \def\do##1% {{\def\dodo####1% {\hss\hbox to 1em{\hss\expanded{##1####1\recurselevel}\hss}}% \hbox to \hsize - {\localcolortrue + {\strut + \localcolortrue \hbox to 2em{\tttf\string##1\hss}% \dorecurse{26}{\dodo\character}}% \hbox to \hsize - {\localcolortrue + {\strut + \localcolortrue \hskip2em \dorecurse{26}{\dodo\Character}}}% \par} @@ -56,9 +59,10 @@ \gdef\showcharacters% {\bgroup - \savefont - \setuptextrules[\c!letter=] + %\savefont + \setuptextrules[\c!korps=,\c!letter=] \starttextrule{\visualizecharacterslegend} + \witruimte \dontcomplain \forgetall \def\startencoding[##1]{} @@ -66,34 +70,34 @@ \dimen0=\!!zeropoint \dimen2=\!!zeropoint \def\definecharacter ##1 ##2 % - {\setbox0=\hbox{\getvalue{##1}}% + {\setbox0=\hbox spread 1em{\getvalue{##1}}% \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi \setbox2=\hbox spread 1em{\box0 ##1} \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}% \readsysfile{\f!encodingprefix def}{}{} - \advance\dimen0 by 1em \edef\encwidth{\the\dimen0} \dimen0=\hsize \advance\dimen0 2em \advance\dimen2 2em - \divide \dimen0 by \dimen2 + \divide \dimen0 by \dimen2 \advance\dimen0 1sp \edef\enccols{\number\dimen0} \visualizecharacters \startcolumns[\c!n=\enccols,\c!afstand=2em] - \restorefont\stelinterliniein + %\restorefont\stelinterliniein \def\definecharacter ##1 ##2 % - {\hbox{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}##1}\par} + {\hbox{\strut\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}##1}\par} \readsysfile{\f!encodingprefix def}{}{} \stopcolumns \stoptextrule \egroup} \gdef\showhyphenations#1% - {\hbox - {language: \currentlanguage/\the\normallanguage\quad - font: \fontname\font\quad - encoding: \currentencoding\quad - mapping: \currentencoding\quad - sample: \hyphenatedword{#1}}} + {\starttabulate[|le|l|] + \NC language \NC \currentlanguage (code:\the\normallanguage) \NC \NR + \NC font \NC \fontname\font \NC \NR + \NC encoding \NC \currentencoding \NC \NR + \NC mapping \NC \currentencoding \NC \NR + \NC sample \NC \hyphenatedword{#1} \NC \NR + \stoptabulate} \protect \endinput diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index bf904b9ab..afe943ee7 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -1006,11 +1006,17 @@ \def\doparsefontspec#1 #2% {\def\somefontname{#1}% - \ifx#2\relax - \expandafter\setnaturalfontspec + \ifx#1\relax\relax % space before filename + \@EA\doparsefontspec \else - \expandafter\setforcedfontspec - \fi#2} + \ifx#2\relax + \@EA\@EA\@EA\setnaturalfontspec + \else + \@EA\@EA\@EA\setforcedfontspec + \fi + \fi + #2} + \def\setnaturalfontspec#1]% {\@fs@scaled\!!thousand} @@ -1022,7 +1028,7 @@ {\scaledfont#1pt% \scaledfont\dorelativefontsize\scaledfont \ifautofontsize\scaledfont\currentfontbodyscale\scaledfont\fi - \scratchcounter\scaledfont + \scratchcounter\scaledfont % \scaledfont is now pretty large \advance\scratchcounter \!!medcard \divide\scratchcounter \!!maxcard \edef\somefontspec{ scaled \the\scratchcounter}} @@ -1050,51 +1056,96 @@ \def\somefontspec{ at \scaledfont}% \fi} +% \def\getfontparameters% +% {\expandafter\setfontparameter\fontdata,]=,} +% +% \def\getglobalfontparameters% +% {\expandafter\setglobalfontparameter\fontdata,]=,} +% +% \def\setfontparameter#1=#2,% +% {\if]#1\else +% \expandafter\def\csname\fontfile#1\endcsname{#2}% +% \expandafter\setfontparameter +% \fi} +% +% \def\setglobalfontparameter#1=#2,% +% {\if]#1\else +% \expandafter\gdef\csname\fontfile#1\endcsname{#2}% +% \expandafter\setglobalfontparameter +% \fi} +% +% \def\donoparsefontspec#1% +% {\edef\fontfile{\truefontname\somefontname}% +% %\writestatus{specifying}{\somefontname/\fontfile/\somefontspec}% +% \ifx\fontfile\s!unknown +% %\writestatus{missing}{\somefontname}% +% \let\fontfile\defaultfontfile +% \else +% \edef\fontdata{\truefontdata\fontfile}% +% \ifx\fontdata\empty \else +% %\writestatus{storing}{\fontfile\space(\fontdata)]}% +% \ifx\fontclass\empty +% \getfontparameters +% \else +% \getglobalfontparameters +% \fi +% \fi +% \fi +% \edef\lastfontname{\fontfile\somefontspec}% not really needed +% %\writestatus{tfmloading}{[#1] [\lastfontname][\the\scaledfont]}% +% \ifx\fontclass\empty\else\global\fi +% \expandafter\font\csname#1\endcsname\lastfontname\relax +% \the\everyfont % new +% % the second \font definition prevents fuzzy font refs +% % \expandafter\font\csname\dummyfontname\endcsname\lastfontname +% % but somehow they changed tex so that it does not matter any more +% \relax} + +\def\getfontparameters% + {\expandafter\setfontparameter\@@fontdata,]=,} + \def\getglobalfontparameters% - {\expandafter\setglobalfontparameter\fontdata,]=,} + {\expandafter\setglobalfontparameter\@@fontdata,]=,} + +\def\setfontparameter#1=#2,% + {\if]#1\else + \expandafter\def\csname\??ff\@@fontfile#1\endcsname{#2}% + \expandafter\setfontparameter + \fi} \def\setglobalfontparameter#1=#2,% {\if]#1\else - \expandafter\gdef\csname\fontfile#1\endcsname{#2}% + \expandafter\gdef\csname\??ff\@@fontfile#1\endcsname{#2}% \expandafter\setglobalfontparameter \fi} -\def\getfontparameters% - {\expandafter\setfontparameter\fontdata,]=,} +\let\@@fontencoding\empty +\let\@@fontmapping \empty +\let\@@fonthandling\empty +\let\@@skewchar \empty +\let\@@hyphenchar \empty % todo, will go to encoding -\def\setfontparameter#1=#2,% - {\if]#1\else - \expandafter\def\csname\fontfile#1\endcsname{#2}% - \expandafter\setfontparameter - \fi} +\newif\ifskipfontcharacteristics % \skipfontcharacteristicstrue \def\donoparsefontspec#1% {\edef\fontfile{\truefontname\somefontname}% - %\writestatus{specifying}{\somefontname/\fontfile/\somefontspec}% - \ifx\fontfile\s!unknown - %\writestatus{missing}{\somefontname}% - \let\fontfile\defaultfontfile - \else - \edef\fontdata{\truefontdata\fontfile}% - \ifx\fontdata\empty \else - %\writestatus{storing}{\fontfile\space(\fontdata)]}% - \ifx\fontclass\empty - \getfontparameters - \else - \getglobalfontparameters - \fi - \fi - \fi - \edef\lastfontname{\fontfile\somefontspec}% not really needed - %\writestatus{tfmloading}{[#1] [\lastfontname][\the\scaledfont]}% + \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi + \edef\lastfontname{\fontfile\somefontspec}% \ifx\fontclass\empty\else\global\fi \expandafter\font\csname#1\endcsname\lastfontname\relax - \the\everyfont % new - % the second \font definition prevents fuzzy font refs - % \expandafter\font\csname\dummyfontname\endcsname\lastfontname - % but somehow they changed tex so that it does not matter any more + \the\everyfont \relax} +%D An additional the second \type {\font} definition can +%D prevent fuzzy font refs +%D +%D \starttypen +%D \expandafter\font\csname\dummyfontname\endcsname\lastfontname +%D \stoptypen +%D +%D but somehow they changed \TEX\ so that it does not matter +%D any more. + \def\defaultfontfile{cmtt10} \edef\nullfontname {\fontname\nullfont} \edef\dummyfontname {font\strippedcsname\\} @@ -1166,24 +1217,83 @@ %D data: \type {\truefontdata{\truefontname{Lucida-Bright}}} %D \stopregels +% \def\definefontsynonym% +% {\dotripleempty\dodefinefontsynonym} +% +% \def\dodefinefontsynonym[#1][#2][#3]% +% {\ifthirdargument +% \setevalue{\??ff#1}{#2}% +% \ifx\fontclass\empty\else\global\fi +% \setevalue{\??ff\??ff#2}{#3}% +% \else +% \setevalue{\??ff\fontclass#1}{#2}% +% \fi} + \def\definefontsynonym% {\dotripleempty\dodefinefontsynonym} \def\dodefinefontsynonym[#1][#2][#3]% {\ifthirdargument - \setevalue{\??ff#1}{#2}% - \ifx\fontclass\empty\else\global\fi - \setevalue{\??ff\??ff#2}{#3}% + \setevalue{\??ff\fontclass#1}{#2}% here fontclass ? + \edef\@@fontdata{#3}% + \ifx\@@fontdata\empty \else + \edef\@@fontfile{#2}% + \ifx\fontclass\empty + \getfontparameters + \else + \getglobalfontparameters + \fi + \fi \else \setevalue{\??ff\fontclass#1}{#2}% \fi} +\def\setupfontsynonym% + {\dodoubleempty\dosetupfontsynonym} + +\def\dosetupfontsynonym[#1][#2]% + {\edef\@@fontdata{#2}% + \ifx\@@fontdata\empty \else + \edef\@@fontfile{#1}% + \ifx\fontclass\empty + \getfontparameters + \else + \getglobalfontparameters + \fi + \fi} + \beginTEX -\def\truefontdata#1% - {\expandafter\ifx\csname\??ff\??ff#1\endcsname\relax +%\def\truefontdata#1#2% font var +% {\expandafter\ifx\csname\??ff#1#2\endcsname\relax +% \expandafter\ifx\csname\??ff\fontclass#1\endcsname\relax +% \expandafter\ifx\csname\??ff#1\endcsname\relax +% \else +% \expandafter\truefontdata\csname\??ff#1\endcsname#2% +% \fi +% \else +% \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2% +% \fi +% \else +% \csname\??ff#1#2\endcsname +% \fi} + +\def\truefontdata#1#2% font var + {\expandafter\ifx\csname\??ff#2\endcsname\relax + \expandafter\ifx\csname\??ff#1#2\endcsname\relax + \expandafter\ifx\csname\??ff\fontclass#1\endcsname\relax + \expandafter\ifx\csname\??ff#1\endcsname\relax + \else + \expandafter\truefontdata\csname\??ff#1\endcsname#2% + \fi + \else + \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2% + \fi + \else + \csname\??ff#1#2\endcsname + \fi \else - \csname\??ff\??ff#1\endcsname + \csname\??ff#2\endcsname \fi} \def\truefontname#1% @@ -1201,10 +1311,25 @@ \beginETEX \ifcsname -\def\truefontdata#1% - {\ifcsname\??ff\??ff#1\endcsname - \csname\??ff\??ff#1\endcsname - \fi} +%\def\truefontdata#1#2% font var +% {\ifcsname\??ff#1#2\endcsname +% \csname\??ff#1#2\endcsname +% \else\ifcsname\??ff\fontclass#1\endcsname +% \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2% +% \else\ifcsname\??ff#1\endcsname +% \expandafter\truefontdata\csname\??ff#1\endcsname#2% +% \fi\fi\fi} + +\def\truefontdata#1#2% font var + {\ifcsname\??ff#2\endcsname + \csname\??ff#2\endcsname + \else\ifcsname\??ff#1#2\endcsname + \csname\??ff#1#2\endcsname + \else\ifcsname\??ff\fontclass#1\endcsname + \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2% + \else\ifcsname\??ff#1\endcsname + \expandafter\truefontdata\csname\??ff#1\endcsname#2% + \fi\fi\fi\fi} \def\truefontname#1% {\ifcsname\??ff\fontclass#1\endcsname @@ -1233,11 +1358,16 @@ %D \def\currentfontfileencoding{texnansi} %D \stoptypen -\def\@@currentfontfile{currentfontfile} +% \def\@@currentfontfile{currentfontfile} +% +% \def\getfontfileparameters#1% +% {\edef\fontdata{\truefontdata{\truefontname{#1}}}% +% \expanded{\getparameters[\@@currentfontfile][\fontdata]}} \def\getfontfileparameters#1% - {\edef\fontdata{\truefontdata{\truefontname{#1}}}% - \expanded{\getparameters[\@@currentfontfile][\fontdata]}} + {\edef\currentfontfileencoding{\truefontdata{#1}\s!encoding}% + \edef\currentfontfilemapping {\truefontdata{#1}\s!mapping }% + \edef\currentfontfilehandling{\truefontdata{#1}\s!handling}} %D \macros %D {definefont} @@ -1267,13 +1397,16 @@ \newif\ifautofontsize \autofontsizetrue +\let\lastfontidentifier\empty + \def\dododefinefont#1#2% {\dosetrelativefontsize{#1}% \parsefontspec{#2}{**#1**}% - \getvalue{**#1**}% \doresetrelativefontsize + \csname**#1**\endcsname + \autofontsizefalse + \edef\lastfontidentifier{#1}% \setfontcharacteristics - \autofontsizefalse \the\everyfontswitch} \def\xxdododefinefont#1#2% \autofontsizetrue is set by calling routine @@ -1283,9 +1416,12 @@ \doresetrelativefontsize \fi \csname*\fontclass#1\fontsize*\endcsname - \setfontcharacteristics - \autofontsizefalse - \the\everyfontswitch} + \autofontsizefalse + \edef\lastfontidentifier{#1}% + \ifskipfontcharacteristics \else + \setfontcharacteristics + \the\everyfontswitch + \fi} %D I considered checking for mistakenly use of \PLAIN's %D \type{\magstep}'s but although it would take only a few @@ -1743,7 +1879,7 @@ \fi \dostorerelativefontsize{\fontclass#2#1#3#4#5}% \iflocalclassfonts - \letbeundefined{*#2#1#3#4#5*}% + \letbeundefined{*\fontclass#2#1#3#4#5*}% \unexpanded \setvalue{#2#1#3#4#5}{\xxdododefinefont {#2#1#3#4#5}{#6}}% @@ -1761,8 +1897,8 @@ \fi \fi} -\def\checkbodyfont#1#2#3#4% body style alternative size / global - {% beware: #4 can be empty +\def\checkbodyfont#1#2#3#4% body style alt size / gdef % #4 can be empty + {%\def\c!mm!{#2}\ifx\c!mm!\c!mm \else % test first \unexpanded\setgvalue {#2#4}{\setcurrentfontstylesize {#2}{#4}}% \rma \unexpanded\setgvalue {#3#4}{\setcurrentfontalternativesize {#3}{#4}}% \sla \unexpanded\setgvalue {#2#3#4}{\setcurrentfontstylealternativesize{#2}{#3}{#4}}% \rmsla @@ -1773,7 +1909,8 @@ \unexpanded\setgvalue {#3\c!x}{\setcurrentfontxalternative {#3}}% \slx \unexpanded\setgvalue{#3\c!xx}{\setcurrentfontxxalternative {#3}}% \slxx \unexpanded\setgvalue {#2#3}{\setcurrentfontstylealternative {#2}{#3}}}% \rmsl - + %\fi} + \def\dodefinedefaultbodyfont[#1][#2][#3]% sizes styles identifier {\def\dododefinedefaultbodyfont##1% {\def\dodododefinedefaultbodyfont####1% @@ -2235,7 +2372,11 @@ \def\synchronizefont% {\let\fontstrategy\dofontstrategy - \the\fontstrategies} + \the\fontstrategies + \ifskipfontcharacteristics + \setfontcharacteristics + \the\everyfontswitch + \fi} \beginTEX @@ -2428,8 +2569,9 @@ \chardef\defaultskewcharsy='60 \def\dosetskewchar#1% - {\skewchar\font=\ifundefined{\purefontname\font\s!skewchar}% - #1\else\csname\purefontname\font\s!skewchar\endcsname\fi} + %{\skewchar\font=\ifundefined{\purefontname\font\s!skewchar}% + % #1\else\csname\purefontname\font\s!skewchar\endcsname\fi} + {\skewchar\font=\ifx\@@fontskewchar\empty#1\else\@@fontskewchar\fi} %D The previous macros show that it's is not always %D neccessary to define the whole bunch of fonts, take for @@ -2550,75 +2692,36 @@ %D The font specific features are bound to the filename. -% This can be made faster by testing for a mapping change -% here, but there is only a reason for doing that for mixed -% cases. +\def\updatefontparameters% + {\edef\@@fontencoding{\truefontdata\fontfile \s!encoding}% + \edef\@@fontmapping {\truefontdata\fontfile \s!mapping }% + \edef\@@fonthandling{\truefontdata\somefontname\s!handling}% + \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}} \def\setfontcharacteristics% - {\doifdefinedelse{\purefontname\font\s!handling} % the file bound one - {\enablehandling[\getvalue{\purefontname\font\s!handling}]}% - {\enablehandling[\s!default]}% - \doifdefinedelse{\purefontname\font\s!encoding} % the file bound one - {\enablecoding[\getvalue{\purefontname\font\s!encoding}]}% - {\enablecoding[\s!default]}% - \doifdefinedelse{\purefontname\font\s!mapping} % the file bound one - {\enablemapping[\getvalue{\purefontname\font\s!mapping}]}% - {\doifdefinedelse{\purefontname\font\s!encoding} - {\enablemapping[\getvalue{\purefontname\font\s!encoding}]} - {\enablemapping[\s!default]}}} - -\beginTEX - -\def\setfontcharacteristics% - {\enablehandling - [\@EA\ifx\csname\purefontname\font\s!handling\endcsname\relax % the file bound one + {\updatefontparameters + \enableencoding + [\ifx\@@fontencoding\empty \s!default \else - \csname\purefontname\font\s!handling\endcsname - \fi]% - \enablecoding - [\@EA\ifx\csname\purefontname\font\s!encoding\endcsname\relax % the file bound one - \s!default - \else - \csname\purefontname\font\s!encoding\endcsname + \@@fontencoding \fi]% \enablemapping - [\@EA\ifx\csname\purefontname\font\s!mapping\endcsname\relax % the file bound one - \@EA\ifx\csname\purefontname\font\s!encoding\endcsname\relax - \s!default - \else - \csname\purefontname\font\s!encoding\endcsname - \fi\else - \csname\purefontname\font\s!mapping\endcsname - \fi]} - -\endTEX - -\beginETEX \ifcsname - -\def\setfontcharacteristics% - {\enablehandling - [\ifcsname\purefontname\font\s!handling\endcsname % the file bound one - \csname\purefontname\font\s!handling\endcsname + [\ifx\@@fontmapping\empty + \ifx\@@fontencoding\empty + \s!default + \else + \@@fontencoding + \fi \else - \s!default + \@@fontmapping \fi]% - \enablecoding - [\ifcsname\purefontname\font\s!encoding\endcsname % the file bound one - \csname\purefontname\font\s!encoding\endcsname - \else + \enablehandling + [\ifx\@@fonthandling\empty \s!default - \fi]% - \enablemapping - [\ifcsname\purefontname\font\s!mapping\endcsname % the file bound one - \csname\purefontname\font\s!mapping\endcsname - \else\ifcsname\purefontname\font\s!encoding\endcsname - \csname\purefontname\font\s!encoding\endcsname \else - \s!default - \fi\fi]} - -\endETEX + \@@fonthandling + \fi][\lastfontidentifier]} %D The next auxilliary macro is an alternative to \type %D {\fontname}. @@ -3453,7 +3556,7 @@ \s!scriptscript=\!!ninepoint, \c!x=\!!twelvepoint, \c!xx=\!!tenpoint, - \c!groot=\!!fourteenpointfour, + \c!groot=17.3pt, \c!klein=\!!twelvepoint] \definebodyfontenvironment diff --git a/tex/context/base/font-run.tex b/tex/context/base/font-run.tex index cc1beccc8..c7ad85df6 100644 --- a/tex/context/base/font-run.tex +++ b/tex/context/base/font-run.tex @@ -57,12 +57,12 @@ &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule \tabskip=\!!zeropoint\cr \noalign{\hrule} - &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil\vrule}\cr + &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil + \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr Ag$\quad}\vrule}\cr \noalign{\hrule}\next{}{\tt\string}{} \noalign{\hrule}\next{\tt\string\rm}{\rm}{Ag} \noalign{\hrule}\next{\tt\string\ss}{\ss}{Ag} \noalign{\hrule}\next{\tt\string\tt}{\tt}{Ag} - \noalign{\hrule}\next{\tt\string$}{$}{Ag$} \noalign{\hrule}}} \stopbaselinecorrection} @@ -131,22 +131,22 @@ \dostepwiserecurse{0}{15}{1} {\let\col\recurselevel \scratchcounter="\hexnumber\row\hexnumber\col\relax -\iffontchar\font\scratchcounter - \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}% - \ifdim\wd\scratchbox>\!!zeropoint\relax - \donetrue \else \donefalse + \iffontchar\font\scratchcounter + \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}% + \ifdim\wd\scratchbox>\!!zeropoint\relax + \donetrue \else \donefalse + \fi + \else + \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% \fi -\else - \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% -\fi \startoverlay {\tf\vbox to 2.5em {\vss \hbox to 2.5em {\dummy\ifdim\fontdimen2\font=\!!zeropoint -\setbox\scratchbox=\hbox - {\raise.5\dp\scratchbox\hbox - {\lower.5\ht\scratchbox\copy\scratchbox}}% + \setbox\scratchbox=\hbox + {\raise.5\dp\scratchbox\hbox + {\lower.5\ht\scratchbox\copy\scratchbox}}% \ht\scratchbox\!!zeropoint \dp\scratchbox\!!zeropoint \else diff --git a/tex/context/base/hand-def.tex b/tex/context/base/hand-def.tex new file mode 100644 index 000000000..66e10aac8 --- /dev/null +++ b/tex/context/base/hand-def.tex @@ -0,0 +1,317 @@ +%D \module +%D [ file=hand-def, % was enco-pro +%D version=2000.29.9, +%D title=\CONTEXT\ Handling Macros, +%D subtitle=Default Protruding Factors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is an experimental definition file. The protruding +%D values we use here are those found from \THANH's thesis. + +\startfonthandling [pure] + + \defineprotrudefactor , 0 1 + \defineprotrudefactor . 0 1 + \defineprotrudefactor : 0 1 + \defineprotrudefactor ; 0 1 + + \defineprotrudefactor hyphen 0 1 + \defineprotrudefactor endash 0 .5 + \defineprotrudefactor emdash 0 .5 + +\stopfonthandling + +\startfonthandling [punctuation] + + \defineprotrudefactor ! 0 .2 + \defineprotrudefactor ' 0 .7 + \defineprotrudefactor ` .7 0 + \defineprotrudefactor ( .05 0 + \defineprotrudefactor ) 0 .05 + \defineprotrudefactor [ .05 0 + \defineprotrudefactor ] 0 .05 + \defineprotrudefactor , 0 .7 + \defineprotrudefactor - 0 .7 + \defineprotrudefactor . 0 .7 + \defineprotrudefactor : 0 .5 + \defineprotrudefactor ; 0 .5 + + \defineprotrudefactor rightupperninequote 0 .5 + \defineprotrudefactor leftupperninequote .5 0 + \defineprotrudefactor endash 0 .3 + \defineprotrudefactor emdash 0 .2 + + \defineprotrudefactor hyphen 0 .7 + +\stopfonthandling + +\startfonthandling [alpha] + + \defineprotrudefactor A .05 .05 + \defineprotrudefactor F 0 .05 + \defineprotrudefactor J .05 0 + \defineprotrudefactor K 0 .05 + \defineprotrudefactor L 0 .05 + \defineprotrudefactor T .05 .05 + \defineprotrudefactor V .05 .05 + \defineprotrudefactor W .05 .05 + \defineprotrudefactor X .05 .05 + \defineprotrudefactor Y .05 .05 + + \defineprotrudefactor k 0 .05 + \defineprotrudefactor r 0 .05 + \defineprotrudefactor t 0 .05 + \defineprotrudefactor v .05 .05 + \defineprotrudefactor w .05 .05 + \defineprotrudefactor x .05 .05 + \defineprotrudefactor y .05 .05 + +\stopfonthandling + +\startfonthandling [extended] + + \inheritprotrudefactor Acircumflex A + \inheritprotrudefactor acircumflex a + \inheritprotrudefactor Ccircumflex C + \inheritprotrudefactor ccircumflex c + \inheritprotrudefactor Ecircumflex E + \inheritprotrudefactor ecircumflex e + \inheritprotrudefactor Gcircumflex G + \inheritprotrudefactor gcircumflex g + \inheritprotrudefactor Hcircumflex H + \inheritprotrudefactor hcircumflex h + \inheritprotrudefactor Icircumflex I + \inheritprotrudefactor icircumflex i + \inheritprotrudefactor Jcircumflex J + \inheritprotrudefactor jcircumflex j + \inheritprotrudefactor Ocircumflex O + \inheritprotrudefactor ocircumflex o + \inheritprotrudefactor Scircumflex S + \inheritprotrudefactor scircumflex s + \inheritprotrudefactor Ucircumflex U + \inheritprotrudefactor ucircumflex u + \inheritprotrudefactor Wcircumflex W + \inheritprotrudefactor wcircumflex w + \inheritprotrudefactor Ycircumflex Y + \inheritprotrudefactor ycircumflex y + + \inheritprotrudefactor Agrave A + \inheritprotrudefactor agrave a + \inheritprotrudefactor Egrave E + \inheritprotrudefactor egrave e + \inheritprotrudefactor Igrave I + \inheritprotrudefactor igrave i + \inheritprotrudefactor Ograve O + \inheritprotrudefactor ograve o + \inheritprotrudefactor Ugrave U + \inheritprotrudefactor ugrave u + \inheritprotrudefactor Ygrave Y + \inheritprotrudefactor ygrave y + + \inheritprotrudefactor Atilde A + \inheritprotrudefactor atilde a + \inheritprotrudefactor Itilde I + \inheritprotrudefactor itilde i + \inheritprotrudefactor Ntilde N + \inheritprotrudefactor ntilde n + \inheritprotrudefactor Otilde O + \inheritprotrudefactor otilde o + \inheritprotrudefactor Utilde U + \inheritprotrudefactor utilde u + + \inheritprotrudefactor Adiaeresis A + \inheritprotrudefactor adiaeresis a + \inheritprotrudefactor Ediaeresis E + \inheritprotrudefactor ediaeresis e + \inheritprotrudefactor Idiaeresis I + \inheritprotrudefactor idiaeresis i + \inheritprotrudefactor Odiaeresis O + \inheritprotrudefactor odiaeresis o + \inheritprotrudefactor Udiaeresis U + \inheritprotrudefactor udiaeresis u + \inheritprotrudefactor Ydiaeresis Y + \inheritprotrudefactor ydiaeresis y + + \inheritprotrudefactor Aacute A + \inheritprotrudefactor aacute a + \inheritprotrudefactor Cacute C + \inheritprotrudefactor cacute c + \inheritprotrudefactor Eacute E + \inheritprotrudefactor eacute e + \inheritprotrudefactor Iacute I + \inheritprotrudefactor iacute i + \inheritprotrudefactor Lacute L + \inheritprotrudefactor lacute l + \inheritprotrudefactor Nacute N + \inheritprotrudefactor nacute n + \inheritprotrudefactor Oacute O + \inheritprotrudefactor oacute o + \inheritprotrudefactor Racute R + \inheritprotrudefactor racute r + \inheritprotrudefactor Sacute s + \inheritprotrudefactor sacute s + \inheritprotrudefactor Uacute U + \inheritprotrudefactor uacute u + \inheritprotrudefactor Yacute Y + \inheritprotrudefactor yacute y + \inheritprotrudefactor Zacute Z + \inheritprotrudefactor zacute z + + \inheritprotrudefactor Dstroke D + \inheritprotrudefactor dstroke d + \inheritprotrudefactor Hstroke H + \inheritprotrudefactor hstroke h + \inheritprotrudefactor Tstroke T + \inheritprotrudefactor tstroke t + + \inheritprotrudefactor Cdotaccent C + \inheritprotrudefactor cdotaccent c + \inheritprotrudefactor Edotaccent E + \inheritprotrudefactor edotaccent e + \inheritprotrudefactor Gdotaccent G + \inheritprotrudefactor gdotaccent g + \inheritprotrudefactor Idotaccent I + \inheritprotrudefactor idotaccent i + \inheritprotrudefactor Zdotaccent Z + \inheritprotrudefactor zdotaccent z + + \inheritprotrudefactor Amacron A + \inheritprotrudefactor amacron a + \inheritprotrudefactor Emacron E + \inheritprotrudefactor emacron e + \inheritprotrudefactor Imacron I + \inheritprotrudefactor imacron i + \inheritprotrudefactor Omacron O + \inheritprotrudefactor omacron o + \inheritprotrudefactor Umacron U + \inheritprotrudefactor umacron u + + \inheritprotrudefactor Ccedilla C + \inheritprotrudefactor ccedilla c + \inheritprotrudefactor Kcedilla K + \inheritprotrudefactor kcedilla k + \inheritprotrudefactor Lcedilla L + \inheritprotrudefactor lcedilla l + \inheritprotrudefactor Ncedilla N + \inheritprotrudefactor ncedilla n + \inheritprotrudefactor Rcedilla R + \inheritprotrudefactor rcedilla r + \inheritprotrudefactor Scedilla S + \inheritprotrudefactor scedilla s + \inheritprotrudefactor Tcedilla T + \inheritprotrudefactor tcedilla t + + \inheritprotrudefactor Ohungarumlaut O + \inheritprotrudefactor ohungarumlaut o + \inheritprotrudefactor Uhungarumlaut U + \inheritprotrudefactor uhungarumlaut u + + \inheritprotrudefactor Aogonek A + \inheritprotrudefactor aogonek a + \inheritprotrudefactor Eogonek E + \inheritprotrudefactor eogonek e + \inheritprotrudefactor Iogonek I + \inheritprotrudefactor iogonek i + \inheritprotrudefactor Uogonek U + \inheritprotrudefactor uogonek u + + \inheritprotrudefactor Aring A + \inheritprotrudefactor aring a + \inheritprotrudefactor Uring U + \inheritprotrudefactor uring u + + \inheritprotrudefactor Abreve A + \inheritprotrudefactor abreve a + \inheritprotrudefactor Ebreve E + \inheritprotrudefactor ebreve e + \inheritprotrudefactor Gbreve G + \inheritprotrudefactor gbreve g + \inheritprotrudefactor Ibreve I + \inheritprotrudefactor ibreve i + \inheritprotrudefactor Obreve O + \inheritprotrudefactor obreve o + \inheritprotrudefactor Ubreve U + \inheritprotrudefactor ubreve u + + \inheritprotrudefactor Ccaron C + \inheritprotrudefactor ccaron c + \inheritprotrudefactor Dcaron D + \inheritprotrudefactor dcaron d + \inheritprotrudefactor Ecaron E + \inheritprotrudefactor ecaron e + \inheritprotrudefactor Lcaron L + \inheritprotrudefactor lcaron l + \inheritprotrudefactor Ncaron N + \inheritprotrudefactor ncaron n + \inheritprotrudefactor Rcaron R + \inheritprotrudefactor rcaron r + \inheritprotrudefactor Scaron S + \inheritprotrudefactor scaron s + \inheritprotrudefactor Tcaron T + \inheritprotrudefactor tcaron t + \inheritprotrudefactor Ycaron Y + \inheritprotrudefactor ycaron y + \inheritprotrudefactor Zcaron Z + \inheritprotrudefactor zcaron z + + \inheritprotrudefactor AEligature E + \inheritprotrudefactor aeligature e + \inheritprotrudefactor Lstroke I + \inheritprotrudefactor lstroke o + \inheritprotrudefactor Ostroke O + \inheritprotrudefactor ostroke o + \inheritprotrudefactor OEligature O + \inheritprotrudefactor oeligature o + + \inheritprotrudefactor Ssharp S + \inheritprotrudefactor ssharp s + \inheritprotrudefactor IJligature J + \inheritprotrudefactor ijligature j + + \inheritprotrudefactor aumlaut a + \inheritprotrudefactor eumlaut e + \inheritprotrudefactor iumlaut i + \inheritprotrudefactor oumlaut o + \inheritprotrudefactor uumlaut u + + \inheritprotrudefactor Aumlaut A + \inheritprotrudefactor Eumlaut E + \inheritprotrudefactor Iumlaut I + \inheritprotrudefactor Oumlaut O + \inheritprotrudefactor Uumlaut U + + \inheritprotrudefactor Lslash L + \inheritprotrudefactor lslash l + \inheritprotrudefactor Dslash D + \inheritprotrudefactor dslash d + \inheritprotrudefactor Oslash O + \inheritprotrudefactor oslash o + + \inheritprotrudefactor Eszett S + \inheritprotrudefactor eszett s + + \inheritprotrudefactor Thorn P + \inheritprotrudefactor thorn p + +\stopfonthandling + +\unprotect + +\definefonthandling [pure] [pure] + +% slanted/italic is yet incomplete + +\definefonthandling [normal] [punctuation,alpha,extended] +\definefonthandling [bold] [punctuation,alpha,extended] +\definefonthandling [slanted] [punctuation] [\c!rechts=1.5] +\definefonthandling [italic] [punctuation] [\c!rechts=1.5] +\definefonthandling [boldslanted] [punctuation] [\c!rechts=1.5] +\definefonthandling [bolditalic] [punctuation] [\c!rechts=1.5] + +\protect \endinput diff --git a/tex/context/base/hand-ini.tex b/tex/context/base/hand-ini.tex new file mode 100644 index 000000000..248ec401e --- /dev/null +++ b/tex/context/base/hand-ini.tex @@ -0,0 +1,253 @@ +%D \module +%D [ file=hand-ini, % moved from enco-ini / pro +%D version=2000.12.27, % 1998.12.03, +%D title=\CONTEXT\ Handling Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%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. + +\writestatus{loading}{Context Handling Macros (ini)} + +%D {\em This module is experimental and implements font +%D specific features, like hanging punctuation.} + +\unprotect + +\startmessages dutch library: handlings + title: handling + 1: font afhandeling -- + 2: font afhandeling -- wordt geladen + 3: onbekende font afhandeling -- +\stopmessages + +\startmessages english library: handlings + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\startmessages german library: handlings % to do + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\startmessages czech library: handlings % to do + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\startmessages italian library: handlings % to do + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\startmessages norwegian library: handlings % to do + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\startmessages romanian library: handlings % to do + title: handling + 1: font handling -- + 2: font handling -- is loaded + 3: unknown font handling -- +\stopmessages + +\newif\ifembasedprotruding \embasedprotrudingfalse +\newif\ifskipprotrudingdef \skipprotrudingdeffalse + +\newdimen\lproddimen \newdimen\rproddimen \let\prodfont\font + +\ifx\undefined\pdfprotrudechars % we don't use pdftex + + \let\enableprotruding \relax + \let\disableprotruding \relax + \let\setprotrudingfactor \gobbletwoarguments + + \def\defineprotrudefactor #1 #2 #3 {} + \def\inheritprotrudefactor #1 #2 {} + +\else + + \def\enableprotruding {\pdfprotrudechars=2 } + \def\disableprotruding{\pdfprotrudechars=0 } + + \appendtoks \disableprotruding \to \everyforgetall % Here or not here? + + \def\setprotrudingfactor#1#2% + {\lproddimen=#1pt\multiply\lproddimen\!!thousand\divide\lproddimen \!!maxcard\relax + \rproddimen=#2pt\multiply\rproddimen\!!thousand\divide\rproddimen \!!maxcard\relax} + + \def\dodefineprotrudefactor#1#2 #3 #4 % + {\ifskipprotrudingdef \else + \doifelsenothing{#2} + {\doifnumberelse{\string#1} + {\dododefineprotrudefactor{#1}{#3}{#4}} + {\dododefineprotrudefactor{`#1}{#3}{#4}}} + {\pushmacro\char \let\char\empty + \doifnumberelse{\csname#1#2\endcsname} + {\dododefineprotrudefactor{\csname#1#2\endcsname}{#3}{#4}} + {}% + \popmacro\char}% + \fi} + + \def\doinheritprotrudefactor#1 #2 % + {\ifskipprotrudingdef \else + \pushmacro\char \let\char\empty + \doifnumberelse{\csname#1\endcsname} + {\dodoinheritprotrudefactor{\csname#1\endcsname}{`#2}} + {}% + \popmacro\char + \fi} + + \beginETEX \fontcharwd + + \def\dododefineprotrudefactor#1#2#3% + {\scratchdimen#2\lproddimen + \ifembasedprotruding \else + \multiply\scratchdimen\fontcharwd\prodfont#1\relax + \divide\scratchdimen\fontdimen6\font + \fi + \lpcode\prodfont#1\scratchdimen + \scratchdimen#3\rproddimen + \ifembasedprotruding \else + \multiply\scratchdimen\fontcharwd\prodfont#1\relax + \divide\scratchdimen\fontdimen6\font + \fi + \rpcode\prodfont#1\scratchdimen} + + \endETEX + + \beginTEX + + \ifx\undefined\charbox \newbox\charbox \fi + + \def\dododefineprotrudefactor#1#2#3% + {\setbox\charbox{\prodfont\char#1}% ! yet untested ! + \scratchdimen#2\lproddimen + \ifembasedprotruding \else + \multiply\scratchdimen\wd\charbox + \divide\scratchdimen\fontdimen6\font + \fi + \lpcode\prodfont#1\scratchdimen + \scratchdimen#3\rproddimen + \ifembasedprotruding \else + \multiply\scratchdimen\wd\charbox + \divide\scratchdimen\fontdimen6\font + \fi + \rpcode\prodfont#1\scratchdimen} + + \endTEX + + \def\dodoinheritprotrudefactor#1#2% + {\lpcode\prodfont#1\lpcode\prodfont#2\relax + \rpcode\prodfont#1\rpcode\prodfont#2\relax} + + \def\dodefinefonthandling[#1][#2][#3]% + {\setvalue{\@fha@\@fha@#1}{#2}% + \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} + + \def\defineprotrudefactor#1 #2 #3 % + {\setfonttoks + \appendtoks\dodefineprotrudefactor#1 #2 #3 \to\fonttoks} + + \def\inheritprotrudefactor#1 #2 % + {\setfonttoks + \appendtoks\doinheritprotrudefactor#1 #2 \to\fonttoks} + +\fi + +\setprotrudingfactor{1}{1} + +\let\fonthandling\empty + +\def\startfonthandling[#1]% + {\def\fonthandling{#1}% + \doifundefined{\@fha@\fonthandling} + {\expanded{\newtoks\csname\@fha@\fonthandling\endcsname}}} + +\def\stopfonthandling% + {\let\fonthandling\empty} + +\def\setfonttoks% + {\@EA\let\@EA\fonttoks\csname\@fha@\fonthandling\endcsname} + +\def\definefonthandling% + {\dotripleempty\dodefinefonthandling} + +\def\dodefinefonthandling[#1][#2][#3]% + {\setvalue{\@fha@\@fha@#1}{#2}% + \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} + +\def\setupfonthandling% + {\dodoubleempty\dosetupfonthandling} + +\def\dosetupfonthandling[#1][#2]% + {\getparameters[\@fha@\@fha@#1][#2]} + +\def\enablehandling% + {\dodoubleempty\doenablehandling} + +\def\doenablehandling[#1][#2]% handling / symbolic fontname + {\doifdefinedelse{\@fha@\@fha@#1}% + {\setprotrudingfactor + {\getvalue{\@fha@\@fha@#1\c!links}} + {\getvalue{\@fha@\@fha@#1\c!rechts}}% + \edef\fonthandling{\getvalue{\@fha@\@fha@#1}}% + \checkfonthandling{#2}% + \@EA\rawprocesscommalist\@EA[\fonthandling]\dodoenablehandling + \registerfonthandling{#2}} + {\edef\fonthandling{#1}% new + \dodoenablehandling{#1}}} + +\def\dodoenablehandling#1% + {\doifdefined{\@fha@#1}{\@EA\the\csname\@fha@#1\endcsname}} + +\def\checkfonthandling#1% + {\doifelsevalue{#1\s!handling\c!file}{\purefontname\font} + \skipprotrudingdeftrue\skipprotrudingdeffalse} + +\def\registerfonthandling#1% + {%\ifskipprotrudingdef\else\message{#1->#2->\purefontname\font}\wait\fi + \setxvalue{#1\s!handling\c!file}{\purefontname\font}} + +%D \macros +%D {usehandling} +%D +%D Handling definitions are collected in dedicated files and +%D loaded only once: +%D +%D % \showsetup{\y!usehandling} + +\def\dousehandling#1% is the same as encoding + {\doifundefined{\c!file\f!handlingprefix#1}% + {\setvalue{\c!file\f!handlingprefix#1}{}% + \makeshortfilename[\f!handlingprefix#1]% + \startreadingfile + \readsysfile{\shortfilename} + {\showmessage{\m!handlings}{2}{#1}} + {\showmessage{\m!handlings}{3}{#1}}% + \stopreadingfile}} + +\def\usehandling[#1]% + {\processcommalist[#1]\dousehandling} + +%D Let's now see if this macro works: + +\usehandling [def] + +\protect \endinput diff --git a/tex/context/base/main-001.tex b/tex/context/base/main-001.tex index 65abc611e..8d72cfc79 100644 --- a/tex/context/base/main-001.tex +++ b/tex/context/base/main-001.tex @@ -7148,9 +7148,6 @@ \newif\ifconcept \conceptfalse -\def\infofont% - {\getvalue{7pttttf}} - \edef\utilityversion{1998.07.07} % was: 1996.03.15 % status variables \edef\utilityversion{1998.12.20} % was: 1998.07.07 % index attributes diff --git a/tex/context/base/math-ams.tex b/tex/context/base/math-ams.tex index 4cfe92440..55e5596d9 100644 --- a/tex/context/base/math-ams.tex +++ b/tex/context/base/math-ams.tex @@ -13,9 +13,11 @@ \unprotect +% maybe we should just include these into the default tex one + \definefamilysynonym [ams] [blackboard] [mb] -\startmathcollection[ams] +\startmathcollection [default] % [ams] \definemathsymbol [varGamma] [ord] [letters] ["00] \definemathsymbol [varDelta] [ord] [letters] ["01] @@ -37,7 +39,7 @@ \stopmathcollection -\startmathcollection[ams] +\startmathcollection [default] % [ams] \definemathsymbol [boxdot] [bin] [ma] ["00] \definemathsymbol [boxplus] [bin] [ma] ["01] @@ -177,7 +179,7 @@ \stopmathcollection -\startmathcollection[ams] +\startmathcollection [default] % [ams] \definemathsymbol [lvertneqq] [rel] [mb] ["00] \definemathsymbol [gvertneqq] [rel] [mb] ["01] @@ -275,7 +277,7 @@ \stopmathcollection -\startmathcollection[ams] +\startmathcollection [default] % [ams] \definemathcommand [yen] [nothing] {\mathhexbox{\hexmafam}55} \definemathcommand [checkmark] [nothing] {\mathhexbox{\hexmafam}58} @@ -307,7 +309,7 @@ \mathaccent"0\purefamilyhex{ex}65{#1}% \fi} -\startmathcollection[ams] +\startmathcollection [default] % [ams] \definemathcommand [widehat] {\AMSwidehat} \definemathcommand [widetilde] {\AMSwidetilde} diff --git a/tex/context/base/math-ini.tex b/tex/context/base/math-ini.tex index 1a86aeac4..82349b446 100644 --- a/tex/context/base/math-ini.tex +++ b/tex/context/base/math-ini.tex @@ -89,6 +89,74 @@ #1\endcsname} \endTEX + +%D Because a command can have a different meaning in math +%D and in text mode, we provide a selector. We also provide +%D the pure alternatives as \type {\mathcharacter} and \type +%D {\textcharacter}. + +\ifx\dohandlecommand\undefined \wait \fi % troubles ! + +\let\mathcharacter\dohandlemathtoken +\let\textcharacter\dohandlecommand % better \dohandletexttoken + +\beginETEX \ifcsname + +\def\dohandlemathtoken#1% + {\csname + \ifmmode + \ifcsname\@mt@\mathcollection#1\endcsname + \@mt@\mathcollection + \else\ifcsname\@mt@\nomathcollection#1\endcsname + \@mt@\nomathcollection + \else\ifcsname\characterencoding#1\endcsname + \characterencoding + \else + \nocharacterencoding + \fi\fi\fi + \else + \ifcsname\characterencoding#1\endcsname + \characterencoding + \else + \nocharacterencoding + \fi + \fi + #1\endcsname} + +\endETEX + +\beginTEX + +\def\dohandlemathtoken#1% + {\csname + \ifmmode + \@EA\ifx\csname\@mt@\mathcollection#1\endcsname\relax + \@EA\ifx\csname\@mt@\nomathcollection#1\endcsname\relax + \@EA\ifcsname\characterencoding#1\endcsname + \nocharacterencoding + \else + \characterencoding + \fi + \else + \@mt@\nomathcollection + \fi + \else + \@mt@\mathcollection + \fi\fi\fi + \else + \@EA\ifcsname\characterencoding#1\endcsname + \nocharacterencoding + \else + \characterencoding + \fi + \fi + #1\endcsname} + +\endTEX + +%D Now we redefine the text encoding handler. + +\let\dohandlecommand\dohandlemathtoken \def\definefamilysynonym% {\dotripleempty\dodefinefamilysynonym} @@ -277,9 +345,11 @@ \def\autoenablemathcollection% {\doifdefinedelse{\@mc@\fontclass\@mc@} {\enablemathcollection[\getvalue{\@mc@\fontclass\@mc@}]} - {\enablemathcollection[\s!default]}} + {\enablemathcollection[\s!default]}} % ? ? ? \appendtoks\autoenablemathcollection\to\mathstrategies + +\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run} \edef\hexmrfam {0} \edef\hexbsfam {8} \edef\hexmifam {1} \edef\hexbifam {9} diff --git a/tex/context/base/math-run.tex b/tex/context/base/math-run.tex new file mode 100644 index 000000000..b394de614 --- /dev/null +++ b/tex/context/base/math-run.tex @@ -0,0 +1,73 @@ +%D \module +%D [ file=math-run, +%D version=2001.23.04, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=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. + +\unprotect + +\gdef\showmathcharacters% nearly \showcharacters + {\bgroup + \setuptextrules[\c!korps=,\c!letter=] + \starttextrule{math characters} + \witruimte + \dontcomplain + \forgetall + \def\startmathcollection[##1]{} + \let\stopmathcollection\relax + \dimen0=\!!zeropoint + \dimen2=\!!zeropoint + \def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol} + \def\definemathcharacter{\dosixtupleempty\dodefinemathcharacter} + \def\definemathcommand {\dodoubleempty \dodefinemathcommand} + %\newcounter\mathcolor + \def\dodefinemathsymbol[##1][##2][##3][##4][##5][##6]% + {%\doifcolorelse{math \purefamilyhex{##3}}{} + % {\increment\mathcolor + % \definecolor[math \purefamilyhex{##3}][\mathcolor]}% + \setbox0=\hbox spread 1em + {$\getvalue{##1}{}$}% + \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi + \setbox2=\hbox spread 1em + {\hbox to 1em{\tttf\purefamilyhex{##3}\hss}\box0 ##1} + \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi} + \def\dodefinemathcharacter[##1][##2][##3][##4][##5][##6]{} + \def\dodefinemathcommand[##1][##2]##3{} + \readsysfile{\f!mathprefix tex}{}{} + \edef\encwidth{\the\dimen0} + \dimen0=\hsize + \advance\dimen0 2em + \advance\dimen2 2em + \divide \dimen0 by \dimen2 \advance\dimen0 1sp + \edef\enccols{\number\dimen0} + \startcolumns[\c!n=\enccols,\c!afstand=2em] + \def\dodefinemathsymbol[##1][##2][##3][##4][##5][##6]% + {%\localcolortrue + %\color + % [math \purefamilyhex{##3}] + {\hbox + {\hbox to \encwidth{$\getvalue{##1}{}$\hss}% + \hbox to 1em{\tttf\purefamilyhex{##3}\hss}##1}\par}} + \readsysfile{\f!mathprefix tex}{}{} + \stopcolumns + \stoptextrule + \egroup} + +% \definecolor[math \purefamilyhex{mr}] [darkred] +% \definecolor[math \purefamilyhex{mi}] [darkgreen] +% \definecolor[math \purefamilyhex{sy}] [darkblue] +% \definecolor[math \purefamilyhex{ex}] [darkmagenta] +% \definecolor[math \purefamilyhex{nn}] [darkyellow] +% \definecolor[math \purefamilyhex{ma}] [lightred] +% \definecolor[math \purefamilyhex{mb}] [lightgreen] +% \definecolor[math \purefamilyhex{mc}] [lightblue] +% \definecolor[math \purefamilyhex{md}] [lightmagenta] + +\protect \endinput diff --git a/tex/context/base/math-tex.tex b/tex/context/base/math-tex.tex index b938356b4..df66ee094 100644 --- a/tex/context/base/math-tex.tex +++ b/tex/context/base/math-tex.tex @@ -13,9 +13,7 @@ \unprotect -\mathcode`\ ="8000 -\mathcode`\_="8000 -\mathcode`\'="8000 +\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000 \definefamilysynonym [default] [lcgreek] [mi] \definefamilysynonym [default] [ucgreek] [mr] @@ -401,8 +399,8 @@ \definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40] \definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41] -\definemathsymbol [lgroup] [open] [bf] ["28] [ex] ["3A] -\definemathsymbol [rgroup] [close] [bf] ["29] [ex] ["3B] +\definemathsymbol [lgroup] [open] [mr] ["28] [ex] ["3A] % ? +\definemathsymbol [rgroup] [close] [mr] ["29] [ex] ["3B] % ? \definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C] \definemathsymbol [Arrowvert] [nothing] [sy] ["6B] [ex] ["3D] \definemathsymbol [bracevert] [nothing] [ex] ["3E] % ? diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex index 424b172f9..0494b45d4 100644 --- a/tex/context/base/mult-sys.tex +++ b/tex/context/base/mult-sys.tex @@ -34,6 +34,7 @@ \definesystemconstant {afrikaans} \definesystemconstant {af} \definesystemconstant {chinese} \definesystemconstant {cn} +\definesystemconstant {croation} \definesystemconstant {hr} \definesystemconstant {czech} \definesystemconstant {cz} \definesystemconstant {danish} \definesystemconstant {da} \definesystemconstant {dutch} \definesystemconstant {nl} @@ -41,6 +42,7 @@ \definesystemconstant {finish} \definesystemconstant {fi} \definesystemconstant {french} \definesystemconstant {fr} \definesystemconstant {german} \definesystemconstant {de} +\definesystemconstant {hungarian} \definesystemconstant {hu} \definesystemconstant {italian} \definesystemconstant {it} \definesystemconstant {latin} \definesystemconstant {la} \definesystemconstant {norwegian} \definesystemconstant {no} @@ -53,19 +55,17 @@ \definesystemconstant {turkish} \definesystemconstant {tr} \definesystemconstant {ukenglish} \definesystemconstant {uk} \definesystemconstant {usenglish} \definesystemconstant {us} -\definesystemconstant {croation} \definesystemconstant {hr} -\definesystemconstant {hungarian} \definesystemconstant {hu} %D For proper \UNICODE\ support we need a few font related %D constants. -\definesystemconstant {Unicode} -\definesystemconstant {Regular} +\definesystemconstant {BoldItalic} +\definesystemconstant {BoldSlanted} \definesystemconstant {Bold} -\definesystemconstant {Slanted} \definesystemconstant {Italic} -\definesystemconstant {BoldSlanted} -\definesystemconstant {BoldItalic} +\definesystemconstant {Regular} +\definesystemconstant {Slanted} +\definesystemconstant {Unicode} \definesystemconstant {Serif} \definesystemconstant {Regular} \definesystemconstant {Sans} \definesystemconstant {Support} @@ -76,11 +76,12 @@ \definemessageconstant {colors} \definemessageconstant {columns} -\definemessageconstant {files} +\definemessageconstant {encodings} \definemessageconstant {figures} +\definemessageconstant {files} \definemessageconstant {floatblocks} \definemessageconstant {fonts} -\definemessageconstant {encodings} +\definemessageconstant {handlings} \definemessageconstant {interactions} \definemessageconstant {javascript} \definemessageconstant {layouts} @@ -91,8 +92,8 @@ \definemessageconstant {symbols} \definemessageconstant {systems} \definemessageconstant {textblocks} -\definemessageconstant {versions} \definemessageconstant {verbatims} +\definemessageconstant {versions} %D The word \type{height} takes 6~token memory cells. The %D control sequence \type{\height} on the other hand uses only @@ -561,6 +562,7 @@ \definefileconstant {colorprefix} {colo-} \definefileconstant {encodingprefix} {enco-} +\definefileconstant {handlingprefix} {hand-} \definefileconstant {regimeprefix} {regi-} \definefileconstant {typeprefix} {type-} \definefileconstant {fontprefix} {font-} diff --git a/tex/context/base/s-pre-19.tex b/tex/context/base/s-pre-19.tex index 6aa2ee40c..440abebfe 100644 --- a/tex/context/base/s-pre-19.tex +++ b/tex/context/base/s-pre-19.tex @@ -43,6 +43,8 @@ %D developed using an $1400\times1050$ pixel LCD screen, so I %D may be biased. +\usetypescript [serif] [palatino] [ec] + \setupbodyfont [ppl] diff --git a/tex/context/base/supp-fil.tex b/tex/context/base/supp-fil.tex index 2b9acd12f..611183d2f 100644 --- a/tex/context/base/supp-fil.tex +++ b/tex/context/base/supp-fil.tex @@ -236,6 +236,8 @@ %D \type{\input} when needed, for instance when loading third %D party libraries. +\newevery \everyreadfile \EveryReadFile + \let\normalinput=\input \def\maxreadlevel{3} @@ -253,9 +255,13 @@ \fi \else \immediate\closein\scratchread - #2% % we skip over the \fi - \@EA\normalinput\@EA\readfilename\@EA\relax % so that we can end a - \fi} % document here too + #2% % we skip over the \fi + \@EA\dodoreadfile % so that we can end a + \fi} % document here too + +\def\dodoreadfile% + {\the\everyreadfile % hook, for instance for \enableXML + \normalinput\readfilename\relax} \def\readfile#1% {\let\readlevel=\maxreadlevel diff --git a/tex/context/base/supp-mpe.tex b/tex/context/base/supp-mpe.tex index 9267f155b..22786cda8 100644 --- a/tex/context/base/supp-mpe.tex +++ b/tex/context/base/supp-mpe.tex @@ -98,8 +98,8 @@ \def\dohandleMPspecialcomment#1 {\setMPargument{#1}% - \advance\scratchcounter by -1 - \ifcase\scratchcounter + \advance\scratchcounter by -1\relax + \ifcase\scratchcounter\relax \handleMPspecialcommand \donetrue \doresetMPstack @@ -183,6 +183,8 @@ %D {0.001} is the first path and \type {0.010} the tenth. Since %D \METAPOST strips trailing zeros, we have to padd the string. +\newif\ifMPcmyk + \ifx\normalhandleMPrgbcolor\undefined % in case we reload this module \let\normalhandleMPrgbcolor \handleMPrgbcolor diff --git a/tex/context/base/type-enc.tex b/tex/context/base/type-enc.tex index 852bce272..2c62b9955 100644 --- a/tex/context/base/type-enc.tex +++ b/tex/context/base/type-enc.tex @@ -362,6 +362,13 @@ \definefontsynonym [LucidaSans-BoldItalic] [lsbi] [encoding=texnansi] \stoptypescript +\starttypescript [sans] [lucida] [ec] + \definefontsynonym [LucidaSans] [hlsr8t] [encoding=ec] + \definefontsynonym [LucidaSans-Demi] [hlsb8t] [encoding=ec] + \definefontsynonym [LucidaSans-Italic] [hlsri8t] [encoding=ec] + \definefontsynonym [LucidaSans-DemiItalic] [hlsbi8t] [encoding=ec] +\stoptypescript + \starttypescript [mono] [lucida] [texnansi] \definefontsynonym [LucidaSans-Typewriter] [lstr] [encoding=texnansi] \definefontsynonym [LucidaSans-TypewriterBold] [lstb] [encoding=texnansi] @@ -370,10 +377,6 @@ \stoptypescript \starttypescript [mono] [lucida] [ec] - \definefontsynonym [LucidaSans] [hlsr8t] [encoding=ec] - \definefontsynonym [LucidaSans-Demi] [hlsb8t] [encoding=ec] - \definefontsynonym [LucidaSans-Italic] [hlsri8t] [encoding=ec] - \definefontsynonym [LucidaSans-DemiItalic] [hlsbi8t] [encoding=ec] \definefontsynonym [LucidaSans-Typewriter] [hlsrt8t] [encoding=ec] \definefontsynonym [LucidaSans-TypewriterBold] [hlsbt8t] [encoding=ec] \definefontsynonym [LucidaSans-TypewriterOblique] [hlsrot8t] [encoding=ec] @@ -490,6 +493,15 @@ % Palatino +\starttypescript [serif] [palatino] [texnansi] % brrr, wrong files + \definefontsynonym [Palatino] [uplr8t] [encoding=ec] + \definefontsynonym [Palatino-Italic] [uplri8t] [encoding=ec] + \definefontsynonym [Palatino-Slanted] [uplro8t] [encoding=ec] + \definefontsynonym [Palatino-Bold] [uplb8t] [encoding=ec] + \definefontsynonym [Palatino-BoldItalic] [uplbi8t] [encoding=ec] + \definefontsynonym [Palatino-BoldSlanted] [uplbo8t] [encoding=ec] +\stoptypescript + \starttypescript [serif] [palatino] [ec] \definefontsynonym [Palatino] [uplr8t] [encoding=ec] \definefontsynonym [Palatino-Italic] [uplri8t] [encoding=ec] diff --git a/tex/context/base/type-exa.tex b/tex/context/base/type-exa.tex index 43a746a3c..e9ce15e63 100644 --- a/tex/context/base/type-exa.tex +++ b/tex/context/base/type-exa.tex @@ -66,4 +66,70 @@ \stoptypescript +\starttypescript [serif] [hanging] [pure] + +\setupfontsynonym [Serif] [hanging=pure] +\setupfontsynonym [Serif-Bold] [hanging=pure] +\setupfontsynonym [Serif-Slanted] [hanging=pure] +\setupfontsynonym [Serif-Italic] [hanging=pure] +\setupfontsynonym [Serif-BoldSlanted] [hanging=pure] +\setupfontsynonym [Serif-BoldItalic] [hanging=pure] + +\stoptypescript + +\starttypescript [sans] [hanging] [pure] + +\setupfontsynonym [Sans] [hanging=pure] +\setupfontsynonym [Sans-Bold] [hanging=pure] +\setupfontsynonym [Sans-Slanted] [hanging=pure] +\setupfontsynonym [Sans-Italic] [hanging=pure] +\setupfontsynonym [Sans-BoldSlanted] [hanging=pure] +\setupfontsynonym [Sans-BoldItalic] [hanging=pure] + +\stoptypescript + +\starttypescript [mono] [hanging] [pure] + +\setupfontsynonym [Mono] [hanging=pure] +\setupfontsynonym [Mono-Bold] [hanging=pure] +\setupfontsynonym [Mono-Slanted] [hanging=pure] +\setupfontsynonym [Mono-Italic] [hanging=pure] +\setupfontsynonym [Mono-BoldSlanted] [hanging=pure] +\setupfontsynonym [Mono-BoldItalic] [hanging=pure] + +\stoptypescript + +\starttypescript [serif] [hanging] [thanh] + +\setupfontsynonym [Serif] [hanging=normal] +\setupfontsynonym [Serif-Bold] [hanging=bold] +\setupfontsynonym [Serif-Slanted] [hanging=slanted] +\setupfontsynonym [Serif-Italic] [hanging=italic] +\setupfontsynonym [Serif-BoldSlanted] [hanging=boldslanted] +\setupfontsynonym [Serif-BoldItalic] [hanging=bolditalic] + +\stoptypescript + +\starttypescript [sans] [hanging] [thanh] + +\setupfontsynonym [Sans] [hanging=normal] +\setupfontsynonym [Sans-Bold] [hanging=bold] +\setupfontsynonym [Sans-Slanted] [hanging=slanted] +\setupfontsynonym [Sans-Italic] [hanging=italic] +\setupfontsynonym [Sans-BoldSlanted] [hanging=boldslanted] +\setupfontsynonym [Sans-BoldItalic] [hanging=bolditalic] + +\stoptypescript + +\starttypescript [mono] [hanging] [thanh] + +\setupfontsynonym [Mono] [hanging=normal] +\setupfontsynonym [Mono-Bold] [hanging=bold] +\setupfontsynonym [Mono-Slanted] [hanging=slanted] +\setupfontsynonym [Mono-Italic] [hanging=italic] +\setupfontsynonym [Mono-BoldSlanted] [hanging=boldslanted] +\setupfontsynonym [Mono-BoldItalic] [hanging=bolditalic] + +\stoptypescript + \endinput diff --git a/tex/context/base/type-ini.tex b/tex/context/base/type-ini.tex index 6cb1e43b1..0fbe16289 100644 --- a/tex/context/base/type-ini.tex +++ b/tex/context/base/type-ini.tex @@ -41,8 +41,8 @@ \def\usetypescript% {\dotripleempty\dousetypescript} -\let\typescriptone\empty -\let\typescripttwo\empty +\let\typescriptone \empty +\let\typescripttwo \empty \let\typescriptthree\empty \def\dousetypescript[#1][#2][#3]% also loads type-loc, a user file @@ -119,13 +119,16 @@ \long\def\dostarttypescript[#1][#2][#3]#4\stoptypescript {\iffirstargument - \dochecktypescript{#1}{\typescriptone}\ifdone - \dochecktypescript{#2}{\typescripttwo}\ifdone + \dochecktypescript{#1}{\typescriptone }\ifdone + \dochecktypescript{#2}{\typescripttwo }\ifdone \dochecktypescript{#3}{\typescriptthree}\ifdone %\writestatus \debuggerinfo {typescript} - {\currenttypefile: [#1] [#2] [#3]}% + {\currenttypefile: pat=scr + [\typescriptone =#1] + [\typescripttwo =#2] + [\typescriptthree=#3]}% #4\typescriptfoundtrue \fi\fi\fi \else\iffirsttypescriptpass @@ -174,19 +177,19 @@ \let\relativefontsize\@@tsrscale \let\savedfontclass\fontclass \setcurrentfontclass{#1} -\def\@@tslabel{#1} -\def\@@tsstyle{#2} -\def\@@tsfont {#3} -\def\@@tssize {#4} + \def\@@tslabel{#1} + \def\@@tsstyle{#2} + \def\@@tsfont {#3} + \def\@@tssize {#4} \writestatus {typeface} {[#1] [#2] [#3] [#4]}% \expanded{\usetypescript[#3][#4][name,default,\@@tsencoding,special]} \expanded{\usetypescript[#3][#5][size]} -\let\@@tslabel\empty -\let\@@tsstyle\empty -\let\@@tsfont \empty -\let\@@tssize \empty + \let\@@tslabel\empty + \let\@@tsstyle\empty + \let\@@tsfont \empty + \let\@@tssize \empty \setcurrentfontclass\savedfontclass \def\relativefontsize{1} \else\ifthirdargument @@ -197,24 +200,29 @@ {\doifundefined{\??tf#1\s!default}{\setgvalue{\??tf#1\s!default}{#2}}% \doifundefined{#1}{\setgvalue{#1}{\switchtotypeface[#1][#2]}}} -\def\setuptypeface% +\def\setuptypeface% [class] [settings] {\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]} -\def\switchtotypeface% +\def\switchtotypeface% [class] [settings] {\doquadrupleempty\doswitchtotypeface[\switchtobodyfont][\globalfontclass]} \def\doswitchtotypeface[#1][#2][#3][#4]% - {\setcurrentfontclass{#3}% + {%\doifinsetelse{\s!default,\v!reset}{#3} + % {\setcurrentfontclass\empty} + % {\setcurrentfontclass{#3}}% + \setcurrentfontclass{#3}% \let\globalfontclass#2% \iffourthargument #1[#4]% - \else\ifx\fontclass\empty - #1[\c!rm]% \else - \doifdefinedelse{\??tf\fontclass\s!default} - {#1[\getvalue{\??tf\fontclass\s!default}]} - {#1[\c!rm]}% - \fi\fi + \ifx\fontclass\empty + #1[\c!rm]% + \else + \doifdefinedelse{\??tf\fontclass\s!default} + {#1[\getvalue{\??tf\fontclass\s!default}]} + {#1[\c!rm]}% + \fi + \fi \tf} \def\usetypefile[#1]% @@ -229,9 +237,10 @@ \def\doreadfontdefinitionfile#1#2% #1 = set/switch state {\ifundefined{\??tf#2\c!default}% - \pushmacro\typescriptone\edef\typescriptone{\truetypescript{#2}} - \pushmacro\typescripttwo\let \typescripttwo \empty - \pushmacro\typescriptthree\let \typescriptthree \empty + \setcurrentfontclass\empty + \pushmacro\typescriptone \edef\typescriptone {\truetypescript{#2}} + \pushmacro\typescripttwo \let\typescripttwo \empty + \pushmacro\typescriptthree\let\typescriptthree\empty \typescriptfoundfalse \dodousetypescript{\f!typeprefix pre} \popmacro\typescriptthree @@ -240,6 +249,7 @@ \iftypescriptfound \else \normaldoreadfontdefinitionfile{#1}{#2} \fi + \setcurrentfontclass\empty \else\ifcase#1\relax \switchtotypeface[#2]% \else diff --git a/tex/context/base/type-pre.tex b/tex/context/base/type-pre.tex index e65054814..146a1151b 100644 --- a/tex/context/base/type-pre.tex +++ b/tex/context/base/type-pre.tex @@ -17,9 +17,9 @@ \starttypescript [cmr] -\usetypescript [all] [computer-modern] [default,name,size] +\usetypescript [serif,sans,mono,math] [computer-modern] [default,name,size] -\enablemathcollection[default] +\usemathcollection[default] \stoptypescript @@ -28,9 +28,9 @@ \starttypescript [aer] -\usetypescript [all] [computer-modern] [default,name,size,ec] +\usetypescript [serif,sans,mono,math] [computer-modern] [default,name,size,ec] -\enablemathcollection[default] +\usemathcollection[default] \stoptypescript @@ -39,9 +39,9 @@ \starttypescript [csr] -\usetypescript [all] [computer-modern] [default,name,size,il2] +\usetypescript [serif,sans,mono,math] [computer-modern] [default,name,size,il2] -\enablemathcollection[default] +\usemathcollection[default] \stoptypescript @@ -50,9 +50,9 @@ \starttypescript [plr] -\usetypescript [all] [computer-modern] [default,name,size,pl0] +\usetypescript [serif,sans,mono,math] [computer-modern] [default,name,size,pl0] -\enablemathcollection[default] +\usemathcollection[default] \stoptypescript @@ -64,7 +64,7 @@ \usetypescript [math] [ams] [all] -\enablemathcollection[ams] +\usemathcollection[ams] \stoptypescript @@ -84,7 +84,7 @@ \usetypescript [math] [euler] [all] -\enablemathcollection[eul] +\usemathcollection[eul] \stoptypescript @@ -97,10 +97,10 @@ \starttypescript [lbr] -\usetypescript [all] [lucida] [name,special] -\usetypescript [all] [default] [size] +\usetypescript [serif,sans,mono,math,handwriting] [lucida] [name,special] +\usetypescript [serif,sans,mono,math,handwriting] [default] [size] -\enablemathcollection[lbr] +\usemathcollection[lbr] \stoptypescript @@ -112,7 +112,7 @@ \usetypescript [math] [times] [all] \usetypescript [math] [default] [size] -\enablemathcollection[tim] +\usemathcollection[tim] \stoptypescript diff --git a/tex/context/base/type-siz.tex b/tex/context/base/type-siz.tex index 5232edd8a..f71ac14d1 100644 --- a/tex/context/base/type-siz.tex +++ b/tex/context/base/type-siz.tex @@ -13,18 +13,6 @@ \unprotect -%\starttypescript [serif] [default] [size] -% \definebodyfont -% [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] -% [\tsvar{style}{rm}] [default] -%\stoptypescript - -\starttypescript [casual] [default] [size] - \definebodyfont - [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] - [rm] [default] -\stoptypescript - \starttypescript [serif] [default] [size] \definebodyfont [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] @@ -55,6 +43,24 @@ [mm] [boldmath] \stoptypescript +\starttypescript [handwriting] [default] [size] + \definebodyfont + [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] + [hw] [default] +\stoptypescript + +\starttypescript [calligraphy] [default] [size] + \definebodyfont + [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] + [cg] [default] +\stoptypescript + +\starttypescript [casual] [default] [size] % maps onto rm ! + \definebodyfont + [17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] + [rm] [default] +\stoptypescript + \starttypescript [all] [dtp] [size] \definebodyfontenvironment @@ -357,7 +363,7 @@ it=cmitt10 at 12pt] \definebodyfont [11pt] [tt] - [tf=cmtt10 at 11pt, + [tf=cmtt10 at 11pt, sl=cmsltt10 at 11pt, it=cmitt10 at 11pt] @@ -405,6 +411,16 @@ \starttypescript [math] [computer-modern] [size] +% hack to prevent mapping of filenames, watch the space! + +\definefontsynonym[xcmr12][cmr12 ] +\definefontsynonym[xcmr10][cmr10 ] +\definefontsynonym[xcmr9] [cmr9 ] +\definefontsynonym[xcmr8] [cmr8 ] +\definefontsynonym[xcmr7] [cmr7 ] +\definefontsynonym[xcmr6] [cmr6 ] +\definefontsynonym[xcmr5] [cmr5 ] + \definebodyfont [12pt] [mm] [mr=xcmr12, ex=cmex10 at 12pt, @@ -465,16 +481,6 @@ mi=cmmi12 sa 1, sy=cmsy10 sa 1] -% hack to prevent mapping of filenames, watch the space! - -\definefontsynonym[xcmr12][cmr12 ] -\definefontsynonym[xcmr10][cmr10 ] -\definefontsynonym[xcmr9] [cmr9 ] -\definefontsynonym[xcmr8] [cmr8 ] -\definefontsynonym[xcmr7] [cmr7 ] -\definefontsynonym[xcmr6] [cmr6 ] -\definefontsynonym[xcmr5] [cmr5 ] - \stoptypescript \starttypescript [serif] [concrete] [size] diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex index 1b6f98cfe..7be11a1db 100644 --- a/tex/context/base/xtag-ini.tex +++ b/tex/context/base/xtag-ini.tex @@ -196,6 +196,12 @@ .relax* needed for successive .if's E +.gdef.enableXMLelements* + B.catcode`.<=.@@active .unexpanded.def<B.doXMLelementE* + .catcode`.>=.@@other* + .relax* needed for successive .if's + E + .egroup %D An element can be singular or paired. A singular element is |