diff options
| author | Gerd Moellmann | 2000-05-18 21:52:48 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-05-18 21:52:48 +0000 |
| commit | f4fa5c853aeb6daeef62bcb5e5549e61a79c1468 (patch) | |
| tree | 6ae0e92ff2f1e5bd048f9187fbdc8c8c47c0db4a /etc | |
| parent | 98f2fbe725e2402267927b04d950edee928df2a0 (diff) | |
| download | emacs-f4fa5c853aeb6daeef62bcb5e5549e61a79c1468.tar.gz emacs-f4fa5c853aeb6daeef62bcb5e5549e61a79c1468.zip | |
PostScript code compatibility with other utilities
like mpage, psnup, etc.
(isLineStep): Code fix.
(BeginDoc, BeginSheet): Utility compatibility.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/ps-prin1.ps | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/etc/ps-prin1.ps b/etc/ps-prin1.ps index eef39a295f3..a2fc98ac4b4 100644 --- a/etc/ps-prin1.ps +++ b/etc/ps-prin1.ps | |||
| @@ -301,10 +301,14 @@ StandardEncoding 46 82 getinterval aload pop | |||
| 301 | % stack: -- |- boolean | 301 | % stack: -- |- boolean |
| 302 | /isLineStep{ | 302 | /isLineStep{ |
| 303 | SyncLineZebra | 303 | SyncLineZebra |
| 304 | {PrintLineStep 1 gt | 304 | {PLScounter 0 gt % or zebra |
| 305 | {/PrintLineStep PrintLineStep 1 sub def false} % or inside zebra | 305 | {/PLScounter PLScounter 1 sub def PLScounter 0 eq} |
| 306 | {/PrintLineStep ZebraHeight def true}ifelse} % or 1st zebra line | 306 | {false}ifelse |
| 307 | {LineNumber 1 sub PrintLineStep mod 0 eq}ifelse % or line step | 307 | PrintLineStep 1 gt |
| 308 | {/PrintLineStep PrintLineStep 1 sub def} | ||
| 309 | {/PrintLineStep ZebraHeight def | ||
| 310 | /PLScounter PrintLineStart def}ifelse} | ||
| 311 | {LineNumber PrintLineStart sub PrintLineStep mod 0 eq}ifelse % or line step | ||
| 308 | }def | 312 | }def |
| 309 | 313 | ||
| 310 | % stack: -- | 314 | % stack: -- |
| @@ -417,55 +421,15 @@ StandardEncoding 46 82 getinterval aload pop | |||
| 417 | /docState save def | 421 | /docState save def |
| 418 | % ---- [andrewi] set PageSize based on chosen dimensions | 422 | % ---- [andrewi] set PageSize based on chosen dimensions |
| 419 | UseSetpagedevice{ | 423 | UseSetpagedevice{ |
| 420 | BMark /PageSize [PageWidth LandscapePageHeight] EMark setpagedevice | 424 | BMark/PageSize[PageWidth LandscapePageHeight LandscapeMode{exch}if]EMark setpagedevice |
| 421 | }{ | ||
| 422 | LandscapeMode{ | ||
| 423 | % ---- translate to bottom-right corner of Portrait page | ||
| 424 | LandscapePageHeight 0 translate | ||
| 425 | 90 rotate | ||
| 426 | }if | ||
| 427 | }ifelse | ||
| 428 | % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7 | ||
| 429 | /JackGhostscript where{pop 1 27.7 29.7 div scale}if | ||
| 430 | UpsideDown{PageWidth LandscapePageHeight translate 180 rotate}if | ||
| 431 | % ---- N-Up printing | ||
| 432 | N-Up 1 gt{ | ||
| 433 | % ---- landscape | ||
| 434 | N-Up-Landscape{ | ||
| 435 | PageWidth 0 translate | ||
| 436 | 90 rotate | ||
| 437 | }if | ||
| 438 | N-Up-Margin dup translate | ||
| 439 | % ---- scale | ||
| 440 | LandscapeMode{ | ||
| 441 | /HH PageWidth def | ||
| 442 | /WW LandscapePageHeight def | ||
| 443 | }{ | ||
| 444 | /HH LandscapePageHeight def | ||
| 445 | /WW PageWidth def | ||
| 446 | }ifelse | ||
| 447 | WW N-Up-Margin sub N-Up-Margin sub | ||
| 448 | N-Up-Landscape | ||
| 449 | {N-Up-Lines div HH}{N-Up-Columns N-Up-Missing add div WW}ifelse | ||
| 450 | div dup scale | ||
| 451 | 0 N-Up-Repeat 1 sub LandscapePageHeight mul translate | ||
| 452 | % ---- go to start position in page matrix | ||
| 453 | N-Up-XStart N-Up-Missing 0.5 mul | ||
| 454 | LandscapeMode{ | ||
| 455 | LandscapePageHeight mul N-Up-YStart add | ||
| 456 | }{ | ||
| 457 | PageWidth mul add N-Up-YStart | ||
| 458 | }ifelse | ||
| 459 | translate | ||
| 460 | }if | 425 | }if |
| 461 | /ColumnWidth PrintWidth InterColumn add def | 426 | /ColumnWidth PrintWidth InterColumn add def |
| 462 | % ---- translate to lower left corner of TEXT | ||
| 463 | LeftMargin BottomMargin translate | ||
| 464 | % ---- define where printing will start | 427 | % ---- define where printing will start |
| 465 | /f0 F % this installs Ascent | 428 | /f0 F % this installs Ascent |
| 466 | /PrintStartY PrintHeight Ascent sub def | 429 | /PrintStartY PrintHeight Ascent sub def |
| 467 | /ColumnIndex 1 def | 430 | /ColumnIndex 1 def |
| 468 | /N-Up-Counter N-Up-End 1 sub def | 431 | /N-Up-Counter N-Up-End 1 sub def |
| 432 | /PLScounter PrintLineStart def | ||
| 469 | }def | 433 | }def |
| 470 | 434 | ||
| 471 | /EndDoc{ | 435 | /EndDoc{ |
| @@ -536,6 +500,46 @@ StandardEncoding 46 82 getinterval aload pop | |||
| 536 | /BeginSheet{ | 500 | /BeginSheet{ |
| 537 | /sheetState save def | 501 | /sheetState save def |
| 538 | /pages-per-sheet exch def | 502 | /pages-per-sheet exch def |
| 503 | |||
| 504 | % ---- translate to bottom-right corner of Portrait page | ||
| 505 | LandscapeMode{ | ||
| 506 | LandscapePageHeight 0 translate | ||
| 507 | 90 rotate | ||
| 508 | }if | ||
| 509 | % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7 | ||
| 510 | /JackGhostscript where{pop 1 27.7 29.7 div scale}if | ||
| 511 | UpsideDown{PageWidth LandscapePageHeight translate 180 rotate}if | ||
| 512 | % ---- N-Up printing | ||
| 513 | N-Up 1 gt{ | ||
| 514 | % ---- landscape | ||
| 515 | N-Up-Landscape{ | ||
| 516 | PageWidth 0 translate | ||
| 517 | 90 rotate | ||
| 518 | }if | ||
| 519 | N-Up-Margin dup translate | ||
| 520 | % ---- scale | ||
| 521 | LandscapeMode{ | ||
| 522 | /HH PageWidth def | ||
| 523 | /WW LandscapePageHeight def | ||
| 524 | }{ | ||
| 525 | /HH LandscapePageHeight def | ||
| 526 | /WW PageWidth def | ||
| 527 | }ifelse | ||
| 528 | WW N-Up-Margin sub N-Up-Margin sub | ||
| 529 | N-Up-Landscape | ||
| 530 | {N-Up-Lines div HH}{N-Up-Columns N-Up-Missing add div WW}ifelse | ||
| 531 | div dup scale | ||
| 532 | 0 N-Up-Repeat 1 sub LandscapePageHeight mul translate | ||
| 533 | % ---- go to start position in page matrix | ||
| 534 | N-Up-XStart N-Up-Missing 0.5 mul | ||
| 535 | LandscapeMode | ||
| 536 | {LandscapePageHeight mul N-Up-YStart add} | ||
| 537 | {PageWidth mul add N-Up-YStart}ifelse | ||
| 538 | translate | ||
| 539 | }if | ||
| 540 | % ---- translate to lower left corner of TEXT | ||
| 541 | LeftMargin BottomMargin translate | ||
| 542 | |||
| 539 | % ---- N-up printing | 543 | % ---- N-up printing |
| 540 | N-Up 1 gt N-Up-Border and pages-per-sheet 0 gt and{ | 544 | N-Up 1 gt N-Up-Border and pages-per-sheet 0 gt and{ |
| 541 | % ---- page border | 545 | % ---- page border |