diff options
Diffstat (limited to 'tex/context/base/type-ini.mkiv')
-rw-r--r-- | tex/context/base/type-ini.mkiv | 540 |
1 files changed, 0 insertions, 540 deletions
diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv deleted file mode 100644 index f0b20cbed..000000000 --- a/tex/context/base/type-ini.mkiv +++ /dev/null @@ -1,540 +0,0 @@ -%D \module -%D [ file=type-ini, -%D version=2001.03.05, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%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 Typescript Macros / Initialization} - -\registerctxluafile{type-ini}{1.001} - -%D The default fontclass is empty. We could demand always using fontclasses, -%D and then make the calling macros simplier (always assume fontclass) but -%D apart from downward compatibility issues, it would make global, class -%D spanning definitions a pain. Some day we will introduce a default class. - -%D Todo: store them at the lua end - -\unprotect - -\unexpanded\def\starttypescriptcollection - {\dosingleempty\dostarttypescriptcollection} - -\def\dostarttypescriptcollection[#1]% - {} - -\unexpanded\def\stoptypescriptcollection - {} - -\let\typescriptfiles\empty - -\unexpanded\def\usetypescriptfile[#1]% - {\doifelse{#1}\v!reset - {\let\typescriptfiles\empty} - {\splitfilename{#1}% - \addtocommalist\splitoffbase\typescriptfiles}} - -% SO FAR - -\let\currenttypescripts\empty - -\newif\iftypescriptfound - -\let\@@typescriptone \empty \let\typescriptone \empty -\let\@@typescripttwo \empty \let\typescripttwo \empty -\let\@@typescriptthree\empty \let\typescriptthree\empty - -% method 2 is for Hans van der Meer - -\newtoks\documenttypescripts - -% tricky ... here we push/pop - -\chardef\typescriptmethod\plusone % 1: empty==all==true 2: empty==false -\chardef\typescriptstate \plustwo % 1: process 2: store - -\unexpanded\def\usetypescript {\let\typescriptmethod\plusone\dotripleempty\dousetypescript} -\unexpanded\def\usetypescriptexact{\let\typescriptmethod\plustwo\dotripleempty\dousetypescript} - -\def\dousetypescript[#1][#2][#3]% - {\normalexpanded{\noexpand\dodousetypescript[#1][#2][#3]}} - -\def\dodousetypescript[#1][#2][#3]% also loads type-loc, a user file - {\pushmacro\@@typescriptone \edef\@@typescriptone {\truetypescript{#1}}% - \pushmacro\@@typescripttwo \edef\@@typescripttwo {\truetypescript{#2}}% - \pushmacro\@@typescriptthree\edef\@@typescriptthree{\truetypescript{#3}}% - \pushmacro\typescriptone - \pushmacro\typescripttwo - \pushmacro\typescriptthree - \pushmacro\typescriptmethod - \pushmacro\typescriptstate \let\typescriptstate\plusone % process - \pushmacro\stoptypescript - \typescriptfoundfalse - \iftracetypescripts\writestatus\m!fonts{request: [\@@typescriptone] [\@@typescripttwo] [\@@typescriptthree]}\fi - \processcommacommand[\typescriptfiles]\dododousetypescriptfile - \the\documenttypescripts - \firsttypescriptpassfalse % testen - \popmacro\stoptypescript - \popmacro\typescriptstate - \popmacro\typescriptmethod - \popmacro\typescriptthree - \popmacro\typescripttwo - \popmacro\typescriptone - \popmacro\@@typescriptthree - \popmacro\@@typescripttwo - \popmacro\@@typescriptone} - -\newconditional\preloadingtypescripts - -\def\preloadtypescripts{\ifproductionrun\settrue\preloadingtypescripts\fi} - -\prependtoks - \preloadtypescripts -\to \everyjob - -% \long\def\xxstarttypescript#1\stoptypescript -% {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescript#1\stoptypescript}} -% -% \long\def\xxstarttypescriptcollection#1\stoptypescriptcollection -% {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescriptcollection#1\stoptypescriptcollection}} - -\newcount\nofpreloadedtypescripts % it's faster to append references than blobs - -\long\def\xxstarttypescript#1\stoptypescript - {\global\advance\nofpreloadedtypescripts\plusone - \edef\currentpreloadedtypescript{\??ts:\the\nofpreloadedtypescripts}% - \setgvalue\currentpreloadedtypescript{\starttypescript#1\stoptypescript}% - %\global\loadedtypescripts\@EAEAEA{\@EA\the\@EA\loadedtypescripts\@EA\getvalue\@EA{\currentpreloadedtypescript}}} - \normalexpanded{\global\loadedtypescripts{\the\@EA\loadedtypescripts\noexpand\csname\currentpreloadedtypescript\endcsname}}} - -\long\def\xxstarttypescriptcollection#1\stoptypescriptcollection - {\global\advance\nofpreloadedtypescripts\plusone - \edef\currentpreloadedtypescript{\??ts:\the\nofpreloadedtypescripts}% - \setgvalue\currentpreloadedtypescript{\starttypescriptcollection#1\stoptypescriptcollection}% - %\global\loadedtypescripts\@EAEAEA{\@EA\the\@EA\loadedtypescripts\@EA\getvalue\@EA{\currentpreloadedtypescript}}} - \normalexpanded{\global\loadedtypescripts{\the\@EA\loadedtypescripts\noexpand\csname\currentpreloadedtypescript\endcsname}}} - -\def\dododousetypescriptfile#1% - {\setfalse\quittingtypescript - \pushmacro\currenttypefile - \def\currenttypefile{#1}% - \ifconditional\preloadingtypescripts - \doprocessandbuffertypescriptfile - \else - \doprocesstypescriptfile - \fi - \popmacro\currenttypefile - \ifconditional\quittingtypescript - \quitcommalist - \setfalse\quittingtypescript - \fi} - -\def\doprocessandbuffertypescriptfile - {\expandafter\let\expandafter\loadedtypescripts\csname\??ts:\c!file:\currenttypefile\endcsname - \ifx\loadedtypescripts\relax - \dobuffertypescriptfile - \fi - \the\loadedtypescripts} - -\def\dobuffertypescriptfile - {\newtoks\loadedtypescripts - \bgroup - \let\starttypescript\xxstarttypescript - \let\starttypescriptcollection\xxstarttypescriptcollection - \doprocesstypescriptfile - \egroup - \expandafter\let\csname\??ts:\c!file:\currenttypefile\endcsname\loadedtypescripts} - -\def\doprocesstypescriptfile - {\ctxcommand{doprocesstypescriptfile("\currenttypefile")}} - -\def\usetypescriptonce - {\dotripleempty\dousetypescriptonce} - -\def\dousetypescriptonce[#1][#2][#3]% - {\doifelseflagged{ts:#1:#2:#3}% - {\writestatus\m!fonts{once (#1) (#2) (#3)}} - {\setflag{ts:#1:#2:#3}% - \normalexpanded{\noexpand\dodousetypescript[#1][#2][#3]}}} - -% \definetypescriptsynonym[lbr][cmr] - -\unexpanded\def\definetypescriptsynonym - {\dodoubleempty\dodefinetypescriptsynonym} - -\def\dodefinetypescriptsynonym[#1][#2]% - {\ifsecondargument\setevalue{\??tm#1}{#2}\fi} - -\def\truetypescript#1% - {\ifcsname\??tm#1\endcsname - \@EA\truetypescript\csname\??tm#1\endcsname\else#1% - \fi} - -% script [serif] [default] [size] -% script [serif] [computer-modern] [size] -% script [serif] [computer-modern] [ec] -% script [serif] [computer-modern] [name] -% script [serif] [computer-modern] [special] - -% todo, make firsttypescriptpass conditional - -\newif\iffirsttypescriptpass \firsttypescriptpasstrue - -\prependtoks\firsttypescriptpasstrue\to\everyjob - -\def\typescript@@all{all} - -\newif\iftracetypescripts - -\let\stoptypescript\relax - -\unexpanded\def\starttypescript - {\ifcase\typescriptstate - % 0 = skip - \@EA\gobbleuntil\@EA\stoptypescript - \or - % 1 = process - \expandafter\dostarttypescript - \or - % 2 = store - \expandafter\nostarttypescript - \else - % ? = skip - \@EA\gobbleuntil\@EA\stoptypescript - \fi} - -\long\def\nostarttypescript#1\stoptypescript - {\appendtoks\starttypescript#1\stoptypescript\to\documenttypescripts} - -\def\dostarttypescript - {\let\typescriptone \@@typescriptone - \let\typescripttwo \@@typescripttwo - \let\typescriptthree\@@typescriptthree - \let\typescriptmatch\empty - \doifnextoptionalelse\dostarttypescriptone\dostarttypescriptall} - -\long\def\dostarttypescriptall - {\iffirsttypescriptpass - \expandafter\doprocesstypescript - \else - % skip this since it may do unwanted resets, like - % setting symbolic font names to unknown, especially - % in run time user type scripts - \expandafter\noprocesstypescript - \fi} - -\def\typescriptwritestatus - {\writestatus\m!fonts{match:\ifx\currenttypefile\relax\space *\fi \typescriptmatch}} - -\long\def\dostarttypescriptyes - {\ifdone - \typescriptfoundtrue - \iftracetypescripts\typescriptwritestatus\fi - \expandafter\doprocesstypescript - \else - \expandafter\noprocesstypescript - \fi} - -\long\def\dostarttypescriptone - {\dochecktypescript\@@typescriptone\typescriptone\redostarttypescriptone} - -\long\def\dostarttypescripttwo - {\dochecktypescript\@@typescripttwo\typescripttwo\redostarttypescripttwo} - -\long\def\dostarttypescriptthree - {\dochecktypescript\@@typescriptthree\typescriptthree\redostarttypescriptthree} - -\long\def\redostarttypescriptone - {\doifnextoptionalelse\dostarttypescripttwo\dostarttypescriptyes} - -\long\def\redostarttypescripttwo - {\doifnextoptionalelse\dostarttypescriptthree\dostarttypescriptyes} - -\long\def\redostarttypescriptthree - {\dostarttypescriptyes} - -\def\doprocesstypescript - {\pushmacro\fontclass} - -\unexpanded\def\stoptypescript - {\popmacro\fontclass} - -\long\def\noprocesstypescript#1\stoptypescript - {} - -\let\typescriptmatch\empty - -\def\dochecktypescript#1#2#3[#4]% script use value next - {\donefalse - \def\@@typescriptcheck{#4}% - \ifx\@@typescriptcheck\empty % no longer needed / met - \ifcase\typescriptmethod\or\donetrue\fi - \else\ifx#1\typescript@@all - \donetrue - \else\ifx\@@typescriptcheck\typescript@@all - \donetrue - \else\ifx#1\@@typescriptcheck % saves 10% trace so probably faster too - \donetrue - \let#2\@@typescriptcheck - \else - \normalexpanded{\noexpand\doifcommonelse{\@@typescriptcheck}{#1}}\donetrue\donefalse - \ifdone - \let#2\commalistelement - \fi - \fi\fi\fi\fi - \ifdone - \edef\typescriptmatch{\typescriptmatch\space[#4]}% - \expandafter#3% - \else - \expandafter\noprocesstypescript - \fi} - -%D Yet another speed up: when issued inside typescript, the call -%D -%D \starttyping -%D \quittypescriptscanning -%D \stoptyping -%D -%D quits further loading. For an example, see type-exa: - -\newconditional\quittingtypescript \setfalse\quittingtypescript - -\def\quittypescriptscanning{\settrue\quittingtypescript} - -%D Map files will go away in \LUATEX, but till that happens we -%D use stripped down support for loading them. - -\def\loadmapfile{\dosingleempty\doloadmapfile} -\def\loadmapline{\dodoubleempty\doloadmapline} - -\def\doloadmapfile [#1]{\ctxlua{fonts.mappings.loadfile("#1")}} -\def\doloadmapline [#1][#2]{\ctxlua{fonts.mappings.loadline("#1","#2")}} -\def\forgetmapfiles {\ctxlua{fonts.mappings.reset()}} - -% \appendtoks -% \pdfmapfile{}% somehow does not work at the lua end -% \to \everyjob - -\prependtoks - \loadmapfile[mkiv-base.map]% -\to \everystarttext - -%D A handy shortcut: - -% \definetypescriptprefix[serif][Serif] -% \definetypescriptprefix[sans] [Sans] -% \definetypescriptprefix[mono] [Mono] -% -%\starttypescript [serif,sans,mono] [handling,hanging,hz] [pure,normal,hz,quality] -% \setupfontsynonym [\typescriptprefix\typescriptone] [handling=\typescriptthree] -% \stoptypescript - -\unexpanded\def\definetypescriptprefix - {\dodoubleargument\dodefinetypescriptprefix} - -\def\dodefinetypescriptprefix[#1][#2]% - {\setgvalue{\??ts::#1}{#2}} % made global - -% without testing: -% -% \def\typescriptprefix#1% -% {\csname\??ts::#1\endcsname} -% -% with testing: - -\def\typescriptprefix#1% - {\executeifdefined{\??ts::#1}{#1}} - -% defining typefaces: -% -% \definetypeface [#1:joke] [#2:rm] -% \definetypeface [#1:joke] [#2:rm] [#3:...] -% \definetypeface [#1:joke] [#2:rm] [#3:serif] [#4:lucida] [#5:size] [#6:...] - -\unexpanded\def\definetypeface - {\dosixtupleargument\dodefinetypeface} - -\def\tsvar#1#2% \executeifdefined{\??ts#1}{#2} - {\@EA\ifx\csname\??ts#1\endcsname\empty - #2% - \else - \csname\??ts#1\endcsname - \fi} - -% #1=main #2=rm #3=serif #4=fontname #5=size #6=settings - -\let\typefaceencoding\s!default % obsolete - -\newtoks \everybeforedefinetypeface -\newtoks \everyafterdefinetypeface - -\appendtoks - \resetfontclassmathfamilies\fontclass -\to \everybeforedefinetypeface - -\let\fontclassstyle\empty - -\def\dostarttypefacedefining#1#2#3% - {\geteparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,\s!goodies=,\s!direction=,#3]% - \pushmacro\fontclass - \pushmacro\fontclassstyle - \setcurrentfontclass{#1}% - \pushmacro\relativefontsize - \let\relativefontsize\@@tsrscale % still needed ? - \savefontclassparameters{#2}\@@tsrscale\@@tsfeatures\@@tsfallbacks\@@tsgoodies\@@tsdirection - \the\everybeforedefinetypeface} - -\def\dostoptypefacedefining - {\the\everyafterdefinetypeface - \popmacro\relativefontsize - \popmacro\fontclassstyle - \popmacro\fontclass} - -\def\dofastdefinetypeface#1#2#3#4#5% - {\dododefinetypeface[#1][#2]% - \dostarttypefacedefining{#1}{#2}{#5}% - \usetypescript[#3][#4][\s!size]% - \dostoptypefacedefining} - -\def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% - {\iffifthargument % sixth is optional, we need to expand since in #6 there can be a \typescripttwo - \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi - \dododefinetypeface[#1][#2]% - \dostarttypefacedefining{#1}{#2}{#6}% - \usetypescript[#3][#4][\s!name,\s!default]% - \usetypescript[#3][#5][\s!size]% - \dostoptypefacedefining - \else\iffourthargument - \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi - \dododefinetypeface[#1][#2]% - \dostarttypefacedefining{#1}{#2}{}% - \usetypescript[#3][#4][\s!name,\s!default]% - \usetypescript[#3][\s!default][\s!size]% - \dostoptypefacedefining - \else\ifthirdargument - \dododefinetypeface[#1][#2]% - \getparameters[\??tf#1#2][#3]% - \else % use definitions in lfg file - \ctxlua{fonts.definetypeface(\!!bs#1\!!es,\!!bs#2\!!es)}% - \fi\fi\fi} - -\def\dododefinetypeface[#1][#2]% saveguard against redefinition - {\doifsomething{#1} - {\ifcsname\??tf#1\s!default\endcsname \else - \registerfontclass{#1}% - \setgvalue{\??tf#1\s!default}{#2}% - \fi - \ifcsname#1\endcsname \else - \setugvalue{#1}{\switchtotypeface[#1][#2]}% hm, what if #2 changes - \fi}} - -\unexpanded\def\setuptypeface% [class] [settings] - {\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]} - -\unexpanded\def\switchtotypeface% [class] [settings] - {\doquadrupleempty\doswitchtotypeface[\switchtobodyfont][\globalfontclass]} - -\def\doswitchtotypeface[#1][#2][#3][#4]% - {%\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\ifcsname\??tf\fontclass\s!default\endcsname - #1[\csname\??tf\fontclass\s!default\endcsname]% - \else - #1[\c!rm]% - \fi \fi \fi - \ifmmode\mr\else\tf\fi} % needed ? - -% \def\usetypefile[#1]% recurses on path ! -% {\edef\currenttypefile{\f!typeprefix#1}% -% \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}} - -\def\usetypefile[#1]% recurses on path ! % no storage? obsolete? - {\edef\currenttypefile{#1}% - \ctxcommand{doprocesstypescriptfile("\currenttypefile")}} - -%D For Taco: -%D -%D \starttyping -%D \inherittypeface[palatino][rm][postscript] -%D \inherittypeface[palatino][rm][\fontclass] -%D \inherittypeface[palatino][rm] % == \fontclass -%D \inherittypeface[palatino] % == [rm,ss,tt,mm] -%D \stoptyping - -\def\inherittypeface - {\dotripleempty\doinherittypeface} - -\def\doinherittypeface[#1][#2][#3]% - {\doifelsenothing{#2} - {\doinherittypeface[#1][\c!rm,\c!ss,\c!tt,\c!mm][\fontclass]} - {\doifnot{#1}{#3} - {\global\let\checkfontclass\docheckfontclass - \def\dodoinherittypeface##1{\setevalue{#1-##1}{#3}}% - \processcommalist[#2]\dodoinherittypeface}}} - -%D This hooks into the font mechanism with: - -% \def\checkfontclass#1% called often -% {\edef\fontclass{\executeifdefined{\fontclass-#1}{\fontclass}}} - -% \def\checkfontclass#1% called often -% {\edef\fontclass{\ifcsname\fontclass-#1\endcsname\csname\fontclass-#1\endcsname\else\fontclass\fi}} - -\def\docheckfontclass#1% called often - {\ifcsname\fontclass-#1\endcsname - \expandafter\let\expandafter\fontclass\csname\fontclass-#1\endcsname - \fi} - -\let\checkfontclass\gobbleoneargument - -\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} % will become module - -\protect \endinput - -% Computer Modern Roman : Donald Knuth -% Latin Modern: LM Font Revision Team - -% LM math vs CM math (analysis by Taco): -% -% lmex10.tfm % identical -% lmmi5.tfm % identical -% lmmi6.tfm % identical -% lmmi7.tfm % identical -% lmmi8.tfm % identical -% lmmi9.tfm % identical -% lmmi10.tfm % identical -% lmmi12.tfm % identical -% lmmib10.tfm % identical -% lmsy5.tfm % extra chars: 254,255 (octal) -% lmsy6.tfm % extra chars: 254,255 (octal) -% lmsy7.tfm % extra chars: 254,255 (octal) -% lmsy8.tfm % extra chars: 254,255 (octal) -% lmsy9.tfm % extra chars: 254,255 (octal) -% lmsy10.tfm % extra chars: 254,255 (octal) -% lmbsy10.tfm % extra chars: 254,255 (octal) -% -% From the 'AMS' set: -% -% lmmib5.tfm % identical -% lmmib7.tfm % identical -% lmbsy5.tfm % extra chars: 254,255 (octal) -% lmbsy7.tfm % extra chars: 254,255 (octal) -% -% The two extra characters are: -% -% /lessorequalslant -% /greaterorequalslant |