ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* shading question
@ 2000-10-31 21:29 Denis B. Roegel
  2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
  2000-11-01  8:12 ` shading question Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Denis B. Roegel @ 2000-10-31 21:29 UTC (permalink / raw)
  Cc: roegel

In the following example, the top parts of the circles are
slightly trimmed, at least when I view them with acroread.
Is this normal?

Thanks,

Denis

\setupcolors[state=start]
\starttext

\definecolor[a][darkyellow]
\definecolor[b][s=.8]
\definecolor[c][darkred]

\startuniqueMPgraphic{CircularShade}
  path p;
  p:= unitsquare xscaled \overlaywidth yscaled \overlayheight ;
  circular_shade(p,0,\MPcolor{a},\MPcolor{b});
\stopuniqueMPgraphic

\startuniqueMPgraphic{LinearShade}
  path p;
  p:= unitsquare xscaled \overlaywidth yscaled \overlayheight ;
  linear_shade(p,0,\MPcolor{a},\MPcolor{b});
\stopuniqueMPgraphic

\defineoverlay[circular shade][\uniqueMPgraphic{CircularShade}]
\defineoverlay[linear shade]  [\uniqueMPgraphic{LinearShade}]

\framed
  [background=circular shade,frame=off]
  {\bf \white Hi there, I'm Circular!}

\framed
  [background=linear shade,frame=off]
  {\bf \white Whow, this is Linear!}

\startuniqueMPgraphic{test}
path p; p:=fullcircle scaled 1cm;
for i:= 0 step 2cm until 8cm:
  circular_shade(p shifted (i,0),0,\MPcolor{a},\MPcolor{b});
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test}

\startuniqueMPgraphic{test1}
circular_shade(fullcircle scaled 1cm,0,\MPcolor{a},\MPcolor{b});
picture s; s:=currentpicture; currentpicture := nullpicture;
for i=0 step 2cm until 8cm:
  addto currentpicture also s shifted (i,0);
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test1}

\startuniqueMPgraphic{test2}
sh:=define_circular_shade(origin,origin,0,8cm,\MPcolor{a},\MPcolor{b});
for i=0 step 2cm until 8cm:
  fill fullcircle scaled 1cm shifted (i,0) withshade sh;
endfor;
\stopuniqueMPgraphic

\useMPgraphic{test2}

\stoptext


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

* Re: shading, Trying shading example, missing metafun.mem
  2000-10-31 21:29 shading question Denis B. Roegel
@ 2000-10-31 22:02 ` Thomas Porter
  2000-10-31 22:45   ` Christopher Tipper
  2000-11-01  8:12 ` shading question Hans Hagen
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Porter @ 2000-10-31 22:02 UTC (permalink / raw)


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

I have the most recent stable pdfTeX and ConTeXt versions, but when I
ran he recently posted shading example, I got an error message during my
texexec run saying that metafun.mem could not be found, was using
mpost.mem instead.

I scanned dejanews and google, but no mention of metafun.mem

Any help welcome.

-- 
Tom Porter                                   txporter@mindspring.com
--------------------------------------------------------------------
"On two occasions I have been asked [by members of Parliament], 
'Pray, Mr. Babbage, if you put into the machine wrong figures, will 
the right answers come out?'  I am not able rightly to apprehend the 
kind of confusion of ideas that could provoke such a question."

