diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/enco-ini.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/enco-ini.tex | 101 |
1 files changed, 62 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.tex b/Master/texmf-dist/tex/context/base/enco-ini.tex index da14b509b4e..4c85bac5b25 100644 --- a/Master/texmf-dist/tex/context/base/enco-ini.tex +++ b/Master/texmf-dist/tex/context/base/enco-ini.tex @@ -11,6 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D Quite some code will be moved to the mk files once we're ready +%D for it. + %D This module is a reimplementation of the module that handled %D composed characters and non \ASCII\ characters. The changed %D are not that fundamental, and mainly concerns moving @@ -638,7 +641,8 @@ \pathypsettings\afterassignment\hyphenation\scratchtoks=} %D This is not needed for patterns because they are loaded grouped -%D anyway and it saves us an assignment. +%D anyway and it saves us an assignment. Can go ... no longer +%D shared patterns. \def\startpatternloading#1#2#3% % we should use \everypatternloading {\startreadingfile @@ -977,6 +981,9 @@ % "\dobuildtextaccent \char 18 a" but "\dobuildtextaccent {\char 18}{a}" % instead +\def\buildmathaccent#1% + {\mathaccent#1 } + \def\buildtextaccent#1#2% ** {\ifignoreaccent \expandafter\nobuildtextaccent @@ -984,28 +991,27 @@ \expandafter\dobuildtextaccent \fi{#1}{#2}} +\unexpanded\def\nobuildtextaccent#1#2% + {#2} + \unexpanded\def\dobuildtextaccent#1#2% {{\let\char\normalaccent#1\let\char\normalchar#2}} -\unexpanded\def\nobuildtextaccent#1#2% - {#2} +% EVENTUALLY THIS CODE WILL MOVE TO AN mkiv module -\def\buildmathaccent#1% - {\mathaccent#1 } +\beginLUATEX -% will be overloaded later +\newbox\accenttestbox -\definecommand ` {\buildtextaccent\textgrave} -\definecommand ' {\buildtextaccent\textacute} -\definecommand r {\buildtextaccent\textring} -\definecommand v {\buildtextaccent\textcaron} -\definecommand u {\buildtextaccent\textbreve} -\definecommand = {\buildtextaccent\textmacron} -\definecommand ^ {\buildtextaccent\textcircumflex} -\definecommand . {\buildtextaccent\textdotaccent} -\definecommand H {\buildtextaccent\texthungarumlaut} -\definecommand ~ {\buildtextaccent\texttilde} -\definecommand " {\buildtextaccent\textdiaeresis} +\unexpanded\def\dobuildtextaccent#1#2% + {\begingroup + \global\setbox\accenttestbox\hbox{#1}% + \scratchcounter\ctxlua{characters.charcode(\number\accenttestbox)}% + \ifcase\scratchcounter\else\accent\scratchcounter\fi + \relax#2% + \endgroup} + +\endLUATEX % some fake ones, name will change into build @@ -1032,11 +1038,6 @@ \def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}} \def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}} -\definecommand c {\buildtextcedilla} -\definecommand b {\buildtextmacron} -\definecommand d {\buildtextbottomdot} -\definecommand k {\buildtextogonek} - %D A collectors item: \def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}} @@ -1069,19 +1070,6 @@ \def\donormalmathaccent#1% {\getvalue{normalmathaccent\string#1}} -\definemathaccent acute {\buildmathaccent\mathacute} -\definemathaccent grave {\buildmathaccent\mathgrave} -\definemathaccent ddot {\buildmathaccent\mathddot} -\definemathaccent tilde {\buildmathaccent\mathtilde} -\definemathaccent bar {\buildmathaccent\mathbar} -\definemathaccent breve {\buildmathaccent\mathbreve} -\definemathaccent check {\buildmathaccent\mathcheck} -\definemathaccent hat {\buildmathaccent\mathhat} -\definemathaccent vec {\buildmathaccent\mathvec} -\definemathaccent dot {\buildmathaccent\mathdot} -\definemathaccent widetilde {\buildmathaccent\mathwidetilde} -\definemathaccent widehat {\buildmathaccent\mathwidehat} - %D Some precautions: \ifx\usepdffontresource\undefined @@ -1194,12 +1182,47 @@ %D We preload several encodings: -\useencoding[def,acc,raw,com,cas,mis] % mis should come first +\loadmarkfile{enco-ini} + +\definecommand ` {\buildtextaccent\textgrave} +\definecommand ' {\buildtextaccent\textacute} +\definecommand r {\buildtextaccent\textring} +\definecommand v {\buildtextaccent\textcaron} +\definecommand u {\buildtextaccent\textbreve} +\definecommand = {\buildtextaccent\textmacron} +\definecommand ^ {\buildtextaccent\textcircumflex} +\definecommand . {\buildtextaccent\textdotaccent} +\definecommand H {\buildtextaccent\texthungarumlaut} +\definecommand ~ {\buildtextaccent\texttilde} +\definecommand " {\buildtextaccent\textdiaeresis} -\useencoding[ans,il2,ec,tbo,pdf,uc,pol,qx,t5,cyr,agr] % pol and il2 will go away +\definecommand c {\buildtextcedilla} +\definecommand b {\buildtextmacron} +\definecommand d {\buildtextbottomdot} +\definecommand k {\buildtextogonek} + +\definemathaccent acute {\buildmathaccent\mathacute} +\definemathaccent grave {\buildmathaccent\mathgrave} +\definemathaccent ddot {\buildmathaccent\mathddot} +\definemathaccent tilde {\buildmathaccent\mathtilde} +\definemathaccent bar {\buildmathaccent\mathbar} +\definemathaccent breve {\buildmathaccent\mathbreve} +\definemathaccent check {\buildmathaccent\mathcheck} +\definemathaccent hat {\buildmathaccent\mathhat} +\definemathaccent vec {\buildmathaccent\mathvec} +\definemathaccent dot {\buildmathaccent\mathdot} +\definemathaccent widetilde {\buildmathaccent\mathwidetilde} +\definemathaccent widehat {\buildmathaccent\mathwidehat} -\useencoding[032,033,037] +\useencoding[def] % defaults (partly simplified) +\useencoding[acc] % accent commands +\useencoding[raw] % simplified (incomplete) +\useencoding[com] % a few commands +\useencoding[cas] % case mapping, not needed in mkiv +\useencoding[mis] % a few commands -\setupencoding[\s!default=ec] % was: [\s!default=\s!default] +% \useencoding[ans,il2,ec,tbo,pdf,uc,pol,qx,t5,cyr,agr] % pol and il2 will go away, not needed in mkiv +% \useencoding[032,033,037] % fallbacks for some unicode chars +% \setupencoding[\s!default=ec] % was: [\s!default=\s!default] \protect \endinput |