ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* A better \definesymbol sought
@ 2017-01-21  3:33 Rik Kabel
  2017-01-21  4:54 ` Alan Braslau
  0 siblings, 1 reply; 9+ messages in thread
From: Rik Kabel @ 2017-01-21  3:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1551 bytes --]

ConTeXters,

I have been using \definesymbol for a while, and for most purposes it 
suffices. However, there is one thing that it does not do that perhaps 
it should.

What it does not do is offer the option to center one glyph over another 
(horizontally and/or vertically) when it should be centered. Rather, it 
leaves the work to a process of tuning the horizontal and vertical 
levers (kern and raise here) to get something that is close, but rarely 
perfect.

I also see some problems with the horizontal spacing around the new 
symbol, but that may be a function of the underlying glyphs here.

The following example shows what I mean

    \definefont
       [Inits]
       [dejavusans]
    \usesymbols[mvs]
    \define\SqSteel{%
       \tfc
       \symbol[martinvogel 2][SquareSteel]
    }
    \define\RedSansA{%
       \tfx
       \Inits{\red A}
    }
    \definesymbol
       [MyMark]
       [\SqSteel\kern-.87em{\raise.38ex\hbox{\RedSansA}}]
    \define\Test{Some text \symbol[MyMark] some more text.\par}

    \starttext
    \Test
    \setupbodyfont[8pt]
    \Test
    \setupbodyfont[18pt]
    \Test
    \scale[factor=40]{\Test}
    \stoptext

Can anyone suggest a better way to compose such symbols than using the 
raw TeX commands used here? Is there a more ConTeXt-ish way to do this?

Is it possible to get options to center the glyphs from which the symbol 
is assembled (separate horizontal and vertical, with the ability to 
offset them)?

Is there a ConTeXt way other than \definesymbol to create such combined 
symbols?

-- 
Rik


[-- Attachment #1.2: Type: text/html, Size: 2355 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: A better \definesymbol sought
  2017-01-21  3:33 A better \definesymbol sought Rik Kabel
@ 2017-01-21  4:54 ` Alan Braslau
  2017-01-23  3:39   ` Rik Kabel
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Braslau @ 2017-01-21  4:54 UTC (permalink / raw)
  To: Rik Kabel; +Cc: mailing list for ConTeXt users

On Fri, 20 Jan 2017 22:33:40 -0500
Rik Kabel <context@rik.users.panix.com> wrote:

> Can anyone suggest a better way to compose such symbols than using
> the raw TeX commands used here? Is there a more ConTeXt-ish way to do
> this? Is it possible to get options to center the glyphs from which
> the symbol is assembled (separate horizontal and vertical, with the
> ability to offset them)?
> 
> Is there a ConTeXt way other than \definesymbol to create such
> combined symbols?

MetaPost (with textext())?
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: A better \definesymbol sought
  2017-01-21  4:54 ` Alan Braslau
@ 2017-01-23  3:39   ` Rik Kabel
  2017-01-23  5:06     ` Alan Braslau
  0 siblings, 1 reply; 9+ messages in thread
From: Rik Kabel @ 2017-01-23  3:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1628 bytes --]

On 2017-01-20 23:54, Alan Braslau wrote:
> On Fri, 20 Jan 2017 22:33:40 -0500
> Rik Kabel <context@rik.users.panix.com> wrote:
>
>> Can anyone suggest a better way to compose such symbols than using
>> the raw TeX commands used here? Is there a more ConTeXt-ish way to do
>> this? Is it possible to get options to center the glyphs from which
>> the symbol is assembled (separate horizontal and vertical, with the
>> ability to offset them)?
>>
>> Is there a ConTeXt way other than \definesymbol to create such
>> combined symbols?
> MetaPost (with textext())?

Thank you for that, Alan. I hadn’t ever used MetaPost before, thinking 
it was too complex for my needs. Now I see it may be quite useful.

So, how can I make the inner glyph (‘?’ in the example below) 
transparent, so that the background shows through along with anything 
else that lives on a lower layer? I’ve seen a method for constructed 
shapes, but nothing that I can apply to text glyphs. Undraw doesn’t do it.

       \setupbackgrounds
        [page]
        [background=color,backgroundcolor=yellow]
      \definefont
        [DVSrB]
        [file:DejaVuSerif-Bold.ttf]
      \startuseMPgraphic{HeartTest}
        picture h;
        h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20;
        picture q;
        q := textext("{\DVSrB ?}") scaled 10;     % just a different way
        q := q shifted - (xpart center q, 12pt) ;
        draw h withcolor blue;
        undraw q;                                   % this doesn't do it
      \stopuseMPgraphic
      \starttext
        \useMPgraphic{HeartTest}
      \stoptext

