1a96d7823Smrg/*
2a96d7823Smrg
3a96d7823SmrgCopyright 1990, 1994, 1998  The Open Group
4a96d7823Smrg
5a96d7823SmrgPermission to use, copy, modify, distribute, and sell this software and its
6a96d7823Smrgdocumentation for any purpose is hereby granted without fee, provided that
7a96d7823Smrgthe above copyright notice appear in all copies and that both that
8a96d7823Smrgcopyright notice and this permission notice appear in supporting
9a96d7823Smrgdocumentation.
10a96d7823Smrg
11a96d7823SmrgThe above copyright notice and this permission notice shall be included
12a96d7823Smrgin all copies or substantial portions of the Software.
13a96d7823Smrg
14a96d7823SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15a96d7823SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16a96d7823SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17a96d7823SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18a96d7823SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19a96d7823SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20a96d7823SmrgOTHER DEALINGS IN THE SOFTWARE.
21a96d7823Smrg
22a96d7823SmrgExcept as contained in this notice, the name of The Open Group shall
23a96d7823Smrgnot be used in advertising or otherwise to promote the sale, use or
24a96d7823Smrgother dealings in this Software without prior written authorization
25a96d7823Smrgfrom The Open Group.
26a96d7823Smrg
27a96d7823Smrg*/
28a96d7823Smrg
29a96d7823Smrg/*
30a96d7823Smrg * Author:  Keith Packard, MIT X Consortium
31a96d7823Smrg */
32a96d7823Smrg
33a96d7823Smrg#ifndef _FONTXLFD_H_
34a96d7823Smrg#define _FONTXLFD_H_
35a96d7823Smrg
36a96d7823Smrg#include <X11/fonts/FSproto.h>
37a96d7823Smrg
38a96d7823Smrg/* Constants for values_supplied bitmap */
39a96d7823Smrg
40a96d7823Smrg#define SIZE_SPECIFY_MASK		0xf
41a96d7823Smrg
42a96d7823Smrg#define PIXELSIZE_MASK			0x3
43a96d7823Smrg#define PIXELSIZE_UNDEFINED		0
44a96d7823Smrg#define PIXELSIZE_SCALAR		0x1
45a96d7823Smrg#define PIXELSIZE_ARRAY			0x2
46a96d7823Smrg#define PIXELSIZE_SCALAR_NORMALIZED	0x3	/* Adjusted for resolution */
47a96d7823Smrg
48a96d7823Smrg#define POINTSIZE_MASK			0xc
49a96d7823Smrg#define POINTSIZE_UNDEFINED		0
50a96d7823Smrg#define POINTSIZE_SCALAR		0x4
51a96d7823Smrg#define POINTSIZE_ARRAY			0x8
52a96d7823Smrg
53a96d7823Smrg#define PIXELSIZE_WILDCARD		0x10
54a96d7823Smrg#define POINTSIZE_WILDCARD		0x20
55a96d7823Smrg
56a96d7823Smrg#define ENHANCEMENT_SPECIFY_MASK	0x40
57a96d7823Smrg
58a96d7823Smrg#define CHARSUBSET_SPECIFIED		0x40
59a96d7823Smrg
60a96d7823Smrg#define EPS		1.0e-20
61a96d7823Smrg#define XLFD_NDIGITS	3		/* Round numbers in pixel and
62a96d7823Smrg					   point arrays to this many
63a96d7823Smrg					   digits for repeatability */
64a96d7823Smrg
65a96d7823Smrgtypedef struct _FontScalable {
66a96d7823Smrg    int		values_supplied;	/* Bitmap identifying what advanced
67a96d7823Smrg					   capabilities or enhancements
68a96d7823Smrg					   were specified in the font name */
69a96d7823Smrg    double	pixel_matrix[4];
70a96d7823Smrg    double	point_matrix[4];
71a96d7823Smrg
72a96d7823Smrg    /* Pixel and point fields are deprecated in favor of the
73a96d7823Smrg       transformation matrices.  They are provided and filled in for the
74a96d7823Smrg       benefit of rasterizers that do not handle the matrices.  */
75a96d7823Smrg
76a96d7823Smrg    int		pixel,
77a96d7823Smrg		point;
78a96d7823Smrg
79a96d7823Smrg    int         x,
80a96d7823Smrg                y,
81a96d7823Smrg                width;
82a96d7823Smrg    char	*xlfdName;
83a96d7823Smrg    int		nranges;
84a96d7823Smrg    fsRange	*ranges;
85a96d7823Smrg}           FontScalableRec, *FontScalablePtr;
86a96d7823Smrg
87a96d7823Smrg
88a96d7823Smrgextern double xlfd_round_double ( double x );
89a96d7823Smrgextern Bool FontParseXLFDName ( char *fname, FontScalablePtr vals, int subst );
90a96d7823Smrgextern fsRange *FontParseRanges ( char *name, int *nranges );
91a96d7823Smrg
92a96d7823Smrg#define FONT_XLFD_REPLACE_NONE	0
93a96d7823Smrg#define FONT_XLFD_REPLACE_STAR	1
94a96d7823Smrg#define FONT_XLFD_REPLACE_ZERO	2
95a96d7823Smrg#define FONT_XLFD_REPLACE_VALUE	3
96a96d7823Smrg
97a96d7823Smrg#endif				/* _FONTXLFD_H_ */
98