Ghostscript
HORAKK at earn.cvut.cz
HORAKK at earn.cvut.cz
Wed Oct 26 11:30:20 CET 1994
% Ja bych jeste dodal, ze DOSova verze GS je podle mych zkusenosti naprosto
% nespolehliva. 99% mych dokumentu GS nezvladne a hlasi nesmyslne chyby. Verze
% 2.5 je pri te bide relativne nejspolehlivejsi, verze 2.6 nefunguje na me
% texty vubec, 2.61 je vyrazne rychlejsi nez 2.5, ale nikdy se mi nepodarilo z
% ni dostat nic na papir. Nastesti mam postscriptovou tiskarnu...
Moje zkusenost s GS neni tak zla, i kdyz musim uznat, ze az dosud
nejlepe fungovala verze 2.5.2, ke ktere jsem se cas od casu stale
vracel, kdyz jsem s nekterou novejsi verzi na nekterem souboru
neuspel. S touto verzi mi take vyborne funguje dosovsky (!)
prohlizec, ktery jsem prave dovezl od svych polskych pratel (cca
23 kB ps soubor), ktery umoznuje pohyb p strance a libovolnou
magnifikaci dokumentu i skok na libovolnou stranu.
Verzi GS 3.12 jsem ozkousel a jsem ji nadsen (pozor ovsem: jedna
se o Alladin Ghostscript, nikoli GNU!), poprve dovede poznat
ljet4, takze jsem prestal mit problemy s umistenim stranky
(predchozi verze fungovaly i na 600dpi, ale stranka byla vzdy
posunuta do mista, kde se objevil prvni cerny pixel) a navic
konecne poskytuje rastr kvalitou odpovidajici vyssimu rozliseni.
Navic se mi poprve podarilo na laserove tiskarne vytisknout
testovaci soubor test.tex z instalace dvips se vsim vsudy vcetne
celeho cerneho ramecku, a to i pri 4nasobne iterace vlozeni
zmensene strany. Pouzivam tgedy nadale verzi 2.5.2 na prohlizeni
(a byl bych rad, kdyby nejaky znalec PostScriptu dokazal zjistit,
v cem je chyba, ze jine verze GS nedokazi zmineny ps soubor
spravne interpretovat) a GS3.12 na tisk na laserjetu 4. Odlozil
jsem koupi PS karty v okamziku, kdy dosly nove em drivery rady
1.5 a zatim se mi to stale vyplaci! Nemel jsem ovsem dosud
moznost srovnani mezi tiskem s kartou a pomoci GS, ani co se tyce
doby tisku (komplikovanejsi stranka trva GS max. 90 sekund
na uvedene tiskarne).
Prikladam zminovany soubor ps_view.ps (nefungoval ani s verzi 2.5,
zatim jen s 2.5.2!?, verze 2.6.x jsem zatim nemel moznost
ozkouset). Pouziti spociva v predchozim precteni tohoto souboru
pred prohlizenym dokumentem. Pote by mely fungovat klavesy v
(zvetseni o 1 rad, x vystup do dosu, n nasledujici strana, u
nahoru (up), r doprava (right) apod. -- nasledovany vzdy ENTERem;
dalsi moznosti lze vycist z komentare na zacatku souboru.
%!PS-Adobe-2.0
%%
%% Utility for Ghostscript interpreter v. 2.6 and newer
%% Authors: P.Pianowski, B.Jackowski
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Under pressure from participants of the 8th EuroTeX Conference, we
%%%% decided to release this ``viewer'' as a PRE-PUBLIC-DOMAIN product.
%%%% People using our product are kindly requested to inform
%%%% us about it (by mail). Any comments are welcome.
%%%% The authors.
%%%% Gda\'nsk-Sobieszewo, 1994
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright: BOP s.c. Gda$sk, Tatrza$ska 6/1, tel. 51-23-09
%% Version: 0.995
%% Creation date: Jan 15 1993
%% Update: May 23 1994
%%
%% Commands for PostScript documents viewing
%%
%% (FILE_NAME) a apply new picture
%% (FILE_NAME) ap apply new paged document
%% i view picture with initial parameter settings
%% w view whole picture
%% c redraw current picture
%% [(FILE_NAME)] rr conditional reading the restart informations
%% [(FILE_NAME)] wr writing the restart informations
%% [PAGE] pn goto specified page
%% [INCR] n goto next page
%% [INCR] p goto previous page
%% [MAG] m set magnification factor
%% g draw grid
%% [HORIZ] [VERT] v view magnified and shifted picture
%% [SHIFT] s set shift
%% [SHIFT] l shift left
%% [SHIFT] r shift right
%% [SHIFT] u shift up
%% [SHIFT] d shift down
%% [STEP] ro rotate picture counterclockwise by abs(STEP)*90
%% hf flip picture horizontaly
%% vf flip picture verticaly
%% [INCR] * undo previous picture
%% [INCR] + redo undone picture
%% fr show the frame
%% [(FILE_NAME)] pr print contents of the frame to printer (to file)
%% r1024 |
%% r800 | set screen resolution -- for TVGA and TSENG only
%% r640 |
%% e error handler
%% q quit with saving the restart information
%% x exit
%%
%% [ ... ] means optional parameter
%%
/view_dict 100 dict def view_dict begin
%
% default settings
/output_name () def % printing immediately to the printer OR
%/output_name (!ps_vie.jep) def % printing to the file
/restart_name (!ps_rest.ps) def % name of the restart file
/svga [(tvga) (tseng)] def % TRIDENT OR TSENG
/printer_name (ljet3) def % HP LaserJet III OR
%/printer_name (cdj550) def % DeskJet 550c
/printer_x_corr 0 def % | printer horizontal
/printer_y_corr -71 def % | and vertical corrections
/page_string (%%Page:) def % begin-of-page mark
/mag_factor 2 def % MAG for the `m' command
/shift 4 def % SHIFT for the `l' `r' `u' `d' commands
/max_pages 256 def % maximal viewable pages number
/line_length 2048 def % maximal document line length in the `ap' comma
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
/letter {} def
/note {} def
/legal {} def
/a3 {} def
/ori_a4 /a4 load def /a4 {} def
/a5 {} def
/a6 {} def
/b4 {} def
/b5 {} def
/flsa {} def
/flse {} def
/halfletter {} def
/11x17 {} def
/ledger {} def
%
/BD {bind def} def
/XD {exch def} def
/LD {load def} def
/inch {72 mul} BD
/grid_wd 10 inch def
/grid_ht 10 inch def
/ori_run /run LD
/current_restart /restart_name LD
/current_output /output_name LD
/pages_array max_pages array def
/line line_length string def
/val_str 20 string def
/initials {/orig_x 0 def /orig_y 0 def
/angle 0 def /trans_x 0 def /trans_y 0 def
/hflip false def /vflip false def
/curr_page 0 def /pages_count 0 def /curr_pos 0 def
/document_dict 0 def /magnification 1 def} BD
/get_screen {currentdevice getdeviceprops] /screen_device XD
/S_res screen_device 1 get def
/S_size screen_device 3 get def
/default_matrix screen_device 5 get def
/screen_name screen_device 7 get def
screen_name (tvga) eq
{0.94 0.94 matrix scale default_matrix matrix concatmatrix
/default_matrix XD} if} BD
get_screen
gsave initgraphics default_matrix setmatrix
clippath pathbbox 3 -1 roll
sub /page_ht XD exch sub /page_wd XD
page_wd grid_wd div /grid_h_scale XD
page_ht grid_ht div /grid_v_scale XD
grid_h_scale grid_wd mul 10 div /grid_h_step XD
grid_v_scale grid_ht mul 10 div /grid_v_step XD
grestore
initials
/page_begin {pages_count 0 ge pages_count max_pages lt and
{pages_array pages_count last_pos put
/pages_count pages_count 1 add def} {/overfull true def} ifelse} BD
/read_pages {gsave
/moveto {currentdict /document_dict exch store stop} BD
file_name (r) file /opened_file XD
opened_file 0 setfileposition opened_file cvx stopped pop
opened_file status {opened_file closefile} if
clear cleardictstack view_dict begin
view_dict /moveto undef
/overfull false def
file_name (r) file /opened_file XD
opened_file 0 setfileposition
{opened_file dup fileposition /last_pos XD
line readline
{/sub_line XD sub_line length page_string length ge
sub_line length 30 le and
{sub_line 0 page_string length getinterval page_string eq
{page_begin} if} if} {pop exit} ifelse} loop
opened_file status {opened_file closefile} if
overfull
{(Too many pages, only first ) print
pages_count val_str cvs print
( pages are accessible.\n) print}
{(OK, ) print
pages_count val_str cvs print
pages_count 1 eq {( page is accessible.\n)}
{( pages are accessible.\n)} ifelse print} ifelse grestore} BD
/showpage {cleardictstack view_dict begin stop} BD
/do_run_file {/run_matrix XD
curr_page 0 eq {/curr_page 1 def} if
curr_page pages_count gt {/curr_page pages_count def} if
curr_page 0 gt {pages_array curr_page 1 sub get /curr_pos XD} if
/view_save save def
document_dict dup type cvlit /dicttype eq {begin} {pop} ifelse
initgraphics erasepage erasepage
run_matrix setmatrix
magnification dup scale
orig_x grid_h_step magnification div mul neg
orig_y grid_v_step magnification div mul neg translate
hflip {[-1 0 0 1 page_wd 0] concat} if
vflip {[1 0 0 -1 0 page_ht] concat} if
angle rotate trans_x trans_y translate
/view_matrix matrix currentmatrix def
/initgraphics {view_matrix setmatrix} BD
/initmatrix {view_matrix setmatrix} BD
file_name (r) file /opened_file XD
opened_file curr_pos setfileposition
opened_file cvx stopped pop
clear view_dict /view_save get restore} BD
/run_file {default_matrix do_run_file} BD
/printer_run_file {
currentdevice getdeviceprops] /printer_device XD
printer_device 13 current_output put
[printer_device aload pop currentdevice putdeviceprops pop
printer_device 5 get % printer default matrix
[1 0 0 1 printer_x_corr printer_y_corr] matrix concatmatrix
do_run_file} BD
%
FontDirectory/Qhvr-Digits known{/Qhvr-Digits findfont dup/UniqueID known{dup
/UniqueID get 0 eq exch/FontType get 1 eq and}{pop false}ifelse
{save true}{false}ifelse}{false}ifelse
7 dict begin
/FontInfo 6 dict dup begin
/version(1.000)readonly def
/FullName(Qhvr Digits)readonly def
/FamilyName(Qhv)readonly def
/Weight(Normal)readonly def
/isFixedPitch false def
/ItalicAngle 0 def
end readonly def
/FontName /Qhvr-Digits def
/Encoding StandardEncoding def
/PaintType 0 def
/FontType 1 def
/FontMatrix[0.001 0 0 0.001 0 0]readonly def
/FontBBox{0 -20 520 699}readonly def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA0525392EECAC163E584A9104D99AD0BC1B1F3F7121D1D0
F2C60DD206B0D3C8C450620B47320CA0AEB8937511E456AADE8E66B301B1E3E9DFE17E2F79ECFE
A709FF3DAE19B4C169DF6773EDA414D02915A6F0FAF8B24FBB0777C697BE8A37D63A390AD9DAE4
95BB7E626721FF2FD3FB147C80D22BEAC37C2624D818D58C8DF0209F5CE76ACDDE57A303D9042B
F0A674D095697F925F532D1814BEA8F8A5B1FD0737F362C88E00ACAED0FBD4A36E9C2A308F5357
0CF2A0C2F3CAC3DE98B695B11D327E8E5E25B2589830D510A1570E925D168B402333C9664C7924
E7805676F81E34A9F6A4C0D20F0316BD666AD522F9F2A81B22B50B30B4A18CFD9CD3F7160FF9C0
F87FF37B5E53B43C6AC52DFA2C3D94709623D68D3D7FFBB35130E6DBAA922DE516232E911BC201
1F95EE2183B5BCD0B7A2A9548B93C87D63E07D7B88A951D55AC9F4512F3A2E6B39794EBAF8DC45
2A5B218D3354E5BDEA6AB78C3C303469AA4CC6F847A6ED68D86593D02B88104A97C10FF834FC38
44B68ECA890039369983A930ED07C9E1E3DB7C63EBC2DACEA6A1B0F028193EF6D9D00858712C5B
678C037BF276C2DC43A687E773EB2F5B97F224640913D272BA0C32DC25A29C3EF2C3D6448C1719
C88FE99BCBF6690711724355A590EF227A020E5CD98FCB7208B76351A33757FD8DCEA2C8595B8D
62814B49D7497793CD79180C683AFED2AF2CA96F6398AF0CD10416A7037B3476CFB77124373543
A2C18439DB2227247B37014776B3E8D3ECD94200CFA4CE377380A440A0EB50FEB41A86B90BE1FC
F4F9AC6DCE054CEADEFCD37AD00997C5E882628E69A52A6D6B8ECA1A2FE45A37211C066B06EAC3
064D8B6644976E736091D33F5E6D4508278FE8CC7B5F8460EA0CE21010E3AAC8487C9AED61EAAB
99E33528A116753DCCB18277AD919493833AC73ACDEEC0FB3F3995207B36E865797879DD5D854A
04EB38FDC39DA3D4F891E6D67DD487340D1EA966A93A6A58AB0BD2C807298D66CD97A86DAD7904
3E68FFB9D1987363B27C31A53178C1FE53DBD0E67E799E945013469C3D60BDCAEC77494907D44B
F377544FD6A227476B322B43D601DA290F2121EBDAC4C5DC683159A390D960EE1535FA1B41FCC7
4689C1D7077CB480A612C0072981268303DA79D0DEB2DE62161412C3B7DA3620B27EFFAC43C743
556130DF08CCB317082C211111713A08AF28B8E5E8871CD28EC176E6F73A48C13EBC8F322F52B9
FF5CEA6F78A478F36DF47D6C101972BC869F1E9495C5D043366F5F34C4BED8192E7741BD0A86AA
CFEC7C2DEA96FEBB15BFDFE1B4300C32B78C99EEE5C26AF76056DA6AAE671255C220643A0B9220
9561FC4FC1796A8B4978920504BFF87CD295E060714F25A7C35BD91255E24AB73C8AFB7B82F8F3
AA31CBD2FB1815BFCB566C6C1A69E55238BF4FCD8C953C294693BDF4A251D70103DD3B19F2BF07
AEFDE36E86E78D9B6E3A667461603FAF6D65CE82770CE071E0A76F2256AEC37234711AA85CE4BF
357539840350F065C690B77A270910949CA1173853A816F004960A68375EA6894B275DC76C1DD8
65A9488BD209748B2F722107B615AE936E3EDA31A2644D01873EA8D388617A642B5782098B6C06
E12C9AF1A989BC1476C8789C8E0316189D77F70AF8035C92B6E1C4E64B1BC1CD9356D655F0D482
452ACB9FE959C4E33C639DF69D97D28A22B5BD83FE29FFB03280022CFF4B186D4B71BC0CD4AB6F
9415AEEE7C28F6C6F1C5150A10D7FA0958E45E77F916571D4C8FAF3DD842C08D7F282B979711DE
E4619B6C459C73DA37F1CB09EE8333BB5FD90488EB5CF8BD22EE222CDB978875359A439FAAD7E4
1EB4450620D35B5408871E3A3E9A6683BA488928BDA3B56C6942D5C14D45677096CCFFD9C8F126
3E9548883068BC551E15BD898429D8205BCAD0438A121445BFC9A896519A1FFED3BBC7CBF5E564
CCD04D8111AE02EBE5BD71DCC23FA03096005858566260570D9B9475AAFDAC4562056D39C346CB
50F11ADD1EDA81AEDA445EDC3A7593BCA187A6AE0AE62810656C5039EA3B3B7C538FB1B94E3CAA
F64F8F536CACEB4ACF60263EE1212B09367A1CA7ECA46FCBA49441255BA16C49E5302A89267ADA
FDFDDFE20E37677891A74980ACD7932639F89FF74C038AD9D8BFA731CB17B84A94FD7588A36F69
77716DE84AEB6AC6B9087B6113251272204CE882BDB763B82E56389248E759E08BFFFF4CED92DB
C136F2F5BF30DB84ACFA26FBB45BED7C276E386EBDD13FE736DEEA8E7D4E51199BDAEB0ED1AB9D
82B6DCBA64D0E5FB8CC0586B703737EBF0F7C59C2399015F39207EF5BDE64010F443E862B24F07
56CC98BD23E9F2DD0E57B757917AC448C8936C4A70E8711FC5A2A2B24FC5AFDB347B93BBC663E0
C55185F788F843663EF11BB722476EBF17B959C8108354DC5EDE1A209282E59C56B37AAA009AF6
3DC54F4C59D467D21CCB61338F9D90E92FAFF04C3544C9B0D3251262AEF9E9435A7B426AF9082E
FC4784E3AFD6ED849EA318DBAE244DAA38F506231E9849356C7D643D2AFC73C376711D6945ADBC
2221F41E6B4E5290E6DF4302AD80111C0F5C11F2E7E49D39857C9B5507360F84E670328A832FE7
D37CC6FCE8ACF99AF78C4CA862F9EF6F1931C2B3BE37DB4B3EFAB07A6DB60622AC34C277984CF3
F56E8716717E8ABD20FE9C78150F163EBE1FF0715EC28F8756EB2F4DD8EFA37FCF9F6C39E897E3
35F2D915B846292DCB54EAE683C0A022EB7065B77654EBD1B1C50FEA7035DDA2DAF82E407ED35E
22A065C83AB8CFD62FD688D837EC761671699AE09629BF6A60B1866952BCAA10DFDF1237F10ACA
79B02A4CD5AF0248EEC406DBE8CEBEB3A4EC58754347DBAD9195D0BC8537F34FE29AF8BA06267D
2A956370F597A42FAC09902520B3564A2BC6BA1BD5904A15AF0092065D154636C6E91BA9502E70
CE5A18426761AEAB41EFD48F9F039E1D88A5A4E3ED76CEB268A27486E9D7D2B88AF0E0CA78AE03
AE5AFB2331D9CB0DCC7042A67FB8604FE7440FA6DDDA0E9A94EC823434BFCFE218A410E4D742B4
B4E4E20CDE2E1A007A2F2E1C030522776A06EFD06B092FB98CAE7A83085199454266A730056185
702ADDE88C43BA06FD1AE925640C472F961DA26C518197582E965E84E9E862D1C10AFDD6BF29D0
A5C74E68309B7A929C93E66798B4BC72627A0D472B3AAAE983AB027FA7D91E64B699FEA8B636FD
A6F2ADB84450A8880983A9F02331AFBFA443DE548DE2CFE331C788911BD2498681A93E4C33342B
D11D39D2903CFE6E170C0863304639590204D0ED61DA54FA3E546AB94AD010AD0EB0D7D4AC83AE
DE623C60863EC6750FD7A133AB09C3D22F314DCDDF47EB8AA39BFB17CB3FA9F071E083400DB00A
3EA2B947D87215489995E661B9BE20D820215E095CED651C234DD32149C74CFAF3CAC67320494E
2AB777F53B8918F3A4533EEBBE283B21BF4C7CA5E1F8D407805B4022D03E74A697512327CAC9B2
2ED95DF644667A21AE8ECF0A6BE1F83B4C7433518910230A896F81C5B0A2EB65F50F98E09BB726
A7BB6869E71D55E5882A693BC1125D39C8C1582443B0F12E99A18636988056A907225778017504
74202641DB4AA354F7C3FA50A1582C630751C723F93616D9628AC1693C4C815F30DBE881809A27
0FD888DFDE5849B8B5D1B6AEEBD253EB9A4200A34DB50C1AFEF2C7F4C1B9877D3DE79232851A19
3DBBB3795A20A5F37D41EA79B72133C01A563847D03DC61B708B024E11193C2AF12F6BADC77FAB
122AE12D7D5ACD3D99B0A15BAB97E9250DC5208EA1D6FDD84F54231D207ECA339917B662883D9B
21A37333E5EE9950D46DBC7802C5F0641E8A0FDEBF11705A46CC8B4E
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
cleartomark{restore}if
%
/do_grid {
72 72 scale
0 setlinewidth
1 0 0.8 0.4 setcmykcolor
%
newpath
0 0 moveto 10 0 lineto
0 1 moveto 10 1 lineto
0 2 moveto 10 2 lineto
0 3 moveto 10 3 lineto
0 4 moveto 10 4 lineto
0 5 moveto 10 5 lineto
0 6 moveto 10 6 lineto
0 7 moveto 10 7 lineto
0 8 moveto 10 8 lineto
0 9 moveto 10 9 lineto
0 10 moveto 10 10 lineto
%
0 0 moveto 0 10 lineto
1 0 moveto 1 10 lineto
2 0 moveto 2 10 lineto
3 0 moveto 3 10 lineto
4 0 moveto 4 10 lineto
5 0 moveto 5 10 lineto
6 0 moveto 6 10 lineto
7 0 moveto 7 10 lineto
8 0 moveto 8 10 lineto
9 0 moveto 9 10 lineto
10 0 moveto 10 10 lineto
stroke
%
/grid_squ {
gsave -0.05 -0.11 rmoveto currentpoint translate
0.3 0.5 scale
0 0 0 0 setcmykcolor
1 setgray
0 0 moveto
1 0 lineto 1 1 lineto 0 1 lineto
closepath fill
grestore} def
%
/Qhvr-Digits findfont 0.4 scalefont setfont
0.2 1 0.8 0 setcmykcolor
-0.6 0.3 moveto
%
gsave
1 0 rmoveto gsave grid_squ (0) show grestore
1 0 rmoveto gsave grid_squ (1) show grestore
1 0 rmoveto gsave grid_squ (2) show grestore
1 0 rmoveto gsave grid_squ (3) show grestore
1 0 rmoveto gsave grid_squ (4) show grestore
1 0 rmoveto gsave grid_squ (5) show grestore
1 0 rmoveto gsave grid_squ (6) show grestore
1 0 rmoveto gsave grid_squ (7) show grestore
1 0 rmoveto gsave grid_squ (8) show grestore
1 0 rmoveto gsave grid_squ (9) show grestore
grestore
%
1 0 rmoveto
0 1 rmoveto gsave grid_squ (1) show grestore
0 1 rmoveto gsave grid_squ (2) show grestore
0 1 rmoveto gsave grid_squ (3) show grestore
0 1 rmoveto gsave grid_squ (4) show grestore
0 1 rmoveto gsave grid_squ (5) show grestore
0 1 rmoveto gsave grid_squ (6) show grestore
0 1 rmoveto gsave grid_squ (7) show grestore
0 1 rmoveto gsave grid_squ (8) show grestore
0 1 rmoveto gsave grid_squ (9) show grestore
} BD
/do_frame {
/mm {25.4 div 72 mul} def
%
/frame_squ{
newpath
0 0 moveto 1 0 lineto
0 1 moveto 1 1 lineto
0 0 moveto 0 1 lineto
1 0 moveto 1 1 lineto
} def
%
0 setlinewidth
1 1 0 0 setcmykcolor
%
%gsave 210 mm 297 mm scale frame_squ stroke grestore
gsave 6 mm 6 mm translate 198 mm 285 mm scale frame_squ stroke grestore
} BD
/a {/file_name XD
/curr_page 0 def /pages_count 0 def /curr_pos 0 def /document_dict 0 def
file_name status
{pop pop pop pop (OK\n) print}
{pop pop pop pop (File not opened\n) print} ifelse} BD
/ap {/file_name XD
/curr_page 0 def /pages_count 0 def /curr_pos 0 def /document_dict 0 def
file_name status
{pop pop pop pop read_pages}
{pop pop pop pop (File not opened\n) print} ifelse} BD
/rr {count 0 eq {/current_restart restart_name def}
{/current_restart XD} ifelse current_restart status
{pop pop pop pop current_restart ori_run} if run_file} BD
/pn {count 0 eq {(page ) print curr_page val_str cvs print (\n) print}
{round cvi /prop_page XD prop_page 0 gt prop_page pages_count le and
{save_state /curr_page /prop_page LD pages_array curr_page 1 sub get
/curr_pos XD run_file} if} ifelse} BD
/n {count 0 eq {1} if curr_page add round cvi /prop_page XD
prop_page 1 lt {1 /prop_page XD} if
prop_page pages_count gt {pages_count /prop_page XD} if
prop_page curr_page ne
{save_state /curr_page /prop_page LD pages_array curr_page 1 sub get
/curr_pos XD run_file} if} BD
/p {count 0 eq {1} if curr_page exch sub round cvi /prop_page XD
prop_page 1 lt {1 /prop_page XD} if
prop_page pages_count gt {pages_count /prop_page XD} if
prop_page curr_page ne
{save_state /curr_page /prop_page LD pages_array curr_page 1 sub get
/curr_pos XD run_file} if} BD
/i {save_state
/angle 0 def /trans_x 0 def /trans_y 0 def
/hflip false def /vflip false def
/orig_x 0 def /orig_y 0 def /magnification 1 def
run_file} BD
/w {save_state
/orig_x 0 def /orig_y 0 def /magnification 1 def
run_file} BD
/g {gsave default_matrix setmatrix
page_wd grid_wd div page_ht grid_ht div scale
do_grid grestore} BD
/fr {gsave default_matrix setmatrix
do_frame grestore} BD
/m {count 0 eq {(magnification ) print magnification val_str cvs print
( mag_factor ) print mag_factor val_str cvs print (\n) print}
{/mag_factor XD} ifelse} BD
/s {count 0 eq {(shift ) print shift val_str cvs print (\n) print}
{/shift XD} ifelse} BD
/v {save_state
count 0 eq {0 0} if count 1 eq {dup} if
/new_y0 XD /new_x0 XD
/magnification magnification mag_factor mul def
/orig_x orig_x new_x0 add mag_factor mul def
/orig_y orig_y new_y0 add mag_factor mul def
run_file} BD
/rot {save_state
count 0 eq {1} if /angle_mul exch abs round cvi def
/angle angle 90 angle_mul mul add def
angle 360 ge {/angle angle dup 360 idiv 360 mul sub def} if
angle 0 eq {0 0} if
angle 90 eq {0 page_ht neg} if
angle 180 eq {page_wd neg page_ht neg} if
angle 270 eq {page_ht neg page_wd page_ht sub} if
/trans_y XD /trans_x XD} BD
/ro {rot run_file} BD
/hf {/hflip hflip not def run_file} BD
/vf {/vflip vflip not def run_file} BD
/l {save_state
count 0 eq {shift} if /orig_x exch neg orig_x add def run_file} BD
/r {save_state
count 0 eq {shift} if /orig_x exch orig_x add def run_file} BD
/u {save_state
count 0 eq {shift} if /orig_y exch orig_y add def run_file} BD
/d {save_state
count 0 eq {shift} if /orig_y exch neg orig_y add def run_file} BD
/c {run_file} BD
/pr {count 0 eq {/current_output output_name def}
{/current_output XD} ifelse /dev currentdevice def fr gsave
printer_name selectdevice ori_a4 printer_run_file copypage
grestore dev setdevice run_file} BD
/e {clear cleardictstack view_dict begin
view_dict /view_save known {view_save restore} if} BD
/x {quit} BD
/write_str {restart_file exch writestring} BD
/write_num {val_str cvs write_str} BD
/write_restart {count 0 eq {/current_restart restart_name def}
{/current_restart XD} ifelse /restart_file current_restart (w) file def
curr_page write_num ( /curr_page XD\15\12) write_str
angle write_num ( /angle XD\15\12) write_str
trans_x write_num ( /trans_x XD\15\12) write_str
trans_y write_num ( /trans_y XD\15\12) write_str
hflip {(true)}{(false)} ifelse write_str ( /hflip XD\15\12) write_str
vflip {(true)}{(false)} ifelse write_str ( /vflip XD\15\12) write_str
magnification write_num ( /magnification XD\15\12) write_str
orig_x write_num ( /orig_x XD\15\12) write_str
orig_y write_num ( /orig_y XD\15\12) write_str
restart_file flushfile restart_file closefile} BD
/q {write_restart quit} BD
%
/set_res {/scr_y XD /scr_x XD
screen_device 3 [scr_x scr_y] put
[screen_device aload pop currentdevice putdeviceprops pop
false svga {screen_name eq or} forall {get_screen} if run_file} BD
/r640 { 640 480 set_res} BD
/r800 { 800 600 set_res} BD
/r1024 {1024 768 set_res} BD
%
/undo_stack [] def
/redo_stack [] def
/prepare_state {% -- prepare_state <array>
[curr_page angle trans_x trans_y hflip vflip magnification orig_x orig_y]} BD
/save_state {% -- save_state --
prepare_state /undo_stack put_state} BD
/restore_state {% <array> restore_state --
aload pop /orig_y XD /orig_x XD
/magnification XD /vflip XD /hflip XD /trans_y XD /trans_x XD
/angle XD /curr_page XD} BD
/put_state {% <array> <literal> put_state --
/stack_name XD
stack_name load aload length 1 add array astore
stack_name XD} BD
/pop_state {% <literal> pop_state <array>
/stack_name XD
stack_name load aload length 1 sub array astore
stack_name XD} BD
/undo {count 0 eq {1} {dup 0 le {pop 1} if} ifelse round cvi /control_length XD
undo_stack length 1 ge {
1 1 control_length {pop undo_stack length 1 ge {prepare_state
/redo_stack put_state /undo_stack pop_state restore_state} if} for
run_file} if} BD
/redo {count 0 eq {1} {dup 0 le {pop 1} if} ifelse round cvi /control_length XD
redo_stack length 1 ge {
1 1 control_length {pop redo_stack length 1 ge {prepare_state
/undo_stack put_state /redo_stack pop_state restore_state} if} for
run_file} if} BD
/* /undo LD
/+ /redo LD
/wr /write_restart LD
end
view_dict begin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Srdecne zdravi
Karel Horak
More information about the csTeX
mailing list