ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: A better \definesymbol sought
Date: Wed, 25 Jan 2017 11:17:58 +0100	[thread overview]
Message-ID: <982600f3-cfd4-4a13-6f27-adeaaf1a6348@wxs.nl> (raw)
In-Reply-To: <c12b5ed8-a387-6864-7302-110901d33958@rik.users.panix.com>

On 1/24/2017 8:01 PM, Rik Kabel wrote:
> On 2017-01-24 03:34, Hans Hagen wrote:
>> On 1/24/2017 4:04 AM, Rik wrote:
>>>
>>> What I want is that the background of the page (yellow in this case)
>>> should show through. That is what is done with fill / reverse / cycle,
>>> as in:
>>>
>>>     \setupbackgrounds
>>>       [page]
>>>       [background=color,backgroundcolor=yellow]
>>>     \startuseMPgraphic{CircleTest}
>>>       path p,q ;
>>>       p := fullcircle scaled 2cm ;
>>>       q := fullcircle scaled 1cm ;
>>>       fill p -- reverse q -- cycle withcolor blue;
>>>     \stopuseMPgraphic
>>>     \starttext
>>>      \useMPgraphic{CircleTest}
>>>     \stoptext
>>>
>>> where the background color (yellow) comes through the inner circle
>>> (path q).
>>>
>>> Can this be done with text characters? I suspect that the answer is that
>>> the glyphs have to be converted to paths and that it will only work when
>>
>> \setupbackgrounds
>>   [page]
>>   [background=color,
>>    backgroundcolor=yellow]
>> \starttext
>>     \startcolor[blue]\starteffect[outer]PQR\stopeffect\stopcolor
>> \stoptext
>
>
> Still not there.
>
> Is there a way to define the ? characters to remove their coloring in
> the output of the following so that the background yellow appears
> through the outline even within the portions of the ?s placed on the
> blue heart? I want to be able to place this over arbitrary text and
> color backgrounds (stencil-like) so that the arbitrary text and
> background color shows through.
>
>
>
>     \setupbackgrounds
>       [page]
>       [background={color,bgtext},backgroundcolor=yellow]
>     \definelayer
>       [bgtext]
>       [x=1in,
>        y=2.0in,
>        state=start]
>     \setlayerframed
>       [bgtext]
>       {\setupbodyfont[36pt]@@@}
>     \definefont
>       [DVSrB]
>       [file:DejaVuSerif-Bold.ttf]
>     \startbuffer[Outer]
>      \startcolor[blue]
>        \starteffect
>          [outer]
>          {\DVSrB ???}
>        \stopeffect
>      \stopcolor
>     \stopbuffer
>     \startuseMPgraphic{HeartTest}
>       picture h,q ;
>       h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 5 ;
>       q := textext("{\getbuffer[Outer]}") scaled 3 ;
>       draw h withcolor blue ;
>       draw q ;
>     \stopuseMPgraphic
>     \starttext
>     \starttext
>      \useMPgraphic{HeartTest}
>     \stoptext

\setupbackgrounds
   [page]
   [background={color,bgtext},
    backgroundcolor=yellow]

\definelayer
   [bgtext]
   [x=1in,
    y=2.0in,
    state=start]

\setlayerframed
   [bgtext]
   {\setupbodyfont[36pt]@@@}

\definefont
   [DVSrB]
   [file:DejaVuSerif-Bold.ttf*default]

\startuseMPgraphic{HeartTest}
     draw outlinetext.f
         ("\DVSrB ♥")
         (withcolor red)
         scaled 5 ;
     draw outlinetext.b
         ("\DVSrB ???")
         (withcolor yellow)
         (withcolor blue)
         scaled 3 ;
\stopuseMPgraphic

\starttext
     \useMPgraphic{HeartTest}
\stoptext

-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2017-01-25 10:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21  3:33 Rik Kabel
2017-01-21  4:54 ` Alan Braslau
2017-01-23  3:39   ` Rik Kabel
2017-01-23  5:06     ` Alan Braslau
2017-01-23 19:09       ` Rik Kabel
2017-01-24  3:04         ` Rik
2017-01-24  8:34           ` Hans Hagen
2017-01-24 19:01             ` Rik Kabel
2017-01-25 10:17               ` Hans Hagen [this message]

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=982600f3-cfd4-4a13-6f27-adeaaf1a6348@wxs.nl \
    --to=pragma@wxs.nl \
    --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).