blob: 2631f399ed90aa7f262c74c23ff59b73b910472d (
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
|
%D \module
%D [ file=spec-tr,
%D version=1996.01.25,
%D title=\CONTEXT\ Special Macros,
%D subtitle=Thomas Rokicki's \DVIPS,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
%D Especially the rotation proved to be incompatible with
%D the default \POSTSCRIPT\ special driver. Many thanks to
%D Gilbert van den Dobbelsteen for testing and hacking the
%D \DVIPS\ source and pinpointing the problem.
%D \macros
%D {doinsertfile}
%D
%D We overrule the figure||insertion special. Things should
%D be more accurate, but maybe someday \unknown
\startspecials[rokicki]
\def\@@insertpostscriptliteral {ps: }
\def\@@insertpostscriptretain {" }
%\definefileinsertion{tr}{eps}#1#2#3#4#5#6#7#8#9%
% {\PointsToBigPoints{#5}\width
% \PointsToBigPoints{#6}\height
% \special
% {psfile=#1
% hscale=#3\space
% vscale=#4\space
% hoffset=\width\space
% voffset=\height}}
%D Ugly but useful:
\definefileinsertion{tr}{eps}#1#2#3#4#5#6#7#8#9%
{\PointsToWholeBigPoints{#7}\width
\PointsToWholeBigPoints{#8}\height
\special
{PSfile="#1"\space
llx=\EPSllx\space
lly=\EPSlly\space
urx=\EPSurx\space
ury=\EPSury\space
rwi=\width0\space
rhi=\height0}}
\definefileinsertion{tr}{mps}#1#2#3#4#5#6#7#8#9%
{\hbox
{%\includeMPfonts{#1}% dvips know mp
\convertMPcolors{#1}%
\dofileinsertion{tr}{eps}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}
\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
{\bgroup
\dodoinsertfile{tr}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
\egroup}
%D Some MP stuff:
\definespecial\doinsertMPfile#1%
{\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}}
%D \macros
%D {dostartrotation}
%D
%D Because \DVIPS\ uses a reverse rotation scheme, we have
%D to add an extra \type{neg} to the default \POSTSCRIPT\
%D rotation definition:
\definespecial\dostartrotation#1% straight from the YandY manual / 1st neg added
{\special
{\@@insertpostscriptliteral
gsave currentpoint currentpoint translate
\number#1\space\space neg rotate neg exch neg exch translate}}
\definespecial\dostoprotation
{\special
{\@@insertpostscriptliteral
currentfont currentpoint grestore moveto setfont}}
%D Drawing ovals in \DVIPS\ is complicated by the fact that
%D the colors get reset. Therefore we need a more literal
%D approach and therefore scale to local units. By redefining
%D the retain constant into a macro, we can use the already
%D present \POSTSCRIPT\ definition (see \type{spec-ps}).
\definespecial\doovalbox#1#2#3#4#5#6#7%
{\bgroup
\edef\@@insertpostscriptretain gsave%
{\@@insertpostscriptliteral
gsave
Resolution 72 div
VResolution 72 div neg scale currentpoint translate}%
\dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
\egroup}
%D \macros
%D {dosetuppaper}
%D
%D Relatively new:
\definespecial\dosetuppaper#1#2#3%
{\begingroup
\!!dimena#2%
\!!dimenb#3%
\special{papersize=\the\!!dimena,\the\!!dimenb}%
\endgroup}
\stopspecials
\endinput
|