bdfint.h revision a96d7823
1a96d7823Smrg/*
2a96d7823Smrg
3a96d7823SmrgCopyright 1990, 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#ifndef BDFINT_H
30a96d7823Smrg#define BDFINT_H
31a96d7823Smrg
32a96d7823Smrg#define bdfIsPrefix(buf,str)	(!strncmp((char *)buf,str,strlen(str)))
33a96d7823Smrg#define	bdfStrEqual(s1,s2)	(!strcmp(s1,s2))
34a96d7823Smrg
35a96d7823Smrg#define	BDF_GENPROPS	6
36a96d7823Smrg#define NullProperty	((FontPropPtr)0)
37a96d7823Smrg
38a96d7823Smrg/*
39a96d7823Smrg * This structure holds some properties we need to generate if they aren't
40a96d7823Smrg * specified in the BDF file and some other values read from the file
41a96d7823Smrg * that we'll need to calculate them.  We need to keep track of whether
42a96d7823Smrg * or not we've read them.
43a96d7823Smrg */
44a96d7823Smrgtypedef struct BDFSTAT {
45a96d7823Smrg    int         linenum;
46a96d7823Smrg    char       *fileName;
47a96d7823Smrg    char        fontName[MAXFONTNAMELEN];
48a96d7823Smrg    float       pointSize;
49a96d7823Smrg    int         resolution_x;
50a96d7823Smrg    int         resolution_y;
51a96d7823Smrg    int         digitCount;
52a96d7823Smrg    int         digitWidths;
53a96d7823Smrg    int         exHeight;
54a96d7823Smrg
55a96d7823Smrg    FontPropPtr fontProp;
56a96d7823Smrg    FontPropPtr pointSizeProp;
57a96d7823Smrg    FontPropPtr resolutionXProp;
58a96d7823Smrg    FontPropPtr resolutionYProp;
59a96d7823Smrg    FontPropPtr resolutionProp;
60a96d7823Smrg    FontPropPtr xHeightProp;
61a96d7823Smrg    FontPropPtr weightProp;
62a96d7823Smrg    FontPropPtr quadWidthProp;
63a96d7823Smrg    BOOL        haveFontAscent;
64a96d7823Smrg    BOOL        haveFontDescent;
65a96d7823Smrg    BOOL        haveDefaultCh;
66a96d7823Smrg}           bdfFileState;
67a96d7823Smrg
68a96d7823Smrgextern void bdfError ( const char * message, ... ) _X_ATTRIBUTE_PRINTF(1, 2);
69a96d7823Smrgextern void bdfWarning ( const char *message, ... ) _X_ATTRIBUTE_PRINTF(1, 2);
70a96d7823Smrgextern unsigned char * bdfGetLine ( FontFilePtr file, unsigned char *buf,
71a96d7823Smrg				    int len );
72a96d7823Smrgextern Atom bdfForceMakeAtom ( const char *str, int *size );
73a96d7823Smrgextern Atom bdfGetPropertyValue ( char *s );
74a96d7823Smrgextern int bdfIsInteger ( char *str );
75a96d7823Smrgextern unsigned char bdfHexByte ( unsigned char *s );
76a96d7823Smrgextern Bool bdfSpecialProperty ( FontPtr pFont, FontPropPtr prop,
77a96d7823Smrg				 char isString, bdfFileState *bdfState );
78a96d7823Smrgextern int bdfReadFont( FontPtr pFont, FontFilePtr file,
79a96d7823Smrg			int bit, int byte, int glyph, int scan );
80a96d7823Smrgextern int bdfReadFontInfo( FontInfoPtr pFontInfo, FontFilePtr file );
81a96d7823Smrg
82a96d7823Smrgextern void FontCharInkMetrics ( FontPtr pFont, CharInfoPtr pCI,
83a96d7823Smrg				 xCharInfo *pInk );
84a96d7823Smrgextern void FontCharReshape ( FontPtr pFont, CharInfoPtr pSrc,
85a96d7823Smrg			      CharInfoPtr pDst );
86a96d7823Smrg
87a96d7823Smrg#endif				/* BDFINT_H */
88