📄 stcinfo.ps
字号:
mul 4 index 0 get add 4 index 3 get 5 index 1 get
newpath
2 index 1 index moveto
3 index 1 index lineto
3 index 2 index lineto
2 index 2 index lineto
closepath fill
pop pop pop pop
} for
pop pop
0 setgray
newpath
dup 0 get 1 index 1 get moveto
dup 2 get 1 index 1 get lineto
dup 2 get 1 index 3 get lineto
dup 0 get 1 index 3 get lineto
closepath stroke
pop
} bind def
% End: stcinfo_procedures_1
% Begin: stcinfo_preparation
% Compute used area from clippath
/STCi_clip [
newpath clippath pathbbox
2 sub 4 1 roll 2 sub 4 1 roll 2 add 4 1 roll 2 add 4 1 roll
] def
%
% Perpare the texual messages, assume no stcolor if this fails
%
{
/STCi_stopped % A Special Mark
% Textual Parameters (an array of pairs of strings)
/STCi_l1 0 def
/STCi_l2 0 def
/STCi_text [
% Driver-Name & Version
(Parameters of)
/Name STCiget length /Version STCiget length add 1 add string
dup 0 /Name STCiget putinterval dup /Name STCiget length (-)putinterval
dup /Name STCiget length 1 add /Version STCiget putinterval
% Dithering-Algorithm
(Dithering)
/Dithering STCiget
[{( \(Monochrome\))}{( \(RGB\))}{( \(CMYK\))}] STCimode
dup length 2 index length add string exch 1 index exch
3 index length exch putinterval dup 3 1 roll exch 0 exch putinterval
% Flags for the algorithm
(Flag4-0) 5 string
dup 0 /Flag4 STCiget {(T)}{(f)} ifelse putinterval
dup 1 /Flag3 STCiget {(T)}{(f)} ifelse putinterval
dup 2 /Flag2 STCiget {(T)}{(f)} ifelse putinterval
dup 3 /Flag1 STCiget {(T)}{(f)} ifelse putinterval
dup 4 /Flag0 STCiget {(T)}{(f)} ifelse putinterval
% Bits Per Pixel & Bits Per Component
(BitsPerPixel) 10 string % (nn -> nxnn)
/BitsPerPixel STCiget 1 index cvs length % string used
dup 2 index exch ( -> ) putinterval 4 add dup 2 add exch 2 index exch
[{(1x)}{(3x)}{(4x)}] STCimode putinterval % String used
/BitsPerComponent STCiget 2 index 2 index 2 getinterval cvs length add
0 exch getinterval
() ()
% ColorAdjustMatrix
(ColorAdjustMatrix)
/ColorAdjustMatrix STCiget dup null eq {
pop (default)
}{
{ STCicvs } forall
[{ % Monochrome
26 string
dup 0 6 -1 roll putinterval dup 8 ( ) putinterval
dup 9 5 -1 roll putinterval dup 17 ( ) putinterval
dup 18 4 -1 roll putinterval
}{ % RGB
26 string
dup 0 12 -1 roll putinterval dup 8 ( ) putinterval
dup 9 11 -1 roll putinterval dup 17 ( ) putinterval
dup 18 10 -1 roll putinterval
() 26 string
dup 0 11 -1 roll putinterval dup 8 ( ) putinterval
dup 9 10 -1 roll putinterval dup 17 ( ) putinterval
dup 18 9 -1 roll putinterval
() 26 string
dup 0 10 -1 roll putinterval dup 8 ( ) putinterval
dup 9 9 -1 roll putinterval dup 17 ( ) putinterval
dup 18 8 -1 roll putinterval
}{
35 string
dup 0 19 -1 roll putinterval dup 8 ( ) putinterval
dup 9 18 -1 roll putinterval dup 17 ( ) putinterval
dup 18 17 -1 roll putinterval dup 26 ( ) putinterval
dup 27 16 -1 roll putinterval
() 35 string
dup 0 17 -1 roll putinterval dup 8 ( ) putinterval
dup 9 16 -1 roll putinterval dup 17 ( ) putinterval
dup 18 15 -1 roll putinterval dup 26 ( ) putinterval
dup 27 14 -1 roll putinterval
() 35 string
dup 0 15 -1 roll putinterval dup 8 ( ) putinterval
dup 9 14 -1 roll putinterval dup 17 ( ) putinterval
dup 18 13 -1 roll putinterval dup 26 ( ) putinterval
dup 27 12 -1 roll putinterval
() 35 string
dup 0 13 -1 roll putinterval dup 8 ( ) putinterval
dup 9 12 -1 roll putinterval dup 17 ( ) putinterval
dup 18 11 -1 roll putinterval dup 26 ( ) putinterval
dup 27 10 -1 roll putinterval
}
] STCimode
} ifelse
() ()
% Printer Model
(Printer-Model) /Model STCiget
% Resolution
(Resolution) 15 string % (nnnnnxnnnnn DpI)
/HWResolution STCiget 0 get cvi 1 index cvs length
dup 2 index exch (x) putinterval 1 add dup 2 index exch 5 getinterval
/HWResolution STCiget 1 get cvi exch cvs length add dup 2 index
exch ( DpI) putinterval 4 add 0 exch getinterval
% HWsize holds entire Page in Pixels,
% .HWMargins is [left,bottom,right,top] in Points
(Printed Area) 18 string % (nnnnnxnnnnn Pixel)
/HWSize STCiget 0 get /.HWMargins STCiget dup 0 get exch 2 get add
/HWResolution STCiget 0 get mul 72.0 div sub cvi 1 index cvs length
dup 2 index exch (x) putinterval 1 add dup 2 index exch 5 getinterval
/HWSize STCiget 1 get /.HWMargins STCiget dup 1 get exch 3 get add
/HWResolution STCiget 1 get mul 72.0 div sub cvi exch cvs length add
dup 2 index exch ( Pixel) putinterval 6 add 0 exch getinterval
() ()
% WeaveMode
(Weave-Mode)
/noWeave STCiget {
(noWeave)
}{
/Microweave STCiget {(Microweave)}{(Softweave)}ifelse
}ifelse
% Unidirectional
(Unidirectional) /Unidirectional STCiget {(ON)}{(off)} ifelse
% Output coding
(OutputCode) /OutputCode STCiget
% number of heads
(escp_Band) /escp_Band STCiget 3 string cvs
(escp_Width) /escp_Width STCiget 5 string cvs
(escp_Height) /escp_Height STCiget 5 string cvs
(escp_Top) /escp_Top STCiget 5 string cvs
(escp_Bottom) /escp_Bottom STCiget 5 string cvs
] def
%
% compute the Proper X & Y-Arrays
%
[{ % Monochrome
/Ktransfer STCiget /Kcoding STCiget STCisteps
/STCi_yv [ 3 -1 roll ] def
/STCi_xv [ 3 -1 roll ] def
/STCi_col [[0 0 0]] def
/STCi_set [{1.0 exch sub setgray}] def
}{ % RGB
/Rtransfer STCiget /Rcoding STCiget STCisteps
/Gtransfer STCiget /Gcoding STCiget STCisteps
/Btransfer STCiget /Bcoding STCiget STCisteps
exch 4 -1 roll 6 -1 roll exch 3 -1 roll
/STCi_xv [ 5 2 roll ] def
/STCi_yv [ 5 2 roll ] def
/STCi_col [[1 0 0] [0 1 0] [0 0 1]] def
/STCi_set [
{1.0 exch sub 1 exch dup setrgbcolor}
{1.0 exch sub dup 1 exch setrgbcolor}
{1.0 exch sub dup 1 setrgbcolor}
] def
}{ % CMYK
/Ctransfer STCiget /Ccoding STCiget STCisteps
/Mtransfer STCiget /Mcoding STCiget STCisteps exch 3 1 roll
/Ytransfer STCiget /Ycoding STCiget STCisteps exch 4 1 roll
/Ktransfer STCiget /Kcoding STCiget STCisteps exch 5 1 roll
/STCi_yv [ 6 2 roll ] def
/STCi_xv [ 6 2 roll ] def
/STCi_col [[0 1 1] [1 0 1] [1.0 0.5 0.0] [0 0 0]] def
/STCi_set [
{ 0 0 0 setcmykcolor }
{ 0 exch 0 0 setcmykcolor }
{ 0 exch 0 exch 0 setcmykcolor }
{ 0 exch 0 exch 0 exch setcmykcolor }
] def
}
]STCimode
} stopped
{ {/STCi_stopped eq {exit}if}loop true}
{ {/STCi_stopped eq {exit}if}loop false} ifelse
% End: stcinfo_preparation
% The Next section does the real job
% Begin: stcinfo_execution
{
(%%[ stcinfo.ps: currentdevice is not supported -> colortri ]%%\n) print
STCi_clip colortri % The default action
}{
%
% Print the text
%
0 2 STCi_text length 2 sub { dup 1 add exch
STCi_text exch get length dup STCi_l1 gt{/STCi_l1 exch def}{pop}ifelse
STCi_text exch get length dup STCi_l2 gt{/STCi_l2 exch def}{pop}ifelse
} for
/STCi_l2 STCi_l2 neg def
0 2 STCi_text length 2 sub {
dup 1 add STCi_text exch get exch STCi_text exch get
1 index length 0 gt {
dup STCi_l1 STCiprint length 0 gt {(: )}{( )}ifelse print print
}{
pop pop
} ifelse
(\n) print
} for
%
% Deactivate a present ColorAdjust Matrix, if any
%
/ColorAdjustMatrix STCiget null ne STCi_onstc and {
mark
/ColorAdjustMatrix null
currentdevice putdeviceprops pop
} if
%
% "Show" the text
%
/Times-Roman findfont 10 scalefont setfont
/STCi_l1 0 def
0 2 STCi_text length 2 sub {
STCi_text exch get stringwidth pop dup STCi_l1 gt {
/STCi_l1 exch def
}{
pop
} ifelse
} for
STCi_l1 STCi_clip 0 get add /STCi_l1 exch def
STCi_clip 3 get 12 sub
0 2 STCi_text length 2 sub {
STCi_text exch get dup length 0 gt {
dup stringwidth pop STCi_l1 exch sub 2 index moveto show
}{
pop
} ifelse
12 sub
} for
pop
/Courier findfont 10 scalefont setfont
/STCi_l2 0 def
1 2 STCi_text length 1 sub {
STCi_text exch get stringwidth pop dup STCi_l2 gt {
/STCi_l2 exch def
}{
pop
} ifelse
} for
STCi_clip 3 get 12 sub
1 2 STCi_text length 1 sub {
STCi_text exch get dup length 0 gt {
STCi_l1 12 add 2 index moveto show
}{
pop
} ifelse
12 sub
} for
pop
%
% compute the space for the graph-window
%
STCi_l1 12 add STCi_l2 add 12 add dup STCi_clip 2 get exch sub % Extend
[ 3 -1 roll dup 3 index add STCi_clip 3 get dup 5 index sub 3 1 roll ]
/STCi_win exch def /STCi_l1 exch def
% The "Axis"
newpath
STCi_win 0 get STCi_win 1 get 14 add moveto
STCi_win 2 get STCi_win 1 get 14 add lineto stroke
STCi_win 0 get 14 add STCi_win 1 get moveto
STCi_win 0 get 14 add STCi_win 3 get lineto stroke
% The Labels
/Times-Roman findfont 10 scalefont setfont
(Postscript-color) dup stringwidth pop
STCi_win 2 get STCi_win 0 get sub 14 sub 1 index sub 2 div exch pop
STCi_win 0 get add 14 add STCi_win 1 get 4 add moveto show
gsave
STCi_win 0 get 10 add STCi_win 1 get 14 add translate 90 rotate
(Device-color) dup stringwidth pop
STCi_win 3 get STCi_win 1 get sub 14 sub 1 index sub 2 div exch pop
0 moveto show
grestore
% The Graphs
gsave
STCi_win 0 get 14 add STCi_win 1 get 14 add
STCi_win 2 get 2 index sub STCi_win 3 get 2 index sub
4 2 roll translate
STCi_col 0 1 2 index length 1 sub {
1 index 1 index get aload pop setrgbcolor
STCi_xv 1 index get STCi_yv 3 -1 roll get
newpath
1 index 0 get 5 index mul 1 index 0 get 5 index mul moveto
1 index 1 get 5 index mul 1 index 0 get 5 index mul lineto
1 1 2 index length 1 sub {
2 index 1 index get 6 index mul
2 index 2 index get 6 index mul lineto
2 index 1 index 1 add get 6 index mul
2 index 2 index get 6 index mul lineto
pop
} for
stroke pop pop
} for
pop pop pop
grestore
%
% Find lowest Y from Text or graph
%
STCi_win 1 get STCi_clip 3 get STCi_text length 2 div 12 mul sub
dup 2 index gt { pop } { exch pop } ifelse 12 sub
%
% compute the upper bar-window
%
/STCi_win [
STCi_clip 0 get 4 -1 roll 36 sub STCi_clip 2 get 1 index 36 add
] def
%
% Draw the required number of graphs
%
[{ % Monochrome
STCi_win STCi_xv 0 get {setgray} STCibar
}{ % RGB
STCi_win STCi_xv 0 get {0 0 setrgbcolor} STCibar
STCi_win dup 1 exch 1 get 47 sub put
STCi_win dup 3 exch 3 get 47 sub put
STCi_win STCi_xv 1 get {0 0 3 1 roll setrgbcolor} STCibar
STCi_win dup 1 exch 1 get 47 sub put
STCi_win dup 3 exch 3 get 47 sub put
STCi_win STCi_xv 2 get {0 0 3 2 roll setrgbcolor} STCibar
}{ % CMYK
STCi_win STCi_xv 0 get {0 0 0 setcmykcolor} STCibar
STCi_win dup 1 exch 1 get 47 sub put
STCi_win dup 3 exch 3 get 47 sub put
STCi_win STCi_xv 1 get {0 0 0 4 1 roll setcmykcolor} STCibar
STCi_win dup 1 exch 1 get 47 sub put
STCi_win dup 3 exch 3 get 47 sub put
STCi_win STCi_xv 2 get {0 0 0 4 2 roll setcmykcolor} STCibar
STCi_win dup 1 exch 1 get 47 sub put
STCi_win dup 3 exch 3 get 47 sub put
STCi_win STCi_xv 3 get {0 0 0 4 3 roll setcmykcolor} STCibar
}
] STCimode
STCi_win 1 STCi_clip 1 get put
STCi_win dup 3 exch 3 get 47 sub put
%
% Plot either one or two Color-Triangles
%
/ColorAdjustMatrix STCiget null ne STCi_onstc and {
STCi_win 0 get STCi_win 2 get add 2 div
[STCi_win 0 get STCi_win 1 get 3 index STCi_win 3 get ] colortri
mark /ColorAdjustMatrix dup STCiget currentdevice putdeviceprops pop
[1 index STCi_win 1 get STCi_win 2 get STCi_win 3 get ] colortri
pop
}{
STCi_win colortri
} ifelse
newpath clippath stroke
} ifelse
showpage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -