[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-10 Thread Hans Hagen

On 4/10/2024 5:22 AM, seyal zavira wrote:
seams this code means to put a hidden text with same size behind 
metapost shape.
but it does not work properly for me (current version: 2024.04.01 08:59) 
and produce empty page but with searchable hidden text.


as mentioned kind = "outline" will be in the next upload so with the 
current one you need to use the also posted here for ... endfor variant



also when i edit the code and replace metapost part like this:

\startMPcode
      draw lmt_outline [
          kind = "outline",
          text = "\getbuffer[MyText]",
       ]
          withcolor red
       ;
\stopMPcode

it produces a selectable hidden text on top of body and red text that 
drawn by metapost below of that.


How can this problem be solved?

i attached the codes and pdf results.

On Mon, Apr 8, 2024 at 4:37 AM Hans Hagen > wrote:


On 4/8/2024 8:22 AM, seyal zavira wrote:
 > thank you Harban and Keith McKay.
 >
 >     \startMPpage
 >            picture tt ; tt := lmt_outline [
 >                kind = "path",
 >                text =
"\definedfont[name:texgyrepagellabold*default]foo
 >     f o o",
 >            ] ;
 >
 >            fill
 >               for i within tt : pathpart i && endfor cycle
 >               withshademethod "linear"
 >               withshadedirection down
 >               withshadecolors (red, blue) ;
 >     \stopMPpage
 >
 >     I'll add this:
 >
 >     \startMPpage
 >           draw lmt_outline [
 >               kind = "outline",
 >               text =
"\definedfont[name:texgyrepagellabold*default]foo f
 >     o o",
 >           ]
 >               withshademethod "linear"
 >               withshadedirection down
 >               withshadecolors (red, blue)
 >           ;
 >     \stopMPpage
 >
 >     so a single path option (no picture)
 >
 >     Hans
 >
 >
 > Thank you so much for the sample examples
 > it would be great to also make text select able in output pdf
 > the third example currently does not work. did you mean you will add
 > this feature for next updates?
we're talking outlines so that is paths which implies no search but you
can do this (Keith and/or Hraban will explain and/or wikify it)

\starttext

\startbuffer[MyText]
      \definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
      \framed[align=normal,frame=off]{\input{tufte}}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
      \startMPcode
           draw lmt_outline [
               kind = "outline",
               text = "\getbuffer[MyText]",
           ]
               withshademethod "linear"
               withshadedirection down
               withshadecolors (red, blue)
           ;
      \stopMPcode
\egroup

\startoverlay


{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
      {\box\scratchbox}
\stopoverlay

\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  /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl

webpage  : https://www.pragma-ade.nl  /
https://context.aanhet.net  (mirror)
archive  : https://github.com/contextgarden/context

wiki     : https://wiki.contextgarden.net


___


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


--

-
 

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-09 Thread seyal zavira
seams this code means to put a hidden text with same size behind metapost
shape.
but it does not work properly for me (current version: 2024.04.01 08:59)
and produce empty page but with searchable hidden text.
also when i edit the code and replace metapost part like this:

\startMPcode
 draw lmt_outline [
 kind = "outline",
 text = "\getbuffer[MyText]",
  ]
 withcolor red
  ;
\stopMPcode

it produces a selectable hidden text on top of body and red text that drawn
by metapost below of that.

How can this problem be solved?

i attached the codes and pdf results.

On Mon, Apr 8, 2024 at 4:37 AM Hans Hagen  wrote:

> On 4/8/2024 8:22 AM, seyal zavira wrote:
> > thank you Harban and Keith McKay.
> >
> > \startMPpage
> >picture tt ; tt := lmt_outline [
> >kind = "path",
> >text = "\definedfont[name:texgyrepagellabold*default]foo
> > f o o",
> >] ;
> >
> >fill
> >   for i within tt : pathpart i && endfor cycle
> >   withshademethod "linear"
> >   withshadedirection down
> >   withshadecolors (red, blue) ;
> > \stopMPpage
> >
> > I'll add this:
> >
> > \startMPpage
> >   draw lmt_outline [
> >   kind = "outline",
> >   text = "\definedfont[name:texgyrepagellabold*default]foo f
> > o o",
> >   ]
> >   withshademethod "linear"
> >   withshadedirection down
> >   withshadecolors (red, blue)
> >   ;
> > \stopMPpage
> >
> > so a single path option (no picture)
> >
> > Hans
> >
> >
> > Thank you so much for the sample examples
> > it would be great to also make text select able in output pdf
> > the third example currently does not work. did you mean you will add
> > this feature for next updates?
> we're talking outlines so that is paths which implies no search but you
> can do this (Keith and/or Hraban will explain and/or wikify it)
>
> \starttext
>
> \startbuffer[MyText]
>  \definedfont[name:texgyrepagellabold*default]foo f o o%
> \stopbuffer
>
> \startbuffer[MyText]
>  \framed[align=normal,frame=off]{\input{tufte}}%
> \stopbuffer
>
> \setbox\scratchbox\hbox\bgroup
>  \startMPcode
>   draw lmt_outline [
>   kind = "outline",
>   text = "\getbuffer[MyText]",
>   ]
>   withshademethod "linear"
>   withshadedirection down
>   withshadecolors (red, blue)
>   ;
>  \stopMPcode
> \egroup
>
> \startoverlay
>
>
> {\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
>  {\box\scratchbox}
> \stopoverlay
>
> \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 /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
\starttext

\startbuffer[MyText]
 \definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
 \framed[align=normal,frame=off]{a sample text}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
 \startMPcode
  draw lmt_outline [
  kind = "outline",
  text = "\getbuffer[MyText]",
  ]
  withshademethod "linear"
  withshadedirection down
  withshadecolors (red, blue)
  ;
 \stopMPcode
\egroup

\startoverlay

{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
 {\box\scratchbox}
\stopoverlay

\stoptext


test1.pdf
Description: Adobe PDF document
\starttext

\startbuffer[MyText]
 \definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
 \framed[align=normal,frame=off]{a sample text}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
 \startMPcode
  draw lmt_outline [
  kind = "outline",
  text = "\getbuffer[MyText]",
  ]
  withcolor red;
  ;
 \stopMPcode
\egroup

\startoverlay

{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
 {\box\scratchbox}
\stopoverlay

\stoptext


test2.pdf
Description: Adobe PDF document

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread Hans Hagen

On 4/8/2024 8:22 AM, seyal zavira wrote:

thank you Harban and Keith McKay.

\startMPpage
       picture tt ; tt := lmt_outline [
           kind = "path",
           text = "\definedfont[name:texgyrepagellabold*default]foo
f o o",
       ] ;

       fill
          for i within tt : pathpart i && endfor cycle
          withshademethod "linear"
          withshadedirection down
          withshadecolors (red, blue) ;
\stopMPpage

I'll add this:

\startMPpage
      draw lmt_outline [
          kind = "outline",
          text = "\definedfont[name:texgyrepagellabold*default]foo f
o o",
      ]
          withshademethod "linear"
          withshadedirection down
          withshadecolors (red, blue)
      ;
\stopMPpage

so a single path option (no picture)

Hans


Thank you so much for the sample examples
it would be great to also make text select able in output pdf
the third example currently does not work. did you mean you will add 
this feature for next updates?
we're talking outlines so that is paths which implies no search but you 
can do this (Keith and/or Hraban will explain and/or wikify it)


\starttext

\startbuffer[MyText]
\definedfont[name:texgyrepagellabold*default]foo f o o%
\stopbuffer

\startbuffer[MyText]
\framed[align=normal,frame=off]{\input{tufte}}%
\stopbuffer

\setbox\scratchbox\hbox\bgroup
\startMPcode
 draw lmt_outline [
 kind = "outline",
 text = "\getbuffer[MyText]",
 ]
 withshademethod "linear"
 withshadedirection down
 withshadecolors (red, blue)
 ;
\stopMPcode
\egroup

\startoverlay

{\scale[height=\htdp\scratchbox,width=\wd\scratchbox]{\effect[hidden]{\getbuffer[MyText]}}}
{\box\scratchbox}
\stopoverlay

\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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread seyal zavira
thank you Harban and Keith McKay.

\startMPpage
>   picture tt ; tt := lmt_outline [
>   kind = "path",
>   text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
>   ] ;
>
>   fill
>  for i within tt : pathpart i && endfor cycle
>  withshademethod "linear"
>  withshadedirection down
>  withshadecolors (red, blue) ;
> \stopMPpage
>
> I'll add this:
>
> \startMPpage
>  draw lmt_outline [
>  kind = "outline",
>  text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
>  ]
>  withshademethod "linear"
>  withshadedirection down
>  withshadecolors (red, blue)
>  ;
> \stopMPpage
>
> so a single path option (no picture)
>
> Hans
>

Thank you so much for the sample examples
it would be great to also make text select able in output pdf
the third example currently does not work. did you mean you will add this
feature for next updates?
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:42 PM, Henning Hraban Ramm wrote:

Am 07.04.24 um 19:05 schrieb Hans Hagen:

\startMPpage
 picture tt ; tt := lmt_outline [
 kind = "fillup",
 text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
 ] xsized 12cm ;

 path bb ; bb := boundingbox tt ;
 path pp ; pp := bb enlarged 2cm ;

 fill pp
 withshademethod "linear"
 withshadedirection down
 withshadecolors (red, blue) ;

 draw tt withcolor green ;
\stopMPpage

no need to loop over tt


But the intention was to get a gradient _within_ the text.

Might there be a problem with the latest changes to gradients?

\startMPpage
 picture tt ; tt := lmt_outline [
 kind = "path",
 text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
 ] ;

 fill
for i within tt : pathpart i && endfor cycle
withshademethod "linear"
withshadedirection down
withshadecolors (red, blue) ;
\stopMPpage

I'll add this:

\startMPpage
draw lmt_outline [
kind = "outline",
text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
]
withshademethod "linear"
withshadedirection down
withshadecolors (red, blue)
;
\stopMPpage

so a single path option (no picture)

Hans


-
  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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Keith McKay
I've found my original file and the image is as Hraban says below. The 
code is the original in the post I quoted  and gives a green background 
with shaded colours in the text.


Best Wishes

Keith

On 07/04/2024 18:42, Henning Hraban Ramm wrote:

Am 07.04.24 um 19:05 schrieb Hans Hagen:

\startMPpage
 picture tt ; tt := lmt_outline [
 kind = "fillup",
 text = "\definedfont[name:texgyrepagellabold*default]foo f o 
o",

 ] xsized 12cm ;

 path bb ; bb := boundingbox tt ;
 path pp ; pp := bb enlarged 2cm ;

 fill pp
 withshademethod "linear"
 withshadedirection down
 withshadecolors (red, blue) ;

 draw tt withcolor green ;
\stopMPpage

no need to loop over tt


But the intention was to get a gradient _within_ the text.

Might there be a problem with the latest changes to gradients?

Hraban

___ 

If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
(mirror)

archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___ 


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Henning Hraban Ramm

Am 07.04.24 um 19:05 schrieb Hans Hagen:

\startMPpage
     picture tt ; tt := lmt_outline [
     kind = "fillup",
     text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
     ] xsized 12cm ;

     path bb ; bb := boundingbox tt ;
     path pp ; pp := bb enlarged 2cm ;

     fill pp
     withshademethod "linear"
     withshadedirection down
     withshadecolors (red, blue) ;

     draw tt withcolor green ;
\stopMPpage

no need to loop over tt


But the intention was to get a gradient _within_ the text.

Might there be a problem with the latest changes to gradients?

Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___