[futurebasic] Re: Printing hairlines

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2003 : Group Archive : Group : All Groups

From: Laurent SIEBENMANN <lcs@...>
Date: Fri, 22 Aug 2003 20:59:42 +0200 (MEST)

Hi all,

OSX (which I don't use yet) is said to have a cozy
relationship with PostScript and PDF.

So here is a simplistic PostScript demo file that should print
lines of Hexadecimal widths  8, 4, 2, 1, .8, .4, .2, .1, and ".0"   
points respectively. Here ".0" means 1 pixel wide which is 
by definition "hairline width".

     Cheers

            Laurent S. (in Paris)




%%%%%%%%%%%--- Send following file to any PS renderer.
%%%%%%%%%%%--- File starts below this line. 
%!
%%Pages: 1
%%EndProlog
%%Page: 1 1
0 setlinecap 0 setlinejoin 10 setmiterlimit 
     % Setup.
     % Enjoy the inverse polish arithmetic!

newpath 

100 100 moveto

gsave
200 0 rlineto % 'relative line' 100 points to right 
8 setlinewidth % pen nib width
stroke % Draw the line.
grestore % Line drawing operation was 'local'
  %% so we are now at 100 100 again with
  %% an empty path.

0 -9 rmoveto % 9 = 3+(8+4)/2 = 3+6
  % Move 3 points down plus adjacant semi-linewidths.

gsave
200 0 rlineto
4 setlinewidth % Halve width at each repition.
stroke
grestore

0 -6 rmoveto % 6 = 3+6/2 

gsave
200 0 rlineto
2 setlinewidth
stroke
grestore

0 -4.5 rmoveto % etc!

gsave
200 0 rlineto
1 setlinewidth
stroke
grestore

0 -3.75 rmoveto 

gsave
200 0 rlineto
.5 setlinewidth
stroke
grestore

0 -3.75 rmoveto 

gsave
200 0 rlineto
.25 setlinewidth
stroke
grestore

0 -3.1875  rmoveto  

gsave
200 0 rlineto
.125 setlinewidth
stroke
grestore

0 -3.09375  rmoveto  

gsave
200 0 rlineto
.0625 setlinewidth
stroke
grestore

0 -3.03125  rmoveto  

gsave
200 0 rlineto
.0 setlinewidth % **hairline** width is 1 pixel wide
  % no matter what the device
stroke
grestore

showpage
%%EOF