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