[-- Attachment #2: mptest_run.log --]
[-- Type: text/plain, Size: 3563 bytes --]

This is pdfeTeX, Version 3.14159-14f-released-20000525-2.1 (Web2C 7.3.2x)
entering extended mode
(mptest.tex{/usr/share/texmf/pdftex/config/pdftex.cfg}

ConTeXt  ver: 2000.10.3  fmt: 2000.10.23  int: english  mes: english

language       : language en is active
system         : cont-new loaded
(/usr/share/texmf/tex/context/base/cont-new.tex
systems        : beware: some patches loaded from cont-new.tex!
)
system         : cont-old loaded
(/usr/share/texmf/tex/context/base/cont-old.tex
loading        : Context Old Macros
)
system         : cont-fil loaded
(/usr/share/texmf/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
bodyfont       : 12pt rm is loaded
language       : patterns 2-en-2 2-uk-2 2-de-2 2-fr-2 2-sp-2 2-nl-2 loaded
specials       : tex,postscript,rokicki loaded
system         : mptest.top loaded
(./mptest.top
specials       : tex,postscript,rokicki is reset
specials       : loading definition file tpd
(/usr/share/texmf/tex/context/base/spec-tpd.tex <unprotect 2>
specials       : loading definition file fdf
(/usr/share/texmf/tex/context/base/spec-fdf.tex <unprotect 3> <unprotect 4>
<protect 4> <protect 3>)
specials       : fdf loaded
<unprotect 3> <protect 3> <protect 2>)
specials       : fdf,tpd loaded
) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo)
(./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo)
color          : rgb color space is supported
color          : cmyk color space is supported
color          : system rgb is global activated
(./mptest.tuo) (./mptest.tuo)
systems        : begin file mptest at line 2
Randomizer initialized to 1194900621. [MP to PDF mpgraph.1] (mpgraph.1)
(./mptest.tuo) [MP to PDF mpgraph.2] (mpgraph.2) [MP to PDF mpgraph.3]
(mpgraph.3) [MP to PDF mpgraph.4] (mpgraph.4) [MP to PDF mpgraph.5] (mpgraph.5)
[1.1{/usr/share/texmf/dvips/config/pdftex.map}]
systems        : end file mptest at line 65
[flush and process mpgraph.mp afterwards] )</usr/share/texmf/fonts/type1/bluesk
y/cm/cmbx12.pfb></usr/share/texmf/fonts/type1/bluesky/cm/cmr12.pfb>
Output written on mptest.pdf (1 page, 15449 bytes).
Transcript written on mptest.log.
This is MetaPost, Version 0.641 (Web2C 7.3.1)
Sorry, I can't find the mem file `metafun.mem'; will try `mpost.mem'.
(mpgraph.mp (/usr/share/texmf/metapost/context/mp-tool.mp)
(/usr/share/texmf/metapost/context/mp-spec.mp)
(/usr/share/texmf/metapost/context/mp-page.mp)
(/usr/share/texmf/metapost/context/mp-core.mp) [1] [2] [3] [4] [5] )
5 output files written: mpgraph.1 .. mpgraph.5
Transcript written on mpgraph.log.

 TeXExec 2.2 - ConTeXt / PRAGMA ADE 1997-2000

              metapost : mpgraph
                format : metafun

 TeXUtil 7.3 - ConTeXt / PRAGMA ADE 1992-2000

                action : processing commands, lists and registers 
                option : sorting IJ under Y 
                option : converting high ASCII values 
            input file : mptest.tui 
           output file : mptest.tuo 
       passed commands : 5 
         remapped keys : 0 
      register entries : 0 -> 0 entries 0 references 
       synonym entries : 0 -> 0 entries 
        embedded files : 1 

 TeXExec 2.2 - ConTeXt / PRAGMA ADE 1997-2000

            executable : pdfetex
                format : cont-en
             inputfile : mptest
                output : pdftex
             interface : en
          current mode : all
               TeX run : 1

              run time : 0 seconds
   generating graphics : metaposting mpgraph.mp
  sorting and checking : running texutil

[-- Attachment #3: mptest.tex --]
[-- Type: application/x-tex, Size: 1501 bytes --]

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

* Re: shading, Trying shading example, missing metafun.mem
  2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
@ 2000-10-31 22:45   ` Christopher Tipper
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Tipper @ 2000-10-31 22:45 UTC (permalink / raw)
  Cc: ConTeXT Mailing List

I quote from page 355 of the metafun manual

When you use the macros that come with CONT E XT, you may wish to package them in a memory dump file that can be loaded fast. You can do that by the following command.

mpost --ini metafun

You have to move the resulting mem file to the location where METAPOST expects to find it. If you want to be sure that everything is done correctly, you may try:

texexec --make --alone metafun

I recommend the last method. I don't know what it's like for tetex or web2c but for miktex put the .mem file in texmf\miktex\mem.

Hope this helps,
Christopher
--------------------------------o00o--------------------------------
Christopher G D Tipper | Inglewood | Longville in the Dale 
         nr. Much Wenlock | Shropshire TF13 6DT | U.K.
         mailto:chris.tipper@e-conomist.fsnet.co.uk
         http://www.e-conomist.fsnet.co.uk/
         tel: (01694) 771 809 | fax: (01694) 771 808 
---------------------------------------------------------------------
   Nil Desperandum Illegitimi 
   -- Don't let the bastards get you down (~Ovid)

----- Original Message ----- 
From: "Thomas Porter" <txporter@mindspring.com>
To: <ntg-context@ntg.nl>
Sent: Tuesday, October 31, 2000 10:02 PM
Subject: Re: shading, Trying shading example, missing metafun.mem

> I have the most recent stable pdfTeX and ConTeXt versions, but when I
> ran he recently posted shading example, I got an error message during my
> texexec run saying that metafun.mem could not be found, was using
> mpost.mem instead.
> 
> I scanned dejanews and google, but no mention of metafun.mem
> 
> Any help welcome.
> 
> -- 
> Tom Porter                                   txporter@mindspring.com
> --------------------------------------------------------------------
> "On two occasions I have been asked [by members of Parliament], 
> 'Pray, Mr. Babbage, if you put into the machine wrong figures, will 
> the right answers come out?'  I am not able rightly to apprehend the 
> kind of confusion of ideas that could provoke such a question."

--------------------------------------------------------------------------------

> This is pdfeTeX, Version 3.14159-14f-released-20000525-2.1 (Web2C 7.3.2x)
> entering extended mode
> (mptest.tex{/usr/share/texmf/pdftex/config/pdftex.cfg}
> 
> ConTeXt  ver: 2000.10.3  fmt: 2000.10.23  int: english  mes: english
> 
> language       : language en is active
> system         : cont-new loaded
> (/usr/share/texmf/tex/context/base/cont-new.tex
> systems        : beware: some patches loaded from cont-new.tex!
> )
> system         : cont-old loaded
> (/usr/share/texmf/tex/context/base/cont-old.tex
> loading        : Context Old Macros
> )
> system         : cont-fil loaded
> (/usr/share/texmf/tex/context/base/cont-fil.tex
> loading        : Context File Synonyms
> )
> bodyfont       : 12pt rm is loaded
> language       : patterns 2-en-2 2-uk-2 2-de-2 2-fr-2 2-sp-2 2-nl-2 loaded
> specials       : tex,postscript,rokicki loaded
> system         : mptest.top loaded
> (./mptest.top
> specials       : tex,postscript,rokicki is reset
> specials       : loading definition file tpd
> (/usr/share/texmf/tex/context/base/spec-tpd.tex <unprotect 2>
> specials       : loading definition file fdf
> (/usr/share/texmf/tex/context/base/spec-fdf.tex <unprotect 3> <unprotect 4>
> <protect 4> <protect 3>)
> specials       : fdf loaded
> <unprotect 3> <protect 3> <protect 2>)
> specials       : fdf,tpd loaded
> ) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo)
> (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo) (./mptest.tuo)
> color          : rgb color space is supported
> color          : cmyk color space is supported
> color          : system rgb is global activated
> (./mptest.tuo) (./mptest.tuo)
> systems        : begin file mptest at line 2
> Randomizer initialized to 1194900621. [MP to PDF mpgraph.1] (mpgraph.1)
> (./mptest.tuo) [MP to PDF mpgraph.2] (mpgraph.2) [MP to PDF mpgraph.3]
> (mpgraph.3) [MP to PDF mpgraph.4] (mpgraph.4) [MP to PDF mpgraph.5] (mpgraph.5)
> [1.1{/usr/share/texmf/dvips/config/pdftex.map}]
> systems        : end file mptest at line 65
> [flush and process mpgraph.mp afterwards] )</usr/share/texmf/fonts/type1/bluesk
> y/cm/cmbx12.pfb></usr/share/texmf/fonts/type1/bluesky/cm/cmr12.pfb>
> Output written on mptest.pdf (1 page, 15449 bytes).
> Transcript written on mptest.log.
> This is MetaPost, Version 0.641 (Web2C 7.3.1)
> Sorry, I can't find the mem file `metafun.mem'; will try `mpost.mem'.
> (mpgraph.mp (/usr/share/texmf/metapost/context/mp-tool.mp)
> (/usr/share/texmf/metapost/context/mp-spec.mp)
> (/usr/share/texmf/metapost/context/mp-page.mp)
> (/usr/share/texmf/metapost/context/mp-core.mp) [1] [2] [3] [4] [5] )
> 5 output files written: mpgraph.1 .. mpgraph.5
> Transcript written on mpgraph.log.
> 
>  TeXExec 2.2 - ConTeXt / PRAGMA ADE 1997-2000
> 
>               metapost : mpgraph
>                 format : metafun
> 
>  TeXUtil 7.3 - ConTeXt / PRAGMA ADE 1992-2000
>  
>                 action : processing commands, lists and registers 
>                 option : sorting IJ under Y 
>                 option : converting high ASCII values 
>             input file : mptest.tui 
>            output file : mptest.tuo 
>        passed commands : 5 
>          remapped keys : 0 
>       register entries : 0 -> 0 entries 0 references 
>        synonym entries : 0 -> 0 entries 
>         embedded files : 1 
> 
>  TeXExec 2.2 - ConTeXt / PRAGMA ADE 1997-2000
> 
>             executable : pdfetex
>                 format : cont-en
>              inputfile : mptest
>                 output : pdftex
>              interface : en
>           current mode : all
>                TeX run : 1
> 
> 
>               run time : 0 seconds
>    generating graphics : metaposting mpgraph.mp
>   sorting and checking : running texutil
> 


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

* Re: shading question
  2000-10-31 21:29 shading question Denis B. Roegel
  2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
@ 2000-11-01  8:12 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2000-11-01  8:12 UTC (permalink / raw)
  Cc: ntg-context, roegel

At 10:29 PM 10/31/00 +0100, Denis B. Roegel wrote:
>
>In the following example, the top parts of the circles are
>slightly trimmed, at least when I view them with acroread.
>Is this normal?

This has to do with the fact that graphics that need resources [like
shading] are put in an xform object and such an object always clips. And,
clipping it kind of inaccurate, I have spend many days experimenting with
this and the current implementation is about the best we can get out of it;
think of making sure that only the positive quadrant is used and so. 

The best way out is to slightly enlarge the bbox, so at the end of the
picture say: 

setbounds currentpicture to boundingbox currentpicture enlarged 1bp ; 

or use a value 50% of the linewidth. 

Because overlays are centered, a larger than normal one will still be okay
from the perspective of context, 

Hans

-------------------------------------------------------------------------
                                                  Hans Hagen | PRAGMA ADE
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2000-11-01  8:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-31 21:29 shading question Denis B. Roegel
2000-10-31 22:02 ` shading, Trying shading example, missing metafun.mem Thomas Porter
2000-10-31 22:45   ` Christopher Tipper
2000-11-01  8:12 ` shading question 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).