* Round-corner textbox with shadow
@ 2009-08-15 12:49 Tom
2009-08-15 14:03 ` Peter Rolf
2009-08-16 16:05 ` Hans Hagen
0 siblings, 2 replies; 3+ messages in thread
From: Tom @ 2009-08-15 12:49 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1.1.1: Type: text/plain, Size: 3278 bytes --]
Shadows on round-corner textboxes are producing square-corner shaded boxes
with square-corner shadows. The following code illustrates the problem and
should run asis.
\def\Demos{
\startuniqueMPgraphic{shadow}
fill OverlayBox shifted (4pt,-4pt) withcolor .8white ;
fill OverlayBox withcolor .8white ;
draw OverlayBox withcolor black ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
\defineoverlay [shadow] [\uniqueMPgraphic{shadow}]
\setupcolors[state=start]
\startframedtext[
height=fit,
width=\textwidth,
location=inmargin ,
align=low,
frame=on,
% framecolor=black,
framecorner=round,
frameradius=.0625 in,
background=shadow, %substitute screen for shadow and get clean box BUT no
shadow
backgroundscreen=0.9,
backgroundcorner=round,
backgroundradius=.0625 in,
bodyfont=9pt,
offset=0.05 in
]
\setuptables[distance=small,bodyfont={9pt,sansserif}]
\starttable[s1|Br|o4l|Br|l|]
\NC Name: \NC \getvariable{Book:Demos}{name}
\NC Nickname: \NC \getvariable{Book:Demos}{nickname} \NC\AR
\NC DOB: \NC \getvariable{Book:Demos}{dob}
\NC Height: \NC \getvariable{Book:Demos}{height} \NC\AR
\NC Weight: \NC \getvariable{Book:Demos}{weight}
\NC Age: \NC \getvariable{Book:Demos}{age} \NC\AR
\NC Tribe: \NC \getvariable{Book:Demos}{tribe}
\NC Home: \NC \getvariable{Book:Demos}{home} \NC\AR
\NC Parents: \NC \THREE \getvariable{Book:Demos}{parents} \NC\AR
\doifnot {\getvariable{Book:Demos}{parentsextra}}{}{\NC \NC \THREE
\getvariable{Book:Demos}{parentsextra} \NC\AR}
\stoptable
\starttable[s1|Br|l|]
\NC Early Schooling: \NC \getvariable{Book:Demos}{earlyschooling} \NC\AR
\doifnot {\getvariable{Book:Demos}{laterschooling}}{}{\NC Later Schooling:
\NC \getvariable{Book:Demos}{laterschooling} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors1}}{}{\NC Honors: \NC
\getvariable{Book:Demos}{honors1} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors2}}{}{\NC \NC
\getvariable{Book:Demos}{honors2} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors3}}{}{\NC \NC
\getvariable{Book:Demos}{honors3} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors4}}{}{\NC \NC
\getvariable{Book:Demos}{honors4} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors5}}{}{\NC \NC
\getvariable{Book:Demos}{honors5} \NC\AR}
\doifnot {\getvariable{Book:Demos}{honors6}}{}{\NC \NC
\getvariable{Book:Demos}{honors6} \NC\AR}
\stoptable
\stopframedtext
}
\starttext
\setvariables[Book:Demos]
[name={Glenn Scobey Warner},
nickname={Pop, The Old Fox},
dob={4/5/1871},
height={6'0"},
weight={205},
age={},
tribe={N/A},
home={Springville, NY},
parents={William H. Warner, Adaline Scobey},
parentsextra={},
earlyschooling={Griffith Instatute},
laterschooling={Cornell University},
honors1={College Football Hall of Fame, Charter Member, 1951},
honors2={Helm's Athletic Foundation Hall of Fame, 1951},
honors3={Stanford Athletic Hall of Fame},
honors4={Greater Buffalo Hall of Fame, 2001},
honors5={},
honors6={}
]
\Demos
\stoptext
Tom Benjey
717-258-9733 voice
717-243-0074 fax
Twitter: @TomBenjey
Football player w C small
[-- Attachment #1.1.2: Type: text/html, Size: 36247 bytes --]
[-- Attachment #1.2: image003.jpg --]
[-- Type: image/jpeg, Size: 2443 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Round-corner textbox with shadow
2009-08-15 12:49 Round-corner textbox with shadow Tom
@ 2009-08-15 14:03 ` Peter Rolf
2009-08-16 16:05 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: Peter Rolf @ 2009-08-15 14:03 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 4415 bytes --]
Hi Tom,
you simply get what you draw (the OverlayBox is always a square). See
page 50 in the MetaFun manual for a solution...
Best wishes, Peter
Tom schrieb:
>
> Shadows on round-corner textboxes are producing square-corner shaded
> boxes with square-corner shadows. The following code illustrates the
> problem and should run asis.
>
>
>
> \def\Demos{
>
>
>
> \startuniqueMPgraphic{shadow}
>
> fill OverlayBox shifted (4pt,-4pt) withcolor .8white ;
>
> fill OverlayBox withcolor .8white ;
>
> draw OverlayBox withcolor black ;
>
> setbounds currentpicture to OverlayBox ;
>
> \stopuniqueMPgraphic
>
> \defineoverlay [shadow] [\uniqueMPgraphic{shadow}]
>
>
>
> \setupcolors[state=start]
>
> \startframedtext[
>
> height=fit,
>
> width=\textwidth,
>
> location=inmargin ,
>
> align=low,
>
> frame=on,
>
> % framecolor=black,
>
> framecorner=round,
>
> frameradius=.0625 in,
>
> background=shadow, %substitute screen for shadow and get clean box
> BUT no shadow
>
> backgroundscreen=0.9,
>
> backgroundcorner=round,
>
> backgroundradius=.0625 in,
>
> bodyfont=9pt,
>
> offset=0.05 in
>
> ]
>
> \setuptables[distance=small,bodyfont={9pt,sansserif}]
>
>
>
> \starttable[s1|Br|o4l|Br|l|]
>
> \NC Name: \NC \getvariable{Book:Demos}{name}
>
> \NC Nickname: \NC \getvariable{Book:Demos}{nickname} \NC\AR
>
> \NC DOB: \NC \getvariable{Book:Demos}{dob}
>
> \NC Height: \NC \getvariable{Book:Demos}{height} \NC\AR
>
> \NC Weight: \NC \getvariable{Book:Demos}{weight}
>
> \NC Age: \NC \getvariable{Book:Demos}{age} \NC\AR
>
> \NC Tribe: \NC \getvariable{Book:Demos}{tribe}
>
> \NC Home: \NC \getvariable{Book:Demos}{home} \NC\AR
>
> \NC Parents: \NC \THREE \getvariable{Book:Demos}{parents} \NC\AR
>
> \doifnot {\getvariable{Book:Demos}{parentsextra}}{}{\NC \NC
> \THREE \getvariable{Book:Demos}{parentsextra} \NC\AR}
>
> \stoptable
>
> \starttable[s1|Br|l|]
>
> \NC Early Schooling: \NC \getvariable{Book:Demos}{earlyschooling} \NC\AR
>
> \doifnot {\getvariable{Book:Demos}{laterschooling}}{}{\NC Later
> Schooling: \NC \getvariable{Book:Demos}{laterschooling} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors1}}{}{\NC Honors:
> \NC \getvariable{Book:Demos}{honors1} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors2}}{}{\NC
> \NC \getvariable{Book:Demos}{honors2} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors3}}{}{\NC
> \NC \getvariable{Book:Demos}{honors3} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors4}}{}{\NC
> \NC \getvariable{Book:Demos}{honors4} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors5}}{}{\NC
> \NC \getvariable{Book:Demos}{honors5} \NC\AR}
>
> \doifnot {\getvariable{Book:Demos}{honors6}}{}{\NC
> \NC \getvariable{Book:Demos}{honors6} \NC\AR}
>
> \stoptable
>
> \stopframedtext
>
> }
>
>
>
> \starttext
>
>
>
> \setvariables[Book:Demos]
>
> [name={Glenn Scobey Warner},
>
> nickname={Pop, The Old Fox},
>
> dob={4/5/1871},
>
> height={6'0"},
>
> weight={205},
>
> age={},
>
> tribe={N/A},
>
> home={Springville, NY},
>
> parents={William H. Warner, Adaline Scobey},
>
> parentsextra={},
>
> earlyschooling={Griffith Instatute},
>
> laterschooling={Cornell University},
>
> honors1={College Football Hall of Fame, Charter Member, 1951},
>
> honors2={Helm's Athletic Foundation Hall of Fame, 1951},
>
> honors3={Stanford Athletic Hall of Fame},
>
> honors4={Greater Buffalo Hall of Fame, 2001},
>
> honors5={},
>
> honors6={}
>
> ]
>
>
>
> \Demos
>
>
>
> \stoptext
>
>
>
> Tom Benjey
>
> 717-258-9733 voice
>
> 717-243-0074 fax
>
> Twitter: @TomBenjey
>
>
>
> Football player w C small
>
>
>
> ------------------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive : https://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
>
[-- Attachment #1.2.1: Type: text/html, Size: 32638 bytes --]
[-- Attachment #1.2.2: Type: image/jpeg, Size: 2443 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Round-corner textbox with shadow
2009-08-15 12:49 Round-corner textbox with shadow Tom
2009-08-15 14:03 ` Peter Rolf
@ 2009-08-16 16:05 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2009-08-16 16:05 UTC (permalink / raw)
To: mailing list for ConTeXt users
Tom wrote:
> Shadows on round-corner textboxes are producing square-corner shaded boxes
> with square-corner shadows. The following code illustrates the problem and
> should run asis.
>
> \def\Demos{
>
> \startuniqueMPgraphic{shadow}
> fill OverlayBox shifted (4pt,-4pt) withcolor .8white ;
> fill OverlayBox withcolor .8white ;
> draw OverlayBox withcolor black ;
> setbounds currentpicture to OverlayBox ;
> \stopuniqueMPgraphic
> \defineoverlay [shadow] [\uniqueMPgraphic{shadow}]
>
> \setupcolors[state=start]
> \startframedtext[
> height=fit,
> width=\textwidth,
> location=inmargin ,
> align=low,
> frame=on,
> % framecolor=black,
> framecorner=round,
> frameradius=.0625 in,
> background=shadow, %substitute screen for shadow and get clean box BUT no
> shadow
> backgroundscreen=0.9,
> backgroundcorner=round,
> backgroundradius=.0625 in,
> bodyfont=9pt,
> offset=0.05 in
> ]
> \setuptables[distance=small,bodyfont={9pt,sansserif}]
>
> \starttable[s1|Br|o4l|Br|l|]
> \NC Name: \NC \getvariable{Book:Demos}{name}
> \NC Nickname: \NC \getvariable{Book:Demos}{nickname} \NC\AR
> \NC DOB: \NC \getvariable{Book:Demos}{dob}
> \NC Height: \NC \getvariable{Book:Demos}{height} \NC\AR
> \NC Weight: \NC \getvariable{Book:Demos}{weight}
> \NC Age: \NC \getvariable{Book:Demos}{age} \NC\AR
> \NC Tribe: \NC \getvariable{Book:Demos}{tribe}
> \NC Home: \NC \getvariable{Book:Demos}{home} \NC\AR
> \NC Parents: \NC \THREE \getvariable{Book:Demos}{parents} \NC\AR
> \doifnot {\getvariable{Book:Demos}{parentsextra}}{}{\NC \NC \THREE
> \getvariable{Book:Demos}{parentsextra} \NC\AR}
> \stoptable
> \starttable[s1|Br|l|]
> \NC Early Schooling: \NC \getvariable{Book:Demos}{earlyschooling} \NC\AR
> \doifnot {\getvariable{Book:Demos}{laterschooling}}{}{\NC Later Schooling:
> \NC \getvariable{Book:Demos}{laterschooling} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors1}}{}{\NC Honors: \NC
> \getvariable{Book:Demos}{honors1} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors2}}{}{\NC \NC
> \getvariable{Book:Demos}{honors2} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors3}}{}{\NC \NC
> \getvariable{Book:Demos}{honors3} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors4}}{}{\NC \NC
> \getvariable{Book:Demos}{honors4} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors5}}{}{\NC \NC
> \getvariable{Book:Demos}{honors5} \NC\AR}
> \doifnot {\getvariable{Book:Demos}{honors6}}{}{\NC \NC
> \getvariable{Book:Demos}{honors6} \NC\AR}
> \stoptable
> \stopframedtext
> }
>
> \starttext
>
> \setvariables[Book:Demos]
> [name={Glenn Scobey Warner},
> nickname={Pop, The Old Fox},
> dob={4/5/1871},
> height={6'0"},
> weight={205},
> age={},
> tribe={N/A},
> home={Springville, NY},
> parents={William H. Warner, Adaline Scobey},
> parentsextra={},
> earlyschooling={Griffith Instatute},
> laterschooling={Cornell University},
> honors1={College Football Hall of Fame, Charter Member, 1951},
> honors2={Helm's Athletic Foundation Hall of Fame, 1951},
> honors3={Stanford Athletic Hall of Fame},
> honors4={Greater Buffalo Hall of Fame, 2001},
> honors5={},
> honors6={}
> ]
>
> \Demos
>
> \stoptext
just use mp for both instead of expecting these two mechanism to know of
each other ...
\startuniqueMPgraphic{shadow}
fill OverlayBox cornered .5 shifted (4pt,-4pt) withcolor .8white ;
fill OverlayBox withcolor .9white ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
\defineoverlay [shadow] [\uniqueMPgraphic{shadow}]
\setupcolors[state=start]
\startframedtext[
height=fit,
width=\textwidth,
align=low,
frame=off,
background=shadow,
bodyfont=9pt,
offset=0.05in]
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-16 16:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-15 12:49 Round-corner textbox with shadow Tom
2009-08-15 14:03 ` Peter Rolf
2009-08-16 16:05 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).