diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-ini.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/font-ini.tex | 1125 |
1 files changed, 521 insertions, 604 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-ini.tex b/Master/texmf-dist/tex/context/base/font-ini.tex index dda16084534..d528d51d47d 100644 --- a/Master/texmf-dist/tex/context/base/font-ini.tex +++ b/Master/texmf-dist/tex/context/base/font-ini.tex @@ -14,6 +14,8 @@ \writestatus{loading}{Context Font Macros (ini)} +\loadmarkfile{font-ini} + \unprotect % \def\fontrange#1% @@ -899,7 +901,7 @@ \def\synchronizesymb % stylish math stuff in mmode {\ifsynchronizemathfonts\the\symbstrategies\fi} % \if...\fam\minusone\fi} -%D By not setting the family we can append a font switch to \tyep +%D By not setting the family we can append a font switch to \type %D {\everymath}. On the other hand, one never knows in what family %D state the strategies brought us. %D @@ -934,55 +936,6 @@ % \def\s!nullfont{nullfont} -\beginTEX - -\def\dodosettextfamily#1% - {\@EA\ifx\csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\relax - \@EA\ifx\csname\fontclass\fontbody\c!mm\fontfamily\endcsname \relax - \@EA\ifx\csname\fontclass\fontbody\c!rm\fontfamily\fontsize\endcsname\relax - \@EA\ifx\csname\fontclass\fontbody\c!rm\fontfamily\endcsname \relax - \@EA\ifx\csname \fontbody\c!mm\fontfamily\fontsize\endcsname\relax - \@EA\ifx\csname \fontbody\c!mm\fontfamily\endcsname \relax - \@EA\ifx\csname \fontbody\c!rm\fontfamily\fontsize\endcsname\relax - \@EA\ifx\csname \fontbody\c!rm\fontfamily\endcsname \relax - \autofontsizetrue \nullfont \else - \autofontsizetrue \csname\fontbody\c!rm\fontfamily\endcsname \fi\else - \autofontsizefalse \csname\fontbody\c!rm\fontfamily\fontsize\endcsname\fi\else - \autofontsizetrue \csname\fontbody\c!mm\fontfamily\endcsname \fi\else - \autofontsizefalse \csname\fontbody\c!mm\fontfamily\fontsize\endcsname\fi\else - \autofontsizetrue \csname\fontclass\fontbody\c!rm\fontfamily\endcsname \fi\else - \autofontsizefalse \csname\fontclass\fontbody\c!rm\fontsize\endcsname\fi\else - \autofontsizetrue \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \fi\else - \autofontsizefalse \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\fi - #1\csname\fontfamily\s!fam\endcsname\font} - -\endTEX - -\beginETEX \ifcsname - -%\def\dodosettextfamily#1% -% {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \else -% \ifcsname\fontclass\fontbody\c!mm\fontfamily\endcsname \autofontsizetrue -% \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \else -% \ifcsname\fontclass\fontbody\c!rm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname\fontclass\fontbody\c!rm\fontfamily\fontsize\endcsname \else -% \ifcsname\fontclass\fontbody\c!rm\fontfamily\endcsname \autofontsizetrue -% \csname\fontclass\fontbody\c!rm\fontfamily\endcsname \else -% \ifcsname \fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname \fontbody\c!mm\fontfamily\fontsize\endcsname \else -% \ifcsname \fontbody\c!mm\fontfamily\endcsname \autofontsizetrue -% \csname \fontbody\c!mm\fontfamily\endcsname \else -% \ifcsname \fontbody\c!rm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname \fontbody\c!rm\fontfamily\fontsize\endcsname \else -% \ifcsname \fontbody\c!rm\fontfamily\endcsname \autofontsizetrue -% \csname \fontbody\c!rm\fontfamily\endcsname \else -% \nullfont \autofontsizetrue -% \fi\fi\fi\fi\fi\fi\fi\fi -% #1\csname\fontfamily\s!fam\endcsname\font} -% -% slightly faster: - \def\dodosettextfamily {\ifx\fontclass\empty \@EA\dodosettextfamilyA @@ -1016,8 +969,6 @@ \fi\fi\fi\fi #1\csname\fontfamily\s!fam\endcsname\font} -\endETEX - \def\mrfallback{\c!rm\c!tf} \appendtoks @@ -1046,55 +997,6 @@ \let\fontbody #2\dodosetmathfamily \textfont#1% \let\fontbody\savedfontbody} -\beginTEX - -\def\dodosetmathfamily#1#2% - {\@EA\ifx \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\relax - \@EA\ifx \csname\fontclass\fontbody\c!mm\fontfamily \endcsname\relax - \@EA\ifx \csname\fontclass\fontbody \backfamily\fontsize\endcsname\relax - \@EA\ifx \csname\fontclass\fontbody \backfamily \endcsname\relax - \@EA\ifx \csname \fontbody\c!mm\fontfamily\fontsize\endcsname\relax - \@EA\ifx \csname \fontbody\c!mm\fontfamily \endcsname\relax - \@EA\ifx \csname \fontbody \backfamily\fontsize\endcsname\relax - \@EA\ifx \csname \fontbody \backfamily \endcsname\relax - \autofontsizetrue \nullfont \else - \autofontsizetrue \csname \fontbody \backfamily \endcsname\fi \else - \autofontsizefalse \csname \fontbody \backfamily\fontsize\endcsname\fi \else - \autofontsizetrue \csname \fontbody\c!mm\fontfamily \endcsname\fi \else - \autofontsizefalse \csname \fontbody\c!mm\fontfamily\fontsize\endcsname\fi \else - \autofontsizetrue \csname\fontclass\fontbody \backfamily \endcsname\fi \else - \autofontsizefalse \csname\fontclass\fontbody \backfamily\fontsize\endcsname\fi \else - \autofontsizetrue \csname\fontclass\fontbody\c!mm\fontfamily \endcsname\fi \else - \autofontsizefalse \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\fi - #1#2\font} - -\endTEX - -\beginETEX \ifcsname - -%\def\dodosetmathfamily#1#2% -% {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \else -% \ifcsname\fontclass\fontbody\c!mm\fontfamily\endcsname \autofontsizetrue -% \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \else -% \ifcsname\fontclass\fontbody\backfamily\fontsize\endcsname \autofontsizefalse -% \csname\fontclass\fontbody\backfamily\fontsize\endcsname \else -% \ifcsname\fontclass\fontbody\backfamily\endcsname \autofontsizetrue -% \csname\fontclass\fontbody\backfamily\endcsname \else -% \ifcsname \fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse -% \csname \fontbody\c!mm\fontfamily\fontsize\endcsname \else -% \ifcsname \fontbody\c!mm\fontfamily\endcsname \autofontsizetrue -% \csname \fontbody\c!mm\fontfamily\endcsname \else -% \ifcsname \fontbody\backfamily\fontsize\endcsname \autofontsizefalse -% \csname \fontbody\backfamily\fontsize\endcsname \else -% \ifcsname \fontbody\backfamily\endcsname \autofontsizetrue -% \csname \fontbody\backfamily\endcsname \else -% \nullfont \autofontsizetrue -% \fi\fi\fi\fi\fi\fi\fi\fi -% #1#2\font} -% -% sligthly faster: - \def\dodosetmathfamily {\ifx\fontclass\empty \@EA\dodosetmathfamilyA @@ -1128,8 +1030,6 @@ \fi\fi\fi\fi #1#2\font} -\endETEX - \appendtoks \dosetsymbfamily\mrfam\textface\scriptface\scriptscriptface\c!mr \dosetsymbfamily\mifam\textface\scriptface\scriptscriptface\c!mi @@ -1149,24 +1049,6 @@ \let\fontbody #2\dodosetsymbfamily \textfont#1% \let\fontbody\savedfontbody} -\beginTEX - -\def\dodosetsymbfamily#1#2% - {\@EA\ifx\csname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname\relax - \@EA\ifx\csname\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname\relax - \else - \csname\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname - #1#2\font - \fi - \else - \csname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname - #1#2\font - \fi} - -\endTEX - -\beginETEX \ifcsname - \def\dodosetsymbfamily#1#2% {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname \csname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname @@ -1175,8 +1057,6 @@ \csname\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname #1#2\font \fi\fi} - -\endETEX %D All used styles, like rm, ss and tt, are saved in a comma %D separated list. Appart from practical limitations one can @@ -1253,20 +1133,6 @@ \def\saverelativefontsize#1#2% #1=rm|ss|.. #2=waarde {\setxvalue{\fontclass#1\s!rscale}{#2}} -\beginTEX - -\def\checkrelativefontsize#1% - {\edef\relativefontsize - {\@EA\ifx\csname\fontclass#1\s!rscale\endcsname\relax - \defaultrelativefontsize - \else - \csname\fontclass#1\s!rscale\endcsname - \fi}} - -\endTEX - -\beginETEX \ifcsname - \def\checkrelativefontsize#1% {\edef\relativefontsize {\ifcsname\fontclass#1\s!rscale\endcsname @@ -1275,8 +1141,6 @@ \defaultrelativefontsize \fi}} -\endETEX - %D We also save: \def\savemathtextstyle#1% #1=rm|ss|.. @@ -1300,6 +1164,8 @@ % % but, better: +\let\somefontname\empty + \def\parsefontspec#1% {\xdef\somefontspec{#1\space}% \@EA\doparsefontspec\somefontspec\relax]% =>#1 \relax] @@ -1322,81 +1188,6 @@ \def\setforcedfontspec#1 #2\relax]% {\csname\@fs@#1\endcsname#2\relax} -%D For \XETEX\ we need to support a bit more: -%D -%D \starttyping -%D \definedfont[{cmr10} at 40pt] test -%D \definedfont['cmss10' at 40pt] test -%D \definedfont["cmtt10" at 40pt] test -%D -%D \definedfont[{cmr10} at 40pt] test -%D \definedfont['cmss10' at 40pt] test -%D \definedfont["cmtt10" at 40pt] test -%D -%D \definedfont["Gentium" at 40pt] test -%D \stoptyping - -\beginXETEX \font - - % actually, we can use "" in pdftex> 1.20 as well - - \def\parsefontspec#1% - {\xdef\somefontspec{#1\space}% - \@EA\doparsefontspec\somefontspec\relax]% =>#1 \empty] - \donoparsefontspec} - - \def\doparsefontspec#1% - {\ifx"#1% - \@EA\dodqparsefontspec - \else\ifx'#1% - \@EAEAEA\dosqparsefontspec - \else - \@EAEAEA\dodoparsefontspec - \fi\fi#1} - - \def\dqfontquote{"} - \def\sqfontquote{'} - - \def\dodqparsefontspec"#1"#2% - {\def\somefontname{#1}% - \let\somefontquote\dqfontquote - \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} - - \def\dosqparsefontspec'#1'#2% - {\def\somefontname{#1}% - \let\somefontquote\sqfontquote - \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} - - \def\dodoparsefontspec#1 #2% - {\def\somefontname{#1}% - \let\somefontquote\empty - \ifx\somefontname\empty % space before fontname - \@EA\doparsefontspec - \else\ifx#2\relax - \@EAEAEA\setnaturalfontspec - \else - \@EAEAEA\setforcedfontspec - \fi\fi - #2} - - \def\setnaturalfontspec#1]% - {\@fs@scaled\plusthousand\relax} - - \def\setforcedfontspec#1 #2\relax]% - {\csname\@fs@#1\endcsname#2\relax} - - \def\donoparsefontspec % #1 == \cs - {\edef\fontfile{\somefontquote\truefontname\somefontname\somefontquote}% - \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi - \edef\lastfontname{\fontfile\somefontspec}% - \ifx\fontclass\empty - \expandafter\definefontlocal - \else - \expandafter\definefontglobal - \fi} % #1 == \cs - -\endXETEX - \def\@fs@scaled {\afterassignment\do@fs@scaled\scratchcounter} @@ -1452,6 +1243,7 @@ \let\@@fontencoding\empty \let\@@fontmapping \empty \let\@@fonthandling\empty +\let\@@fontfeatures\empty \let\@@skewchar \empty \let\@@hyphenchar \empty % todo, will go to encoding @@ -1476,10 +1268,310 @@ \let\fontfile\s!unknown +\ifx\checkfontfilename\undefined \let\checkfontfilename\relax \fi + +% \definefontsynonym +% [blabla] +% [name:Latin Modern Something] +% \definefontsynonym +% [blabla] +% [file:texnansi-lmr10] +% [encoding=texnansi] +% \definedfont[blabla] test \currentencoding/\fontfile \par +% \definefontsynonym +% [blabla] +% [texnansi-lmtt10] +% [encoding=texnansi] +% \definedfont[blabla] test \currentencoding/\fontfile \par +% \definefontsynonym +% [blabla] +% [ec-lmtt10] +% [encoding=ec] +% \definedfont[blabla] test \currentencoding/\fontfile \par + +\beginOLDTEX + + \def\checkfontfilename + {\expandafter\docheckfontfilename\fontfile:\empty:\empty\relax} + + \def\docheckfontfilename#1:#2:#3#4\relax + {\edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \ifx\!!stringb\empty + \edef\checkedfontfile{\!!stringa}% + \else\ifx\!!stringa\v!file + \edef\checkedfontfile{"\!!stringb"}% + \else\ifx\!!stringa\v!name + \edef\checkedfontfile{"\!!stringb"}% + \else + \edef\checkedfontfile{\!!stringb}% + \fi\fi\fi} + +\endOLDTEX + +% \definefontfeature[default] [liga=yes,texligatures=yes,texquotes=yes] +% \definefontfeature[default-caps][liga=yes,texligatures=yes,texquotes=yes,smcp=yes,script=latn] +% +% \starttypescript [serif] [palatino-nova-regular] [name] +% \definefontsynonym[Serif] [palatinonova-regular][features=default] +% \definefontsynonym[SerifCaps][palatinonova-regular][features=default-caps] % also sets Serif +% \stoptypescript +% +% \starttypescript [serif] [palatino-nova-regular] [name] +% \definefontsynonym[Serif] [palatinonova-regular*default] +% \definefontsynonym[SerifCaps] [palatinonova-regular*default-caps] +% \stoptypescript + +% \definetypeface[mainface][rm][serif][palatino-nova-regular][default] \setupbodyfont[mainface] +% +% \starttext +% ``Test'' -- --- ff fi fl \sc ``Test'' -- --- ff fi fl +% \stoptext + +% \starttext +% \definefont +% [blabla] +% [name:Latin Modern Something] +% \definefont +% [blabla] +% [file:texnansi-lmr10] +% \blabla test +% \definefont +% [blabla] +% [texnansi-lmtt10] +% \blabla test +% \stoptext + +% \starttext +% +% \setupcolors[state=start] +% +% \definefontfeature +% [default-base] +% [script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes] +% \definefontfeature +% [default-node] +% [script=latn,language=dflt,liga=yes,kern=yes,tlig=yes,trep=yes,mode=node] +% \definefontfeature +% [default-none] +% [script=latn,language=dflt,liga=yes,kern=no, tlig=yes,trep=yes] +% +% \startoverlay +% {\vtop{\color[red] {\font\test=name:lmroman12regular*default-node \test \input ward \input zapf \input linden }}} +% {\vtop{\color[green]{\font\test=name:lmroman12regular*default-base \test \input ward \input zapf \input linden }}} +% {\vtop{\color[blue] {\font\test=name:lmroman12regular*default-none \test \input ward \input zapf \input linden }}} +% \stopoverlay +% +% \blank +% +% \startoverlay +% {\vtop{\color[red] {\font\test=name:texgyrepagella*default-node \test \input ward \input zapf \input linden }}} +% {\vtop{\color[green]{\font\test=name:texgyrepagella*default-base \test \input ward \input zapf \input linden }}} +% {\vtop{\color[blue] {\font\test=name:texgyrepagella*default-none \test \input ward \input zapf \input linden }}} +% \stopoverlay +% +% \blank +% +% \startoverlay +% {\vtop{\color[red] {\font\test=name:palatinonovaregular*default-node \test \input ward \input zapf \input linden }}} +% {\vtop{\color[green]{\font\test=name:palatinonovaregular*default-base \test \input ward \input zapf \input linden }}} +% {\vtop{\color[blue] {\font\test=name:palatinonovaregular*default-none \test \input ward \input zapf \input linden }}} +% \stopoverlay +% +% \startoverlay +% {\vtop{\color[red] {\font\test=name:OfficinaSerifBookITC*default-node \test \input ward \input zapf \input linden }}} +% {\vtop{\color[green]{\font\test=name:OfficinaSerifBookITC*default-base \test \input ward \input zapf \input linden }}} +% {\vtop{\color[blue] {\font\test=name:OfficinaSerifBookITC*default-none \test \input ward \input zapf \input linden }}} +% \stopoverlay +% +% \definefontfeature[superdefault][default][compose=yes] +% +% {\font\oeps=name:lmroman10regular*default at 30pt \oeps test \char7683} +% {\font\oeps=name:lmroman10regular*superdefault at 30pt \oeps test \char7683} +% +% \stoptext + +\beginLUATEX + + \def\checkfontfilename% -- todo: integrate so that we call do.. directly + {\expandafter\docheckfontfilename\fontfile*\empty*\relax} + + \def\docheckfontfilename#1*#2#3*#4\relax % class overrules file + {\edef\checkedfontfile{{% + #1% + \expandafter\ifx\csname\fontclass\s!features\endcsname\empty + \ifx\@@fontfeatures\empty\ifx#2\empty\else*#2#3\fi\else*\@@fontfeatures\fi + \else + *\csname\fontclass\s!features\endcsname + \fi + }}% + \doshowcheckedfontfeatures} + +\endLUATEX + +% xetex / todo: disable default features ! file:, name:, [], "" etc etc + +\beginXETEX + + % for some reason xetex does not support [filename] for tfm files and + % quotes also behave kind of strange " vs ' vs [ vs ... + + % we need to use the specs, + % + % \font\myfont = msam7 % ok + % \font\myfont = "msam7" % also ok + % \font\myfont = "msam7" at 8pt % error + + \ifx\suppressfontnotfounderror\undefined + + \newcount\xetexsavedinteractionmode + \newbox \xetexcrappyhackbox + + \def\doiffoundxetexfontelse#1#2% + {\xetexsavedinteractionmode\interactionmode + \batchmode + \setbox\xetexcrappyhackbox\vbox{\par}% resets error count + \font\xetextempfont=#2\somefontspec\relax + \edef\xetextempfont{\fontname\xetextempfont}% + \ifx\xetextempfont\nullfontname + \interactionmode\xetexsavedinteractionmode + %\writestatus\m!fonts{fails #1: #2 (\xetextempfont)}% + \expandafter\secondoftwoarguments + \else + \interactionmode\xetexsavedinteractionmode + %\writestatus\m!fonts{succeeds #1: #2 (\xetextempfont)}% + \expandafter\firstoftwoarguments + \fi} + + \else + + \def\doiffoundxetexfontelse#1#2% + {\suppressfontnotfounderror\plusone + \font\xetextempfont=#2\somefontspec\relax + \suppressfontnotfounderror\zerocount + \edef\xetextempfont{\fontname\xetextempfont}% + \ifx\xetextempfont\nullfontname + %\writestatus\m!fonts{fails #1: #2 (\xetextempfont)}% + \expandafter\secondoftwoarguments + \else + %\writestatus\m!fonts{succeeds #1: #2 (\xetextempfont)}% + \expandafter\firstoftwoarguments + \fi} + + \fi + + \def\docheckfontfilenameprefix#1:#2:#3#4\relax + {\edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \ifx\!!stringb\empty + % no prefix + \let\checkedfontfile\!!stringa + \doiffoundxetexfontelse{1a}{\checkedfontfile\checkedfontfeatures} + {\edef\checkedfontfile{\checkedfontfile\checkedfontfeatures}} + {\doiffoundxetexfontelse{1b}{"\checkedfontfile\checkedfontfeatures"} + {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} + {\doiffoundxetexfontelse{1c}{"[\checkedfontfile]\checkedfontfeatures"} + {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} + {}}}% + \else\ifx\!!stringa\v!file + % force file, only file check when no spaces + \let\checkedfontfile\!!stringb + \doiffoundxetexfontelse{2b}{"[\checkedfontfile]\checkedfontfeatures"} + {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} + {\doiffoundxetexfontelse{2c}{"\checkedfontfile\checkedfontfeatures"} + {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} + {}}% + \else\ifx\!!stringa\v!name + % force name, always lookup by xetex itself, "" forces otf/ttf/type1 + \edef\checkedfontfile{"\!!stringb\checkedfontfeatures"}% + \else + % whatever, maybe even xetex spec, forget about features + \edef\checkedfontfile{"\!!stringa\!!stringb"}% + \fi\fi\fi} + + \def\checkfontfilename% -- todo: integrate so that we call do.. directly + {\expandafter\docheckfontfilename\fontfile*\empty*\relax} + + \def\docheckfontfilename#1*#2#3*#4\relax % class overrules file + {\edef\checkedfontfeatures + {\expandafter\ifx\csname\fontclass\s!features\endcsname\empty + \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi + \else\expandafter\ifx\csname\fontclass\s!features\endcsname\relax % redundant, will go away + \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi + \else + \csname\fontclass\s!features\endcsname + \fi\fi}% + \ifx\checkedfontfeatures\empty + % done + \else + \edef\checkedfontfeatures{\executeifdefined{\??fa\checkedfontfeatures}\empty}% + \ifx\checkedfontfeatures\empty + % done + \else + \let\convertedfontfeatures\empty + \processcommacommand[\checkedfontfeatures]\doconvertfontfeatures % raw + \ifx\convertedfontfeatures\empty + \let\checkedfontfeatures\empty + \else + \edef\checkedfontfeatures{:\convertedfontfeatures}% + \fi + \fi + \fi + \docheckfontfilenameprefix#1:\empty:\empty\relax + \doshowcheckedfontfeatures} + + \def\dodoconvertfontfeatures#1=#2#3=#4\relax + {\ifx#2\empty + % invalid feature + \else\ifcsname @xtx@#1@#2#3\endcsname + \edef\convertedfontfeatures{\convertedfontfeatures\csname @xtx@#1@#2#3\endcsname;}% + \else + \edef\!!stringa{#1}% + \edef\!!stringb{#2#3}% + \edef\convertedfontfeatures + {\convertedfontfeatures + \ifx\!!stringb\v!yes + +\!!stringa + \else\ifx\!!stringb\v!no + -\!!stringa + \else + \!!stringa=\!!stringb + \fi\fi;}% + \fi\fi} + + \def\doconvertfontfeatures#1% + {\dodoconvertfontfeatures#1=\empty=\relax} + + \def\remapfontfeature #1 #2 #3 {\setvalue{@xtx@#1@#2}{#3}} + + % this may move to another file, maybe font-xtx + + \remapfontfeature tlig yes mapping=tlig + %remapfontfeature tlig no mapping= + %remapfontfeature trep yes mapping=tex-text + %remapfontfeature trep no mapping= + \remapfontfeature texligatures yes mapping=tlig + %remapfontfeature texligatures no mapping= + %remapfontfeature texquotes yes mapping=tex-text + %remapfontfeature texquotes no mapping= + +\endXETEX + +\let\doshowcheckedfontfeatures\relax + +\def\showcheckedfontfeatures + {\def\doshowcheckedfontfeatures{\writestatus\m!fonts{checked: \checkedfontfile}}} + +\def\checkedfontfile{\fontfile} % default + +% todo: adapt this to luatex, i.e. no encoding etc mess + \def\donoparsefontspec % #1 == \cs {\edef\fontfile{\truefontname\somefontname}% \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi - \edef\lastfontname{\fontfile\somefontspec}% + \updatefontparameters + \checkfontfilename + \edef\lastfontname{\checkedfontfile\somefontspec}% \ifx\fontclass\empty \expandafter\definefontlocal \else @@ -1487,16 +1579,21 @@ \fi} % #1 == \cs \def\definefontlocal#1% - {\expandafter\font\csname#1\endcsname\lastfontname\relax} + {\expandafter\edef\csname#1\endcsname % ! ! ! ! not needed in luatex ! ! ! ! + {\noexpand\csname#1:\endcsname + \noexpand\reactivatefont{\somefontname}{\fontfile}}% + \expandafter\font\csname#1:\endcsname\lastfontname\relax} \def\definefontglobal#1% stores \somefontname=Mono and \fontfile=cmtt10 - {\expandafter\xdef\csname#1\endcsname + {\expandafter\xdef\csname#1\endcsname % ! ! ! ! not needed in luatex ! ! ! ! {\noexpand\csname#1:\endcsname \noexpand\reactivatefont{\somefontname}{\fontfile}}% \global\expandafter\font\csname#1:\endcsname\lastfontname\relax} -\def\reactivatefont#1%#2% - {\def\somefontname{#1}\def\fontfile}%{#2}} +\def\reactivatefont#1#2% + {\def\somefontname{#1}% + \def\fontfile {#2}% + \updatefontparameters} % can be handy for tracing purposes % @@ -1519,9 +1616,13 @@ %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\\} +\def \defaultfontfile{\truefontname{Normal}} % was cmtt10, but that one is gone +\edef\nullfontname {\fontname\nullfont} +\edef\dummyfontname {font\strippedcsname\\} + +\beginXETEX + \def\defaultfontfile{lmtypewriter10-regular} +\endXETEX %D \macros %D {everyfont,everyfontswitch} @@ -1546,24 +1647,11 @@ %D We also accept \type{sa a}||\type{sa d} as specification. -\beginETEX \ifcsname - \def\checkfontscale#1#2\end#3% {#3\ifcsname\??ft\s!default\noexpand#1\endcsname \csname\??ft\s!default\noexpand#1\endcsname\else#1#2% \fi#3} -\endETEX - -\beginTEX - -\def\checkfontscale#1#2\end#3% - {#3\expandafter\ifx\csname\??ft\s!default\noexpand#1\endcsname\relax - #1#2\else\csname\??ft\s!default\noexpand#1\endcsname - \fi#3} - -\endTEX - %D The duplicate font definition, using the ever the same dummy %D font name, results in less fuzzy error messages. In the log %D file, for instance when overfull boxes are reported, the @@ -1612,9 +1700,10 @@ % % \testfeatureonce{5000}{\definefontsynonym[somefont][somename]} \end - \def\classfont#1#2{#1#2} % \definefont[whatever][\classfont{xx}{yy} at 10pt] +\beginOLDTEX + \def\definefontsynonym[#1]#2[#3]% {\edef\@@fontfile{#3}% \@EA\let\csname\??ff\fontclass#1\endcsname\@@fontfile @@ -1628,72 +1717,63 @@ \getglobalfontparameters \fi \fi} -\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater +\endOLDTEX -\def\setupfontsynonym - {\dodoubleempty\dosetupfontsynonym} +% We need to move the feature into the filename else it may be +% overloaded by another reference. For instance the definition of +% a regular and caps variant can use the same font. -\def\dosetupfontsynonym[#1][#2]% - {\edef\@@fontdata{#2}% - \ifx\@@fontdata\empty \else - \edef\@@fontfile{#1}% +% We could use an indirect method ... store in 'array' and refer to +% slot. + +\beginNEWTEX + +\def\definefontsynonym[#1]#2[#3]% + {\edef\@@fontname{#1}% + \edef\@@fontfile{#3}% + \doifnextcharelse[\dodefinefontsynonym\nodefinefontsynonym} + +\def\nodefinefontsynonym + {\@EA\let\csname\??ff\fontclass\@@fontname\endcsname\@@fontfile} + +\def\dodefinefontsynonym[#1]% + {\edef\@@fontdata{#1}% + \ifx\@@fontdata\empty + \nodefinefontsynonym + \else \ifx\fontclass\empty \getfontparameters \else \getglobalfontparameters \fi - \fi} - -\beginTEX - -\def\truefontdata#1#2% - {\expandafter\ifx\csname\??ff#1#2\endcsname\relax - \expandafter\ifx\csname\??ff\fontclass#1\endcsname\relax - \expandafter\ifx\csname\??ff#1\endcsname\relax - \expandafter\ifx\csname\??ff#2\endcsname\relax - \else - % raw(key) - \csname\??ff#2\endcsname - \fi - \else - % exp(Regular) raw(key) - \expandafter\truefontdata\csname\??ff#1\endcsname#2% - \fi + \ifcsname\??ff\@@fontfile\s!features\endcsname + \@EA\edef\csname\??ff\fontclass\@@fontname\endcsname{\@@fontfile*\csname\??ff\@@fontfile\s!features\endcsname}% + \@EA\let\csname\??ff\@@fontfile\s!features\endcsname\undefined \else - % exp(palatino Regular) raw(key) - \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2% + \nodefinefontsynonym \fi - \else - % raw(Regular) raw(key) - \csname\??ff#1#2\endcsname \fi} -\def\truefontname#1% - {\expandafter\ifx\csname\??ff\fontclass#1\endcsname\relax - \expandafter\ifx\csname\??ff#1\endcsname\relax - #1% - \else - \@EA\truefontname\csname\??ff#1\endcsname - \fi - \else - \@EA\truefontname\csname\??ff\fontclass#1\endcsname - \fi} +\endNEWTEX -\def\expandfontsynonym#1#2% #2 := onelevelexpansion(#1) - {\@EA\ifx\csname\??ff\fontclass#2\endcsname\relax\else - \expandafter\def\expandafter#1\expandafter{\csname\??ff\fontclass#2\endcsname}% - \fi} +% \def\resetfontsynonym[#1]% fails +% {\letbeundefined{\??ff\fontclass#1}\letbeundefined{\??ff#1}} -\def\doifelsefontsynonym#1% - {\@EA\ifx\csname\??ff\fontclass#1\endcsname\relax - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} +\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater -\endTEX +\def\setupfontsynonym + {\dodoubleempty\dosetupfontsynonym} -\beginETEX \ifcsname +\def\dosetupfontsynonym[#1][#2]% + {\edef\@@fontdata{#2}% + \ifx\@@fontdata\empty \else + \edef\@@fontfile{#1}% + \ifx\fontclass\empty + \getfontparameters + \else + \getglobalfontparameters + \fi + \fi} \def\truefontdata#1#2% {\ifcsname\??ff#1#2\endcsname @@ -1710,6 +1790,8 @@ \csname\??ff#2\endcsname \fi\fi\fi\fi} +\beginOLDTEX + \def\truefontname#1% {\ifcsname\??ff\fontclass#1\endcsname \@EA\truefontname\csname\??ff\fontclass#1\endcsname @@ -1719,6 +1801,86 @@ #1% \fi\fi} +\endOLDTEX + +\beginNEWTEX + +% simple version +% +% \def\truefontname#1% +% {\@EA\dotruefontname#1*\relax} +% +% \def\dotruefontname#1*#2\relax +% {\ifcsname\??ff\fontclass#1\endcsname +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname +% \else\ifcsname\??ff#1\endcsname +% \@EA\truefontname\csname\??ff#1\endcsname +% \else +% #1% +% \fi\fi} +% +% last counts +% +% \def\truefontname#1% +% {\@EA\dotruefontname#1*\empty*\relax} +% +% \def\dotruefontname#1*#2#3*#4\relax +% {\ifcsname\??ff\fontclass#1\endcsname +% \ifx#2\empty +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname +% \else +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname*#2#3% +% \fi +% \else\ifcsname\??ff#1\endcsname +% \ifx#2\empty +% \@EA\truefontname\csname\??ff#1\endcsname +% \else +% \@EA\truefontname\csname\??ff#1\endcsname*#2#3% +% \fi +% \else +% \ifx#2\empty +% #1% +% \else +% #1*#2#3% +% \fi +% \fi\fi} +% +% first counts + +\def\truefontname#1% + {\@EA\dotruefontname#1*\empty*\relax} + +\def\dotruefontname#1*#2#3*#4\relax + {\ifcsname\??ff\fontclass#1\endcsname + \ifx#2\empty + \@EA\truefontname\csname\??ff\fontclass#1\endcsname + \else + \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname*#2#3% + \fi + \else\ifcsname\??ff#1\endcsname + \ifx#2\empty + \@EA\truefontname\csname\??ff#1\endcsname + \else + \@EA\redotruefontname\csname\??ff#1\endcsname*#2#3% + \fi + \else + #1\ifx#2\empty\else*#2#3\fi + \fi\fi} + +\def\redotruefontname#1% + {\@EA\dodotruefontname#1*\relax} + +\def\dodotruefontname#1*#2\relax + {\ifcsname\??ff\fontclass#1\endcsname + \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname + \else\ifcsname\??ff#1\endcsname + \@EA\redotruefontname\csname\??ff#1\endcsname + \else + #1% + \fi\fi} + +\endNEWTEX + \def\expandfontsynonym#1#2% #2 := onelevelexpansion(#1) {\ifcsname\??ff\fontclass#2\endcsname \expandafter\def\expandafter#1\expandafter{\csname\??ff\fontclass#2\endcsname}% @@ -1730,8 +1892,6 @@ \else \expandafter\secondoftwoarguments \fi} - -\endETEX % \definetypeface[palatino][rm][serif][palatino,allbold][default] % @@ -1749,7 +1909,9 @@ \def\dostartfontclass[#1]% {\pushmacro\fontclass - \doifsomething{#1}{\def\fontclass{#1}}} + \doifelse{#1}{\v!each} + {\let\fontclass\empty} + {\doifsomething{#1}{\def\fontclass{#1}}}} \def\stopfontclass {\popmacro\fontclass} @@ -1759,30 +1921,6 @@ %D %D A goody: -\beginTEX - -\def\tracedfontencoding#1% - {\expandafter\ifx\csname\??ff#1\s!encoding\endcsname\relax\else - \space[\csname\??ff#1\s!encoding\endcsname]% - \fi} - -\def\tracedfontname#1% - {\expandafter\ifx\csname\??ff\fontclass#1\endcsname\relax - \expandafter\ifx\csname\??ff#1\endcsname\relax - #1% - \else - #1\tracedfontencoding{#1}\space->\space - \@EA\tracedfontname\csname\??ff#1\endcsname - \fi - \else - #1\tracedfontencoding{\fontclass#1}\space->\space - \@EA\tracedfontname\csname\??ff\fontclass#1\endcsname - \fi} - -\endTEX - -\beginETEX - \def\tracedfontencoding#1% {\ifcsname\??ff#1\s!encoding\endcsname \space[\csname\??ff#1\s!encoding\endcsname]% @@ -1798,8 +1936,6 @@ \else #1% \fi\fi} - -\endETEX %D \macros %D {getfontfileparameters} @@ -1823,11 +1959,12 @@ % {\edef\fontdata{\truefontdata{\truefontname{#1}}}% % \expanded{\getparameters[\@@currentfontfile][\fontdata]}} -\def\getfontfileparameters#1% +\def\getfontfileparameters#1% can be simpler for mkii {\edef\@@truefontname{\truefontname{#1}}% \edef\currentfontfileencoding{\truefontdata\@@truefontname\s!encoding}% \edef\currentfontfilemapping {\truefontdata\@@truefontname\s!mapping }% - \edef\currentfontfilehandling{\truefontdata\@@truefontname\s!handling}} + \edef\currentfontfilehandling{\truefontdata\@@truefontname\s!handling}% + \edef\currentfontfilefeatures{\truefontdata\@@truefontname\s!features}} %D \macros %D {definefont} @@ -1842,17 +1979,7 @@ %D \definefont[Text][LucidaBright sa 5.4] \Text last %D \stoptyping %D -%D The implementation one looks familiar: - -% The simple implementation is: -% -% \def\definefont -% {\dodoubleargument\dodefinefont} -% -% \def\dodefinefont[#1][#2]% -% {\doifinstringelse{ }{#2} -% {\unexpanded\setvalue{#1}{\dododefinefont{#1}{#2}}} -% {\dodefinefont[#1][#2 sa 1]}} +%D The implementation looks as follows: \def\definefont {\dotripleempty\dodefinefont} @@ -1866,14 +1993,6 @@ \fi} {\definefont[#1][#2 sa *][#3]}} -%\def\redodefinefont#1#2#3% -% {\dododefinefont{#1}{#2}% -% \doifnumberelse{#3} -% {\setupinterlinespace[#3]\setupspacing} -% {\doifassignmentelse{#3} -% {\setupinterlinespace[#3]\setupspacing} -% {\setups[#3]}}} % so, we can have setups associated to fonts ! - \def\redodefinefont#1#2#3% {\dododefinefont{#1}{#2}% \doifsetupselse{#3} @@ -1881,6 +2000,13 @@ {\setuplocalinterlinespace[#3]% \setupspacing}} % needed ? +\def\definefrozenfont + {\dotripleempty\dodefinefrozenfont} + +\def\dodefinefrozenfont[#1][#2][#3]% + {\dodefinefont[#1][#2][#3]% + \expandafter\let\csname\lastfontidentifier\expandafter\endcsname\csname\rawfontidentifier\endcsname} + % \def\defineclassfont % {\doquadrupleempty\dodefineclassfont} % @@ -1922,28 +2048,6 @@ \setfontcharacteristics \the\everyfontswitch} -\beginTEX - -\def\xxdododefinefont#1#2#3#4% \autofontsizetrue is set by calling routine - {\edef\lastfontidentifier{#3}% - \@EA\ifx\csname\newfontidentifier\endcsname\relax - \def\localrelativefontsize{#1}% - \def\localabsolutefontsize{#2}% - \parsefontspec{#4}\newfontidentifier - \let\localrelativefontsize\defaultrelativefontsize % not needed - \fi - \csname\newfontidentifier\endcsname - \autofontsizefalse - %\edef\lastfontidentifier{#3}% - \ifskipfontcharacteristics \else - \setfontcharacteristics - \the\everyfontswitch - \fi} - -\endTEX - -\beginETEX \ifcsname - \def\xxdododefinefont#1#2#3#4% \autofontsizetrue is set by calling routine {\edef\lastfontidentifier{#3}% \ifcsname\newfontidentifier\endcsname\else @@ -1960,8 +2064,6 @@ \the\everyfontswitch \fi} -\endETEX - %D I considered checking for mistakenly use of \PLAIN's %D \type{\magstep}'s but although it would take only a few %D lines of code, this would not add to consistent use. I @@ -2002,19 +2104,6 @@ {\scratchdimen#1\relax % \relax is really needed here \setvalue{\??ft*\the\scratchdimen}{#2}} -\beginTEX - -\def\setmappedfontsize#1% - {\expandafter\ifx\csname\??ft*#1\endcsname\relax - #1% - \else - \csname\??ft*#1\endcsname - \fi} - -\endTEX - -\beginETEX \ifcsname - \def\setmappedfontsize#1% {\ifcsname\??ft*#1\endcsname \csname\??ft*#1\endcsname @@ -2022,8 +2111,6 @@ #1% \fi} -\endETEX - %D \macros %D {getfontname} %D @@ -2065,34 +2152,6 @@ %D returns the current scaling factor. Take a look at %D \type {cont-log.tex} for an example of its use. -\beginTEX - -\def\currentfontscale - {\@EA\ifx\csname\??ft\s!default\xfontsize\endcsname\relax - \@EA\ifx\csname\??ft\s!default\s!text\endcsname\relax - 1% - \else - \csname\??ft\s!default\s!text\endcsname - \fi - \else - \csname\??ft\s!default\xfontsize\endcsname - \fi} - -\def\currentfontbodyscale - {\@EA\ifx\csname\??ft\s!default\fontsize\endcsname\relax - \@EA\ifx\csname\??ft\s!default\s!text\endcsname\relax - 1% - \else - \csname\??ft\s!default\s!text\endcsname - \fi - \else - \csname\??ft\s!default\fontsize\endcsname - \fi} - -\endTEX - -\beginETEX \ifcsname - \def\currentfontscale {\csname\??ft\s!default \ifcsname\??ft\s!default\xfontsize\endcsname \xfontsize \else @@ -2105,8 +2164,6 @@ \ifcsname\??ft\s!default\s!text \endcsname \s!text \fi\fi \endcsname} -\endETEX - \setvalue{\??ft\s!default}{1} %D Both alternatives use \type {\xfontsize}, a macro that @@ -2300,20 +2357,9 @@ %D Just a couple of interface macros: -\beginTEX - -\def\bodyfontvariable#1% - {\??ft\@EA\ifx\csname\??ft\fontclass#1\endcsname\relax\else\fontclass\fi#1} - -\endTEX - -\beginETEX \ifcsname - \def\bodyfontvariable#1% {\??ft\ifcsname\??ft\fontclass#1\endcsname\fontclass\fi#1} -\endETEX - \def\bodyfontcsname {\csname\bodyfontvariable} @@ -2675,7 +2721,7 @@ %D easily be made \ETEX\ aware. %D \macros -%D {everybodyfont,Everybodyfont} +%D {everybodyfont,Everybodyfont,everyglobalbodyfont} %D %D Every change in bodyfont size has conseqences for the baseline %D distance and skips between paragraphs. These are initialized @@ -2746,27 +2792,10 @@ \chardef\fontdigits=1 -% \def\donormalizedbodyfontsize#1.#2#3#4\to#5% -% {\edef#5% -% {#1% -% \ifcase\fontdigits\space -% \or -% \ifcase#2 \else.#2\fi % and not: \ifcase#2\else ... -% \else -% \ifcase#2#3 \else.#2\ifcase#3 \else#3\fi\fi % not: \ifcase#2#3\else ... -% \fi -% pt}} -% -% \def\normalizebodyfontsize#1\to#2% -% {\scratchdimen#1\relax -% \@EA\@EA\@EA\donormalizedbodyfontsize -% \@EA\WITHOUTPT\the\scratchdimen00\to#2} - \def\normalizebodyfontsize#1\to#2% {\scratchdimen#1\relax \ifcase\fontdigits\advance\scratchdimen.5\points\fi - \@EA\@EA\@EA\donormalizedbodyfontsize - \@EA\WITHOUTPT\the\scratchdimen00\to#2} + \@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\scratchdimen00\to#2} \def\donormalizedbodyfontsize#1.#2#3#4\to#5% \points ? {\edef#5% @@ -2919,6 +2948,7 @@ \doswitchpoints[\normalizedbodyfontsize]% \doswitchstyle[\fontstyle]% \the\everybodyfont + \the\everyglobalbodyfont \saveinterlinespace \global\let\preloadfonts\relax} @@ -3141,21 +3171,6 @@ \newtoks\fontstrategies \newif\iftryingfont -% \def\synchronizefont -% {\tryingfonttrue -% \ifx\fontclass\empty\else -% \let\fontstrategy\dofontclassstrategy -% \the\fontstrategies \relax % \relax still needed ? -% \fi -% \iftryingfont -% \let\fontstrategy\dofontstrategy -% \the\fontstrategies \relax % \relax still needed ? -% \fi -% \ifskipfontcharacteristics -% \setfontcharacteristics -% \the\everyfontswitch -% \fi} - \let\fontstrategy\relax \def\synchronizefont @@ -3173,22 +3188,6 @@ \the\everyfontswitch \fi} -\beginTEX - -\def\dofontstrategy#1#2#3#4#5% - {\@EA\ifx\csname#2#3#4#5\endcsname\relax\else - #1\csname#2#3#4#5\endcsname \tryingfontfalse - \fi} - -\def\dofontclassstrategy#1#2#3#4#5% - {\@EA\ifx\csname\fontclass#2#3#4#5\endcsname\relax\else - #1\csname\fontclass#2#3#4#5\endcsname \tryingfontfalse - \fi} - -\endTEX - -\beginETEX \ifcsname - \def\dofontstrategy#1#2#3#4#5% {\ifcsname#2#3#4#5\endcsname #1\csname#2#3#4#5\endcsname \tryingfontfalse @@ -3199,8 +3198,6 @@ #1\csname\fontclass#2#3#4#5\endcsname \tryingfontfalse \fi} -\endETEX - \appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- --- --- --- % pt tt bf a \fontbody \fontstyle \fontalternative \fontsize \fi \to \fontstrategies @@ -3231,7 +3228,9 @@ \prependtoks \ifsynchronizefonts - \synchronizemath \synchronizetext \synchronizefont + \synchronizemath + \synchronizetext + \synchronizefont % problem: syncs last font \fi \to \everybodyfont @@ -3242,20 +3241,6 @@ %D in text mode the values defined by the bodyfontenvironment are %D used. Here we also set \type{\currentxfontsize}. -\beginTEX - -\def\dosetcurrentfontxxxalternative#1#2#3#4% - {\chardef\currentxfontsize#2\relax - \ifmmode - #4% - \else\expandafter\ifx\csname\bodyfontvariable{\normalizedbodyfontsize#3}\endcsname\relax\else - \setcurrentfontbodyalternative{\bodyfontcsname\normalizedbodyfontsize#3\endcsname}{#1}% - \fi\fi} - -\endTEX - -\beginETEX \ifcsname - \def\dosetcurrentfontxxxalternative#1#2#3#4% {\chardef\currentxfontsize#2\relax \ifmmode @@ -3264,8 +3249,6 @@ \setcurrentfontbodyalternative{\bodyfontcsname\normalizedbodyfontsize#3\endcsname}{#1}% \fi\fi} -\endETEX - \def\setcurrentfontxalternative#1% {\dosetcurrentfontxxxalternative{#1}1\c!x\scriptstyle \let\tx\txx} @@ -3351,7 +3334,7 @@ {\rawdoifinsetelse{#2}{\stylelist} {}%\debuggerinfo\m!fonts{unknown style #2}} {\addtocommalist{#2}\stylelist - \showmessage\m!fonts8{#2 (#1)}}% + \showmessage\m!fonts8{#2\space (#1)}}% % check kan hier \def\docommand##1% {\setvalue{\@shortstyle@##1}{#2}% @@ -3471,7 +3454,8 @@ \normalizebodyfontsize\globalbodyfontsize\to\normalizedglobalbodyfontsize \let\globalfontstyle\fontstyle \ifloadingfonts\else - \the\everybodyfont % indeed needed in case \dosetfont is not executed + \the\everybodyfont + \the\everyglobalbodyfont \saveinterlinespace \fi}} @@ -3485,24 +3469,6 @@ %D The following alternative is meant for math||to||text %D switching and will be optimized. -\beginTEX - -\def\fastswitchtobodyfont#1% - {\@EA\ifx\csname\??ft\normalizedbodyfontsize#1\endcsname\else - \edef\futurebodyfontsize - {\csname\??ft\normalizedbodyfontsize#1\endcsname}% - \@EA\ifx\csname\@size@\futurebodyfontsize\endcsname\else - \csname\@size@\futurebodyfontsize\endcsname - \localbodyfontsize\futurebodyfontsize\relax - \fi - \fi - \csname\@style@\fontstyle\endcsname - \the\everybodyfont} - -\endTEX - -\beginETEX \ifcsname - \def\fastswitchtobodyfont#1% {\ifcsname\??ft\normalizedbodyfontsize#1\endcsname \edef\futurebodyfontsize @@ -3515,8 +3481,6 @@ \csname\@style@\fontstyle\endcsname \the\everybodyfont} -\endETEX - %D Because the last macro can appear in arguments or be assigned %D to parameters, we protect this one for unwanted expansion. @@ -3529,19 +3493,8 @@ \scriptfont \mrfam\scriptfont \mffam \scriptscriptfont\mrfam\scriptscriptfont\mffam} -\beginTEX - - \def\domffam#1% - {\csname\ifundefined{#1\s!fam}\c!nn\else#1\fi\s!fam\endcsname} - -\endTEX - -\beginETEX \ifcsname - - \def\domffam#1% - {\csname\ifcsname#1\s!fam\endcsname#1\else\c!nn\fi\s!fam\endcsname} - -\endETEX +\def\domffam#1% + {\csname\ifcsname#1\s!fam\endcsname#1\else\c!nn\fi\s!fam\endcsname} \def\mffam {\domffam\fontalternative} @@ -3557,39 +3510,36 @@ % \enableencodinginmath % too untested to enable by default -%D \startyping +%D \starttyping %D $\cases{& \ccaron}$ $x=\hbox{\ccaron $x=\hbox{\ccaron}$}$ %D \stoptyping %D The font specific features are bound to the filename. -\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 - {\updatefontparameters - \fastenableencoding - {\ifx\@@fontencoding\empty - \s!default \else \@@fontencoding - \fi}% - \fastenablemapping - {\ifx\@@fontmapping\empty - \ifx\@@fontencoding\empty - \s!default \else \@@fontencoding - \fi - \else - \@@fontmapping - \fi}% - \fastenablehandling - {\ifx\@@fonthandling\empty - \s!default \else \@@fonthandling - \fi}% - {\lastfontidentifier}% - \the\everyfont - \synchronizepatterns} +\ifx\updatefontparameters \undefined \let\updatefontparameters \relax \fi +\ifx\setfontcharacteristics\undefined \let\setfontcharacteristics\relax \fi + +%D Experimental: + +\def\definefontfeature + {\dotripleargument\dodefinefontfeature} + +\def\dodefinefontfeature[#1][#2][#3]% + {\mkdefinefontfeature{#1}{#2}{#3}} + +\ifx\mkdefinefontfeature\undefined \let\mkdefinefontfeature\gobbletwoarguments \fi + +\definefontfeature + [default] + [liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes + +\definefontfeature + [smallcaps] + [liga=yes,kern=yes,tlig=yes,trep=yes,smcp=yes] % texligatures=yes,texquotes=yes + +\definefontfeature + [oldstyle] + [liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes %D The next auxilliary macro is an alternative to \type %D {\fontname}. @@ -3737,6 +3687,7 @@ {\doswitchpoints[\normalizedbodyfontsize]% \doswitchstyle[\fontstyle]% \the\everybodyfont + \the\everyglobalbodyfont \saveinterlinespace} %D \macros @@ -3757,7 +3708,9 @@ \doswitchpoints[\normalizedglobalbodyfontsize]% \doswitchstyle[\globalfontstyle]% \redoconvertfont % just in case a pagebreak occurs - \tf \the\everybodyfont + \tf + \the\everybodyfont + \the\everyglobalbodyfont \saveinterlinespace} \def\partialrestoreglobalbodyfont @@ -4279,8 +4232,6 @@ % \def\fontstringC{\executeifdefined{\??ff:s:\fontstyle}\empty} % \def\fontstringD{\executeifdefined{\??ff:t:\csname\??tf\fontclass\s!default\endcsname}\s!Serif} -\beginETEX \ifcsname - \def\glyphfontfile#1% {#1% \ifcsname\??ff#1\fontstringA\fontstringC\endcsname @@ -4295,25 +4246,6 @@ \fontstringC \fi\fi\fi\fi\fi} -\endETEX - -\beginTEX - -\def\glyphfontfile#1% - {#1% - \expandafter\ifx\csname\??ff#1\fontstringA\fontstringC\endcsname\relax - \expandafter\ifx\csname\??ff#1\fontstringB\fontstringC\endcsname\relax - \expandafter\ifx\csname\??ff#1\fontstringA\endcsname\relax - \expandafter\ifx\csname\??ff#1\fontstringB\endcsname\relax - \expandafter\ifx\csname\??ff#1\fontstringC\endcsname\relax - \else \fontstringC \fi - \else \fontstringB \fi - \else \fontstringA \fi - \else \fontstringB\fontstringC \fi - \else \fontstringA\fontstringC \fi} - -\endTEX - %D The next macro can be used to make decisions based on the shape: \def\doifitalicelse#1#2% @@ -4708,21 +4640,24 @@ \definefontsize[\c!a] \definefontsize[\c!b] \definefontsize[\c!c] \definefontsize[\c!d] -\definealternativestyle [\v!mediaeval] [\os] [] -\definealternativestyle [\v!normal] [\tf] [] -\definealternativestyle [\v!bold] [\bf] [] -\definealternativestyle [\v!type] [\tt] [] -\definealternativestyle [\v!mono] [\tt] [] -\definealternativestyle [\v!slanted] [\sl] [] -\definealternativestyle [\v!italic] [\it] [] -\definealternativestyle [\v!boldslanted,\v!slantedbold] [\bs] [] -\definealternativestyle [\v!bolditalic,\v!italicbold] [\bi] [] -\definealternativestyle [\v!small,\v!smallnormal] [\tfx] [] -\definealternativestyle [\v!smallbold] [\bfx] [] -\definealternativestyle [\v!smalltype] [\ttx] [] -\definealternativestyle [\v!smallslanted] [\slx] [] -\definealternativestyle [\v!smallboldslanted,\v!smallslantedbold] [\bsx] [] -\definealternativestyle [\v!smallbolditalic,\v!smallitalicbold] [\bix] [] +\definealternativestyle [\v!mediaeval] [\os] [] +\definealternativestyle [\v!normal] [\tf] [] +\definealternativestyle [\v!bold] [\bf] [] +\definealternativestyle [\v!type] [\tt] [] +\definealternativestyle [\v!mono] [\tt] [] +\definealternativestyle [\v!slanted] [\sl] [] +\definealternativestyle [\v!italic] [\it] [] +\definealternativestyle [\v!boldslanted,\v!slantedbold] [\bs] [] +\definealternativestyle [\v!bolditalic,\v!italicbold] [\bi] [] +\definealternativestyle [\v!small,\v!smallnormal] [\tfx] [] +\definealternativestyle [\v!smallbold] [\bfx] [] +\definealternativestyle [\v!smalltype] [\ttx] [] +\definealternativestyle [\v!smallslanted] [\slx] [] +\definealternativestyle [\v!smallboldslanted,\v!smallslantedbold] [\bsx] [] +\definealternativestyle [\v!smallbolditalic,\v!smallitalicbold] [\bix] [] + +\definealternativestyle [\v!sans,\v!sansserif] [\ss] [] +\definealternativestyle [\v!sansbold] [\ss\bf] [] %D Slow but handy: @@ -4894,22 +4829,6 @@ %D \doiffontpresentelse{adam-lindsay-modern-serif}{YES}{NO} %D \stoptyping -\beginTEX - -\def\doiffontpresentelse#1% - {\bgroup - \batchmode\font\dummy=\truefontname{#1}\errorstopmode - \edef\lastfontname{\fontname\dummy}% - \ifx\lastfontname\nullfontname - \egroup\expandafter\secondoftwoarguments - \else - \egroup\expandafter\firstoftwoarguments - \fi} - -\endTEX - -\beginETEX \interactionmode - \def\doiffontpresentelse#1% {\bgroup \scratchcounter\interactionmode @@ -4923,6 +4842,4 @@ \egroup\expandafter\firstoftwoarguments \fi} -\endETEX - \protect \endinput |