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