-- 
Rik


[-- Attachment #1.2: Type: text/html, Size: 2537 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: A better \definesymbol sought
  2017-01-23  3:39   ` Rik Kabel
@ 2017-01-23  5:06     ` Alan Braslau
  2017-01-23 19:09       ` Rik Kabel
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Braslau @ 2017-01-23  5:06 UTC (permalink / raw)
  To: Rik Kabel; +Cc: mailing list for ConTeXt users

On Sun, 22 Jan 2017 22:39:53 -0500
Rik Kabel <context@rik.users.panix.com> wrote:

> So, how can I make the inner glyph (‘?’ in the example below)
> transparent, so that the background shows through along with anything
> else that lives on a lower layer? I’ve seen a method for constructed
> shapes, but nothing that I can apply to text glyphs. Undraw doesn’t
> do it.

Undraw is simply draw using the background color.

Transparency is a MetaFun extension to MetaPost (so part of ConTeXt).

draw q withtransparency (1,0.5) ; % (method,transparency)

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

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

* Re: A better \definesymbol sought
  2017-01-23  5:06     ` Alan Braslau
@ 2017-01-23 19:09       ` Rik Kabel
  2017-01-24  3:04         ` Rik
  0 siblings, 1 reply; 9+ messages in thread
From: Rik Kabel @ 2017-01-23 19:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1094 bytes --]

On 2017-01-23 00:06, Alan Braslau wrote:
> On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel  > <context@rik.users.panix.com> wrote: > >> So, how can I make the 
inner glyph (‘?’ in the example below) >> transparent, so that the 
background shows through along with >> anything else that lives on a 
lower layer? I’ve seen a method for >> constructed shapes, but nothing 
that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw is 
simply draw using the background color. > > Transparency is a MetaFun 
extension to MetaPost (so part of > ConTeXt). > > draw q 
withtransparency (1,0.5) ; % (method,transparency) > > Alan

Hmmm. That does not work for me (with any of many method and 
transparency values).  The  ‘?’ is solid black. I do see a message in 
the log that looks related:

    mkiv lua stats  > page group warning: transparencies are used but no
    pagecolormodel is set

but adding \setcolors[state=start,cmyk=yes] does not change that; both 
the warning and the solid black glyph remain. Could this be an issue of 
the PDF viewer? Is it a font issue?

-- 
Rik

[-- Attachment #1.2: Type: text/html, Size: 1576 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: A better \definesymbol sought
  2017-01-23 19:09       ` Rik Kabel
@ 2017-01-24  3:04         ` Rik
  2017-01-24  8:34           ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Rik @ 2017-01-24  3:04 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 3317 bytes --]

On 2017-01-23 14:09, Rik Kabel wrote:
> On 2017-01-23 00:06, Alan Braslau wrote:
> > On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel > <context@rik.users.panix.com> wrote: > >> So, how can I make the 
> inner glyph (‘?’ in the example below) >> transparent, so that the 
> background shows through along with >> anything else that lives on a 
> lower layer? I’ve seen a method for >> constructed shapes, but nothing 
> that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw 
> is simply draw using the background color. > > Transparency is a 
> MetaFun extension to MetaPost (so part of > ConTeXt). > > draw q 
> withtransparency (1,0.5) ; % (method,transparency) > > Alan
>
> Hmmm. That does not work for me (with any of many method and 
> transparency values).  The  ‘?’ is solid black. I do see a message in 
> the log that looks related:
>
>     mkiv lua stats  > page group warning: transparencies are used but
>     no pagecolormodel is set
>
> but adding \setcolors[state=start,cmyk=yes] does not change that; both 
> the warning and the solid black glyph remain. Could this be an issue 
> of the PDF viewer? Is it a font issue?
Okay, I got a clean compile using \definecolor and referencing that in 
the MP page.

    \setupbackgrounds
       [page]
       [background=color,backgroundcolor=yellow]
    \definecolor[Transp][r=1,t=0,a=12]
    \definefont
       [DVSrB]
       [file:DejaVuSerif-Bold.ttf]
    \startuseMPgraphic{HeartTest 1}
       picture h,q ;
       h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ;
       q := textext("{\DVSrB ?}") scaled 10 ;
       q := q shifted - (xpart center q, 12pt) ;
       draw h withcolor blue ;
       draw q withtransparency(12,0) ;
       draw q shifted (72pt,0) withtransparency(12,0) ;
    \stopuseMPgraphic
    \startuseMPgraphic{HeartTest 2}
       picture h,q ;
       h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ;
       q := textext("\color[Transp]{\DVSrB ?}") scaled 10 ;
       q := q shifted - (xpart center q, 12pt) ;
       draw h withcolor blue ;
       draw q ;
       draw q shifted (72pt,0) ;
    \stopuseMPgraphic
    \starttext
      \useMPgraphic{HeartTest 1}
      \useMPgraphic{HeartTest 2}
    \stoptext

