summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox/tc-dvips.def
blob: cc66f1770e4569b305cb74a9dce54a02312ca027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
%% Copyright (C) 2011-2020 by Martin Scharrer <martin@scharrer-online.de>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
%% This work consists of the files trimclip.dtx, adjustbox.ins
%% and the derived files trimclip.sty,
%% tc-dvips.def, tc-pdftex.def, tc-luatex.def, tc-pgf.def and tc-xetex.def.
%% Further author information are located in the .def files.
%%
\ProvidesFile{tc-dvips.def}[2019/01/04 v2.2 Clipping driver for dvips]
\def\@cliptoboxdim#1{%
    \setbox#1=\hbox{%
        \adjcalc@settobp\WIDTH{\wd#1}%
        \adjcalc@settobp\DEPTH{\dp#1}%
        \adjcalc@settobp\TOTALHEIGHT{-\ht#1-\dp#1}%
        \special{%
            ps:
              /mtrxc matrix currentmatrix def
              currentpoint gsave
              translate
              Resolution 72 div VResolution 72 div
              scale
              newpath
              0 \DEPTH \WIDTH \TOTALHEIGHT rectclip
              newpath
              mtrxc setmatrix
        }%
        \hbox to 0pt{\copy#1\hss}%
        \special{ps: grestore }%
        \hskip\wd#1%
    }%
}
\def\@clipcornersofbox#1#2#3#4#5{%
    \setbox#1=\hbox{%
        \adjcalc@settobp\DEPTHmRADIUSBL\@tempdima
        \adjcalc@settobp\TOTALHEIGHT{-\ht#1-\dp#1}%
        \adjcalc@settobp\HEIGHT{-\ht#1}%
        \adjcalc@settobp\DEPTH{\dp#1}%
        \adjcalc@settobp\WIDTH{\wd#1}%
        \adjcalc@settobp\RADIUSTL{#2}%
        \adjcalc@settobp\RADIUSTR{#3}%
        \adjcalc@settobp\RADIUSBL{#4}%
        \adjcalc@settobp\RADIUSBR{#5}%
        \adjcalc@settobp\RADIUSTLmHEIGHT{#2-\ht#1}%
        \adjcalc@settobp\RADIUSTRmHEIGHT{#3-\ht#1}%
        \adjcalc@settobp\WIDTHmRADIUSTR{\wd#1-#3}%
        \adjcalc@settobp\DEPTHmRADIUSBR{\dp#1-#5}%
        \adjcalc@settobp\WIDTHmRADIUSBR{\wd#1-#5}%
        \adjcalc@settobp\DEPTHmRADIUSBL{\dp#1-#4}%
        \special{%
            ps:
              /mtrxc matrix currentmatrix def
              currentpoint gsave
              translate
              Resolution 72 div VResolution 72 div
              scale
              newpath
              %0 \DEPTH neg translate
              %0 \DEPTH \WIDTH \TOTALHEIGHT rectclip
              0 \RADIUSTLmHEIGHT\space moveto
              \RADIUSTL\space \RADIUSTLmHEIGHT\space \RADIUSTL\space 180 -90 arc
              \WIDTHmRADIUSTR\space \HEIGHT\space lineto
              \WIDTHmRADIUSTR\space \RADIUSTRmHEIGHT\space \RADIUSTR\space -90 0 arc
              \WIDTH\space \DEPTHmRADIUSBR\space lineto
              \WIDTHmRADIUSBR\space \DEPTHmRADIUSBR\space \RADIUSBR\space 0 90 arc
              \RADIUSBL\space \DEPTH\space lineto
              \RADIUSBL\space \DEPTHmRADIUSBL\space \RADIUSBL\space -270 -180 arc
              closepath
              %gsave 0.5 0 0 setrgbcolor stroke grestore
              clip
              newpath
              mtrxc setmatrix
        }%
        \hbox to 0pt{\copy#1\hss}%
        \special{ps: grestore }%
        \hskip \wd#1%
    }%
}
\def\@rndframearoundbox#1#2#3#4#5#6{%
    \setbox#1=\hbox{%
        \adjsetlength\@tempdima{\fboxsep+.5\fboxrule}%
        \@marginbox#1\@tempdima\@tempdima\@tempdima\@tempdima%
        \adjcalc@settobp\TOTALHEIGHT{-\ht#1-\dp#1}%
        \adjcalc@settobp\HEIGHT{-\ht#1}%
        \adjcalc@settobp\DEPTH{\dp#1}%
        \adjcalc@settobp\WIDTH{\wd#1}%
        \adjcalc@settobp\RADIUSTL{#2}%
        \adjcalc@settobp\RADIUSTR{#3}%
        \adjcalc@settobp\RADIUSBR{#5}%
        \adjcalc@settobp\RADIUSBL{#4}%
        \adjcalc@settobp\RADIUSTLmHEIGHT{#2-\ht#1}%
        \adjcalc@settobp\RADIUSTRmHEIGHT{#3-\ht#1}%
        \adjcalc@settobp\WIDTHmRADIUSTR{\wd#1-#3}%
        \adjcalc@settobp\DEPTHmRADIUSBR{\dp#1-#5}%
        \adjcalc@settobp\WIDTHmRADIUSBR{\wd#1-#5}%
        \adjcalc@settobp\DEPTHmRADIUSBL{\dp#1-#4}%
        \adjcalc@settobp\LINEWIDTH{\fboxrule}%
        \edef\@tempa{#6}%
        \ifx\@empty\@tempa\else
            \@clipcornersofbox{#1}{#2}{#3}{#4}{#5}%
        \fi
        %
        \hbox to 0pt{\copy#1\hss}%
        \hbox to 0pt{%
            \color@setgroup
            \adjbox@rndframe@color
            \special{%
                ps:
                /mtrxc matrix currentmatrix def
                currentpoint gsave
                translate
                Resolution 72 div VResolution 72 div
                scale
                newpath
                %0 \DEPTH neg translate
                %0 \DEPTH \WIDTH \TOTALHEIGHT rectclip
                0 \RADIUSTLmHEIGHT moveto
                \RADIUSTL \RADIUSTLmHEIGHT \RADIUSTL 180 -90 arc
                \WIDTHmRADIUSTR \HEIGHT lineto
                \WIDTHmRADIUSTR \RADIUSTRmHEIGHT \RADIUSTR -90 0 arc
                \WIDTH \DEPTHmRADIUSBR lineto
                \WIDTHmRADIUSBR \DEPTHmRADIUSBR \RADIUSBR 0 90 arc
                \RADIUSBL \DEPTH lineto
                \RADIUSBL \DEPTHmRADIUSBL \RADIUSBL -270 -180 arc
                closepath
                \LINEWIDTH setlinewidth
                stroke
                newpath
                mtrxc setmatrix
                grestore
            }%
            \color@endgroup
        }%
        \hskip \wd#1%
    }%
    \adjsetlength\@tempdima{.5\fboxrule}%
    \@marginbox#1\@tempdima\@tempdima\@tempdima\@tempdima%
}
\endinput
%%
%% End of file `tc-dvips.def'.