1 | /* $Id: stroke.h,v 1.2 2000-02-09 08:46:21 jeroen Exp $ */
|
---|
2 | /* $XConsortium: wfont.h,v 5.1 91/02/16 09:46:37 rws Exp $ */
|
---|
3 |
|
---|
4 | /*****************************************************************
|
---|
5 | Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
|
---|
6 |
|
---|
7 | All Rights Reserved
|
---|
8 |
|
---|
9 | Permission to use, copy, modify, and distribute this software and its
|
---|
10 | documentation for any purpose and without fee is hereby granted,
|
---|
11 | provided that the above copyright notice appear in all copies and that
|
---|
12 | both that copyright notice and this permission notice appear in
|
---|
13 | supporting documentation, and that the names of Sun Microsystems,
|
---|
14 | the X Consortium, and MIT not be used in advertising or publicity
|
---|
15 | pertaining to distribution of the software without specific, written
|
---|
16 | prior permission.
|
---|
17 |
|
---|
18 | SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
19 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
|
---|
20 | SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
---|
21 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
22 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
23 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
24 | SOFTWARE.
|
---|
25 |
|
---|
26 | ******************************************************************/
|
---|
27 |
|
---|
28 | #ifndef WFONT_INCLUDED
|
---|
29 | #define WFONT_INCLUDED
|
---|
30 |
|
---|
31 | #define WFONT_MAGIC 0x813
|
---|
32 | #define WFONT_MAGIC_PLUS 0x715
|
---|
33 | #define WFONT_MAGIC_PEX 0x70686e74
|
---|
34 | #define START_PROPS 0x100
|
---|
35 | #define START_DISPATCH(_num_props) (START_PROPS + 160 * _num_props)
|
---|
36 | #define START_PATH(_num_ch_, _num_props) (START_DISPATCH(_num_props) + sizeof(Dispatch) * _num_ch_)
|
---|
37 | #define NUM_DISPATCH 128
|
---|
38 |
|
---|
39 | typedef struct {
|
---|
40 | unsigned short x;
|
---|
41 | unsigned short y;
|
---|
42 | } Path_point2dpx;
|
---|
43 |
|
---|
44 | typedef struct {
|
---|
45 | float x;
|
---|
46 | float y;
|
---|
47 | } Path_point2df;
|
---|
48 |
|
---|
49 | typedef struct {
|
---|
50 | int x;
|
---|
51 | int y;
|
---|
52 | int z;
|
---|
53 | } Path_point3di;
|
---|
54 |
|
---|
55 | typedef struct {
|
---|
56 | float x;
|
---|
57 | float y;
|
---|
58 | float z;
|
---|
59 | } Path_point3df;
|
---|
60 |
|
---|
61 | typedef struct {
|
---|
62 | float x;
|
---|
63 | float y;
|
---|
64 | float z;
|
---|
65 | float w;
|
---|
66 | } Path_point4df;
|
---|
67 |
|
---|
68 | typedef union {
|
---|
69 | Path_point2dpx *pt2dpx;
|
---|
70 | Path_point2df *pt2df;
|
---|
71 | Path_point3di *pt3di;
|
---|
72 | Path_point3df *pt3df;
|
---|
73 | Path_point4df *pt4df;
|
---|
74 | } Path_pt_ptr;
|
---|
75 |
|
---|
76 | typedef enum {
|
---|
77 | PATH_2DF,
|
---|
78 | PATH_2DPX,
|
---|
79 | PATH_3DF,
|
---|
80 | PATH_3DI,
|
---|
81 | PATH_4DF
|
---|
82 | } Path_type;
|
---|
83 |
|
---|
84 | typedef struct {
|
---|
85 | int n_pts; /* number of points in the subpath */
|
---|
86 | Path_pt_ptr pts; /* pointer to them */
|
---|
87 | int closed; /* true if the subpath is closed */
|
---|
88 | int dcmp_flag; /* flag for pgon dcmp, pgon type
|
---|
89 | * and dcmped triangle type */
|
---|
90 | } Path_subpath;
|
---|
91 |
|
---|
92 | typedef struct {
|
---|
93 | Path_type type; /* type of vertices in this path */
|
---|
94 | int n_subpaths; /* number of subpaths */
|
---|
95 | int n_vertices; /* total number of vertices */
|
---|
96 | Path_subpath *subpaths; /* array of subpaths */
|
---|
97 | } Path;
|
---|
98 |
|
---|
99 | typedef Path *Path_handle;
|
---|
100 |
|
---|
101 | typedef struct {
|
---|
102 | char propname[80]; /* font property name */
|
---|
103 | char propvalue[80]; /* font property value */
|
---|
104 | } Property;
|
---|
105 |
|
---|
106 | typedef struct {
|
---|
107 | int magic; /* magic number */
|
---|
108 | char name[80]; /* name of this font */
|
---|
109 | float top, /* extreme values */
|
---|
110 | bottom, max_width;
|
---|
111 | int num_ch; /* no. of fonts in the set */
|
---|
112 | int num_props; /* no. of font properties */
|
---|
113 | Property *properties; /* array of properties */
|
---|
114 | } Font_header;
|
---|
115 |
|
---|
116 | typedef struct {
|
---|
117 | float center, /* center of the character */
|
---|
118 | right; /* right edge */
|
---|
119 | long offset; /* offset in the file of the character
|
---|
120 | * * description */
|
---|
121 | } Dispatch;
|
---|
122 |
|
---|
123 | typedef struct {
|
---|
124 | float center, right;
|
---|
125 | Path strokes;
|
---|
126 | } Ch_font;
|
---|
127 |
|
---|
128 | typedef struct {
|
---|
129 | char name[80];
|
---|
130 | float top, bottom, max_width;
|
---|
131 | int num_ch; /* # characters in the font */
|
---|
132 | Ch_font **ch_data;
|
---|
133 | } Phg_font;
|
---|
134 |
|
---|
135 | #endif /*WFONT_INCLUDED */
|
---|