ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* frames in ConTeXt and metafun
@ 2007-07-12  6:56 Thomas A. Schmitz
  2007-07-12  8:04 ` Peter Rolf
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas A. Schmitz @ 2007-07-12  6:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

This is a very small cosmetic problem, but it bugs me: I'm preparing  
a background for a presentation, and I want a frame with a  
transparent color to appear on every slide, so I define an overlay  
and use metapost. I also want to frame some text elements, so I use a  
\framed. The problem is that in the \framed, the lines of the frame  
overlap at the edges, so with a transparent color, the corners are  
slightly darker. The minimal example below shows the problem. Any  
solution? Is it possible to have the frame around \framed drawn by  
metapost?

Thanks!

Thomas


%%%%% MINIMAL EXAMPLE %%%%%%

\setupcolors[state=start]

\definecolor [MyFrameColor]    [b=.55, t=.5, a=1]

\starttext

\startuseMPgraphic{fancyframe}
draw unitsquare
xyscaled(8cm,8cm)
withpen pencircle scaled 4pt
withcolor \MPcolor{MyFrameColor} ;
\stopuseMPgraphic

\useMPgraphic{fancyframe}

\framed 
[rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{\strut}

\stoptext

___________________________________________________________________________________
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] 5+ messages in thread

* Re: frames in ConTeXt and metafun
  2007-07-12  6:56 frames in ConTeXt and metafun Thomas A. Schmitz
@ 2007-07-12  8:04 ` Peter Rolf
  2007-07-12  8:47   ` Thomas A. Schmitz
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Rolf @ 2007-07-12  8:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

Hi Thomas,

Thomas A. Schmitz schrieb:
> This is a very small cosmetic problem, but it bugs me: I'm preparing  
> a background for a presentation, and I want a frame with a  
> transparent color to appear on every slide, so I define an overlay  
> and use metapost. I also want to frame some text elements, so I use a  
> \framed. The problem is that in the \framed, the lines of the frame  
> overlap at the edges, so with a transparent color, the corners are  
> slightly darker. The minimal example below shows the problem. Any  
> solution? Is it possible to have the frame around \framed drawn by  
> metapost?
>
sure (see attachment).

Greetings, Peter

> Thanks!
> 
> Thomas
> 
> 
> %%%%% MINIMAL EXAMPLE %%%%%%
> 
> \setupcolors[state=start]
> 
> \definecolor [MyFrameColor]    [b=.55, t=.5, a=1]
> 
> \starttext
> 
> \startuseMPgraphic{fancyframe}
> draw unitsquare
> xyscaled(8cm,8cm)
> withpen pencircle scaled 4pt
> withcolor \MPcolor{MyFrameColor} ;
> \stopuseMPgraphic
> 
> \useMPgraphic{fancyframe}
> 
> \framed 
> [rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{\strut}
> 
> \stoptext
> 
> ___________________________________________________________________________________
> 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 #2: frame.tex --]
[-- Type: text/plain, Size: 732 bytes --]

\setupcolors[state=start]

\definecolor [MyFrameColor]    [b=.55, t=.5, a=1]


\startuniqueMPgraphic{fancyframe}{linewidth,radius,color}
begingroup
  save c, lw ;
  color c ; c:= \MPvar{color} ;
  lw:= \MPvar{linewidth} ;
  
  draw unitsquare xyscaled(OverlayWidth-lw,OverlayHeight-lw)
  smoothed \MPvar{radius}
  withpen pencircle scaled lw
  withcolor c ;
endgroup ;
\stopuniqueMPgraphic

\defineoverlay[fancyframe]
  [\uniqueMPgraphic{fancyframe}{linewidth=4pt,radius=5pt,color=MyFrameColor}]

\presetlocalframed[fancy]
\setuplocalframed[fancy]
  [frame=off,background=fancyframe]



\starttext

\framed 
[rulethickness=4pt,framecolor=MyFrameColor,height=8cm,width=8cm]{}

\localframed[fancy]
[height=8cm,width=8cm]{}

\stoptext

[-- Attachment #3: 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] 5+ messages in thread

* Re: frames in ConTeXt and metafun
  2007-07-12  8:04 ` Peter Rolf
@ 2007-07-12  8:47   ` Thomas A. Schmitz
  2007-07-12 18:51     ` Peter Münster
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas A. Schmitz @ 2007-07-12  8:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:

> Hi Thomas,
> sure (see attachment).
>
> Greetings, Peter

Thanks so much Peter! THis looks MUCH better. The more I use metafun,  
the more I love it.

Thomas
___________________________________________________________________________________
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] 5+ messages in thread

* Re: frames in ConTeXt and metafun
  2007-07-12  8:47   ` Thomas A. Schmitz
@ 2007-07-12 18:51     ` Peter Münster
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Münster @ 2007-07-12 18:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 12 Jul 2007, Thomas A. Schmitz wrote:

> On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:
> 
> > sure (see attachment).
> >
> Thanks so much Peter! THis looks MUCH better. The more I use metafun,  
> the more I love it.

Hello,

Did you take a look at the result with xpdf? There seems to be a problem
somewhere. But it looks very nice with acroread, indeed!

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___________________________________________________________________________________
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] 5+ messages in thread

* Re: frames in ConTeXt and metafun
@ 2007-07-13  9:28 Thomas A. Schmitz
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas A. Schmitz @ 2007-07-13  9:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 12 Jul 2007

> On Thu, 12 Jul 2007, Thomas A. Schmitz wrote:
> 
>> On Jul 12, 2007, at 10:04 AM, Peter Rolf wrote:
>>
>> > sure (see attachment).
>> >
>> Thanks so much Peter! THis looks MUCH better. The more I use metafun,
>> the more I love it.
> 
> Hello,
> 
> Did you take a look at the result with xpdf? There seems to be a problem
> somewhere. But it looks very nice with acroread, indeed!
> 
> Cheers, Peter

Yes you're right, I just looked at it on my linux box (usually I use OS 
X). The result is bizarre both in xpdf and in evince (there is no 
acroread for powerpc, shame on adobe!). But this seems to be merely an 
error in the viewer; I have often found the linux pdf viewers to be 
extremely inferior to what I get in OS X; one of the reasons why I will 
not be able to switch to linux anytime soom.

Best

Thomas
___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2007-07-13  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-12  6:56 frames in ConTeXt and metafun Thomas A. Schmitz
2007-07-12  8:04 ` Peter Rolf
2007-07-12  8:47   ` Thomas A. Schmitz
2007-07-12 18:51     ` Peter Münster
2007-07-13  9:28 Thomas A. Schmitz

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).