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


Groups > comp.lang.postscript > #1465

Re: Rainbow printing

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin1!goblin.stu.neva.ru!newsfeed.pionier.net.pl!feed.xsnews.nl!border-2.ams.xsnews.nl!post-feeder-02.xsnews.nl!frontend-F09-20.ams.news.kpn.nl
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.postscript
Subject Re: Rainbow printing
Organization Decebal Computing
References <87fvvfde6v.fsf@Aspire.decebal.nl> <2ab35483-9e59-4696-875b-b718c82385ea@googlegroups.com> <874nbvd53k.fsf@Aspire.decebal.nl> <87txjvljga.fsf@ixod.org> <87zjtnbd0x.fsf@Aspire.decebal.nl>
X-Face "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR<J%a^F2lh4[N~Yz4 nSp#c+aQo1b5=?HcNEkQ7QzF<])O3X4MDL/AYjys&*mt>,v+Pti8=Vi/Z"g^?b"E
X-Homepage http://www.decebal.nl/
Date Wed, 17 Jul 2013 11:36:12 +0200
Message-ID <87y595a5pv.fsf@Aspire.decebal.nl> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
Cancel-Lock sha1:+SctVo2OwJkJf35H678OWU+38rI=
MIME-Version 1.0
Content-Type text/plain
Lines 119
NNTP-Posting-Host 77.171.42.144
X-Trace 1374054361 news.kpn.nl 21311 77.171.42.144@kpn/77.171.42.144:44787
Xref csiph.com comp.lang.postscript:1465

Show key headers only | View raw


Op dinsdag 16 jul 2013 01:48 CEST schreef Cecil Westerhof:

> Op maandag 15 jul 2013 21:19 CEST schreef Mark Carroll:
>
>> Cecil Westerhof <Cecil@decebal.nl> writes:
>>
>>> But then only for the object drawn, for example some text.
>>
>> This is exactly what clipping paths are for.
>
> I tried the following:
> %!PS-Adobe-3.0 EPSF-3.0
> %%BoundingBox: 0 0 300 450
>
> /URWChanceryL findfont 50 scalefont setfont
>
> /clipBox {
> 4 dict begin
> /dy exch def
> /dx exch def
>
> moveto
> dx 0 rlineto
> 0 dy rlineto
> dx neg 0 rlineto
> closepath
> gsave
> clip
> newpath
> showText
> grestore
> } def
>
> /showText {
> 100 60 moveto
> (Rainbow) show
> } def
>
> 1 1 1 setrgbcolor
> 0 0  300 450 rectfill
>
> 1 0 0 setrgbcolor
> 100 88 175 8 clipBox
> 1 0.5 0 setrgbcolor
> 100  82 175  6 clipBox
> 1 1 0 setrgbcolor
> 100  76 175  6 clipBox
> 0 1 0 setrgbcolor
> 100  70 175  6 clipBox
> 0 0 1 setrgbcolor
> 100  64 175  6 clipBox
> .31 0 .5 setrgbcolor
> 100  58 175  6 clipBox
> .94 .5 .94 setrgbcolor
> 100 50  175  8 clipBox
> showpage
>
> But Rainbow is completely in violet. When I put the last clipBox in
> comment, then the whole word is in indigo. What am I doing wrong
> here?

This does what I want (only the red and violet stripe should be
bigger):
    %!PS-Adobe-3.0 EPSF-3.0
    %%BoundingBox: 0 0 300 200

    /URWChanceryL findfont 50 scalefont setfont

    /showText {
        100 60 moveto
        (Rainbow) show
    } def

    0 setgray
    0 0  300 200 rectfill

    gsave
        100 88 175 8 rectclip
        1 0 0 setrgbcolor
        showText
    grestore
    gsave
        100 82 175 6 rectclip
        1 0.5 0 setrgbcolor
        showText
    grestore
    gsave
        100 76 175 6 rectclip
        1 1 0 setrgbcolor
        showText
    grestore
    gsave
        100 70 175 6 rectclip
        0 1 0 setrgbcolor
        showText
    grestore
    gsave
        100 64 175 6 rectclip
        0 0 1 setrgbcolor
        showText
    grestore
    gsave
        100 58 175 6 rectclip
        .31 0 .5 setrgbcolor
        showText
    grestore
    gsave
        100 50 175 8 rectclip
        .94 .5 .94 setrgbcolor
        showText
    grestore

Is this the best way to do it? What if the showText function becomes
very complex?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-15 17:40 +0200
  Re: Rainbow printing abeddie <abeddie@hotmail.com> - 2013-07-15 09:54 -0700
    Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-15 20:56 +0200
      Re: Rainbow printing Mark Carroll <mtbc@bcs.org> - 2013-07-15 20:19 +0100
        Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-16 01:48 +0200
          Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-17 11:36 +0200
  Re: Rainbow printing Helge Blischke <h.blischke@acm.org> - 2013-07-15 18:56 +0200
  Re: Rainbow printing Michael Unger <spam.to.unger@spamgourmet.com> - 2013-07-15 19:06 +0200
    Re: Rainbow printing Michael Unger <spam.to.unger@spamgourmet.com> - 2013-07-15 22:07 +0200
  Re: Rainbow printing John Deubert <john@acumentraining.com> - 2013-07-16 16:34 -0700
    Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-17 09:10 +0200
  Re: Rainbow printing sjprouty3765@gmail.com - 2013-07-17 15:08 -0700
    Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-18 05:22 +0200
  Re: Rainbow printing luser- -droog <mijoryx@yahoo.com> - 2013-07-17 15:22 -0700
    Re: Rainbow printing luser- -droog <mijoryx@yahoo.com> - 2013-07-17 16:55 -0700
    Re: Rainbow printing Cecil Westerhof <Cecil@decebal.nl> - 2013-07-18 05:22 +0200

csiph-web