summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/pgfsys-dvipdfm.def
blob: 939595089ad41768c80a3ff6526439d0a137c63d (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
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS{pgfsys-dvipdfm.def}

% Driver commands for dvipdfm

%
% Load common pdf and pdf in dvi commands:
%
\input pgfsys-common-pdf.def
\input pgfsys-common-pdf-via-dvi.def

%
% dvipdfm-specific stuff:
%

\def\pgfsys@hbox#1{%
  \pgfsys@begin@idscope%
  \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
  \special{pdf: content -1 0 0 -1 0 0 cm 3 Tr q}% translate to
                                % original coordinate system and do
                                % not show anything
  {\hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}}% enforce font change
  \pgfsys@invoke{0 Tr}%
  \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
    \wd#1=0pt%
    \ht#1=0pt%
    \dp#1=0pt%
    \box#1
  \pgfsys@invoke{n Q Q}%
  \pgfsys@end@idscope%
}
\def\pgfsys@hboxsynced#1{%
  {%
    \pgfsys@begin@idscope%
    \pgfsys@beginscope%
    \setbox\pgf@hbox=\hbox{%
      \hskip\pgf@pt@x%
      \raise\pgf@pt@y\hbox{%
        \pgf@pt@x=0pt%
        \pgf@pt@y=0pt%
        \special{pdf: content q}%
        \pgflowlevelsynccm%
        \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
        \special{pdf: content -1 0 0 -1 0 0 cm q}% translate to original coordinate system
        \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
        \wd#1=0pt%
        \ht#1=0pt%
        \dp#1=0pt%
        \box#1%
        \pgfsys@invoke{n Q Q Q}%
      }%
      \hss%
    }%
    \wd\pgf@hbox=0pt%
    \ht\pgf@hbox=0pt%
    \dp\pgf@hbox=0pt%
    \pgfsys@hbox\pgf@hbox%
    \pgfsys@endscope%
    \pgfsys@end@idscope%
  }%
}

\def\pgfsys@beginpicture{%
  \pgfsys@invoke{3 Tr}%
  \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
  \pgfsys@invoke{0 Tr}%
  \special{pdf: content q}}
\def\pgfsys@endpicture{%
  \pgfsys@invoke{n Q}%
}

\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}} % ugly, but necessary...

\def\pgfsys@papersize#1#2{%
%  \expandafter\gdef\expandafter\pgfsys@atbegindocument%
%  \expandafter{\pgfsys@atbegindocument
    \special{papersize=#1,#2}%
%  }
}

\def\pgfsys@prepare@papersize#1#2{%
  \expandafter\gdef\expandafter\pgfsys@atbegindocument%
  \expandafter{\pgfsys@atbegindocument
    \special{papersize=#1,#2}%
  }
}

%
% Position tracking (needs pdftex >= 1.40.0-alpha-20051205 in dvi mode)
%
\ifx\pdftexversion\@undefined
\else
  \ifnum\pdftexversion>139
    \pgf@sys@pdf@dvi@tracker
  \fi
\fi

\endinput

%%% Local Variables:
%%% mode: latex
%%% End: