ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: [metapost] shading text
       [not found]   ` <463D967C.8050106@arcor.de>
@ 2007-05-06 20:52     ` Mojca Miklavec
  2007-05-07 12:35       ` Peter Rolf
  0 siblings, 1 reply; 8+ messages in thread
From: Mojca Miklavec @ 2007-05-06 20:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Stephan Hennig

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
___________________________________________________________________________________


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

* Re: [metapost] shading text
  2007-05-06 20:52     ` [metapost] shading text Mojca Miklavec
@ 2007-05-07 12:35       ` Peter Rolf
  2007-05-07 18:16         ` Stephan Hennig
  2007-05-07 22:04         ` Stephan Hennig
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Rolf @ 2007-05-07 12:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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


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

* Re: [metapost] shading text
  2007-05-07 12:35       ` Peter Rolf
@ 2007-05-07 18:16         ` Stephan Hennig
  2007-05-07 22:04         ` Stephan Hennig
  1 sibling, 0 replies; 8+ messages in thread
From: Stephan Hennig @ 2007-05-07 18:16 UTC (permalink / raw)
  To: ntg-context

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

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


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

* Re: [metapost] shading text
  2007-05-07 12:35       ` Peter Rolf
  2007-05-07 18:16         ` Stephan Hennig
@ 2007-05-07 22:04         ` Stephan Hennig
  2007-05-08  9:44           ` Peter Rolf
  1 sibling, 1 reply; 8+ messages in thread
From: Stephan Hennig @ 2007-05-07 22:04 UTC (permalink / raw)
  To: ntg-context

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

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


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

* Re: [metapost] shading text
  2007-05-07 22:04         ` Stephan Hennig
@ 2007-05-08  9:44           ` Peter Rolf
  2007-05-08 12:46             ` Stephan Hennig
       [not found]             ` <46407132.6090709@arcor.de>
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Rolf @ 2007-05-08  9:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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


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

* Re: [metapost] shading text
  2007-05-08  9:44           ` Peter Rolf
@ 2007-05-08 12:46             ` Stephan Hennig
       [not found]             ` <46407132.6090709@arcor.de>
  1 sibling, 0 replies; 8+ messages in thread
From: Stephan Hennig @ 2007-05-08 12:46 UTC (permalink / raw)
  To: ntg-context

[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".)

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


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

* Re: [metapost] shading text
       [not found]             ` <46407132.6090709@arcor.de>
@ 2007-05-08 13:17               ` Tobias Burnus
  2007-05-08 13:45               ` Taco Hoekwater
  1 sibling, 0 replies; 8+ messages in thread
From: Tobias Burnus @ 2007-05-08 13:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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


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

* Re: [metapost] shading text
       [not found]             ` <46407132.6090709@arcor.de>
  2007-05-08 13:17               ` Tobias Burnus
@ 2007-05-08 13:45               ` Taco Hoekwater
  1 sibling, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2007-05-08 13:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users



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


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

end of thread, other threads:[~2007-05-08 13:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4638B9DF.5040104@arcor.de>
     [not found] ` <6faad9f00705051945x3781ce8tdda3ebdb8daada85@mail.gmail.com>
     [not found]   ` <463D967C.8050106@arcor.de>
2007-05-06 20:52     ` [metapost] shading text Mojca Miklavec
2007-05-07 12:35       ` Peter Rolf
2007-05-07 18:16         ` Stephan Hennig
2007-05-07 22:04         ` Stephan Hennig
2007-05-08  9:44           ` Peter Rolf
2007-05-08 12:46             ` Stephan Hennig
     [not found]             ` <46407132.6090709@arcor.de>
2007-05-08 13:17               ` Tobias Burnus
2007-05-08 13:45               ` Taco Hoekwater

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).