diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
commit | 8fc3039c82d48605b5ca8b2eda3f4fdd755681e1 (patch) | |
tree | 3cd9bbdd599bc4d1ac0409e167fee2136e4c0ec9 /Master/texmf-dist/tex/context/base/unic-ini.mkii | |
parent | 850fc99b7cd3ae7a20065531fe866ff7bae642ec (diff) |
this is context 2009.08.19 17:10
git-svn-id: svn://tug.org/texlive/trunk@14827 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/unic-ini.mkii')
-rw-r--r-- | Master/texmf-dist/tex/context/base/unic-ini.mkii | 109 |
1 files changed, 42 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/context/base/unic-ini.mkii b/Master/texmf-dist/tex/context/base/unic-ini.mkii index ac1851fb662..f386494f2cd 100644 --- a/Master/texmf-dist/tex/context/base/unic-ini.mkii +++ b/Master/texmf-dist/tex/context/base/unic-ini.mkii @@ -2,7 +2,7 @@ %D [ file=unic-ini, %D version=2002.12.03, %D title=\CONTEXT\ \UNICODE\ Support, -%D subtitle=\UNICODE\ \& UTF-8 support, +%D subtitle=Initialization, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] @@ -11,15 +11,10 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\writestatus{loading}{Context UNICODE Macros (ini)} +\writestatus{loading}{ConTeXt Unicode Support / Initialization} %D Sorry, we only support his in \ETEX. -\beginTEX - \def\useunicodevector[#1]{} - \expandafter \endinput -\endTEX - \unprotect % ÀÁÂÃÄÅàáâãäå @@ -538,7 +533,7 @@ \def\douseunicodevector#1% {\ifundefined{\@@univector#1}% % \readsysfile{\f!unicprefix\threedigits{#1}} - \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}} + \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}.mkii} {\writestatus{unicode}{loading vector #1}} {\writestatus{unicode}{unknown vector #1}}% \fi} @@ -687,72 +682,52 @@ % We have to compensate for etex's rounding (thanks to Taco and % Nanning) for pointing/sorting this out: +\chardef \utf@a= 64 +\mathchardef \utf@b= 4096 +\newcount\utf@c\utf@c=262144 +\chardef \utf@d= 192 +\chardef \utf@e= 224 +\chardef \utf@f= 240 +\chardef \utf@g= 128 +\mathchardef \utf@h= 256 +\chardef \utf@i= 127 +\mathchardef \utf@j= 2048 +\chardef \utf@k= 32 + +% div: \numexp#1/#2\relax +% mod: \numexp#1-(#1/#2)*#2\relax + % \def\numbertoutf#1% -% {\ifnum#1<128 +% {\ifnum#1<\utf@g % \rawcharacter{#1}% % \else\ifnum#1<2048 -% \rawcharacter{\the\numexpr192+(#1-32)/64\relax}% -% \rawcharacter{\the\numexpr128+(#1-((#1-32)/64)*64)\relax}% +% \rawcharacter{\numexpr192+(#1/64)\relax}% 192 + (ud div 64) +% \rawcharacter{\numexpr128+(#1-(#1/64)*64)\relax}% 128 + (ud mod 64) +% \else\ifnum#1<2097152 +% \rawcharacter{\numexpr224+(#1-(#1/4096)\relax}% 224 + (ud div 4096) +% \rawcharacter{\numexpr128+(#1-((#1/64)-((#1/64)/64)*64)\relax}% 128 + ((ud div 64) mod 64) +% \rawcharacter{\numexpr128+(#1-(#1-(#1/64)*64)\relax}% 128 + (ud mod 64) % \else -% \rawcharacter{\the\numexpr224+(#1-2048)/4096\relax}% -% \rawcharacter{\the\numexpr128+(#1-(((#1-2048)/4096)*4096)-32)/64\relax}% -% \rawcharacter{\the\numexpr128+(#1-(((#1-2048)/4096)*4096)-((#1-(((#1-2048)/4096)*4096)-32)/64)*64)\relax}% +% % todo % \fi\fi} -\beginETEX \numexpr - - \chardef \utf@a= 64 - \mathchardef \utf@b= 4096 - \newcount\utf@c\utf@c=262144 - \chardef \utf@d= 192 - \chardef \utf@e= 224 - \chardef \utf@f= 240 - \chardef \utf@g= 128 - \mathchardef \utf@h= 256 - \chardef \utf@i= 127 - \mathchardef \utf@j= 2048 - \chardef \utf@k= 32 - - % div: \numexp#1/#2\relax - % mod: \numexp#1-(#1/#2)*#2\relax - - % \def\numbertoutf#1% - % {\ifnum#1<\utf@g - % \rawcharacter{#1}% - % \else\ifnum#1<2048 - % \rawcharacter{\numexpr192+(#1/64)\relax}% 192 + (ud div 64) - % \rawcharacter{\numexpr128+(#1-(#1/64)*64)\relax}% 128 + (ud mod 64) - % \else\ifnum#1<2097152 - % \rawcharacter{\numexpr224+(#1-(#1/4096)\relax}% 224 + (ud div 4096) - % \rawcharacter{\numexpr128+(#1-((#1/64)-((#1/64)/64)*64)\relax}% 128 + ((ud div 64) mod 64) - % \rawcharacter{\numexpr128+(#1-(#1-(#1/64)*64)\relax}% 128 + (ud mod 64) - % \else - % % todo - % \fi\fi} - - \def\numbertoutf#1% okay? - {\ifnum#1<\utf@g - \rawcharacter{#1}% - \else\ifnum#1<\utf@j - \rawcharacter{\the\numexpr\utf@d+(#1-\utf@k)/\utf@a\relax}% - \rawcharacter{\the\numexpr\utf@g+(#1-((#1-\utf@k)/\utf@a)*\utf@a)\relax}% - \else - \rawcharacter{\the\numexpr\utf@e+(#1-\utf@j)/\utf@b\relax}% - \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a\relax}% - \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-((#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a)*\utf@a)\relax}% - \fi\fi} - -\endETEX +\def\numbertoutf#1% okay? + {\ifnum#1<\utf@g + \rawcharacter{#1}% + \else\ifnum#1<\utf@j + \rawcharacter{\the\numexpr\utf@d+(#1-\utf@k)/\utf@a\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-((#1-\utf@k)/\utf@a)*\utf@a)\relax}% + \else + \rawcharacter{\the\numexpr\utf@e+(#1-\utf@j)/\utf@b\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-((#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a)*\utf@a)\relax}% + \fi\fi} \def\numbertohexstring#1{0x\uchexnumbers{\utfdiv{#1}}\uchexnumbers{\utfmod{#1}}} -\beginXETEX - \let\numbertoutf\numbertohexstring -\endXETEX - -\beginTEX +\ifnum\texengine=\xetexengine \let\numbertoutf\numbertohexstring -\endTEX +\fi \def\uchartoutf#1#2% {\expandafter\numbertoutf\expandafter{\the\numexpr#1*\utf@h+#2\relax}} @@ -786,13 +761,13 @@ %D Goodies: -\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run} -\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run} +\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run.mkii} +\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run.mkii} %D Well, let's at least preload a few familiar ones. Here we %D also load the \UTF\ regime. -\useunicodevector[0,1,2,3,4,5,30,31,32,33,34,37,39,251] +\useunicodevector[0,1,2,3,4,5,30,31,32,33,34,35,37,39,251] \useunicodevector[cjk] \useregime[utf] |