summaryrefslogtreecommitdiff
path: root/tex/context/base/spec-tr.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/spec-tr.tex')
-rw-r--r--tex/context/base/spec-tr.tex125
1 files changed, 81 insertions, 44 deletions
diff --git a/tex/context/base/spec-tr.tex b/tex/context/base/spec-tr.tex
index f449e1211..b27951d6f 100644
--- a/tex/context/base/spec-tr.tex
+++ b/tex/context/base/spec-tr.tex
@@ -1,44 +1,81 @@
-%D \module
-%D [ file=spec-tr,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Thomas Rokicky'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. Non||commercial use is
-%C granted.
-
-%D \macros
-%D {doinsertfile}
-%D {}
-%D
-%D We overrule the figure||insertion special. Things should
-%D be more accurate, but maybe someday \onbekend
-
-\startspecials[rokicky] % [postscript]
-
-\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {" }
-
-\def\dotrinserteps#1#2#3#4#5#6#7#8%
- {\ScaledPointsToBigPoints{#4}\width
- \ScaledPointsToBigPoints{#5}\height
- \special
- {psfile=#1
- hscale=#2\space
- vscale=#3\space
- hoffset=\width \space
- voffset=\height}}
-
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \dodoinsertfile{tr}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
- \egroup}
-
-\stopspecials
-
-\endinput
- \ No newline at end of file
+%D \module
+%D [ file=spec-tr,
+%D version=1996.01.25,
+%D title=\CONTEXT\ Special Macros,
+%D subtitle=Thomas Rokicky'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. Non||commercial use is
+%C granted.
+
+%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 \onbekend
+
+\startspecials[rokicky] % [postscript]
+
+\def\@@insertpostscriptliteral {ps: }
+\def\@@insertpostscriptretain {" }
+
+\def\dotrinserteps#1#2#3#4#5#6#7#8%
+ {\ScaledPointsToBigPoints{#4}\width
+ \ScaledPointsToBigPoints{#5}\height
+ \special
+ {psfile=#1
+ hscale=#2\space
+ vscale=#3\space
+ hoffset=\width \space
+ voffset=\height}}
+
+\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 \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
+ #1 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}
+
+\stopspecials
+
+\endinput