[NTG-context] bug in alignbox

Vit Zyka ntg-context@ntg.nl
Fri, 14 May 2004 10:53:10 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C439A1.A5E2AB30
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hallo Hans,

I have played with positioning text in layers. I noticed that parameter =
"location=3Dt"=20
  \setlayer[MyLayer][...,location=3Dt,...]{...}
behaves the same way as "location=3Dc". It seems to me it is the bug in =
optimized definition of=20
\alignedbox. If I use commented version of \alignedbox from source file =
core-box.tex
it is OK. Can you look at it, please?

Test file:
------------------------------------------------------------------
\definelayer[PositionText][position=3Dno,corner=3Dbuttom,height=3D\texthe=
ight,option=3Dtest]
\def\PosText(#1,#2)[#3]#4{%
  \setlayer[PositionText][x=3D#1,y=3D#2,location=3D#3]{#4}%
  \ignorespaces}
\setupbackgrounds[text][background=3D{PositionText}]

\switchtobodyfont[20pt]
\starttext

\PosText(.3\textwidth,.3\textheight)[c]{Center}
\PosText(.3\textwidth,.3\textheight)[t]{Top}
\PosText(.3\textwidth,.3\textheight)[b]{Bottom}
\PosText(.3\textwidth,.5\textheight)[l]{Left}
\PosText(.3\textwidth,.5\textheight)[r]{Right}
\PosText(.7\textwidth,.5\textheight)[tl]{TopLeft}
\PosText(.7\textwidth,.5\textheight)[tr]{TopRight}
\PosText(.7\textwidth,.5\textheight)[bl]{BottomLeft}
\PosText(.7\textwidth,.5\textheight)[br]{BottomRight}

Ap\hskip1.5em
\alignedbox[b]\hbox{ApB}\hskip1.5em
\alignedbox[c]\hbox{ApC}\hskip1.5em
\alignedbox[t]\hbox{ApT}

\stoptext

------=_NextPart_000_0007_01C439A1.A5E2AB30
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hallo Hans,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have played with positioning text in =
layers. I=20
noticed that parameter "location=3Dt"&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;=20
\setlayer[MyLayer][...,location=3Dt,...]{...}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>behaves the same way as </FONT><FONT =
face=3DArial=20
size=3D2>"location=3Dc". It seems to me it is the bug in optimized =
definition of=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>\alignedbox. If I use commented version =
of=20
\alignedbox&nbsp;from source file core-box.tex</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>it is OK. Can you look at it, =
please?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Test file:</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>----------------------------------------------------------------=
--</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>\definelayer[PositionText][position=3Dno,corner=3Dbuttom,height=3D=
\textheight,option=3Dtest]<BR>\def\PosText(#1,#2)[#3]#4{%<BR>&nbsp;=20
\setlayer[PositionText][x=3D#1,y=3D#2,location=3D#3]{#4}%<BR>&nbsp;=20
\ignorespaces}<BR>\setupbackgrounds[text][background=3D{PositionText}]</F=
ONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>\switchtobodyfont[20pt]<BR>\starttext</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>\PosText(.3\textwidth,.3\textheight)[c]{Center}<BR>\PosText(.3\t=
extwidth,.3\textheight)[t]{Top}<BR>\PosText(.3\textwidth,.3\textheight)[b=
]{Bottom}<BR>\PosText(.3\textwidth,.5\textheight)[l]{Left}<BR>\PosText(.3=
\textwidth,.5\textheight)[r]{Right}<BR>\PosText(.7\textwidth,.5\textheigh=
t)[tl]{TopLeft}<BR>\PosText(.7\textwidth,.5\textheight)[tr]{TopRight}<BR>=
\PosText(.7\textwidth,.5\textheight)[bl]{BottomLeft}<BR>\PosText(.7\textw=
idth,.5\textheight)[br]{BottomRight}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>Ap\hskip1.5em<BR>\alignedbox[b]\hbox{ApB}\hskip1.5em<BR>\aligned=
box[c]\hbox{ApC}\hskip1.5em<BR>\alignedbox[t]\hbox{ApT}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>\stoptext<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0007_01C439A1.A5E2AB30--