summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2001-04-09 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2001-04-09 00:00:00 +0200
commit097d775537de422f644e9d13a40a3b18bf7dfe91 (patch)
tree24871ebb9648fabc5ac88f4003edfa2005a3b3d3
parent2a2e86e6c2022e3925e0ee62f5c7b66bbec03338 (diff)
downloadcontext-097d775537de422f644e9d13a40a3b18bf7dfe91.tar.gz
stable 2001.04.09
-rw-r--r--context/perltk/texexec.pl4
-rw-r--r--metapost/context/mp-core.mp2
-rw-r--r--metapost/context/mp-spec.mp37
-rw-r--r--metapost/context/mp-tool.mp10
-rw-r--r--tex/context/base/colo-ini.tex75
-rw-r--r--tex/context/base/cont-log.tex4
-rw-r--r--tex/context/base/cont-new.tex103
-rw-r--r--tex/context/base/cont-usr.ori8
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-fig.tex2
-rw-r--r--tex/context/base/core-new.tex20
-rw-r--r--tex/context/base/core-pos.tex23
-rw-r--r--tex/context/base/enco-acc.tex4
-rw-r--r--tex/context/base/enco-def.tex8
-rw-r--r--tex/context/base/enco-il2.tex73
-rw-r--r--tex/context/base/enco-ini.tex71
-rw-r--r--tex/context/base/enco-raw.tex4
-rw-r--r--tex/context/base/enco-run.tex8
-rw-r--r--tex/context/base/lang-ini.tex152
-rw-r--r--tex/context/base/lang-sla.tex4
-rw-r--r--tex/context/base/m-pictex.tex4
-rw-r--r--tex/context/base/main-001.tex6
-rw-r--r--tex/context/base/meta-ini.tex10
-rw-r--r--tex/context/base/meta-txt.tex10
-rw-r--r--tex/context/base/mult-com.tex13
-rw-r--r--tex/context/base/mult-sys.tex8
-rw-r--r--tex/context/base/page-lyr.tex52
-rw-r--r--tex/context/base/s-pre-02.tex2
-rw-r--r--tex/context/base/s-pre-15.tex4
-rw-r--r--tex/context/base/s-pre-19.tex4
-rw-r--r--tex/context/base/spec-tpd.tex57
-rw-r--r--tex/context/base/supp-lan.tex3
-rw-r--r--tex/context/base/supp-mpe.tex131
-rw-r--r--tex/context/base/supp-ran.tex2
-rw-r--r--tex/context/base/syst-gen.tex33
-rw-r--r--tex/context/base/x-fig-00.tex7
-rw-r--r--tex/context/base/xtag-ini.tex9
-rw-r--r--tex/context/config/cont-usr.tex8
38 files changed, 753 insertions, 224 deletions
diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl
index 96675fb6d..c5f11859e 100644
--- a/context/perltk/texexec.pl
+++ b/context/perltk/texexec.pl
@@ -1090,9 +1090,9 @@ sub PopResult
unlink "$Result.tuo" ; rename "$File.tuo", "$Result.tuo" ;
unlink "$Result.log" ; rename "$File.log", "$Result.log" ;
unlink "$Result.dvi" ; rename "$File.dvi", "$Result.dvi" ;
-if (-e "$File.dvi") { CopyFile("$File.dvi", "$Result.dvi") }
+ if (-e "$File.dvi") { CopyFile("$File.dvi", "$Result.dvi") }
unlink "$Result.pdf" ; rename "$File.pdf", "$Result.pdf" ;
-if (-e "$File.pdf") { CopyFile("$File.pdf", "$Result.pdf") }
+ if (-e "$File.pdf") { CopyFile("$File.pdf", "$Result.pdf") }
return if ($File ne "texexec") ;
rename "texexec.tuo", "$File.tuo" ;
rename "texexec.log", "$File.log" ;
diff --git a/metapost/context/mp-core.mp b/metapost/context/mp-core.mp
index d4045d3da..3bc42ee74 100644
--- a/metapost/context/mp-core.mp
+++ b/metapost/context/mp-core.mp
@@ -24,6 +24,8 @@ def box_found (expr n,x,y,w,h,d) =
not ((x=0) and (y=0) and (w=0) and (h=0) and (d=0))
enddef ;
+% left / right page problem ! ! ! ! !
+
def initialize_box_pos (expr pos,n,x,y,w,h,d) =
pair lxy, rxy, cxy, llxy, lrxy, ulxy, urxy ;
path pxy ; numeric hxy, wxy, dxy, nxy;
diff --git a/metapost/context/mp-spec.mp b/metapost/context/mp-spec.mp
index b23164c14..db7cbd256 100644
--- a/metapost/context/mp-spec.mp
+++ b/metapost/context/mp-spec.mp
@@ -227,4 +227,41 @@ enddef ;
%
% \blank Does it work or not?
+_cmyk_counter_ := 0 ;
+
+numeric cmykcolorhash[][][][] ;
+
+boolean cmykcolors ; % cmykcolors := true ;
+
+let normalcmyk = cmyk ; % see mp-tool.mp
+
+vardef cmyk(expr c,m,y,k) =
+ if cmykcolors :
+ if not known cmykcolorhash[c][m][y][k] :
+ _cmyk_counter_ := _cmyk_counter_ + 1 ;
+ cmykcolorhash[c][m][y][k] := _cmyk_counter_ ;
+ flush_special(1, 7,
+ decimal _cmyk_counter_ & " " &
+ decimal c & " " &
+ decimal m & " " &
+ decimal y & " " &
+ decimal k) ;
+ fi
+ (_special_signal_/1000,1/1000,cmykcolorhash[c][m][y][k]/1000)
+ else :
+ normalcmyk(1-c-k,1-m-k,1-y-k)
+ fi
+enddef ;
+
+%D Basic position tracking:
+
+def register (expr label, width, height, offset) =
+ begingroup ;
+ flush_special(50, 7,
+ ddecimal offset & " " &
+ decimal width & " " &
+ decimal height & " " & label) ;
+ endgroup ;
+enddef ;
+
endinput ;
diff --git a/metapost/context/mp-tool.mp b/metapost/context/mp-tool.mp
index 958cc3903..76c7708cf 100644
--- a/metapost/context/mp-tool.mp
+++ b/metapost/context/mp-tool.mp
@@ -1031,8 +1031,6 @@ vardef thefreelabel (expr str, loc, ori) =
(s shifted -l)
enddef ;
-
-
vardef freelabel (expr str, loc, ori) =
draw thefreelabel(str,loc,ori) ;
enddef ;
@@ -1040,7 +1038,7 @@ enddef ;
vardef freedotlabel (expr str, loc, ori) =
interim linecap:=rounded ;
draw loc withpen pencircle scaled freedotlabelsize ;
- freelabel(str,loc,ori) ;
+ draw thefreelabel(str,loc,ori) ;
enddef ;
%D \starttypen
@@ -1459,6 +1457,12 @@ primarydef p cornered c =
endfor cycle)
enddef ;
+% cmyk color support
+
+vardef cmyk(expr c,m,y,k) =
+ (1-c-k,1-m-k,1-y-k)
+enddef ;
+
% done
endinput ;
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 729629cea..4bbf139af 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -206,7 +206,7 @@
\def\dodefinecolor[#1][#2]%
{% beware
-\saveglobal
+\saveglobal % ? \dodoglobal
\addtocommalist{#1}\colorlist
\restoreglobal
\doifassignmentelse{#2}
@@ -464,20 +464,34 @@
\else\ifnum#1<1000 0.\the#1%
\else 1\fi\fi\fi}
+% \def\doconvertCMYKtoRGB#1\k#2\to#3%
+% {\scratchdimen=#1\s!pt
+% \advance\scratchdimen by #2\s!pt\relax
+% \ifdim\scratchdimen>1\s!pt
+% \scratchdimen=-1\s!pt
+% \else
+% \scratchdimen=-\scratchdimen
+% \fi
+% \advance\scratchdimen by 1\s!pt
+% \multiply\scratchdimen by 1000
+% \scratchcounter=\scratchdimen
+% \advance\scratchcounter by \!!medcard
+% \divide\scratchcounter by \!!maxcard
+% \edef#3{\realcolorvalue\scratchcounter}}
+
\def\doconvertCMYKtoRGB#1\k#2\to#3%
- {\scratchdimen=#1\s!pt
- \advance\scratchdimen by #2\s!pt\relax
- \ifdim\scratchdimen>1\s!pt
- \scratchdimen=-1\s!pt
+ {\ifdim#2\s!pt<#1\s!pt % k>color
+ \scratchdimen=1\s!pt
+ \advance\scratchdimen -#1\s!pt
+ \advance\scratchdimen -#2\s!pt
+ \multiply\scratchdimen by 1000
+ \scratchcounter=\scratchdimen
+ \advance\scratchcounter by \!!medcard
+ \divide\scratchcounter by \!!maxcard
+ \edef#3{\realcolorvalue\scratchcounter}%
\else
- \scratchdimen=-\scratchdimen
- \fi
- \advance\scratchdimen by 1\s!pt
- \multiply\scratchdimen by 1000
- \scratchcounter=\scratchdimen
- \advance\scratchcounter by \!!medcard
- \divide\scratchcounter by \!!maxcard
- \edef#3{\realcolorvalue\scratchcounter}}
+ \edef#3{0}%
+ \fi}
\def\convertCMYKtoRGB#1#2#3#4%
{\doconvertCMYKtoRGB#1\k#4\to\@@cl@@r
@@ -570,6 +584,9 @@
\doifelse{\@@clcmyk}{\v!nee}
{\showmessage{\m!colors}{9}{\v!cmyk}\CMYKsupportedfalse}
{\showmessage{\m!colors}{10}{\v!cmyk}\CMYKsupportedtrue}%
+ \doifelse{\@@clmpcmyk}{\v!nee}
+ {\showmessage{\m!colors}{9} {\v!mp\v!cmyk}\MPcmykfalse}
+ {\showmessage{\m!colors}{10}{\v!mp\v!cmyk}\MPcmyktrue}%
\processaction
[\@@clconversie]
[ \v!ja=>\preferGRAYtrue,
@@ -1543,7 +1560,7 @@
\box#1\dostopnegative}}
%D \macros
-%D {ifMPgraphics, MPcolor}
+%D {ifMPgraphics, ifMPcmyk, MPcolor}
%D
%D A very special macro is \type{\MPcolor}. This one can be
%D used to pass a \CONTEXT\ color to \METAPOST.
@@ -1553,7 +1570,11 @@
%D \stoptypen
%D
%D This macro returns a \METAPOST\ triplet \type{(R,G,B)}.
-%D Only \kap{RGB} colors and gray scales are supported.
+%D Unless \CMYK\ color support is turned on with \type
+%D {MPcmyk}, only \kap{RGB} colors and gray scales are
+%D supported.
+
+\newif\ifMPcmyk % \MPcmykfalse
\def\MPcolor#1%
{\ifMPgraphics
@@ -1562,14 +1583,21 @@
#1%
\fi}
-\def\doMPcolor#1:#2:#3:#4:#5:#6\end%
+% \def\doMPcolor#1:#2:#3:#4:#5:#6\end%
+% {\if #1R(#2,#3,#4)%
+% \else\if#1C(1-#2-#5,1-#3-#5,1-#4-#5)%
+% % \else\if#1C(1-#2+#5,1-#3+#5,1-#4+#5)%
+% \else\if#1S(#2,#2,#2)%
+% \else (0,0,0)%
+% \fi\fi\fi}
+
+\def\doMPcolor#1:#2:#3:#4:#5:#6\end
{\if #1R(#2,#3,#4)%
- \else\if#1C(1-#2-#5,1-#3-#5,1-#4-#5)%
-% \else\if#1C(1-#2+#5,1-#3+#5,1-#4+#5)%
- \else\if#1S(#2,#2,#2)%
+ \else\if#1C\ifMPcmyk cmyk(#2,#3,#4,#5)\else(1-#2-#5,1-#3-#5,1-#4-#5)\fi
+ \else\if#1S(#2,#2,#2)%
\else (0,0,0)%
\fi\fi\fi}
-
+
%D \macros
%D {PDFcolor,FDFcolor}
%D
@@ -1603,7 +1631,8 @@
\c!conversie=\v!ja,
\c!reductie=\v!nee,
\c!rgb=\v!ja,
- \c!cmyk=\v!ja]
+ \c!cmyk=\v!ja,
+ \c!mp\c!cmyk=\@@clcmyk]
\setupcolor
[\v!rgb]
@@ -1611,6 +1640,4 @@
%D As we can see, color support is turned off by default.
%D Reduction of gray colors to gray scales is turned on.
-\protect
-
-\endinput
+\protect \endinput
diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex
index e048655ed..989c79846 100644
--- a/tex/context/base/cont-log.tex
+++ b/tex/context/base/cont-log.tex
@@ -169,6 +169,4 @@
\let\PDFTEX \pdfTeX
\let\PDFETEX \pdfeTeX
-\protect
-
-\endinput
+\protect \endinput
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 88014d202..935e2229b 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -12,40 +12,69 @@
%C details.
% manual : offsetbox alignbox
-
\def\placefloats{\doflushfloats} % keep this one
-% already patched, spurious space due to stupid optimization
-
-\def\unprotect%
- {\ifcase\protectionlevel
- \edef\doprotectcharacters%
- {\catcode`\noexpand @=\the\catcode`@ %
- \catcode`\noexpand !=\the\catcode`! %
- \catcode`\noexpand ?=\the\catcode`?}%
- \catcode`@=11
- \catcode`!=11
- \catcode`?=11
- \let\protect\doprotect
- \fi
- \advance\protectionlevel 1
- \ifnum\protectionlevel>1
- \message{<unprotect \the\protectionlevel>}%
- \fi}
+\unprotect
+
+\def\definieertekst%
+ {\doseventupleempty\dodefinieertekst}
+
+\def\dodefinieertekst[#1][#2][#3][#4][#5][#6][#7]%
+ {\ifseventhargument
+ \setvalue{\??tk#2#3#1}{\dosixtupleempty\dodododoteksten[#2][#3][#4][#5][#6][#7]}%
+ \else\ifsixthargument
+ \setvalue{\??tk #2#1}{\dosixtupleempty\dodododoteksten[#2][#3][#4][#5][#6]}%
+ \else\iffifthargument
+ \setvalue{\??tk#2#3#1}{\dosixtupleempty\dodododoteksten[#2][#3][#4][#5]}%
+ \else\iffourthargument
+ \setvalue{\??tk #2#1}{\dosixtupleempty\dodododoteksten[#2][#3][#4]}%
+ \else
+ \setvalue{\??tk #2#1}{\dosixtupleempty\dodododoteksten[#2][#3]}%
+ \fi\fi\fi\fi}
+
+\def\plaatslayoutregel#1#2% % handelt o.b.v. tekst
+ {%\message{#1: \getvalue{\??tk#1\v!tekst\c!status}}\wait
+ \ExpandFirstAfter\processaction
+ [\getvalue{\??tk#1\v!tekst\c!status}]
+ [ \v!geen=>,
+ \v!hoog=>, % is reset later on
+ \v!start=>\setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}%
+ \doplaatslayoutregel{#1}{#2},
+ \v!stop=>\vskip#2\relax,
+ \v!leeg=>\setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}%
+ \vskip#2\relax,
+ \v!geenmarkering=>\bgroup
+ \setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}%
+ \let\dohaalmarkering=\nohaalmarkering
+ \doplaatslayoutregel{#1}{#2}%
+ \egroup,
+ \v!normaal=>\doplaatslayoutregel{#1}{#2},
+ \s!default=>\doplaatslayoutregel{#1}{#2},
+ \s!unknown=>\bgroup % new
+ \setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}%
+% \getvalue{\??tk#1\commalistelement}%
+\setlocallayoutline{#1\commalistelement}%
+\setlocallayoutline{#1\v!tekst\commalistelement}%
+\setlocallayoutline{#1\v!marge\commalistelement}%
+\setlocallayoutline{#1\v!rand\commalistelement}%
+ \doplaatslayoutregel{#1}{#2}%
+ \egroup]}
+
+\def\setlocallayoutline#1%
+ {\ifundefined{\??tk#1}\else\getvalue{\??tk#1}\fi}
+
+% permits \stoptext inside module
\def\dousemodules[#1]%
{\doifelsenothing{#1}
{\let\next\relax}
{\def\next{\processcommalist[#1]\dodousemodules}}
\next}
-
-\unprotect
-
-% permits \stoptext inside module
-\def\dododousemodules#1#2%
- {\ifconditional\moduleisloaded
+\def\dododousemodules#1#2% we need to protect \next somehow
+ {\relax
+ \ifconditional\moduleisloaded
\let\next\relax
\else
\makeshortfilename[#1\truefilename{#2}]%
@@ -63,8 +92,6 @@
\let\next\relax}%
\fi
\next}
-
-
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks and new features.
@@ -100,6 +127,30 @@
% already patched
+\def\dochecksidefloat%
+ {\progresssidefloat
+ \ifdim\!!heighta>\!!zeropoint
+% \advance\!!heighta by \sidefloatbottomskip
+% \!!counta=\!!heighta
+\scratchdimen=\!!heighta
+\advance\scratchdimen \ht\strutbox
+\!!counta=\scratchdimen
+ \divide\!!counta by \baselineskip
+ \ifnum\!!counta>0
+ \ifrightfloat
+ \hangindent=-\sidefloatwidth
+ \else
+ \hangindent=\sidefloatwidth
+ \fi
+ \hangafter=-\!!counta
+ \fi
+ \setsidefloatparagraph
+ \else
+ \resetsidefloatparagraph
+ \fi
+ \parskip=\tussenwit}
+
+
\def\setsidefloat%
{\vbox{\strut}\vskip-\lineheight
\kern\sidefloattopskip
diff --git a/tex/context/base/cont-usr.ori b/tex/context/base/cont-usr.ori
index 4ced0fdc8..e11370510 100644
--- a/tex/context/base/cont-usr.ori
+++ b/tex/context/base/cont-usr.ori
@@ -66,10 +66,10 @@
%D pattern files are self contained, which is why (for the
%D moment) we specify encodings here.
-\installlanguage [\s!cz] [\s!mapping=il2,\s!encoding=il2]
-\installlanguage [\s!hr] [\s!mapping=il2,\s!encoding=il2]
+\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
\installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
-\installlanguage [\s!sk] [\s!mapping=il2,\s!encoding=il2]
+\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
%D Sometimes these are not wanted:
@@ -98,7 +98,7 @@
% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
% \installlanguage [\s!sk] [\c!status=\v!start] % slovak
- \installlanguage [\s!es] [\c!status=\v!start] % spanish
+% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index ba7aed004..512010c0d 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -13,7 +13,7 @@
\catcode`\{=1 \catcode`\}=2
-\def\contextversion{2001.3.27}
+\def\contextversion{2001.4.9}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type{tex -i} or \type{whatevertex} using
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index 6a1305675..ea9789f0b 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -1726,7 +1726,7 @@
\c!ny=2,\c!y=1,\c!sy=1,
\c!breedte=\!!zeropoint,\c!hoogte=\!!zeropoint,
\c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint,
- mp=]
+ \c!mp=]
\protect
diff --git a/tex/context/base/core-new.tex b/tex/context/base/core-new.tex
index 92b7c9e4e..692b5dc4b 100644
--- a/tex/context/base/core-new.tex
+++ b/tex/context/base/core-new.tex
@@ -157,17 +157,25 @@
{\bgroup
\dowithnextbox
{\getparameters[\??ox]
- [\c!x=\!!zeropoint,\c!y=\!!zeropoint,\c!plaats=,#2]%
- \edef\next%
- {\wd\nextbox\the\wd\nextbox
- \ht\nextbox\the\ht\nextbox
- \dp\nextbox\the\dp\nextbox}%
+ [\c!x=\!!zeropoint,
+ \c!y=\!!zeropoint,
+ \c!breedte=\wd\nextbox,
+ \c!hoogte=\wd\nextbox,
+ \c!diepte=\dp\nextbox,
+ \c!plaats=,
+ #2]%
+ \freezedimenmacro\@@oxbreedte
+ \freezedimenmacro\@@oxhoogte
+ \freezedimenmacro\@@oxdiepte
\setbox\nextbox\hbox
{\hskip\@@oxx\lower\@@oxy\hbox
{\doifelsenothing{\@@oxplaats}
{\box\nextbox}
{\alignedbox[\@@oxplaats]\hbox{\box\nextbox}}}}%
- \next\box\nextbox
+ \wd\nextbox\@@oxbreedte
+ \ht\nextbox\@@oxhoogte
+ \dp\nextbox\@@oxdiepte
+ \box\nextbox
\egroup}#1}
\def\offset {\dodoubleempty\dooffsetbox [\hbox]} % yes or no
diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex
index 11d7ef1d2..fa40f6888 100644
--- a/tex/context/base/core-pos.tex
+++ b/tex/context/base/core-pos.tex
@@ -138,6 +138,29 @@
\appendtoks \checkpositions \to \everystarttext
+%D Positions are either generated at a delayed write time
+%D (in \PDFTEX), or derived from the dvi file. The actual
+%D method is implemented in a special driver. If needed, the
+%D driver can fall back on the following macros.
+
+\def\dolazysaveposition#1#2#3#4% tag page x y
+ {\expanded{\writeutilitycommand{\noexpand\pospxy
+ {#1}{#2}{#3}{#4}}}}
+
+\def\dolazysavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
+ {\expanded{\writeutilitycommand{\noexpand\pospxywhd
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
+
+\def\dosaveposition#1#2#3#4% tag page x y
+ {\expanded{\immediatewriteutilitycommand{\noexpand\pospxy
+ {#1}{#2}{#3}{#4}}}}
+
+\def\dosavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
+ {\expanded{\immediatewriteutilitycommand{\noexpand\pospxywhd
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
+
+
+
%D \macros
%D {MPp, MPx, MPy, MPw, MPh, MPd,
%D MPxy, MPll, MPlr, MPur, MPul, MPpos}
diff --git a/tex/context/base/enco-acc.tex b/tex/context/base/enco-acc.tex
index db9552693..d1762ba09 100644
--- a/tex/context/base/enco-acc.tex
+++ b/tex/context/base/enco-acc.tex
@@ -37,6 +37,7 @@
\defineaccent ` I {\Igrave} \defineaccent ` i {\igrave}
\defineaccent ` O {\Ograve} \defineaccent ` o {\ograve}
\defineaccent ` U {\Ugrave} \defineaccent ` u {\ugrave}
+\defineaccent ` Y {\Ygrave} \defineaccent ` y {\ygrave}
\defineaccent ~ A {\Atilde} \defineaccent ~ a {\atilde}
\defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde}
@@ -59,7 +60,8 @@
\defineaccent ' O {\Oacute} \defineaccent ' o {\oacute}
\defineaccent ' R {\Racute} \defineaccent ' r {\racute}
\defineaccent ' S {\Sacute} \defineaccent ' s {\sacute}
-\defineaccent ' u {\uacute} \defineaccent ' U {\Uacute}
+\defineaccent ' U {\Uacute} \defineaccent ' u {\uacute}
+\defineaccent ' Y {\Yacute} \defineaccent ' y {\yacute}
\defineaccent ' Z {\Zacute} \defineaccent ' z {\zacute}
\defineaccent . C {\Cdotaccent} \defineaccent . c {\cdotaccent}
diff --git a/tex/context/base/enco-def.tex b/tex/context/base/enco-def.tex
index dda6c5364..f49549e98 100644
--- a/tex/context/base/enco-def.tex
+++ b/tex/context/base/enco-def.tex
@@ -71,7 +71,9 @@
\definecharacter ograve {\buildtextaccent\textgrave o}
\definecharacter Ugrave {\buildtextaccent\textgrave U}
\definecharacter ugrave {\buildtextaccent\textgrave u}
-
+\definecharacter Ygrave {\buildtextaccent\textgrave Y}
+\definecharacter ygrave {\buildtextaccent\textgrave y}
+
\definecharacter Atilde {\buildtextaccent\texttilde A}
\definecharacter atilde {\buildtextaccent\texttilde a}
\definecharacter Itilde {\buildtextaccent\texttilde \dotlessI}
@@ -114,6 +116,8 @@
\definecharacter sacute {\buildtextaccent\textacute s}
\definecharacter Uacute {\buildtextaccent\textacute U}
\definecharacter uacute {\buildtextaccent\textacute u}
+\definecharacter Yacute {\buildtextaccent\textacute Y}
+\definecharacter yacute {\buildtextaccent\textacute y}
\definecharacter Zacute {\buildtextaccent\textacute Z}
\definecharacter zacute {\buildtextaccent\textacute z}
@@ -209,6 +213,8 @@
\definecharacter scaron {\buildtextaccent\textcaron s}
\definecharacter Tcaron {\buildtextaccent\textcaron T}
\definecharacter tcaron {\buildtextaccent\textcaron t}
+\definecharacter Ycaron {\buildtextaccent\textcaron Y}
+\definecharacter ycaron {\buildtextaccent\textcaron y}
\definecharacter Zcaron {\buildtextaccent\textcaron Z}
\definecharacter zcaron {\buildtextaccent\textcaron z}
diff --git a/tex/context/base/enco-il2.tex b/tex/context/base/enco-il2.tex
index 62a926038..5b447bf8c 100644
--- a/tex/context/base/enco-il2.tex
+++ b/tex/context/base/enco-il2.tex
@@ -8,39 +8,39 @@
%D copyright=Hans Hagen]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This Czech/Slovak encoding is dedicated to Han The Thanh.
-%D The numbers are derived from some files he sent me. This
-%D definition file is (still) sort of beta.
+%D This Czech/Slovak encoding is dedicated to Han The Thanh.
+%D The numbers are derived from some files he sent me. This
+%D definition file is (still) sort of beta.
\startmapping[il2]
\definecasemap 127 to 255 % we map them all to themselves
-\definecasemap 165 181 165 \definecasemap 169 185 169
-\definecasemap 171 187 171 \definecasemap 174 190 174
-\definecasemap 181 181 165 \definecasemap 185 185 169
-\definecasemap 187 187 171 \definecasemap 190 190 174
-\definecasemap 192 224 192 \definecasemap 193 225 193
-\definecasemap 196 228 196 \definecasemap 197 229 197
-\definecasemap 200 232 200 \definecasemap 201 233 201
-\definecasemap 204 236 204 \definecasemap 205 237 205
-\definecasemap 207 239 207 \definecasemap 210 242 210
-\definecasemap 211 243 211 \definecasemap 212 244 212
-\definecasemap 214 246 214 \definecasemap 216 248 216
-\definecasemap 217 249 217 \definecasemap 218 250 218
-\definecasemap 220 252 220 \definecasemap 221 253 221
-\definecasemap 224 224 192 \definecasemap 225 225 193
-\definecasemap 228 228 196 \definecasemap 229 229 197
-\definecasemap 232 232 200 \definecasemap 233 233 201
-\definecasemap 236 236 204 \definecasemap 237 237 205
-\definecasemap 239 239 207 \definecasemap 242 242 210
-\definecasemap 243 243 211 \definecasemap 244 244 212
-\definecasemap 246 246 214 \definecasemap 248 248 216
-\definecasemap 249 249 217 \definecasemap 250 250 218
-\definecasemap 252 252 220 \definecasemap 253 253 221
+\definecasemap 165 181 165 \definecasemap 169 185 169
+\definecasemap 171 187 171 \definecasemap 174 190 174
+\definecasemap 181 181 165 \definecasemap 185 185 169
+\definecasemap 187 187 171 \definecasemap 190 190 174
+\definecasemap 192 224 192 \definecasemap 193 225 193
+\definecasemap 196 228 196 \definecasemap 197 229 197
+\definecasemap 200 232 200 \definecasemap 201 233 201
+\definecasemap 204 236 204 \definecasemap 205 237 205
+\definecasemap 207 239 207 \definecasemap 210 242 210
+\definecasemap 211 243 211 \definecasemap 212 244 212
+\definecasemap 214 246 214 \definecasemap 216 248 216
+\definecasemap 217 249 217 \definecasemap 218 250 218
+\definecasemap 220 252 220 \definecasemap 221 253 221
+\definecasemap 224 224 192 \definecasemap 225 225 193
+\definecasemap 228 228 196 \definecasemap 229 229 197
+\definecasemap 232 232 200 \definecasemap 233 233 201
+\definecasemap 236 236 204 \definecasemap 237 237 205
+\definecasemap 239 239 207 \definecasemap 242 242 210
+\definecasemap 243 243 211 \definecasemap 244 244 212
+\definecasemap 246 246 214 \definecasemap 248 248 216
+\definecasemap 249 249 217 \definecasemap 250 250 218
+\definecasemap 252 252 220 \definecasemap 253 253 221
\stopmapping
@@ -51,22 +51,22 @@
\definecharacter textcaron 20
\definecharacter textbreve 21
\definecharacter textmacron 22
-\definecharacter textring 23
-\definecharacter textcedilla 24
+\definecharacter textring 23
+\definecharacter textcedilla 24
\definecharacter textcircumflex 94
\definecharacter textdotaccent 95
\definecharacter texthunagrumlaut 125
\definecharacter texttilde 126
\definecharacter textdiaeresis 127
-\definecharacter aeligature 26
+\definecharacter aeligature 26
\definecharacter AEligature 29
-\definecharacter oeligature 27
+\definecharacter oeligature 27
\definecharacter OEligature 30
-\definecharacter ostroke 28
+\definecharacter ostroke 28
\definecharacter Ostroke 31
-\definecharacter dotlessi 16
-\definecharacter dotlessj 17
+\definecharacter dotlessi 16
+\definecharacter dotlessj 17
\definecharacter ssharp 25
\definecharacter Agrave 152
@@ -107,7 +107,6 @@
\definecharacter eacute 233
\definecharacter ecaron 236
\definecharacter iacute 237
-\definecharacter iacute 237
\definecharacter dcaron 239
\definecharacter ncaron 242
\definecharacter oacute 243
@@ -118,8 +117,8 @@
\definecharacter uring 249
\definecharacter uacute 250
\definecharacter uhungarumlaut 251
-\definecharacter udiaeresis 252
-\definecharacter yacute 253
+\definecharacter udiaeresis 252
+\definecharacter yacute 253
\definecharacter Aring {\ilencodedrA}
\definecharacter lstroke {\ilencodedl}
diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex
index 5ed98df54..3e9c1da1e 100644
--- a/tex/context/base/enco-ini.tex
+++ b/tex/context/base/enco-ini.tex
@@ -29,6 +29,11 @@
%D modules. While implementing Czech support, I decided to
%D isolate this code.
+%D Patterns are kind of mixed with font encodings and
+%D mappings. Alas.
+
+\ifx\synchronizepatterns\undefined \let\synchronizepatterns\relax \fi
+
%D While dealing with input (the text source) and output (the
%D glyphs), encoding comes into view. To summarize a few:
%D
@@ -383,7 +388,8 @@
{\the\csname\@map@\charactermapping\endcsname}%
\enablelanguagespecifics[\currentlanguage]% new
\edef\enabledmapping{\charactermapping\currentlanguage}%
- \fi}
+ \fi
+ \synchronizepatterns}
%D This macro wil be implemented in \type {lang-ini.tex}.
@@ -497,15 +503,15 @@
%D \type {\reduceto}||command for local switching to
%D simplified commands.
-%\def\donthandleaccent#1#2% \empty makes #2={} save % no \unexpanded
-% {\ifundefined{\characterencoding#1\string#2\empty}%
-% #2%
-% \else
-% \getvalue{\characterencoding#1\string#2\empty}%
-% \fi}
+\def\donthandleaccent#1#2% \empty makes #2={} save % no \unexpanded
+ {\ifundefined{\characterencoding#1\string#2\empty}%
+ #2%
+ \else
+ \getvalue{\characterencoding#1\string#2\empty}%
+ \fi}
\def\donthandlecommand#1% % no \unexpanded, otherwise pdfdoc will fail
- {\ifundefined{\characterencoding#1}%
+ {\ifundefined{\characterencoding#1}% as well as hyph patterns
#1%
\else
\getvalue{\characterencoding#1}%
@@ -516,7 +522,8 @@
\def\doenableencoding[#1][#2]% main fallback
{\iffirstargument\edef\characterencoding{@#1@}\fi
- \edef\nocharacterencoding{@\ifsecondargument#2\else\s!default\fi @}}
+ \edef\nocharacterencoding{@\ifsecondargument#2\else\s!default\fi @}%
+ \synchronizepatterns}
\def\startcoding%
{\dodoubleempty\dostartcoding}
@@ -647,16 +654,16 @@
% \@EA\ifx\csname\nocharacterencoding#1\endcsname\relax
% \donormaltextaccent{#1}{#2}%
% \else
- \csname\nocharacterencoding#1\endcsname#2%
+ \csname\nocharacterencoding#1\endcsname{#2}%
% \fi
\else
- \csname\characterencoding#1\endcsname#2%
+ \csname\characterencoding#1\endcsname{#2}%
\fi
\else
\csname\nocharacterencoding#1\string#2\empty\endcsname
\fi
\else
- \csname\characterencoding#1\string#2\endcsname
+ \csname\characterencoding#1\string#2\empty\endcsname
\fi}
\endTEX
@@ -665,19 +672,34 @@
\def\dohandleaccent#1#2%
{\ifcsname\characterencoding#1\string#2\empty\endcsname
- \csname\characterencoding#1\string#2\endcsname
+ \csname\characterencoding#1\string#2\empty\endcsname
\else\ifcsname\nocharacterencoding#1\string#2\empty\endcsname
\csname\nocharacterencoding#1\string#2\empty\endcsname
\else\ifcsname\characterencoding#1\endcsname
- \csname\characterencoding#1\endcsname#2%
+ \csname\characterencoding#1\endcsname{#2}%
\else%\ifcsname\nocharacterencoding#1\endcsname
- \csname\nocharacterencoding#1\endcsname#2%
+ \csname\nocharacterencoding#1\endcsname{#2}%
% \else
% \donormaltextaccent{#1}{#2}%
\fi\fi\fi}%\fi}
\endETEX
+%D In patterns, characters have to be bytes. These will be
+%D mapped onto the compact pattern arrays.
+
+\let\normaldohandleaccent\dohandleaccent
+
+\def\patternchar#1 {\rawcharacter{#1}}
+
+\def\startpatternaccents%
+ {\let\savedpatternchar\char
+ \let\char\patternchar
+ \let\dohandleaccent\normaldohandleaccent}
+
+\def\stoppatternaccents%
+ {\let\char\savedpatternchar}
+
%\def\presetcharacter#1%
% {\setvalue{#1}{\dohandlecharacter{#1}}}
@@ -915,7 +937,7 @@
\def\docurrentencoding @#1@{#1}
%D \macros
-%D {showaccents, showcharacters}
+%D {showaccents, showcharacters, showhyphenations}
%D
%D Encoding is a tricky business. Therefore we provide a
%D a few macros that show most of the characters involved. The
@@ -928,9 +950,19 @@
%D \plaatstabel
%D {The special glyphs in texnansi encoding.}
%D {\switchtobodyfont[lbr]\showaccents}
+%D
+%D The command
+%D
+%D \starttypen
+%D \showhyphenations{doordefini\"eren}
+%D \stoptypen
+%D
+%D can be used to check the correct loading of hyphenation
+%D patterns.
-\fetchruntimecommand \showaccents {\f!encodingprefix run}
-\fetchruntimecommand \showcharacters {\f!encodingprefix run}
+\fetchruntimecommand \showaccents {\f!encodingprefix run}
+\fetchruntimecommand \showcharacters {\f!encodingprefix run}
+\fetchruntimecommand \showhyphenations {\f!encodingprefix run}
%D {\em The next section is experimental and implements font
%D specific features, like hanging punctuation.}
@@ -1384,9 +1416,6 @@
%D We preload several encodings:
-%\input enco-def \input enco-acc \input enco-raw
-%\input enco-com \input enco-cas \input enco-mis
-
\useencoding[def,acc,raw,com,cas,mis]
\useencoding[ans,il2,ec,pdf,uc,pol,x5]
diff --git a/tex/context/base/enco-raw.tex b/tex/context/base/enco-raw.tex
index e880eee8c..02278e708 100644
--- a/tex/context/base/enco-raw.tex
+++ b/tex/context/base/enco-raw.tex
@@ -20,7 +20,8 @@
\definecharacter Igrave {I} \definecharacter igrave {i}
\definecharacter Ograve {O} \definecharacter ograve {o}
\definecharacter Ugrave {U} \definecharacter ugrave {u}
-
+\definecharacter Ygrave {Y} \definecharacter ygrave {y}
+
\definecharacter Atilde {A} \definecharacter atilde {a}
\definecharacter Itilde {I} \definecharacter itilde {i}
\definecharacter Otilde {O} \definecharacter otilde {o}
@@ -43,6 +44,7 @@
\definecharacter Racute {R} \definecharacter racute {r}
\definecharacter Sacute {S} \definecharacter sacute {s}
\definecharacter Uacute {U} \definecharacter uacute {u}
+\definecharacter Yacute {Y} \definecharacter yacute {y}
\definecharacter Zacute {Z} \definecharacter zacute {z}
\definecharacter Dstroke {D} \definecharacter dstroke {d}
diff --git a/tex/context/base/enco-run.tex b/tex/context/base/enco-run.tex
index 074518165..02df0abde 100644
--- a/tex/context/base/enco-run.tex
+++ b/tex/context/base/enco-run.tex
@@ -80,4 +80,12 @@
\stopcolumns
\egroup}
+\gdef\showhyphenations#1%
+ {\hbox
+ {language: \currentlanguage/\the\normallanguage\quad
+ font: \fontname\font\quad
+ encoding: \currentencoding\quad
+ mapping: \currentencoding\quad
+ sample: \hyphenatedword{#1}}}
+
\protect \endinput
diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex
index 2247a98f5..2654d7087 100644
--- a/tex/context/base/lang-ini.tex
+++ b/tex/context/base/lang-ini.tex
@@ -265,37 +265,12 @@
{\doifelsevaluenothing{\??la#1\s!patterns}
{\edef\languagesuffix{#1}}
{\edef\languagesuffix{\getvalue{\??la#1\s!patterns}}}%
- \doifundefinedelse{\??la\??la\languagesuffix}
- {\normallanguage=\loadedlanguage
- \letvalue{\??la\??la\languagesuffix}=\loadedlanguage
- \bgroup
- \scratchtoks=\everyjob % we don't want additional junk put there
- \let\showpatterns\relax
- \startencoding[\getvalue{\??la\languagesuffix\s!encoding}]%
- \enablemapping[\getvalue{\??la\languagesuffix\s!mapping}]%
-\startreadingfile
-\let\dohandleaccent\donthandleaccent % no checking done
- \readsysfile{\truefilename{\f!languageprefix\languagesuffix.\f!patternsextension}}
- {\setxvalue{\??la#1\s!patterns}{\languagesuffix}%
- \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{\languagesuffix}}%
- \showmessage{\m!linguals}{1}{\languagesuffix,#1,\loadedlanguage}}
- {\readsysfile{\f!languageprefix\languagesuffix.\f!patternsextension}
- {\setxvalue{\??la#1\s!patterns}{\languagesuffix}%
- \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{\languagesuffix}}%
- \showmessage{\m!linguals}{1}{\languagesuffix,#1,\loadedlanguage}}
- {\showmessage{\m!linguals}{2}{\languagesuffix,#1,\loadedlanguage}}}%
- \readsysfile{\truefilename{\f!languageprefix\languagesuffix.\f!hyphensextension}}
- {\showmessage{\m!linguals}{3}{\languagesuffix,#1,\loadedlanguage}}
- {\readsysfile{\f!languageprefix\languagesuffix.\f!hyphensextension}
- {\showmessage{\m!linguals}{3}{\languagesuffix,#1,\loadedlanguage}}
- {\showmessage{\m!linguals}{4}{\languagesuffix,#1,\loadedlanguage}}}%
-\stopreadingfile
- \stopencoding
- \global\everyjob=\scratchtoks
- \egroup
- \increment\loadedlanguage}
+% \doifundefinedelse{\??la\??la\languagesuffix}
+\doifundefinedelse{\??la\??la:\currentencoding:\currentmapping:\languagesuffix}
+ {\doloadpatterns{#1}{\languagesuffix}}
{\bgroup
- \edef\loadedlanguage{\getvalue{\??la\??la\languagesuffix}}%
+% \edef\loadedlanguage{\getvalue{\??la\??la\languagesuffix}}%
+\edef\loadedlanguage{\getvalue{\??la\??la:\currentencoding:\currentmapping:\languagesuffix}}%
\showmessage{\m!linguals}{1}{\languagesuffix,#1,\loadedlanguage}%
\showmessage{\m!linguals}{3}{\languagesuffix,#1,\loadedlanguage}%
\egroup}}
@@ -313,6 +288,62 @@
%D used dutch mnemonics in the dutch version, but nowadays
%D conform a standard.
+\let \patternencoding \s!default
+\let \patternmapping \s!default
+
+\def\doloadpatterns#1#2%
+ {\expanded{\getcommacommandsize[\getvalue{\??la#2\s!encoding}]}%
+ \ifnum\commalistsize>0
+\message{[nofpatterns #2: \commalistsize/\getvalue{\??la#2\s!encoding}]}%
+ \dorecurse\commalistsize
+ {\expanded{\getfromcommacommand[\getvalue{\??la#2\s!encoding}][\recurselevel]}%
+ \let\patternencoding\commalistelement
+ \expanded{\getfromcommacommand[\getvalue{\??la#2\s!mapping }][\recurselevel]}%
+ \let\patternmapping \commalistelement
+\message{[patterns: #1/#2/\patternencoding/\patternmapping]}%
+ \dodoloadpatterns{#1}{#2}\patternencoding\patternmapping}%
+ \else
+\message{[patterns: #1/#2]}%
+ \dodoloadpatterns{#1}{#2}{}{}%
+ \fi}
+
+\let\normalpatterns\patterns
+
+\def\dodoloadpatterns#1#2#3#4%
+ {\normallanguage=\loadedlanguage
+% \letvalue{\??la\??la#2}=\loadedlanguage
+ \bgroup
+ \scratchtoks=\everyjob % we don't want additional junk put there
+ \let\showpatterns\relax
+ \startencoding[#3]%
+ \enablemapping[#4]%
+ \doifnothing{\currentencoding}{\let\currentencoding\s!default}%
+ \doifnothing{\currentmapping }{\let\currentmapping \s!default}%
+ \global\letvalue{\??la\??la:\currentencoding:\currentmapping:#2}=\loadedlanguage
+ \startreadingfile
+ \startpatternaccents
+%\def\patterns##1{\message{#1/#2/#3/#4/##1}\normalpatterns{##1}}%
+ \readsysfile{\truefilename{\f!languageprefix#2.\f!patternsextension}}
+ {\setxvalue{\??la#1\s!patterns}{#2}%
+ \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{#2}}%
+ \showmessage{\m!linguals}{1}{#2,#1,\loadedlanguage}}
+ {\readsysfile{\f!languageprefix#2.\f!patternsextension}
+ {\setxvalue{\??la#1\s!patterns}{#2}%
+ \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{#2}}%
+ \showmessage{\m!linguals}{1}{#2,#1,\loadedlanguage}}
+ {\showmessage{\m!linguals}{2}{#2,#1,\loadedlanguage}}}%
+ \readsysfile{\truefilename{\f!languageprefix#2.\f!hyphensextension}}
+ {\showmessage{\m!linguals}{3}{#2,#1,\loadedlanguage}}
+ {\readsysfile{\f!languageprefix#2.\f!hyphensextension}
+ {\showmessage{\m!linguals}{3}{#2,#1,\loadedlanguage}}
+ {\showmessage{\m!linguals}{4}{#2,#1,\loadedlanguage}}}%
+ \stoppatternaccents
+ \stopreadingfile
+ \stopencoding
+ \global\everyjob=\scratchtoks
+ \egroup
+ \increment\loadedlanguage}
+
%D \macros
%D {setuplanguage}
%D
@@ -385,22 +416,67 @@
%D We take care of local as well as standardized language
%D switching (fr and fa, de and du, but nl and nl).
+% new, encoding specific patterns
+
+\ifx\synchronizepatterns\undefined \let\synchronizepatterns\relax \fi
+
+\def\dosetnormallanguage#1#2#3#4%
+ {\doifdefinedelse{\??la\??la#2#3}
+ {\doifelsevaluenothing{\??la\??la#2#3}
+ {#4}
+ {\donetrue
+ \setxvalue{\??la#1\s!patterns}{#3}%
+ \normallanguage=\getvalue{\??la\??la#2#3}\relax}} % \relax is needed for lookahead problems
+ {#4}}
+
\def\setnormallanguage#1#2%
- {\doifdefined{\??la\??la#2}{\doifvaluesomething{\??la\??la#2}
- {\donetrue
- \setxvalue{\??la#1\s!patterns}{#2}%
- \normallanguage=\getvalue{\??la\??la#2}}}}
-
+ {\dosetnormallanguage{#1}{:\currentencoding:\currentmapping:}{#2}{%
+ \dosetnormallanguage{#1}{:\currentencoding:\s!default :}{#2}{%
+ \dosetnormallanguage{#1}{:\s!default :\currentmapping:}{#2}{%
+ \dosetnormallanguage{#1}{:\s!default :\s!default :}{#2}{}}}}}
+
+%
+
+% \def\docomplexlanguage[#1]%
+% {\donefalse
+% \setnormallanguage{#1}{\getvalue{\??la#1\s!patterns}}%
+% \ifdone\else
+% \setnormallanguage{#1}{#1}%
+% \ifdone\else
+% \doifvaluesomething{\??la#1\c!default}
+% {\setnormallanguage{#1}{\getvalue{\??la\defaultlanguage{#1}\s!patterns}}%
+% \ifdone\else
+% \setnormallanguage{#1}{\defaultlanguage{#1}}%
+% \fi}%
+% \fi
+% \fi
+% \edef\currentlanguage{#1}%
+% \enablelanguagespecifics[#1]%
+% \enablemapping[\getvalue{\??la#1\s!mapping}]%
+% \lefthyphenmin =0\getvalue{\??la#1\s!lefthyphenmin}\relax
+% \righthyphenmin=0\getvalue{\??la#1\s!righthyphenmin}\relax
+% \processaction
+% [\getvalue{\??la#1\c!spatiering}]
+% [\v!opelkaar=>\frenchspacing,
+% \v!ruim=>\nonfrenchspacing,
+% \s!unknown=>\frenchspacing]}
+
\def\docomplexlanguage[#1]%
{\donefalse
- \setnormallanguage{#1}{\getvalue{\??la#1\s!patterns}}%
+ \def\synchronizepatterns{\setnormallanguage
+ {#1}{\getvalue{\??la#1\s!patterns}}}%
+ \synchronizepatterns
\ifdone\else
- \setnormallanguage{#1}{#1}%
+ \def\synchronizepatterns{\setnormallanguage{#1}{#1}}%
+ \synchronizepatterns
\ifdone\else
\doifvaluesomething{\??la#1\c!default}
- {\setnormallanguage{#1}{\getvalue{\??la\defaultlanguage{#1}\s!patterns}}%
+ {\def\synchronizepatterns{\setnormallanguage
+ {#1}{\getvalue{\??la\defaultlanguage{#1}\s!patterns}}}%
+ \synchronizepatterns
\ifdone\else
\setnormallanguage{#1}{\defaultlanguage{#1}}%
+ \synchronizepatterns
\fi}%
\fi
\fi
diff --git a/tex/context/base/lang-sla.tex b/tex/context/base/lang-sla.tex
index cd9fbef84..35eb7c2bd 100644
--- a/tex/context/base/lang-sla.tex
+++ b/tex/context/base/lang-sla.tex
@@ -72,7 +72,9 @@
\c!leftquotation=\upperleftdoublesixquote,
\c!rightquotation=\upperrightdoubleninequote,
\c!datum={\v!jaar,\ ,\v!maand,\ ,\v!dag},
- \c!status=\v!stop]
+ \c!status=\v!stop,
+ \s!encoding=il2,
+ \s!mapping=il2]
\installlanguage
[\s!hr]
diff --git a/tex/context/base/m-pictex.tex b/tex/context/base/m-pictex.tex
index 408105581..db06ffd5c 100644
--- a/tex/context/base/m-pictex.tex
+++ b/tex/context/base/m-pictex.tex
@@ -249,6 +249,4 @@
%D and just hope for the best.
-\protect
-
-\endinput
+\protect \endinput
diff --git a/tex/context/base/main-001.tex b/tex/context/base/main-001.tex
index dea630ac7..51a86e887 100644
--- a/tex/context/base/main-001.tex
+++ b/tex/context/base/main-001.tex
@@ -8003,10 +8003,10 @@
\fi
\else
% float is smaller of equal to \hsize
- \scratchdimen=\ifdim\wd\tempfloatbox<\captionminwidth\relax
- \captionminwidth % float smaller than min width
+ \ifdim\wd\tempfloatbox<\captionminwidth\relax
+ \scratchdimen\captionminwidth % float smaller than min width
\else
- \wd\tempfloatbox % float width
+ \scratchdimen\wd\tempfloatbox % float width
\fi
\setbox\scratchbox=\vbox % test with overshoot
{\advance\scratchdimen \captionovershoot
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index 86c6f1364..3b7050659 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -466,6 +466,16 @@
\def\MPstring#1{"\getvalue{\@@MPT#1}"}
\def\MPbetex #1{btex \getvalue{\@@MPT#1} etex}
+%D Unfortunately \METAPOST\ does not have \CMYK\ support
+%D built in, but by means of specials we can supply the
+%D information needed to handle them naturaly.
+
+\newif\ifMPcmyk \MPcmyktrue
+
+\appendtoks
+ cmykcolors := \ifMPcmyk true \else false \fi ;
+\to \MPinitializations
+
%D In order to communicate conveniently with the \TEX\
%D engine, we introduce some typesetting variables.
diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex
index ea9493a1f..2c93147cc 100644
--- a/tex/context/base/meta-txt.tex
+++ b/tex/context/base/meta-txt.tex
@@ -53,7 +53,9 @@
\global\parseriestrue
\xdef\totalparlines{\the\!!counta}%
\global\partoks\!!toksa
- \expanded{\parshape \the\!!counta \the\!!toksa}%
+ %\ifx\partoks\emptytoks\else % safeguard
+ \expanded{\parshape \the\!!counta \the\!!toksa}%
+ %\fi
\setshapecharacteristics % extra dummy
\ifparseries\def\par{\endgraf\adaptparshape}\fi
\EveryPar{\begstrut}}
@@ -78,8 +80,10 @@
\!!toksa=\emptytoks
\expanded{\processseparatedlist[\the\partoks][\space]}\docommando
\global\partoks=\!!toksa
- \expanded{\parshape\totalparlines\the\partoks}}
-
+ %\ifx\partoks\emptytoks\else % safeguard
+ \expanded{\parshape\totalparlines\the\partoks}%
+ }%\fi}
+
\def\getshapecharacteristics%
{\doglobal\increment\currentshapetext
\doifdefinedelse{parlines:\currentshapetext}
diff --git a/tex/context/base/mult-com.tex b/tex/context/base/mult-com.tex
index 35a5547bf..54467f75e 100644
--- a/tex/context/base/mult-com.tex
+++ b/tex/context/base/mult-com.tex
@@ -22,7 +22,18 @@
%D
%D The German translations were provided by Tobias Burnus,
%D the Czech ones by Tom Hudec, and the Italian ones
-%D by Giuseppe Bilottta.
+%D by Giuseppe Bilottta. Here we include their comments.
+
+%D Giuseppe Bilottta: \citaat {Having to choose between a
+%D full-length name and a shortcut, I decided to resort to the
+%D latter, especially in the case of commonly used commands,
+%D or when shortened commands become too short. This led to
+%D one inconsistency: footer (pi di pagina in Italian) became
+%D piedipagina as a standalone term, but is commonly shortened
+%D to pdp. Setupfooter becomes impostapdp, and so for all
+%D composed words: footnote (nota a pi di pagina) becomes
+%D notapdp; footnotetext (testo della nota a pi di pagina)
+%D becomes testonotapdp; and so on.}
\writestatus{loading}{Context Multilingual Macros / Commands}
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 323a7b1e3..ada1eb0c4 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -402,6 +402,7 @@
\definesystemvariable {mb} % MargeBlokken
\definesystemvariable {mg} % Metapost paGe
\definesystemvariable {mk} % MarKering
+\definesystemvariable {mo} % Math Options
\definesystemvariable {nm} % Nummering
\definesystemvariable {np} % NaastPlaatsen
\definesystemvariable {nr} % Nummeren
@@ -503,11 +504,14 @@
\defineinterfaceconstant {b} {b}
\defineinterfaceconstant {rgb} {rgb}
-\defineinterfaceconstant {cmyk} {cmyk}
-
\defineinterfacevariable {rgb} {rgb}
+
+\defineinterfaceconstant {cmyk} {cmyk}
\defineinterfacevariable {cmyk} {cmyk}
+\defineinterfaceconstant {mp} {mp}
+\defineinterfacevariable {mp} {mp}
+
\defineinterfacevariable {s} {s}
\defineinterfacevariable {a} {a}
diff --git a/tex/context/base/page-lyr.tex b/tex/context/base/page-lyr.tex
index 397b78205..530526f13 100644
--- a/tex/context/base/page-lyr.tex
+++ b/tex/context/base/page-lyr.tex
@@ -240,4 +240,56 @@
\def\resetlayer[#1]%
{\doresetlayer{#1}\doresetlayer{#1:\realfolio}}
+%D \macros
+%D
+%D {setMPlayer}
+%D
+%D The following layer macro uses the positions that are
+%D registered by \METAPOST.
+%D
+%D \starttypen
+%D \definelayer[test]
+%D
+%D \setMPlayer [test] [somepos-1] {Whatever we want here!}
+%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
+%D \setMPlayer [test] [somepos-3] {\externalfigure[cow.mps][width=2cm]}
+%D
+%D \startuseMPgraphic{oeps}
+%D draw fullcircle scaled 10cm withcolor red ;
+%D register ("somepos-1",2cm,3cm,center currentpicture) ;
+%D register ("somepos-2",8cm,5cm,(-1cm,-2cm)) ;
+%D register ("somepos-3",0cm,0cm,(-2cm,2cm)) ;
+%D \stopuseMPgraphic
+%D
+%D \getMLlayer[test]{\useMPgraphic{oeps}}
+%D \stoptypen
+%D
+%D The last line is equivalent to
+%D
+%D \starttypen
+%D \framed
+%D [background={foreground,test},offset=overlay]
+%D {\useMPgraphic{oeps}}
+%D \stoptypen
+
+\def\setMPlayer%
+ {\dotripleempty\dosetMPlayer}
+
+\def\MPlayerwidth {\hsize}
+\def\MPlayerheight{\vsize}
+
+\def\dosetMPlayer[#1][#2][#3]%
+ {\edef\MPlayerwidth {\MPw{#2}}%
+ \edef\MPlayerheight{\MPh{#2}}%
+ \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!positie=\v!nee,#3]}
+
+\def\getMPlayer
+ {\dodoubleempty\dogetMPlayer}
+
+\def\dogetMPlayer[#1][#2]%
+ {\framed
+ [\c!achtergrond={\v!voorgrond,#1},
+ \c!kader=\v!uit,
+ \c!offset=\v!overlay,#2]}
+
\protect \endinput
diff --git a/tex/context/base/s-pre-02.tex b/tex/context/base/s-pre-02.tex
index d659594d6..2ec882b72 100644
--- a/tex/context/base/s-pre-02.tex
+++ b/tex/context/base/s-pre-02.tex
@@ -122,8 +122,6 @@
%D {cont-sys.tex}. When direct processing is disabled or not
%D supported, \TEXEXEC\ will tke care of graphic generation.
-\MPinclusions{input mp-tool}
-
\def\MPpagebackground#1#2#3%
{\startreusableMPgraphic{pb:#1#2#3}
delta := #3 ;
diff --git a/tex/context/base/s-pre-15.tex b/tex/context/base/s-pre-15.tex
index 261e520d1..9dc4de2ab 100644
--- a/tex/context/base/s-pre-15.tex
+++ b/tex/context/base/s-pre-15.tex
@@ -19,7 +19,7 @@
%D This presentation is meant for presentations that build up
%D an idea stepwise.
%D
-%D \starttyping
+%D \starttypen
%D \TitlePage{Do you know \TEX ?}
%D
%D \StartIdea
@@ -29,7 +29,7 @@
%D \StartItem or presentations like this \unknown \StopItem
%D \StartItem and whatever you can come up with! \StopItem
%D \StopIdea
-%D \stoptyping
+%D \stoptypen
%D The basic layout is rather simple and used as much of the
%D screen as possible.
diff --git a/tex/context/base/s-pre-19.tex b/tex/context/base/s-pre-19.tex
index d724a2760..6aa2ee40c 100644
--- a/tex/context/base/s-pre-19.tex
+++ b/tex/context/base/s-pre-19.tex
@@ -30,7 +30,7 @@
%D \type {--mode=demo} and \type {--pdf}, you will get a demo
%D document.
-%D We use one of the standard screen \quote {paper} sizes, and
+%D We use one of the standard screen \citeer {paper} sizes, and
%D map it onto the same size, so that we get a nicely cropped
%D page.
@@ -82,7 +82,7 @@
\definecolor [white] [s=.85]
%D This is an interactive document, so we enable interaction.
-%D In this style, we disable the viewer's \quote {highlight a
+%D In this style, we disable the viewer's \citeer {highlight a
%D hyperlink when it's clicked on} feature. We will use a
%D menu, so we enable menus. Later we will see the contract
%D color |<|hyperlinks gets that color when we are already on
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index 14b5528b0..2c830b47b 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -67,6 +67,15 @@
\newcount\pdflastximagepages \pdflastximagepages=1
\fi
+%D In order to get high quality \METAPOST\ inclusion, we set
+%D the number of digits to~5 (prevents rounding errors).
+
+\ifx\pdfdecimaldigits\undefined
+ \newcount\pdfdecimaldigits
+\fi
+
+\pdfdecimaldigits=5
+
% %D Why are the Acrobat viewers so buggy? To prevent font cache
% %D mismatches, we say:
%
@@ -110,7 +119,6 @@
\pdfoutput =1 % we reset that one with \everyresetspecials
\pdfcompresslevel=9 % apart from debugging, no reason for value 0
-\pdfdecimaldigits=5 % otherwise wrong rounding for mp stuff
%D Just in case we mimmick specials, we have to make sure no
%D default specials end up in the process.
@@ -749,25 +757,42 @@
%D \CONTEXT\ only uses relative positions, the origin is of
%D less importance.
-\def\doTPDsetposition#1#2#3%
- {\bgroup
- \edef\doTPDsetposition%
- {\writeutilitycommand
- {#1%
- {#2}%
- {\noexpand\realfolio}%
- {\noexpand\number\pdflastxpos}%
- {\noexpand\number\pdflastypos}%
- #3}}%
- \pdfsavepos
- \doTPDsetposition
- \egroup}
+% \def\doTPDsetposition#1#2#3%
+% {\bgroup
+% \edef\doTPDsetposition%
+% {\writeutilitycommand
+% {#1%
+% {#2}%
+% {\noexpand\realfolio}%
+% {\noexpand\number\pdflastxpos}%
+% {\noexpand\number\pdflastypos}%
+% #3}}%
+% \pdfsavepos
+% \doTPDsetposition
+% \egroup}
+%
+% \definespecial\dosetposition#1%
+% {\doTPDsetposition{\pospxy}{#1}{}}
+%
+% \definespecial\dosetpositionwhd#1#2#3#4%
+% {\doTPDsetposition{\pospxywhd}{#1}{{#2}{#3}{#4}}}
\definespecial\dosetposition#1%
- {\doTPDsetposition{\pospxy}{#1}{}}
+ {\pdfsavepos
+ \dolazysaveposition
+ {#1}%
+ {\noexpand\realfolio}%
+ {\noexpand\number\pdflastxpos}%
+ {\noexpand\number\pdflastypos}}%
\definespecial\dosetpositionwhd#1#2#3#4%
- {\doTPDsetposition{\pospxywhd}{#1}{{#2}{#3}{#4}}}
+ {\pdfsavepos
+ \dolazysavepositionwhd
+ {#1}%
+ {\noexpand\realfolio}%
+ {\noexpand\number\pdflastxpos}%
+ {\noexpand\number\pdflastypos}%
+ {#2}{#3}{#4}}
%D \macros
%D {doPDFdestination}
diff --git a/tex/context/base/supp-lan.tex b/tex/context/base/supp-lan.tex
index d540a86cb..9193dbf54 100644
--- a/tex/context/base/supp-lan.tex
+++ b/tex/context/base/supp-lan.tex
@@ -393,6 +393,9 @@
\expandafter\def\next{#2}% unexpanded goes wrong in pdfdoc
\uccode`~=\scratchcounter}
+%D One reason for abusing the \type{~} is that it is already
+%D an active character, so it is unlikely to appear as argument.
+
%D Although adapting character codes and making characters
%D active can interfere with other features of macropackages,
%D normally there should be no problems with things like:
diff --git a/tex/context/base/supp-mpe.tex b/tex/context/base/supp-mpe.tex
index 8a10efe9c..9267f155b 100644
--- a/tex/context/base/supp-mpe.tex
+++ b/tex/context/base/supp-mpe.tex
@@ -242,12 +242,33 @@
\def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1000.0000\relax}
\def\doMPrgbnumber#1.#2#3#4#5\relax{#2#3#4}
+%D The naive case looks like:
+%D
+%D \starttypen
+%D \def\handleMPrgbcolor%
+%D {\setMPcolor
+%D \ifcase\MPspecialversion
+%D \resetMPcolor\normalhandleMPrgbcolor
+%D \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
+%D % consider it to be a signal
+%D \else
+%D \resetMPcolor\normalhandleMPrgbcolor
+%D \fi\fi}
+%D \stoptypen
+%D
+%D However, since we want \CMYK\ support, we will use the
+%D following implementation:
+
\def\handleMPrgbcolor%
{\setMPcolor
\ifcase\MPspecialversion
\resetMPcolor\normalhandleMPrgbcolor
- \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
- % consider it to be a signal
+ \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax
+ \ifMPcmyk \ifnum\MPrgbnumber\lastMPgvalue=1 % cmyk color spec
+ \doifdefined{mps:k:\number\MPrgbnumber\lastMPbvalue}
+ {\getvalue{mps:k:\number\MPrgbnumber\lastMPbvalue}%
+ \resetMPcolor\normalhandleMPcmykcolor}%
+ \fi \fi
\else
\resetMPcolor\normalhandleMPrgbcolor
\fi\fi}
@@ -599,4 +620,110 @@
\appendtoks \invokeMPhyperlinkspecial \to \invokeMPspecials
+%D Special number~1 is dedicated to \CMYK\ support. If you
+%D want to know why: look at this:
+%D
+%D \startbuffer[mp]
+%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ;
+%D \stopbuffer
+%D
+%D \startbuffer[cmyk]
+%D \startcombinatie[4*1]
+%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3}
+%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15}
+%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8}
+%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1}
+%D \stopcombinatie
+%D \stopbuffer
+%D
+%D \plaatsfiguur
+%D {\CMYK\ support disabled,
+%D conversion to \RGB.}
+%D {\setupcolors[cmyk=nee,status=start]\haalbuffer[cmyk]}
+%D
+%D \plaatsfiguur
+%D {\CMYK\ support enabled,
+%D no support in \METAPOST.}
+%D {\setupcolors[cmyk=ja,mpcmyk=nee,status=start]\haalbuffer[cmyk]}
+%D
+%D \plaatsfiguur
+%D {\CMYK\ support enabled,
+%D no conversion to \RGB,
+%D support in \METAPOST}
+%D {\setupcolors[cmyk=ja,status=start]\haalbuffer[cmyk]}
+
+\defineMPspecial{1}
+ {\ifMPcmyk
+ \setxvalue{mps:k:\gMPs1}{\noexpand\setMPcmyk\gMPs2 \gMPs3 \gMPs4 \gMPs5 }%
+ \fi}
+
+\def\setMPcmyk#1 #2 #3 #4 %
+ {\setvalue{\@@MP01}{#1}%
+ \setvalue{\@@MP02}{#2}%
+ \setvalue{\@@MP03}{#3}%
+ \setvalue{\@@MP04}{#4}}
+
+%D This special (number 50) passes positions to a tex file.
+%D This method uses a two||pass approach an (mis|)|used the
+%D context positioning macros. In \type {core-pos} we will
+%D implement the low level submacro needed.
+%D
+%D \startbuffer
+%D \definelayer[test]
+%D
+%D \setlayer
+%D [test]
+%D [x=\MPx{somepos-1},y=\MPy{somepos-1}]
+%D {Whatever we want here!}
+%D
+%D \setlayer
+%D [test]
+%D [x=\MPx{somepos-2},y=\MPy{somepos-2}]
+%D {Whatever we need there!}
+%D
+%D \startuseMPgraphic{oeps}
+%D draw fullcircle scaled 6cm withcolor red ;
+%D register ("somepos-1",1cm,2cm,center currentpicture) ;
+%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ;
+%D \stopuseMPgraphic
+%D
+%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D Here the width and height are not realy used, but one can
+%D imagine situations where tex has to work with values
+%D calculated by \METAPOST.
+%D
+%D \startlinecorrection
+%D \getbuffer
+%D \stoplinecorrection
+%D
+%D Later we will implement a more convenient macro:
+%D
+%D \starttyping
+%D \setMPlayer [test] [somepos-1] {Whatever we want here!}
+%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
+%D \stoptyping
+
+\ifx\dosavepositionwhd\undefined
+ \let\dosavepositionwhd\gobblesevenarguments
+\fi
+
+\defineMPspecial{50} % x y width height label
+ {\bgroup
+ \scratchdimen\MPllx bp \scratchdimen=-\scratchdimen
+ \advance\scratchdimen\gMPs1bp
+ \edef\x{\number\scratchdimen}%
+ \scratchdimen\gMPs2bp \scratchdimen=-\scratchdimen
+ \advance\scratchdimen\MPury bp
+ \edef\y{\number\scratchdimen}%
+ \scratchdimen=\gMPs3bp
+ \edef\w{\number\scratchdimen}%
+ \scratchdimen=\gMPs4bp
+ \edef\h{\number\scratchdimen}%
+ \dosavepositionwhd{\gMPs5}{0}{\x}{\y}{\w}{\h}{0}%
+ \egroup}
+
\protect \endinput
diff --git a/tex/context/base/supp-ran.tex b/tex/context/base/supp-ran.tex
index b83f4ad52..f830b11c8 100644
--- a/tex/context/base/supp-ran.tex
+++ b/tex/context/base/supp-ran.tex
@@ -37,7 +37,7 @@
%D The randomseed can be set by:
%D
%D \starttypen
-%d \setrandomseed{number>0]
+%d \setrandomseed{number>0}
%D \stoptypen
\ifx\nextrandom\undefined
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index 5e61cdcad..c08ea8229 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -161,14 +161,14 @@
\def\unprotect%
{\ifcase\protectionlevel
\edef\doprotectcharacters%
- {\catcode`\noexpand @=\the\catcode`@ %\relax
- \catcode`\noexpand !=\the\catcode`! %\relax
- \catcode`\noexpand ?=\the\catcode`?}%\relax}%
- \catcode`@=11
- \catcode`!=11
- \catcode`?=11
+ {\catcode`\noexpand @=\the\catcode`@
+ \catcode`\noexpand !=\the\catcode`!
+ \catcode`\noexpand ?=\the\catcode`? }%
\let\protect\doprotect
\fi
+ \catcode`@=11
+ \catcode`!=11
+ \catcode`?=11
\advance\protectionlevel 1
\ifnum\protectionlevel>1
\message{<unprotect \the\protectionlevel>}%
@@ -177,13 +177,14 @@
\def\doprotect%
{\ifnum\protectionlevel=1
\doprotectcharacters
+ \let\doprotectcharacters\relax
\let\protect\normalprotect
\fi
\ifnum\protectionlevel>1
\message{<protect \the\protectionlevel>}%
\fi
\advance\protectionlevel -1 }
-
+
%D Now it is defined, we can make use of this very useful
%D macro.
@@ -1980,7 +1981,19 @@
%D \rawdoifinsetelse{\firstcharacter}{1,2,3,4,5,6,7,8,9,0}}
%D \stoptypen
%D
-%D The current implementation is much faster.
+%D The current implementation is much faster, but the next
+%D one is not, not even when testing milion calls.
+%D
+%D \starttypen
+%D \newif\ifitsanumber
+%D
+%D \long\def\isitanumber#1%
+%D {\itsanumberfalse
+%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\itsanumbertrue\fi}
+%D
+%D \long\def\doifnumberelse#1#2#3%
+%D {\isitanumber{#1}\ifitsanumber#2\else#3\fi}
+%D \stoptypen
%D \macros
%D {makerawcommalist,
@@ -2892,7 +2905,7 @@
{\def\dodogetargument#1########1#2%
{\def\dodogetargument#1################1#2%
{\def\dodogetargument#1################################1#2%
- {\def\dodogetargument#1###############################%
+ {\def\dodogetargument#1################################%
################################1#2%
{\def\dodogetargument%
{#3#1{##1}#2%
@@ -2900,7 +2913,7 @@
#1{########1}#2%
#1{################1}#2%
#1{################################1}#2%
- #1{###############################%
+ #1{################################%
################################1}#2}%
\dogetargument#1#2\seventhargumenttrue\seventhargumentfalse}%
\dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}%
diff --git a/tex/context/base/x-fig-00.tex b/tex/context/base/x-fig-00.tex
index 070363ed3..8f6899c49 100644
--- a/tex/context/base/x-fig-00.tex
+++ b/tex/context/base/x-fig-00.tex
@@ -12,7 +12,12 @@
%C details.
%D This module implements an interface to a figure database
-%D and file. The database is formatted in \XML.
+%D and file. The database is formatted in \XML\ conforming
+%D the following \DTD:
+%D
+%D \typefile{x-fig-00.dtd}
+%D
+%D A figure base coded this way looks like:
%D
%D \starttypen
%D <!-- texexec --pdf --use=fig-01 figtest.xml -->
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index 1e3194cd5..a34a233c3 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -625,8 +625,13 @@
{\setvalue{\@@XMLdata:#1}}
\def\defXMLstring#1#2%
- {\@EA\convertcommand\csname\@@XMLdata:#2\endcsname\to#1}
-
+% {\@EA\convertcommand\csname\@@XMLdata:#2\endcsname\to#1}
+ {\bgroup
+ \let\getXMLentity\firstofoneargument
+ \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}%
+ \egroup
+ \@EA\convertcommand\@@XML@@string\to#1}
+
\def\XMLshow#1%
{\showvalue{\@@XMLdata:#1\endcsname}}
diff --git a/tex/context/config/cont-usr.tex b/tex/context/config/cont-usr.tex
index 4ced0fdc8..e11370510 100644
--- a/tex/context/config/cont-usr.tex
+++ b/tex/context/config/cont-usr.tex
@@ -66,10 +66,10 @@
%D pattern files are self contained, which is why (for the
%D moment) we specify encodings here.
-\installlanguage [\s!cz] [\s!mapping=il2,\s!encoding=il2]
-\installlanguage [\s!hr] [\s!mapping=il2,\s!encoding=il2]
+\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
\installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
-\installlanguage [\s!sk] [\s!mapping=il2,\s!encoding=il2]
+\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
%D Sometimes these are not wanted:
@@ -98,7 +98,7 @@
% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
% \installlanguage [\s!sk] [\c!status=\v!start] % slovak
- \installlanguage [\s!es] [\c!status=\v!start] % spanish
+% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
% \installlanguage [\s!uk] [\c!status=\v!start] % english uk