ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metafun does not change color
@ 2010-02-18 21:03 Xan
  2010-02-19 12:59 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Xan @ 2010-02-18 21:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I have the following code (see at final). I define SquareText to be 
darkblue in framecolor, but metafun use darkred. Why? Any ideas?

Xan.

\page
\section{Tectònica de plaques}

\subsection{Com es formen els relleus?}

\setupFLOWcharts[width=.4\textwidth]

\startFLOWchart[fixistes]
\startFLOWcell
  \name {Fonts}
  \location {1,1}
  \text {Algunes teories es basaven en relats bíblics.  Atribuïen al 
diluvi universal la causa d'alguns relleus i la presència de fòssils 
marins a les muntanyes.}
  \connection [rl] {fixistes}
  \shape{procedure}
\stopFLOWcell
\startFLOWcell
  \name {fixistes}
  \location{2,1}
  \text {Altres suposaven que la Terra s'ha anat arrugat progressivament 
en refredar-se i que els relleus són arrugues provocades per l'escorça 
en contracció.}
  \shape{decision}
\stopFLOWcell
\stopFLOWchart



\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame]
\def\StartFrame{\startFunnyText}
\def\StopFrame {\stopFunnyText }
\def\FrameTitle#1%
  {\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{FunnyFrame}{} % initialize the text variable

\startuseMPgraphic{FunnyFrame}
  picture p ; numeric o ; path a, b ; pair c ;
  p := textext.rt(\MPstring{FunnyFrame}) ;
  o := BodyFontSize ;
  a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
  p := p shifted (2o,OverlayHeight-ypart center p) ;
  pickup pencircle scaled OverlayLineWidth ;
  b := a superellipsed .95 ;
  fill b withcolor OverlayColor ;
  draw b withcolor OverlayLineColor ;
  b := (boundingbox p) superellipsed .95 ;
  fill b withcolor OverlayColor ;
  draw b withcolor OverlayLineColor ;
  draw p withcolor black ;
  setbounds currentpicture to a ;
\stopuseMPgraphic

\setupframedtexts
  [FunnyText]
  [backgroundcolor=lightgray,
   framecolor=darkred,
   rulethickness=2pt,
   offset=\bodyfontsize,
   before={\blank[big,medium]},
   after={\blank[big]},
   width=\textwidth]



\FrameTitle{Teories fixistes}
\StartFrame
Al llarg del segle XIX i el començament del XX, es crearen diverses 
teories que intentaven explicar l'origen de les serrelades i el 
plegament dels estrats, que no podem explicar fàcilment.

Totes aquestes teories tenen com a {\bf principi} que els continents i 
els oceans han ocupat les {\em mateixes posicions} des de l'origen de la 
Terra fins ara.
\StopFrame

\FLOWchart[fixistes]

\defineoverlay[SquareFrame][\useMPgraphic{SquareFrame}]
\defineframedtext[SquareText][frame=off,background=SquareFrame]
\def\StartSquareFrame{\startSquareText}
\def\StopSquareFrame {\stopSquareText }
\def\SquareTitle#1%
  {\setMPtext{SquareFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{SquareFrame}{} % initialize the text variable

\startuseMPgraphic{SquareFrame}
  picture p ; numeric o ; path a, b ; pair c ;
  p := textext.rt(\MPstring{SquareFrame}) ;
  a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
  o := BodyFontSize ;
  p := p shifted (2o,OverlayHeight-ypart center p) ;
  drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
  b := a randomized (o/2) ;
  fill b withcolor .85white ; draw b ;
  c := center p ;
  c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ;
  p := p shifted (c-center p) ;
  b := (boundingbox p) randomized (o/8) ;
  fill b withcolor .85white ; draw b ;
  draw p withcolor black;
  setbounds currentpicture to a ;
 \stopuseMPgraphic


\setupframedtexts
  [SquareText]
  [backgroundcolor=screen,
   framecolor=darkblue,
   rulethickness=2pt,
   offset=\bodyfontsize,
   before={\blank[big,medium]},
   after={\blank[big]},
   width=\textwidth]


\SquareTitle{Mobilisme}
\StartSquareFrame
El 1912, Alfred Wegener proposa una teoria revolucionària
\StopSquareFrame

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Metafun does not change color
  2010-02-18 21:03 Metafun does not change color Xan
@ 2010-02-19 12:59 ` Hans Hagen
  2010-02-19 13:25   ` Xan
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2010-02-19 12:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Xan

On 18-2-2010 22:03, Xan wrote:

> I have the following code (see at final). I define SquareText to be
> darkblue in framecolor, but metafun use darkred. Why? Any ideas?

> p := textext.rt(\MPstring{FunnyFrame}) ;

you need to change the color in textext (or in the MPstring)

> draw p withcolor black ;

-----------------------------------------------------------------
                                           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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Metafun does not change color
  2010-02-19 12:59 ` Hans Hagen
@ 2010-02-19 13:25   ` Xan
  0 siblings, 0 replies; 3+ messages in thread
From: Xan @ 2010-02-19 13:25 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

En/na Hans Hagen ha escrit:
> On 18-2-2010 22:03, Xan wrote:
>
>> I have the following code (see at final). I define SquareText to be
>> darkblue in framecolor, but metafun use darkred. Why? Any ideas?
>
>> p := textext.rt(\MPstring{FunnyFrame}) ;
>
And so, why does the setuoframedtext option mean?

\setupframedtexts
  [SquareText]
  [backgroundcolor=screen,
   framecolor=darkblue,
   rulethickness=2pt,
   offset=\bodyfontsize,
   before={\blank[big,medium]},
   after={\blank[big]},
   width=\textwidth]

I extract the example from manual.

Regards,
Xan.
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-19 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-18 21:03 Metafun does not change color Xan
2010-02-19 12:59 ` Hans Hagen
2010-02-19 13:25   ` Xan

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