Re: [NTG-context] [metapost] shading text
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
Hi Stephan, MP handles text and graphics in different ways. First read http://www.pragma-ade.com/general/manuals/mmakempy.pdf (this should answer some of your questions). You find the needed tools at http://www.cs.wisc.edu/~ghost/ 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 'withshade'. 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@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 ___________________________________________________________________________________
Peter Rolf schrieb:
http://www.pragma-ade.com/general/manuals/mmakempy.pdf
(this should answer some of your questions). You find the needed tools at
Thank you for the pointer!
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.
Unfortunately, pstoedit seems to fail here, too. The following file input metafun beginfig(1); graphictext "Shaded text!" scaled 8 withdrawcolor .7blue withfillcolor .7white dashed evenly withpen pencircle scaled 2pt; endfig; end compiles fine with mpost, but hangs with a pstoedit process in the task manager taking up 100% CPU time.
If you get it to work, you can try the nice 'graphictext' in combination with 'withshade'.
This seems to be the way to go, currently. I'll try to file a bug report for pstoedit when I find the time. Best regards, Stephan Hennig
Peter Rolf schrieb:
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) :(
When I manually run the following commands
pdftops mpy-outline1.pdf pstoedit -v -ssp -dt -f mpost mpy-outline1.ps mpy-outline1.mp
the last lines of output are
GPL Ghostscript 8.56 (2007-03-14) Copyright (C) 2007 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details.
That is, it seems as if pstoedit calls Ghostscript and that hangs. I've updated to v8.56, recently, and didn't observe any problems with pstoedit and MetaPost with older versions of Ghostscript (in other applications). What version of Ghostscript are you running? Best regards, Stephan Hennig
Stephan Hennig wrote:
Peter Rolf schrieb:
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) :(
When I manually run the following commands
pdftops mpy-outline1.pdf pstoedit -v -ssp -dt -f mpost mpy-outline1.ps mpy-outline1.mp
the last lines of output are
GPL Ghostscript 8.56 (2007-03-14) Copyright (C) 2007 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details.
That is, it seems as if pstoedit calls Ghostscript and that hangs. I've updated to v8.56, recently, and didn't observe any problems with pstoedit and MetaPost with older versions of Ghostscript (in other applications). What version of Ghostscript are you running?
also ghostscript 8.56 Good luck for the bug hunt, Peter
Best regards, Stephan Hennig
___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
[CC'ed back to the metapost list, since this is not only related to ConTeXt.] Peter Rolf schrieb:
Stephan Hennig wrote:
[makempy/pstoedit/Ghostscript hang]
That is, it seems as if pstoedit calls Ghostscript and that hangs. I've updated to v8.56, recently, and didn't observe any problems with pstoedit and MetaPost with older versions of Ghostscript (in other applications). What version of Ghostscript are you running?
also ghostscript 8.56
Could someone with an older version of Ghostscript please check if pstoedit/Ghostscript hang with the attached example? That would make it easier for me deciding where to send the bug report to. Best regards, Stephan Hennig input metafun beginfig(1); graphictext "Outlined text!" scaled 8 withfillcolor .7blue; endfig; end Name the file outline.mp and process with
mpost outline perl makempy.pl outline
or what's a proper method to run a Perl script on your OS. (With MiKTeX you can just say "makempy outline".)
Hi Stephan, Stephan Hennig wrote:
Could someone with an older version of Ghostscript please check if pstoedit/Ghostscript hang with the attached example? That would make it easier for me deciding where to send the bug report to.
mpost outline perl makempy.pl outline
$ mpost outline This is MetaPost, Version 0.993 (Web2C 7.5.6) ... 1 output file written: outline.1 Transcript written on outline.log. $ makempy outline ... MakeMPY 1.1 - MetaFun / PRAGMA ADE 2000-2004 ... pstoedit: version 3.44 / DLL interface 108 (build May 4 2007 - release build - g++ 4.1.3 20070413 (prerelease) (SUSE Linux)) : Copyright (C) 1993 - 2006 Wolfgang Glunz processed texts : 1 produced file : outline.mpy This is with Ghostscript 8.15.3 on an openSUSE 10.3alpha3 system (i.e. TeXLive 2007). Tobias
Stephan Hennig wrote:
[CC'ed back to the metapost list, since this is not only related to ConTeXt.]
Peter Rolf schrieb:
Stephan Hennig wrote:
[makempy/pstoedit/Ghostscript hang]
That is, it seems as if pstoedit calls Ghostscript and that hangs. I've updated to v8.56, recently, and didn't observe any problems with pstoedit and MetaPost with older versions of Ghostscript (in other applications). What version of Ghostscript are you running?
also ghostscript 8.56
Could someone with an older version of Ghostscript please check if pstoedit/Ghostscript hang with the attached example? That would make it easier for me deciding where to send the bug report to.
It does not hang, but does not work either: makempy outline MakeMPY 1.1 - MetaFun / PRAGMA ADE 2000-2004 processing file : outline.mpo tex format : plain requested texts : 1 generating : pdf file generating : metapost file pstoedit: version 3.42 / DLL interface 108 (build Jul 2 2006 - release build) : Copyright (C) 1993 - 2005 Wolfgang Glunz ESP Ghostscript 815.03: Unrecoverable error, exit code 1 PostScript/PDF Interpreter finished. Return status 256 executed command : /usr/bin/gs -I/home/taco/.fonts -q -dDELAYBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS /tmp/psineFsL9w The interpreter seems to have failed, cannot proceed ! processed texts : 0 produced file : outline.mpy Best, Taco
participants (5)
-
Mojca Miklavec
-
Peter Rolf
-
Stephan Hennig
-
Taco Hoekwater
-
Tobias Burnus