From: seyal zavira <seyal.zavira@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?
Date: Tue, 9 Apr 2024 23:22:35 -0400 [thread overview]
Message-ID: <CADiGc-kAL--uL8g4b1QBzEb4hhEumWaQEzSxqztnX03WNYCA9g@mail.gmail.com> (raw)
In-Reply-To: <e597a870-8525-459f-86d8-b30188e2329e@xs4all.nl>
[-- Attachment #1.1: Type: text/plain, Size: 3782 bytes --]
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 <j.hagen@xs4all.nl> 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
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 5722 bytes --]
[-- Attachment #2: test1.tex --]
[-- Type: text/x-tex, Size: 670 bytes --]
\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
[-- Attachment #3: test1.pdf --]
[-- Type: application/pdf, Size: 6106 bytes --]
[-- Attachment #4: test2.tex --]
[-- Type: text/x-tex, Size: 580 bytes --]
\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
[-- Attachment #5: test2.pdf --]
[-- Type: application/pdf, Size: 10025 bytes --]
[-- Attachment #6: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-04-10 3:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7d6485a1-3c19-47bb-ba55-3ea15abefa2d@xs4all.nl>
2024-04-07 17:05 ` [NTG-context] " Hans Hagen
2024-04-07 17:42 ` [NTG-context] " Henning Hraban Ramm
2024-04-07 18:16 ` Keith McKay
2024-04-07 18:49 ` Hans Hagen
2024-04-08 6:22 ` seyal zavira
2024-04-08 8:37 ` Hans Hagen
2024-04-10 3:22 ` seyal zavira [this message]
2024-04-10 6:22 ` Hans Hagen
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=CADiGc-kAL--uL8g4b1QBzEb4hhEumWaQEzSxqztnX03WNYCA9g@mail.gmail.com \
--to=seyal.zavira@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).