ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Zunbeltz Izaola <zunbeltz@lcdx00.wm.lc.ehu.es>
Subject: Re: MP figures in the background
Date: Wed, 17 Dec 2003 22:56:03 +0100 (MET)	[thread overview]
Message-ID: <Pine.OSF.4.44.0312172247310.18202-100000@lcdx00.wm.lc.ehu.es> (raw)
In-Reply-To: <6.0.1.1.2.20031215104348.02c8b278@server-1>

>
> >Hi,
> >
> >I'm doing a christmars card in ConTeXt!. I've the following setup
> >
> >\setuppapersize[CD][A4]
> >\setuplayout[marking=on,location=middle]
> >
> >\starttext
> >\startuseMPgraphic{dummy}
> >...
> >...
> >\stopuseMPgraphic
> >
> >\defineoverlay[backfigure][\useMPgraphic{dummy}]
> >\setupbackground[paper][background=backfigure]
> >\hbox{}
> >\stoptext
>
> >\starttext
> >\startuseMPgraphic{dummy}
> >...
> >...
> >\stopuseMPgraphic
> >
> >\defineoverlay[backfigure][\useMPgraphic{dummy}]
> >\setupbackground[paper][background=backfigure]
> >\hbox{}
> >\stoptext
>
>    \defineoverlay[page][\useMPgraphic{dummy}]
>
>    \setupbackground[page][background=page]
>
>    \startstandardmakeup
>    some text
>    \stopstandardmakeup
>
>    \setupbackground[page][background=]
>
>    rest of text on next page
>
> or:
>
>    \definelayer[page] \setlayer[page]{\useMPgraphic{dummy}]
>
>    \startstandardmakeup
>    some text
>    \stopstandardmakeup
>
>    rest of text on next page

Hi Hans!
I'm in trouble with this method. (I supose the error is mine).
I can draw the MP graphic using \useMPgraphic, but when i use

\defineoverlay[bihotzak][\useMPgraphic{bihotz}]
\setupbackgrounds[paper][background=bihotzak]

I get the following error
systems        : randomizer starts with 150693575
[MP to PDF] (./mpgraph.1)
layout         : calculating backgrounds
[MP to PDF] (./mpgraph.4000
! Dimension too large.
\handleMPboundingbox ... 2 \advance \dimen 0 #4bp
                                                  \dimen 0=\MPxscale
\dimen ...
l.2 %%BoundingBox: -6 -141 --32768 --32768

I put my file in the end

>
> Hans (who right now is going to print this years christmas card -)
>
  Zunbeltz (who is working hard to print a christamas card :-)

\setupoutput[pdftex]
\setupcolors[state=start]
\setuplayout[location=middle,marking=on]
\setuppagenumber[state=stop]

%\setuppapersize[CD][A4]

%\useexternalfigure[bihotzirudia][biho.mps][width=12cm,height=12cm]

\starttext
\startuseMPgraphic{bihotz}
    u = 0.017mm;
    z0 = (10,16.2)*u;
    z1 = (14,17.8)*u;
    z2 = (19.5,12.5)*u;
    z3 = (10,0)*u;
    z4 = (0.5,12.5)*u;
    z5 = (6,17.8)*u;
    z6 = (10,16.2)*u;

%  penwidth = 3cm;
  pickup pencircle scaled 0.4;

   randomseed := 12346;

   color color[],colourout,colourin;
   color1 = 0.9red;
   color2 = (red+0.4yellow);

   path heart;
   heart := z0..z1{right}..z2{down}..{dir-110}z3{dir90}..{dir 90}z4..
   {right}z5..z6;

  pair shiftvector;

   picture heartpicture[];
   draw heart   withcolor color1;
   fill heart..cycle  withcolor color2 ;
   heartpicture0 := currentpicture;
   currentpicture:= nullpicture;
   draw heart withcolor color2;
   fill heart..cycle withcolor color1;
   heartpicture1 := currentpicture;
   currentpicture:= nullpicture;
%   scalation := 0.001mm;

  pair shiftvector;
  draw heartpicture0 scaled 0.01mm;
   for i=1 upto 1:
     shiftvector := (uniformdeviate 12, uniformdeviate 12);
     if uniformdeviate 2 > 1:
       draw heartpicture0 shifted shiftvector  scaled 1cm;% scaled
scalation;
     else:
       draw heartpicture1 shifted shiftvector scaled 1cm;% scaled
scalation;
     fi;
     endfor;

setbounds currentpicture to unitsquare scaled 12cm;
\stopuseMPgraphic
%\definecolor[color1][r=0.9,]
%\definecolor[color2][r=1,y=0.4]

\useMPgraphic{bihotz}
%\useMPgraphic{bihotz}


\defineoverlay[bihotzak][\useMPgraphic{bihotz}]
%\setlayer[page]{\externalfigure[bihotzirudia]}

%\externalfigure[biho]%[width=12cm]
%\defineoverlay[page]
%[width=12cm]

\setupbackgrounds[paper][background=bihotzak]

\startstandardmakeup
   some text
\stopstandardmakeup

%\setupbackgrounds[page][background=]

%\page[yes]
%\leftaligned{2004 bihotz}
%\leftaligned{2004 \color[color2]{urterako}}
%\blank
%\rightaligned{Zure Ciruelitoa}

\stoptext

  parent reply	other threads:[~2003-12-17 21:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-15  8:24 Zunbeltz Izaola
     [not found] ` <Pine.OSF.4.44.0312150902060.31717-100000@lcdx00.wm.lc.ehu. es>
2003-12-15  9:47   ` Hans Hagen
2003-12-15 10:02     ` Zunbeltz Izaola
2003-12-17 21:56     ` Zunbeltz Izaola [this message]
     [not found]       ` <Pine.OSF.4.44.0312172247310.18202-100000@lcdx00.wm.lc.ehu. es>
2003-12-18  7:54         ` Hans Hagen
2003-12-18  8:42           ` Zunbeltz Izaola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.OSF.4.44.0312172247310.18202-100000@lcdx00.wm.lc.ehu.es \
    --to=zunbeltz@lcdx00.wm.lc.ehu.es \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).