diff options
Diffstat (limited to 'tex/context/base/type-ini.mkiv')
-rw-r--r-- | tex/context/base/type-ini.mkiv | 102 |
1 files changed, 54 insertions, 48 deletions
diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index fcd16cd27..af9258b44 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -402,65 +402,71 @@ \def\typefaceencoding{\defaultencoding} -\def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% - {\dododefinetypeface[#1][#2]% - \iffifthargument % sixth is optional - % we need to expand since in #6 there can be a \typescripttwo - \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,\s!text=,#6]}% \geteparameters - \pushmacro\relativefontsize - \pushmacro\typefaceencoding - \pushmacro\fontclass - \let\relativefontsize\@@tsrscale - \let\typefaceencoding\@@tsencoding - \setcurrentfontclass{#1}% - \letvalue{\fontclass\s!features }\@@tsfeatures % new per 16/6/2007 - \letvalue{\fontclass\s!fallbacks}\@@tsfallbacks % new per 12/10/2008 - \saverelativefontsize{#2}\relativefontsize % fall back - \savemathtextstyle\@@tstext % math text style (new per 28/4/2006) - \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi - % we need to keep typefaceencoding for a while as it can still be used to filter - % old scripts as we just strip the texnansi- prefix - \ifx\typefaceencoding\t!default - \usetypescript[#3][#4][\t!name,\t!default]% will be default some day - \else - \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]% - \fi - \usetypescript[#3][#5][\t!size]% - \popmacro\fontclass - \popmacro\typefaceencoding - \popmacro\relativefontsize - \else\iffourthargument - \definetypeface[#1][#2][#3][#4][\s!default]% - \else\ifthirdargument - \getparameters[\??tf#1#2][#3]% - \fi\fi\fi} - -% will become (once we've adapted the typescripts): +% we need to keep typefaceencoding for a while as it can still be used to filter +% old scripts as we just strip the texnansi- prefix + +% \def\dostarttypefacedefining#1#2% +% {\pushmacro\fontclass +% \setcurrentfontclass{#1}% +% \pushmacro\relativefontsize +% \let\relativefontsize\@@tsrscale % still needed ? +% \savefontclassparameters{#2}\@@tsrscale\@@tsfeatures\@@tsfallbacks} +% +% \def\dostoptypefacedefining +% {\popmacro\relativefontsize +% \popmacro\fontclass} % % \def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% % {\dododefinetypeface[#1][#2]% -% \iffifthargument % sixth is optional -% % we need to expand since in #6 there can be a \typescripttwo -% \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,\s!text=,#6]}% \geteparameters -% \pushmacro\relativefontsize -% \pushmacro\fontclass -% \let\relativefontsize\@@tsrscale -% \setcurrentfontclass{#1}% -% \letvalue{\fontclass\s!features }\@@tsfeatures % new per 16/6/2007 -% \letvalue{\fontclass\s!fallbacks}\@@tsfallbacks % new per 12/10/2008 -% \saverelativefontsize{#2}\relativefontsize % fall back -% \savemathtextstyle\@@tstext % math text style (new per 28/4/2006) +% \iffifthargument % sixth is optional, we need to expand since in #6 there can be a \typescripttwo +% % \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,#6]}% \geteparameters +% \geteparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,#6]% +% \dostarttypefacedefining{#1}{#2}% +% \pushmacro\typefaceencoding +% \let\typefaceencoding\@@tsencoding % \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi -% \usetypescript[#3][#4][\t!name,\t!default,\empty]% brr, this empty, no encoding +% \ifx\typefaceencoding\t!default +% \usetypescript[#3][#4][\t!name,\t!default]% will be default some day +% \else +% \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]% +% \fi % \usetypescript[#3][#5][\t!size]% -% \popmacro\fontclass -% \popmacro\relativefontsize +% % +% \dostoptypefacedefining +% % +% \popmacro\typefaceencoding % \else\iffourthargument % \definetypeface[#1][#2][#3][#4][\s!default]% % \else\ifthirdargument % \getparameters[\??tf#1#2][#3]% % \fi\fi\fi} +\def\dostarttypefacedefining#1#2#3% + {\geteparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,#3]% + \pushmacro\fontclass + \setcurrentfontclass{#1}% + \pushmacro\relativefontsize + \let\relativefontsize\@@tsrscale % still needed ? + \savefontclassparameters{#2}\@@tsrscale\@@tsfeatures\@@tsfallbacks} + +\def\dostoptypefacedefining + {\popmacro\relativefontsize + \popmacro\fontclass} + +\def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% + {\dododefinetypeface[#1][#2]% + \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 + \dostarttypefacedefining{#1}{#2}{#6}% + \usetypescript[#3][#4][\t!name,\t!default]% + \usetypescript[#3][#5][\t!size]% + \dostoptypefacedefining + \else\iffourthargument + \definetypeface[#1][#2][#3][#4][\s!default]% + \else\ifthirdargument + \getparameters[\??tf#1#2][#3]% + \fi\fi\fi} + \def\dododefinetypeface[#1][#2]% saveguard against redefinition {\doifsomething{#1} {\ifcsname\??tf#1\s!default\endcsname \else |