Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1923 > unrolled thread

Showing text across a back disc

Started byPeter Billam <peter@www.pjb.com.au>
First post2014-06-28 05:28 +0000
Last post2014-06-28 13:53 -0700
Articles 6 — 4 participants

Back to article view | Back to comp.lang.postscript


Contents

  Showing text across a back disc Peter Billam <peter@www.pjb.com.au> - 2014-06-28 05:28 +0000
    Re: Showing text across a back disc luser- -droog <mijoryx@yahoo.com> - 2014-06-28 00:24 -0700
      Re: Showing text across a back disc Peter Billam <peter@www.pjb.com.au> - 2014-06-28 10:09 +0000
    Re: Showing text across a back disc pt <masked@hotmail.com> - 2014-06-28 11:28 +0100
      Re: Showing text across a back disc Peter Billam <peter@www.pjb.com.au> - 2014-06-28 11:53 +0000
    Re: Showing text across a back disc jdaw1 <jdawiseman@gmail.com> - 2014-06-28 13:53 -0700

#1923 — Showing text across a back disc

FromPeter Billam <peter@www.pjb.com.au>
Date2014-06-28 05:28 +0000
SubjectShowing text across a back disc
Message-ID<slrnlqskju.4c0.peter@box8.pjb.com.au>
Greetings :-) In:

  300 300 translate
  /Helvetica-BoldOblique findfont 40 scalefont setfont
  -150 0 moveto (Hello black disc) show
  gsave newpath
    0 10 80 0 360 arc clip fill
    1 setgray
    -150 0 moveto (Hello black disc) show
  grestore

the text has to be printed twice, and the movetos must be identical.
Is there a more elegant way ?

Regards,  Peter

-- 
Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [next] | [standalone]


#1924

Fromluser- -droog <mijoryx@yahoo.com>
Date2014-06-28 00:24 -0700
Message-ID<4ec9a04f-f1ae-41e5-ab3c-9c76b184da74@googlegroups.com>
In reply to#1923
On Saturday, June 28, 2014 12:28:31 AM UTC-5, Peter Billam wrote:
> Greetings :-) In:
> 
> 
> 
>   300 300 translate
>   /Helvetica-BoldOblique findfont 40 scalefont setfont
>   -150 0 moveto (Hello black disc) show
>   gsave newpath
>     0 10 80 0 360 arc clip fill
>     1 setgray
>     -150 0 moveto (Hello black disc) show
>   grestore
> 
> the text has to be printed twice, and the movetos must be identical.
> Is there a more elegant way ?
> 

This wouldn't be portable, but I think ghostscript lets you adjust
the rasterop. So you could draw the text just once by using an XOR op.

Staying portable, you can enforce that the movetos be identical by
stashing the point on the stack.

 300 300 translate 
  /Helvetica-BoldOblique findfont 40 scalefont setfont 
  -150 0 moveto currentpoint (Hello black disc) show  % cp
  gsave newpath  % cp
    0 10 80 0 360 arc clip fill  % cp
    1 setgray  % cp
    moveto (Hello black disc) show 
  grestore 

[toc] | [prev] | [next] | [standalone]


#1925

FromPeter Billam <peter@www.pjb.com.au>
Date2014-06-28 10:09 +0000
Message-ID<slrnlqt51s.5b6.peter@box8.pjb.com.au>
In reply to#1924
On 2014-06-28, luser- -droog <mijoryx@yahoo.com> wrote:
> On Saturday, June 28, 2014 12:28:31 AM UTC-5, Peter Billam wrote:
>>   300 300 translate
>>   /Helvetica-BoldOblique findfont 40 scalefont setfont
>>   -150 0 moveto (Hello black disc) show
>>   gsave newpath
>>     0 10 80 0 360 arc clip fill
>>     1 setgray
>>     -150 0 moveto (Hello black disc) show
>>   grestore
>> the text has to be printed twice, and the movetos must be identical.
>> Is there a more elegant way ?
>
> This wouldn't be portable, but I think ghostscript lets you adjust
> the rasterop. So you could draw the text just once by using an XOR op.

Interesting... Didn't know about that... I'd want to be portable,
though.  I spent some time trying to extract the outline path of
the text (so I could do that, then the 0 360 arc, then eofill);
couldn't find a way, though.

> Staying portable, you can enforce that the movetos be identical by
> stashing the point on the stack.
>  300 300 translate 
>   /Helvetica-BoldOblique findfont 40 scalefont setfont 
>   -150 0 moveto currentpoint (Hello black disc) show  % cp
>   gsave newpath  % cp
>     0 10 80 0 360 arc clip fill  % cp
>     1 setgray  % cp
>     moveto (Hello black disc) show 
>   grestore 

true; or could
  /tmpsub { -150 0 moveto (Hello black disc) show } def
but these tricks still print twice.
(Which is unimportant in this example, of course :-))

Thanks,  regards,  Peter

-- 
Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [prev] | [next] | [standalone]


#1926

Frompt <masked@hotmail.com>
Date2014-06-28 11:28 +0100
Message-ID<MPG.2e18a91ca5110f94989681@news.btinternet.com>
In reply to#1923
In article <slrnlqskju.4c0.peter@box8.pjb.com.au>, peter@www.pjb.com.au 
says...
> 
> Greetings :-) In:
> 
>   300 300 translate
>   /Helvetica-BoldOblique findfont 40 scalefont setfont
>   -150 0 moveto (Hello black disc) show
>   gsave newpath
>     0 10 80 0 360 arc clip fill
>     1 setgray
>     -150 0 moveto (Hello black disc) show
>   grestore
> 
> the text has to be printed twice, and the movetos must be identical.
> Is there a more elegant way ?
> 
> Regards,  Peter


Try:
300 300 translate
  /Helvetica-BoldOblique findfont 40 scalefont setfont
  -150 0 moveto (Hello black disc) true charpath
    80 10 moveto	%to start of arcn
    0 10 80 360 0 arcn fill

Or:
300 300 translate
  /Helvetica-BoldOblique findfont 40 scalefont setfont
  -150 0 moveto (Hello black disc) true charpath
    80 10 moveto	%to start of arc
    0 10 80 0 360 arc eofill

[toc] | [prev] | [next] | [standalone]


#1927

FromPeter Billam <peter@www.pjb.com.au>
Date2014-06-28 11:53 +0000
Message-ID<slrnlqtb6i.66s.peter@box8.pjb.com.au>
In reply to#1926
On 2014-06-28, pt <masked@hotmail.com> wrote:
> Try:
> 300 300 translate
>   /Helvetica-BoldOblique findfont 40 scalefont setfont
>   -150 0 moveto (Hello black disc) true charpath
>     80 10 moveto	%to start of arcn
>     0 10 80 360 0 arcn fill
> Or:
> 300 300 translate
>   /Helvetica-BoldOblique findfont 40 scalefont setfont
>   -150 0 moveto (Hello black disc) true charpath
>     80 10 moveto	%to start of arc
>     0 10 80 0 360 arc eofill

Yes :-) charpath, that's what I was looking for.
Silly me, I've used it before, too; but I'd forgotten :-(

Thanks for your help,
Regards,  Peter

-- 
Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [prev] | [next] | [standalone]


#1928

Fromjdaw1 <jdawiseman@gmail.com>
Date2014-06-28 13:53 -0700
Message-ID<48430353-090b-47e7-9af2-0c6ccc50034a@googlegroups.com>
In reply to#1923
I haven't carefully dissected all the posts, but I would code this as something like
	... charpath gsave fill ... arc ... setgray fill grestore ... setgray fill

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web