shithub: riscv

ref: b3dc2af6d671b6311ccfc8a5f053dc85151cb7ed
dir: /sys/src/cmd/postscript/postdaisy/postdaisy.ps/

View raw version
%
% Version 3.3.2 prologue for Diablo 1640 files.
%

/#copies 1 store
/aspectratio 1 def
/font /Courier def
/formsperpage 1 def
/hmi 12 def
/landscape false def
/magnification 1 def
/margin 10 def
/orientation 0 def
/resolution 240 def
/rotation 1 def
/xoffset .25 def
/yoffset .25 def

/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def

/inch {72 mul} bind def
/min {2 copy gt {exch} if pop} bind def

/ashow {ashow} bind def		% so later references don't bind
/stringwidth {stringwidth} bind def

/setup {
	counttomark 2 idiv {def} repeat pop

	landscape {/orientation 90 orientation add def} if
	/scaling 72 resolution div def
	currentdict /pointsize known not {/pointsize hmi def} if
	font findfont pointsize scaling div scalefont setfont
	/charwidth (M) stringwidth pop def

	pagedimensions
	xcenter ycenter translate
	orientation rotation mul rotate
	width 2 div neg height 2 div translate
	xoffset inch yoffset inch neg translate
	margin 2 div dup neg translate
	magnification dup aspectratio mul scale
	height width div 1 min dup scale
	scaling dup scale
} def

/pagedimensions {
	useclippath userdict /gotpagebbox known not and {
		/pagebbox [clippath pathbbox newpath] def
		roundpage currentdict /roundpagebbox known and {roundpagebbox} if
	} if
	pagebbox aload pop
	4 -1 roll exch 4 1 roll 4 copy
	landscape {4 2 roll} if
	sub /width exch def
	sub /height exch def
	add 2 div /xcenter exch def
	add 2 div /ycenter exch def
	userdict /gotpagebbox true put
} def

/pagesetup {/page exch def 0 0 moveto} bind def

/t {
	charwidth sub /advance exch def
	neg /y exch def
	counttomark 2 idiv {y moveto advance 0 3 -1 roll ashow} repeat
} bind def

/f {findfont pointsize scaling div scalefont setfont} bind def

/done {/lastpage where {pop lastpage} if} def