ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Left border of a rectangle (Metafun)
Date: Sat, 29 Aug 2015 13:11:53 +0200	[thread overview]
Message-ID: <10407382-A082-412B-AF07-2FD55746ABA2@gmail.com> (raw)
In-Reply-To: <CACyK-erDFD=80U6nE7GUiPMp6=iBHZD-bTW65Px7TR_2Xm0dBw@mail.gmail.com>

Hi fabrice,

I dont’t know whether this the best solution, but you can use the following definition of the MPgraphic Funny:

\startuseMPgraphic{Funny}
    interim linecap := butt ;
    path p ;
    p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
    drawoptions (withpen pencircle scaled 6.5pt withcolor \MPcolor{MyColorA}) ;
    draw lrcorner p --urcorner p --ulcorner p withcolor white;
    draw ulcorner p --llcorner p ;

\stopuseMPgraphic

If necessary, you can use a backgroundcolor instead of white for the part of the path p which is to be invisible.

Best regards: OK

> On 29 Aug 2015, at 10:56, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
> 
> Hi,
> I want to draw the left border of the rectangle, but it is drawn in the middle.
> Why ?
> Thank you,
> Fabrice
> 
> \setupcolors[state=start]
> 
> 
> \definecolor[MyColorA][c=0.3, m=0.00, y=0.00, k=0.05]
> 
> 
> 
> \defineoverlay
>   [Funny]
>   [\useMPgraphic{Funny}]
> 
> \startuseMPgraphic{Funny}
>     interim linecap := butt ;
>     path p ;
>     p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
>     drawoptions (withpen pencircle scaled 6.5pt withcolor \MPcolor{MyColorA}) ;
>     draw ulcorner p--llcorner p ;
> \stopuseMPgraphic
> 
> \defineframedtext
>   [Methode]
>   [before={\blank},
>    after={\blank},
>    frame=off,
>    background=Funny,
>    width=\textwidth,
>    height=fit]
> 
> \starttext
> 
> \startMethode
> \input knuth
> \stopMethode
> 
> \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  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2015-08-29 11:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29  8:56 Fabrice Couvreur
2015-08-29 11:11 ` Otared Kavian [this message]
2015-08-29 11:35   ` Hans Hagen
2015-08-30  7:50     ` Fabrice Couvreur
2015-08-30  8:36       ` Otared Kavian
2015-08-29 11:18 ` Otared Kavian

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=10407382-A082-412B-AF07-2FD55746ABA2@gmail.com \
    --to=otared@gmail.com \
    --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).