OSDN Git Service

update.
[putex/putex.git] / src / dvipdfmx-pu / src / dvicodes.h
1 /*  
2     
3     This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
4
5     Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata,
6     the dvipdfmx project team.
7     
8     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
9
10     This program is free software; you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14     
15     This program is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19     
20     You should have received a copy of the GNU General Public License
21     along with this program; if not, write to the Free Software
22     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 */
24
25 #ifndef _DVICODES_H_
26 #define _DVICODES_H_
27
28 /* DVI op codes */
29 #define SET_CHAR_0 0
30 #define SET_CHAR_1 1
31 /* etc. */
32 #define SET_CHAR_127 127
33 #define SET1   128 /* Typesets its single operand between 128 and 255 */
34 #define SET2   129 /* Typesets its single two byte unsigned operand */
35 #define SET3   130 /* Typesets its single three byte unsigned operand */
36 #define SET4   131 /* Typesets its single four byte unsigned operand */
37 #define SET_RULE 132 /* Sets a rule of height param1(four bytes) and width param2(four bytes) */
38                      /* These are *signed*.  Nothing typeset for nonpositive values */
39                      /* However, negative value *do* change current point */
40 #define PUT1   133 /* Like SET1, but point doesn't change */
41 #define PUT2   134 /* Like SET2 */
42 #define PUT3   135 /* Like SET3 */
43 #define PUT4   136 /* Like SET4 */
44 #define PUT_RULE 137 /* Like SET_RULE */
45 #define NOP    138 
46 #define BOP    139 /* Followed by 10 four byte count registers (signed?).  Last parameter points to */
47                    /* previous BOP (backward linked, first BOP has -1).  BOP clears stack and resets current point. */
48 #define EOP    140
49 #define PUSH   141 /* Pushes h,v,w,x,y,z */
50 #define POP    142 /* Opposite of push*/
51 #define RIGHT1 143 /* Move right by one byte signed operand */
52 #define RIGHT2 144 /* Move right by two byte signed operand */
53 #define RIGHT3 145 /* Move right by three byte signed operand */
54 #define RIGHT4 146 /* Move right by four byte signed operand */
55 #define W0     147 /* Move right w */
56 #define W1     148 /* w <- single byte signed operand.  Move right by same amount */
57 #define W2     149 /* Same as W1 with two byte signed operand */
58 #define W3     150 /* Three byte signed operand */
59 #define W4     151 /* Four byte signed operand */
60 #define X0     152 /* Move right x */
61 #define X1     153 /* Like W1 */
62 #define X2     154 /* Like W2 */
63 #define X3     155 /* Like W3 */
64 #define X4     156 /* Like W4 */
65 #define DOWN1  157 /* Move down by one byte signed operand */
66 #define DOWN2  158 /* Two byte signed operand */
67 #define DOWN3  159 /* Three byte signed operand */
68 #define DOWN4  160 /* Four byte signed operand */
69 #define Y0     161 /* Move down by y */
70 #define Y1     162 /* Move down by one byte signed operand, which replaces Y */
71 #define Y2     163 /* Two byte signed operand */
72 #define Y3     164 /* Three byte signed operand */
73 #define Y4     165 /* Four byte signed operand */
74 #define Z0     166 /* Like Y0, but use z */
75 #define Z1     167 /* Like Y1 */
76 #define Z2     168 /* Like Y2 */
77 #define Z3     169 /* Like Y3 */
78 #define Z4     170 /* Like Y4 */
79 #define FNT_NUM_0 171 /* Switch to font 0 */
80 #define FNT_NUM_1 172 /* Switch to font 1 */
81 /* etc. */
82 #define FNT_NUM_63 234 /* Switch to font 63 */
83 #define FNT1       235 /* Switch to font described by single byte unsigned operand */
84 #define FNT2       236 /* Switch to font described by two byte unsigned operand */
85 #define FNT3       237 /* Three byte font descriptor */
86 #define FNT4       238 /* Four byte operator (Knuth says signed, but what would be the point? */
87 #define XXX1       239 /* Special.  Operand is one byte length.  Special follows immediately */
88 #define XXX2       240 /* Two byte operand */
89 #define XXX3       241 /* Three byte operand */ 
90 #define XXX4       242 /* Four byte operand (Knuth says TeX uses only XXX1 and XXX4 */
91 #define FNT_DEF1  243 /* One byte font number, four byte checksum, four byte magnified size (DVI units),
92                           four byte designed size, single byte directory length, single byte name length,
93                           followed by complete name (area+name) */
94 #define FNT_DEF2  244 /* Same for two byte font number */
95 #define FNT_DEF3  245 /* Same for three byte font number */
96 #define FNT_DEF4  246 /* Four byte font number (Knuth says signed) */
97 #define PRE        247 /* Preamble:
98                               one byte DVI version (should be 2)
99                               four byte unsigned numerator
100                               four byte unsigned denominator -- one DVI unit = den/num*10^(-7) m
101                               four byte magnification (multiplied by 1000)
102                               one byte unsigned comment length followed by comment. */
103 #define DVI_ID             2    /* ID Byte for current DVI file */
104 #define DVIV_ID             3    /* with Ascii pTeX VW mode extension */
105 #define OLD_CDI_ID      2       /* old CDI file ID Byte value */
106 #define CDI_ID          100     /* new CDI file ID Byte value */
107 #ifdef XETEX
108 #define XDVI_ID    5    /* XeTeX ".xdv" output that uses XDV opcodes below */
109 #endif
110 #define POST       248  /* Postamble- -- similar to preamble
111                               four byte pointer to final bop
112                               four byte numerator
113                               four byte denominator
114                               four byte mag
115                               four byte maximum height (signed?)
116                               four byte maximum width 
117                               two byte max stack depth required to process file
118                               two byte number of pages */
119 #define POST_POST  249  /* End of postamble
120                               four byte pointer to POST command
121                               Version byte (same as preamble)
122                               Padded by four or more 223's to the end of the file. */
123 #define PADDING    223
124 #define PTEXDIR 255 /* Ascii pTeX DIR command */
125
126 #define CFNT 250          /* k[2] */
127 #define CFNT_DEF 251  /* k[2] a[1] n[a] c[1] size[4] dsize[4] weight[2] style[1]
128                          width[4] height[4] depth[4]
129                          fw_width[4] fw_height[4] fw_depth[4] */
130
131 #ifdef XETEX
132 #define XDV_PIC_FILE        251 /* include graphic or PDF file */
133 #define XDV_NATIVE_FONT_DEF 252 /* fontdef for native platform font */
134 #define XDV_GLYPH_ARRAY     253 /* string of glyph IDs with X and Y positions */
135 #define XDV_GLYPH_STRING    254 /* string of glyph IDs with X-positions only */
136 #endif
137
138 #endif /* _DVICODES_H_ */