summaryrefslogtreecommitdiffstats
path: root/src/glut/glx/stroke.h
blob: 602b2fae9f7ea54d442b4de1ee7ac7569a904d3f (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

/*****************************************************************
Copyright (c) 1989,1990, 1991 by Sun Microsystems, Inc. and the X Consortium.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Sun Microsystems,
the X Consortium, and MIT not be used in advertising or publicity 
pertaining to distribution of the software without specific, written 
prior permission.  

SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

#ifndef WFONT_INCLUDED
#define WFONT_INCLUDED

#define WFONT_MAGIC	0x813
#define WFONT_MAGIC_PLUS 0x715
#define WFONT_MAGIC_PEX 0x70686e74
#define START_PROPS 0x100
#define START_DISPATCH(_num_props)  (START_PROPS + 160 * _num_props)
#define START_PATH(_num_ch_, _num_props)  (START_DISPATCH(_num_props) + sizeof(Dispatch) * _num_ch_)
#define NUM_DISPATCH	128

typedef struct {
  unsigned short x;
  unsigned short y;
} Path_point2dpx;

typedef struct {
  float x;
  float y;
} Path_point2df;

typedef struct {
  int x;
  int y;
  int z;
} Path_point3di;

typedef struct {
  float x;
  float y;
  float z;
} Path_point3df;

typedef struct {
  float x;
  float y;
  float z;
  float w;
} Path_point4df;

typedef union {
  Path_point2dpx *pt2dpx;
  Path_point2df *pt2df;
  Path_point3di *pt3di;
  Path_point3df *pt3df;
  Path_point4df *pt4df;
} Path_pt_ptr;

typedef enum {
  PATH_2DF,
  PATH_2DPX,
  PATH_3DF,
  PATH_3DI,
  PATH_4DF
} Path_type;

typedef struct {
  int n_pts;                    /* number of points in the subpath */
  Path_pt_ptr pts;              /* pointer to them */
  int closed;                   /* true if the subpath is closed */
  int dcmp_flag;                /* flag for pgon dcmp, pgon type 
                                 * and dcmped triangle type */
} Path_subpath;

typedef struct {
  Path_type type;               /* type of vertices in this path */
  int n_subpaths;               /* number of subpaths */
  int n_vertices;               /* total number of vertices */
  Path_subpath *subpaths;       /* array of subpaths */
} Path;

typedef Path *Path_handle;

typedef struct {
  char propname[80];            /* font property name */
  char propvalue[80];           /* font property value */
} Property;

typedef struct {
  int magic;                    /* magic number */
  char name[80];                /* name of this font */
  float top,                    /* extreme values */
    bottom, max_width;
  int num_ch;                   /* no. of fonts in the set */
  int num_props;                /* no. of font properties */
  Property *properties;         /* array of properties */
} Font_header;

typedef struct {
  float center,                 /* center of the character */
    right;                      /* right edge */
  long offset;                  /* offset in the file of the character
                                 * * description */
} Dispatch;

typedef struct {
  float center, right;
  Path strokes;
} Ch_font;

typedef struct {
  char name[80];
  float top, bottom, max_width;
  int num_ch;                   /* # characters in the font */
  Ch_font **ch_data;
} Phg_font;

#endif /*WFONT_INCLUDED */