groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Greeting card revisited: PS and PDF discrepancies


From: Deri
Subject: Re: Greeting card revisited: PS and PDF discrepancies
Date: Sat, 23 Jan 2021 21:56:20 +0000

On Saturday, 23 January 2021 21:30:09 GMT Oliver Corff wrote:
> Hi Damian,
> 
> you are correct --- the Postscript output looks fine (and beautiful). It
> is only with the -Tpdf option that the black PDF file appears.
> 
> Oliver.

Ted's Xmas card was written before Werner had added colour to groff, so the 
only way to add 
colour was to add postscript code (the \X'ps' instructions near the top). These 
are not understood 
by pdf, hence the blackness!

If you update the code to use proper groff colour instructions:-

=======================================================================
=

.ig
.ds RED \X'ps: exec 1    0   0   setrgbcolor'
.ds GR0 \X'ps: exec 0    0.5 0   setrgbcolor'
.ds YEL \X'ps: exec 0    0   1 0 setcmykcolor'
.ds CY0 \X'ps: exec 0.25 0   0 0 setcmykcolor'
..
.defcolor RED rgb 1f 0 0
.defcolor GR0 rgb 0 0.5f 0
.defcolor YEL cmyk 0 0 1f 0
.defcolor CY0 cmyk 0.25f 0 0 0
.blm
.PS
pi = 4*atan2(1,1)
for i=0 to 11 do {
  t = 2*pi*i/24
  x0 = 2*cos(t) ; y0 = 2*sin(t)
  line invis from (-x0,-y0) to (x0,y0) \
  "\M[RED]\v'-0.22m'\D'E 2.0i 0.5i'\v'0.22m'" aligned
}
for i=0 to 11 do {
  t = 2*pi*i/24
  x0 = 2*cos(t) ; y0 = 2*sin(t)
  line invis from (-x0,-y0) to (x0,y0) \
  "\m[CY0]\v'-0.22m'\D'e 2.0i 0.5i'\v'0.22m'" aligned
}
# circle rad 0.24i colour "white" at (0,0)
line invis from (-1,0) to (1,0) "\v'-0.22m'\M[YEL]\D'C 0.50i'\v'0.22m'"
for i=0 to 11 do {
  t = 2*pi*i/24
  x0 = 2*cos(t) ; y0 = 2*sin(t)
  line invis from (-x0,-y0) to (x0,y0) \
  "\m[GR0]\v'-0.22m'\D'e 0.5i 0.125i'\v'0.22m'" aligned
}
.PE

=======================================================================
=

It will work on both postscript and pdf.

Cheers 

Deri



reply via email to

[Prev in Thread] Current Thread [Next in Thread]