Tidy up char 127
[latex2e.git] / trunk / support / dvips.def
blobb3b65bf8d0ffeca559d308375954af2d26bdabfc
1 %%
2 %% This is file `dvips.def',
3 %% original generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% drivers.dtx (with options: `dvips,color1,psrulesZ,dosrules,macrules')
8 %%
9 %% drivers.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
10 %% Copyright (C) 1995 1996 1997 1998 1999 David Carlisle
11 %% Copyright (C) 2000--2016 David Carlisle, LaTeX3 Project
13 %% This work may be distributed and/or modified under the
14 %% conditions of the LaTeX Project Public License, either version 1.3c
15 %% of this license or (at your option) any later version.
16 %% The latest version of this license is in
17 %% http://www.latex-project.org/lppl.txt
18 %% and version 1.3c or later is part of all distributions of LaTeX
19 %% version 2005/12/01 or later.
21 %% This work has the LPPL maintenance status `maintained'.
23 %% The Current Maintainer of this work is the LaTeX3 Project.
25 %% https://github.com/latex3/graphics-def/issues
27 \ProvidesFile{dvips.def}
28 [2016/07/10 v3.1a Driver-dependent file (DPC,SPQR)]
29 \def\c@lor@arg#1{%
30 \dimen@#1\p@
31 \ifdim\dimen@<\z@\dimen@\maxdimen\fi
32 \ifdim\dimen@>\p@
33 \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
34 \fi}
35 \def\color@gray#1#2{%
36 \c@lor@arg{#2}%
37 \edef#1{gray #2}%
39 \def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
40 \def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
41 \c@lor@arg{#4}%
42 \c@lor@arg{#1}%
43 \c@lor@arg{#2}%
44 \c@lor@arg{#3}%
45 \edef#5{cmyk #1 #2 #3 #4}%
47 \def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
48 \def\c@lor@@rgb#1,#2,#3\@@#4{%
49 \c@lor@arg{#1}%
50 \c@lor@arg{#2}%
51 \c@lor@arg{#3}%
52 \edef#4{rgb #1 #2 #3}%
54 \def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
55 \def\c@lor@@RGB#1,#2,#3\@@#4{%
56 \c@lor@RGB@rgb{#1}\@tempa
57 \c@lor@RGB@rgb{#2}\@tempb
58 \c@lor@RGB@rgb{#3}\@tempc
59 \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
61 \def\c@lor@RGB@rgb#1#2{%
62 \dimen@#1\p@
63 \divide\dimen@\@cclv
64 \edef#2{\strip@pt\dimen@}}
65 \def\color@hsb#1#2{\c@lor@@hsb#2\@@#1}
66 \def\c@lor@@hsb#1,#2,#3\@@#4{%
67 \c@lor@arg{#1}%
68 \c@lor@arg{#2}%
69 \c@lor@arg{#3}%
70 \edef#4{hsb #1 #2 #3}%
72 \def\color@named#1#2{\c@lor@@named#2,,\@@#1}
73 \def\c@lor@@named#1,#2,#3\@@#4{%
74 \@ifundefined{col@#1}%
75 {\PackageError{color}{Undefined color `#1'}\@ehd}%
76 {\edef#4{ #1}}%
78 \def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@}
79 \def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end}
80 \def\c@lor@ps@rgb#1\@@{#1 setrgbcolor}
81 \def\c@lor@ps@hsb#1\@@{#1 sethsbcolor}
82 \def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor}
83 \def\c@lor@ps@gray#1\@@{#1 setgray}
84 \def\current@color{ Black}
85 \def\set@color{%
86 \special{color push \current@color
87 }\aftergroup\reset@color}
88 \def\reset@color{\special{%
89 color pop}}
90 \def\set@page@color{\special{%
91 background \current@color}}
92 \def\define@color@named#1#2{%
93 \expandafter\let\csname col@#1\endcsname\@nnil}
94 \def\no@page@color{\special{background \string"newpath clip}}
95 \def\Ginclude@eps#1{%
96 \message{<#1>}%
97 \bgroup
98 \def\@tempa{!}%
99 \dimen@\Gin@req@width
100 \dimen@ii.1bp%
101 \divide\dimen@\dimen@ii
102 \@tempdima\Gin@req@height
103 \divide\@tempdima\dimen@ii
104 \special{PSfile="#1"\space
105 llx=\Gin@llx\space
106 lly=\Gin@lly\space
107 urx=\Gin@urx\space
108 ury=\Gin@ury\space
109 \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
110 \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
111 \ifGin@clip clip\fi}%
112 \egroup}
113 \def\Ginclude@bmp#1{%
114 \message{<#1>}%
115 \dimen@\Gin@req@height
116 \advance\dimen@ by-\Gin@lly bp
117 \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
118 \ifdim\Gin@urx bp=\z@
119 \ifdim\Gin@ury bp=\z@
120 \special{em: graph #1}%
121 \else
122 \special{em: graph #1,\Gin@urx bp}%
124 \else
125 \special{em: graph #1,\Gin@urx bp,\Gin@ury bp}%
129 \def\oztex@include#1#2{%
130 \dimen@1bp%
131 \divide\Gin@req@width\dimen@
132 \divide\Gin@req@height\dimen@
133 \special{#1=#2\space
134 \@width=\number\Gin@req@width \space
135 \@height=\number\Gin@req@height}}
136 \def\Ginclude@pntg{\oztex@include{pntg}}
137 \def\Ginclude@pict{\oztex@include{pict}}
138 \def\Grot@start{%
139 \special{ps: gsave currentpoint
140 currentpoint translate \Grot@angle\space neg
141 rotate neg exch neg exch translate}}
142 \def\Grot@end{\special{ps: currentpoint grestore moveto}}
143 \def\Gscale@start{\special{ps: currentpoint currentpoint translate
144 \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
145 \def\Gscale@end{\special{ps: currentpoint currentpoint translate
146 1 \Gscale@x\space div 1 \Gscale@y\space div scale
147 neg exch neg exch translate}}
148 \def\Gin@PS@raw#1{\special{ps: #1}}
149 \def\Gin@PS@restored#1{\special{" #1}}
150 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
151 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
152 \@ifundefined{ifGin@setpagesize}
153 {\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
154 \csname iftrue\endcsname}
156 \ifGin@setpagesize
157 \ifx\paperwidth\@undefined\else
158 \AtBeginDocument{%
159 % If a package has changed \mag, assume it knows what it is doing
160 % and leave page size alone
161 \ifnum\mag=\@m
162 \AtBeginDvi{%
163 \begingroup
164 \ifx\stockwidth\@undefined\else
165 \paperwidth\stockwidth
166 \paperheight\stockheight
168 \ifdim\paperwidth>\z@
169 \ifdim\paperheight>\z@
170 \special{papersize=\the\paperwidth,\the\paperheight}%
173 \endgroup}%
178 \def\Gin@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps}
179 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
180 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
181 \@namedef{Gin@rule@.mps}#1{{eps}{.mps}{#1}}
182 \@namedef{Gin@rule@.pz}#1{{eps}{.bb}{#1}}
183 \@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.bb}{#1}}
184 \@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.bb}{#1}}
185 \@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.bb}{#1}}
186 \@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.bb}{#1}}
187 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
188 \@namedef{Gin@rule@.pcx}#1{{bmp}{}{#1}}
189 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
190 \@namedef{Gin@rule@.msp}#1{{bmp}{}{#1}}
191 \@namedef{Gin@rule@.pict}#1{{pict}{}{#1}}
192 \@namedef{Gin@rule@.pntg}#1{{pntg}{}{#1}}
193 \endinput
195 %% End of file `dvips.def'.