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