comparison lisp/ps-print.el @ 23691:cfeb9bcbd372

(ps-print-prologue-1): Only use old LandscapeMode handling if setpagedevice is not available. (ps-begin-file): Fix typo.
author Andrew Innes <andrewi@gnu.org>
date Wed, 11 Nov 1998 14:35:27 +0000
parents 53776c6e94b8
children 422bd4826b2c
comparison
equal deleted inserted replaced
23690:5149f79d6dfd 23691:cfeb9bcbd372
2365 /BeginDoc { 2365 /BeginDoc {
2366 % ---- Remember space width of the normal text font `f0'. 2366 % ---- Remember space width of the normal text font `f0'.
2367 /SpaceWidth /f0 findfont setfont ( ) stringwidth pop def 2367 /SpaceWidth /f0 findfont setfont ( ) stringwidth pop def
2368 % ---- save the state of the document (useful for ghostscript!) 2368 % ---- save the state of the document (useful for ghostscript!)
2369 /docState save def 2369 /docState save def
2370 /JackGhostscript where {pop 1 27.7 29.7 div scale}if
2370 % ---- [andrewi] set PageSize based on chosen dimensions 2371 % ---- [andrewi] set PageSize based on chosen dimensions
2371 /setpagedevice where { 2372 /setpagedevice where {
2372 pop 2373 pop
2373 1 dict dup 2374 1 dict dup
2374 /PageSize [ PrintPageWidth LeftMargin RightMargin add add 2375 /PageSize [ PrintPageWidth LeftMargin add RightMargin add
2375 LandscapePageHeight ] put 2376 LandscapePageHeight ] put
2376 setpagedevice 2377 setpagedevice
2377 } if 2378 }{
2378 % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7 2379 LandscapeMode {
2379 /JackGhostscript where { 2380 % ---- translate to bottom-right corner of Portrait page
2380 pop 1 27.7 29.7 div scale 2381 LandscapePageHeight 0 translate
2381 } if 2382 90 rotate
2382 LandscapeMode { 2383 }if
2383 % ---- translate to bottom-right corner of Portrait page 2384 }ifelse
2384 LandscapePageHeight 0 translate
2385 90 rotate
2386 } if
2387 /ColumnWidth PrintWidth InterColumn add def 2385 /ColumnWidth PrintWidth InterColumn add def
2388 % ---- translate to lower left corner of TEXT 2386 % ---- translate to lower left corner of TEXT
2389 LeftMargin BottomMargin translate 2387 LeftMargin BottomMargin translate
2390 % ---- define where printing will start 2388 % ---- define where printing will start
2391 /f0 F % this installs Ascent 2389 /f0 F % this installs Ascent
4560 (ps-output (format "/SpaceWidthRatio %f def\n" 4558 (ps-output (format "/SpaceWidthRatio %f def\n"
4561 (/ (ps-lookup 'space-width) (ps-lookup 'size))))) 4559 (/ (ps-lookup 'space-width) (ps-lookup 'size)))))
4562 4560
4563 (ps-mule-initialize) 4561 (ps-mule-initialize)
4564 4562
4565 (ps-output "%%EndPrologue\n%%BeginSetup\nBeginDoc\n%%EndSetup\n\n"))) 4563 (ps-output "%%EndPrologue\n%%BeginSetup\nBeginDoc\n%%EndSetup\n\n"))
4566 4564
4567 (defun ps-header-dirpart () 4565 (defun ps-header-dirpart ()
4568 (let ((fname (buffer-file-name))) 4566 (let ((fname (buffer-file-name)))
4569 (if fname 4567 (if fname
4570 (if (string-equal (buffer-name) (file-name-nondirectory fname)) 4568 (if (string-equal (buffer-name) (file-name-nondirectory fname))