Unfortunately, the result is not what I want. The result is that the “?” 
disappears, allowing the color directly behind it to show through. The 
example above shows that it works with \definecolor but not 
withwithtransparency. I have no idea why, and certainly realize it could 
be my error.

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 
there are no islands (as in ‘P’).

-- 
Rik

[-- Attachment #1.2: Type: text/html, Size: 4756 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: A better \definesymbol sought
  2017-01-24  3:04         ` Rik
@ 2017-01-24  8:34           ` Hans Hagen
  2017-01-24 19:01             ` Rik Kabel
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2017-01-24  8:34 UTC (permalink / raw)
  To: ntg-context

On 1/24/2017 4:04 AM, Rik wrote:
> On 2017-01-23 14:09, Rik Kabel wrote:
>> On 2017-01-23 00:06, Alan Braslau wrote:
>> > On Sun, 22 Jan 2017 22:39:53 -0500 Rik Kabel > <context@rik.users.panix.com> wrote: > >> So, how can I make the
>> inner glyph (‘?’ in the example below) >> transparent, so that the
>> background shows through along with >> anything else that lives on a
>> lower layer? I’ve seen a method for >> constructed shapes, but nothing
>> that I can apply to text glyphs. >> Undraw doesn’t do it. > > Undraw
>> is simply draw using the background color. > > Transparency is a
>> MetaFun extension to MetaPost (so part of > ConTeXt). > > draw q
>> withtransparency (1,0.5) ; % (method,transparency) > > Alan
>>
>> Hmmm. That does not work for me (with any of many method and
>> transparency values).  The  ‘?’ is solid black. I do see a message in
>> the log that looks related:
>>
>>     mkiv lua stats  > page group warning: transparencies are used but
>>     no pagecolormodel is set
>>
>> but adding \setcolors[state=start,cmyk=yes] does not change that; both
>> the warning and the solid black glyph remain. Could this be an issue
>> of the PDF viewer? Is it a font issue?
> Okay, I got a clean compile using \definecolor and referencing that in
> the MP page.
>
>     \setupbackgrounds
>       [page]
>       [background=color,backgroundcolor=yellow]
>     \definecolor[Transp][r=1,t=0,a=12]
>     \definefont
>       [DVSrB]
>       [file:DejaVuSerif-Bold.ttf]
>     \startuseMPgraphic{HeartTest 1}
>       picture h,q ;
>       h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ;
>       q := textext("{\DVSrB ?}") scaled 10 ;
>       q := q shifted - (xpart center q, 12pt) ;
>       draw h withcolor blue ;
>       draw q withtransparency(12,0) ;
>       draw q shifted (72pt,0) withtransparency(12,0) ;
>     \stopuseMPgraphic
>     \startuseMPgraphic{HeartTest 2}
>       picture h,q ;
>       h := "♥" infont "\truefontname{DejaVuSerif-Bold.ttf}" scaled 20 ;
>       q := textext("\color[Transp]{\DVSrB ?}") scaled 10 ;
>       q := q shifted - (xpart center q, 12pt) ;
>       draw h withcolor blue ;
>       draw q ;
>       draw q shifted (72pt,0) ;
>     \stopuseMPgraphic
>     \starttext
>      \useMPgraphic{HeartTest 1}
>      \useMPgraphic{HeartTest 2}
>     \stoptext
>
> Unfortunately, the result is not what I want. The result is that the “?”
> disappears, allowing the color directly behind it to show through. The
> example above shows that it works with \definecolor but not
> withwithtransparency. I have no idea why, and certainly realize it could
> be my error.
>
> 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

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

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

* Re: A better \definesymbol sought
  2017-01-24  8:34           ` Hans Hagen
@ 2017-01-24 19:01             ` Rik Kabel
  2017-01-25 10:17               ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Rik Kabel @ 2017-01-24 19:01 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2244 bytes --]

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


-- 
Rik




[-- Attachment #1.2.1: Type: text/html, Size: 4284 bytes --]

[-- Attachment #1.2.2: fodcdfohbbomiobd.png --]
[-- Type: image/png, Size: 6404 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

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

* Re: A better \definesymbol sought
  2017-01-24 19:01             ` Rik Kabel
@ 2017-01-25 10:17               ` Hans Hagen
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2017-01-25 10:17 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

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

end of thread, other threads:[~2017-01-25 10:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21  3:33 A better \definesymbol sought 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 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).