summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/enco-ini.mkiv
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/enco-ini.mkiv
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/enco-ini.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ini.mkiv144
1 files changed, 93 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.mkiv b/Master/texmf-dist/tex/context/base/enco-ini.mkiv
index 112c5596a8a..da1892faf2a 100644
--- a/Master/texmf-dist/tex/context/base/enco-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/enco-ini.mkiv
@@ -40,9 +40,9 @@
%D around, just in case they are used in styles (and in for instance
%D symb and xtag files).
-\def\startencoding [#1]{} % used in symb
+\unexpanded\def\startencoding [#1]{} % used in symb
\let\stopencoding \relax
-\def\setupencoding [#1]{}
+\unexpanded\def\setupencoding [#1]{}
\def\enablemapping [#1]{}
\def\enableencoding[#1]{}
@@ -61,20 +61,20 @@
%D \macros
%D {defineaccent, definecharacter, definecommand}
-\def\defineaccent#1 #2 #3 %
+\unexpanded\def\defineaccent#1 #2 #3 %
{\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}%
\setvalue{\??ac\string#1\string#2}{#3}}
\def\dohandleaccent#1#2%
- {\csname\??ac\string#1\string#2\endcsname}
+ {\csname\??ac\string#1\string#2\empty\endcsname}
-\def\definecharacter#1 #2 %
+\unexpanded\def\definecharacter#1 #2 %
{\doifnumberelse{\string#2}
{\setevalue{\string#1}{\utfchar{#2}}} % or {\expandafter\chardef\csname#1\endcsname#2\relax}
- {\unexpanded\setvalue {\string#1}{#2}}}
+ {\setuvalue {\string#1}{#2}}}
-\def\definecommand#1 #2 %
- {\unexpanded\setvalue{\string#1}{#2}}
+\unexpanded\def\definecommand#1 #2 %
+ {\setuvalue{\string#1}{#2}}
%D \macros
%D {everyuppercase, EveryUppercase,
@@ -123,11 +123,13 @@
\vbox to .2ex{\box0\vss}\hidewidth
\crcr}}}
-\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
-\def\buildtextbottomdot {\bottomaccent{.25ex}{0}{5}{\textbottomdot}}
-\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}}
-\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
-\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}}
+\unexpanded\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
+\unexpanded\def\buildtextbottomdot {\bottomaccent{.25ex}{0}{5}{\textbottomdot}}
+\unexpanded\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}}
+\unexpanded\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
+\unexpanded\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}}
+
+\let\d\buildtextbottomdot
\unexpanded\def\topaccent#1#2#3#4#5% down right slantcorrection accent char
{\dontleavehmode
@@ -143,7 +145,7 @@
\def\buildtextgrave{\topaccent{0pt}{0}{15}{\textgrave}} % e.g.
-\def\definemathaccent#1 #2%
+\unexpanded\def\definemathaccent#1 #2%
{\setvalue{#1}{\mathaccent#2 }}
%D Math (will move):
@@ -322,37 +324,65 @@
\unexpanded\def\schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}}
\unexpanded\def\schwagrave {\buildtextgrave\schwa}
-\unexpanded\def\normalcontrolspace{\getglyph{ComputerModernMono}{\char32}}
-\unexpanded\def\textvisiblespace {\fakecontrolspace}
-\unexpanded\def\fakecontrolspace {\let\normalcontrolspace\fakedcontrolspace}
-
-% helpers
-
-\def\fakepercent
- {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}}
-
-\def\fakeperthousand
- {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}}
-
-\def\fakepermine
- {\dontleavehmode
- \bgroup
- \setbox\scratchbox\hbox
- {\mathematics{+}}%
- \hbox to \wd\scratchbox
- {\hss\mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}\hss}%
- \egroup}
-
-\def\fakedcontrolspace % can be virtual in luatex
- {\dontleavehmode\hbox
- {\scratchdimen.1ex%
- \kern\scratchdimen
- \vrule \!!width\scratchdimen \!!height5.5\scratchdimen\!!depth3\scratchdimen
- \vrule \!!width\dimexpr.5em-4\scratchdimen\!!height -2\scratchdimen\!!depth3\scratchdimen
- \vrule \!!width\scratchdimen \!!height5.5\scratchdimen\!!depth3\scratchdimen
- \kern\scratchdimen}}
+\chardef\textcontrolspace"2423
+
+\unexpanded\def\fallbackcontrolspace
+ %{\getglyph{ComputerModernMono}\textcontrolspace}
+ {\getglyph{LMTypewriter10-Regular}\textcontrolspace}
+
+\unexpanded\def\normalcontrolspace
+ {\iffontchar\font\textcontrolspace
+ \textcontrolspace
+ \else
+ \fallbackcontrolspace
+ \fi}
+
+\let\textvisiblespace\normalcontrolspace
+
+\unexpanded\def\fastcontrolspace % no glyph resolving after first (use grouped)
+ {\dofastcontrolspace}
+
+\def\dofastcontrolspace
+ {\iffontchar\font\textcontrolspace
+ \nofastfallbackcontrolspace
+ \else
+ \dofastfallbackcontrolspace
+ \fi
+ \dofastcontrolspace}
+
+\newbox\controlspacebox
+
+\def\nofastfallbackcontrolspace
+ {\let\dofastcontrolspace\textcontrolspace}
+
+\def\dofastfallbackcontrolspace
+ {\setbox\controlspacebox\hbox{\space}%
+ \setbox\controlspacebox\hbox to \wd\controlspacebox{\hss\fallbackcontrolspace\hss}%
+ \let\dofastcontrolspace\flushcontrolspacebox}
+
+\def\flushcontrolspacebox
+ {\copy\controlspacebox}
+
+% a few defaults (\<whatever>{}), we really need the verbose \empty as it will be
+% stringified
+
+\defineaccent ^ {\empty} {\textcircumflex}
+\defineaccent ` {\empty} {\textgrave}
+\defineaccent ~ {\empty} {\texttilde}
+\defineaccent " {\empty} {\textdiaeresis}
+\defineaccent ' {\empty} {\textacute}
+\defineaccent . {\empty} {\textdotaccent}
+\defineaccent = {\empty} {\textmacron}
+\defineaccent c {\empty} {\textcedilla}
+\defineaccent H {\empty} {\texthungarumlaut}
+\defineaccent k {\empty} {\textogonek}
+\defineaccent r {\empty} {\textring}
+\defineaccent u {\empty} {\textbreve}
+\defineaccent v {\empty} {\textcaron}
% from enco-acc:
+%
+% we should to this at the lua end and share code ..
\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex}
\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex}
@@ -469,15 +499,27 @@
%D A smaller and bolder variant, more like the math and monospaced ones.
+% \def\fakeunderscore
+% {\dontleavehmode\hbox % was \leavevmode
+% {\setbox\scratchbox\hbox{(}%
+% \scratchdimen.2\dp\scratchbox
+% \setbox\scratchbox\hbox{\space}%
+% \vrule
+% \!!depth \scratchdimen
+% \!!width \wd\scratchbox
+% \!!height\zeropoint}}
+
+% \startTEXpage
+% \ruledhbox{\strut$1\fakeunderscore^{1\fakeunderscore}$}
+% \ruledhbox{\strut$1\xfakeunderscore^{1\xfakeunderscore}$}
+% \stopTEXpage
+
\def\fakeunderscore
- {\leavevmode\hbox
- {\setbox\scratchbox\hbox{(}%
- \scratchdimen.2\dp\scratchbox
- \setbox\scratchbox\hbox{\space}%
- \vrule
- \!!depth \scratchdimen
- \!!width \wd\scratchbox
- \!!height\zeropoint}}
+ {\relax\ifmmode
+ \vrule\!!depth .12\fontexheight\mathstylefont\normalmathstyle\!!width \fontinterwordspace\mathstylefont\normalmathstyle\!!height\zeropoint\relax
+ \else
+ \dontleavehmode\hbox{\vrule\!!depth .12\fontexheight\font\!!width \fontinterwordspace\font\!!height\zeropoint}%
+ \fi}
\def\fakeunderscores{\let\_\fakeunderscore}
\def\textunderscores{\let\_\textunderscore}