[NTG-context] [metapost] shading text

Peter Rolf indiego at gmx.net
Mon May 7 14:35:44 CEST 2007

Hi Stephan,

MP handles text and graphics in different ways. First read


(this should answer some of your questions). You find the needed tools at

http://www.pstoedit.net/	http://www.foolabs.com/xpdf/download.html

I have tested this some years ago and it worked without problems. A fast
run with the old code ended in the nirvana for pstoedit (3.44) :(

I don't know if this is a general problem, so just give it a try. If you
get it to work, you can try the nice 'graphictext' in combination with

HTH,  Peter

Mojca Miklavec wrote:
> The ConTeXt mailing list is probably more suitable for this
> discussion, so I'm redirecting your question there (if anyone responds
> to it).
> On 5/2/07, Stephan Hennig wrote:
>> Hi,
>> my attempt to shade a piece of text with MetaFun fails (see below).  Is
>> this a restriction of MetFun/MetaPost or of the PDF format?
>> While there is an explicit example for transparent text in metafun-p.pdf
>> on p. 185 I didn't find one for shaded text.  Is shading text possible?
>> Best regards,
>> Stephan Hennig
>> input metafun
>> beginfig(1);
>>   sh_sqr := define_linear_shade(origin, (100bp,0), white, blue);
>>   sh_txt := define_linear_shade(origin, (100bp,0), white, red);
>>   fill unitsquare scaled 100bp withshade sh_sqr;
>>   label("Not shaded!", (50,50)) withshade sh_txt;
>> endfig;
>> end
>> Compile with
>> mpost shad
>> mptopdf shad
> ----------
> On 5/6/07, Stephan Hennig wrote:
>> Mojca Miklavec schrieb:
>>> It should be possible to do it inside PDF, but it's not implemented (yet?).
>> Thanks.  Would be a nice feature for, e.g., invitation cards.
> PDF uses 8 different kinds of text: filled, stroked (already
> implemented with \starteffect[outline]...\stopeffect), ... and some
> others.
> See Chapter 5.2 of PDF reference manual. You probably need Text
> rendering type 4. Extending support for it would be a nice excercise
> in metafun programming, but I'm too slow to figure it out in a
> reasonable time. I *really* need to finish extending smooth shading
> patterns to a more generic model, and I will keep your problem in mind
> in case it remains unsolved, but don't count on me if you need it now.
> There are some people on the ConTeXt mailing list (apart from Hans of
> course) who might be able to help.
> Mojca
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

More information about the ntg-context mailing list