123a0898aSmrg/*
223a0898aSmrg
323a0898aSmrgCopyright 1990, 1998  The Open Group
423a0898aSmrg
523a0898aSmrgPermission to use, copy, modify, distribute, and sell this software and its
623a0898aSmrgdocumentation for any purpose is hereby granted without fee, provided that
723a0898aSmrgthe above copyright notice appear in all copies and that both that
823a0898aSmrgcopyright notice and this permission notice appear in supporting
923a0898aSmrgdocumentation.
1023a0898aSmrg
1123a0898aSmrgThe above copyright notice and this permission notice shall be included
1223a0898aSmrgin all copies or substantial portions of the Software.
1323a0898aSmrg
1423a0898aSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1523a0898aSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1623a0898aSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1723a0898aSmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1823a0898aSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1923a0898aSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2023a0898aSmrgOTHER DEALINGS IN THE SOFTWARE.
2123a0898aSmrg
2223a0898aSmrgExcept as contained in this notice, the name of The Open Group shall
2323a0898aSmrgnot be used in advertising or otherwise to promote the sale, use or
2423a0898aSmrgother dealings in this Software without prior written authorization
2523a0898aSmrgfrom The Open Group.
2623a0898aSmrg
2723a0898aSmrg*/
2823a0898aSmrg
2923a0898aSmrg#ifndef BDFINT_H
3023a0898aSmrg#define BDFINT_H
3123a0898aSmrg
3223a0898aSmrg#define bdfIsPrefix(buf,str)	(!strncmp((char *)buf,str,strlen(str)))
3323a0898aSmrg#define	bdfStrEqual(s1,s2)	(!strcmp(s1,s2))
3423a0898aSmrg
3523a0898aSmrg#define	BDF_GENPROPS	6
3623a0898aSmrg#define NullProperty	((FontPropPtr)0)
3723a0898aSmrg
3823a0898aSmrg/*
3923a0898aSmrg * This structure holds some properties we need to generate if they aren't
4023a0898aSmrg * specified in the BDF file and some other values read from the file
4123a0898aSmrg * that we'll need to calculate them.  We need to keep track of whether
4223a0898aSmrg * or not we've read them.
4323a0898aSmrg */
4423a0898aSmrgtypedef struct BDFSTAT {
4523a0898aSmrg    int         linenum;
4623a0898aSmrg    char       *fileName;
4723a0898aSmrg    char        fontName[MAXFONTNAMELEN];
4823a0898aSmrg    float       pointSize;
4923a0898aSmrg    int         resolution_x;
5023a0898aSmrg    int         resolution_y;
5123a0898aSmrg    int         digitCount;
5223a0898aSmrg    int         digitWidths;
5323a0898aSmrg    int         exHeight;
5423a0898aSmrg
5523a0898aSmrg    FontPropPtr fontProp;
5623a0898aSmrg    FontPropPtr pointSizeProp;
5723a0898aSmrg    FontPropPtr resolutionXProp;
5823a0898aSmrg    FontPropPtr resolutionYProp;
5923a0898aSmrg    FontPropPtr resolutionProp;
6023a0898aSmrg    FontPropPtr xHeightProp;
6123a0898aSmrg    FontPropPtr weightProp;
6223a0898aSmrg    FontPropPtr quadWidthProp;
6323a0898aSmrg    BOOL        haveFontAscent;
6423a0898aSmrg    BOOL        haveFontDescent;
6523a0898aSmrg    BOOL        haveDefaultCh;
6623a0898aSmrg}           bdfFileState;
6723a0898aSmrg
6841c30155Smrgextern void bdfError ( const char * message, ... ) _X_ATTRIBUTE_PRINTF(1, 2);
6941c30155Smrgextern void bdfWarning ( const char *message, ... ) _X_ATTRIBUTE_PRINTF(1, 2);
7041c30155Smrgextern unsigned char * bdfGetLine ( FontFilePtr file, unsigned char *buf,
7123a0898aSmrg				    int len );
7241c30155Smrgextern Atom bdfForceMakeAtom ( const char *str, int *size );
7323a0898aSmrgextern Atom bdfGetPropertyValue ( char *s );
7423a0898aSmrgextern int bdfIsInteger ( char *str );
7523a0898aSmrgextern unsigned char bdfHexByte ( unsigned char *s );
7641c30155Smrgextern Bool bdfSpecialProperty ( FontPtr pFont, FontPropPtr prop,
7723a0898aSmrg				 char isString, bdfFileState *bdfState );
7841c30155Smrgextern int bdfReadFont( FontPtr pFont, FontFilePtr file,
7923a0898aSmrg			int bit, int byte, int glyph, int scan );
8023a0898aSmrgextern int bdfReadFontInfo( FontInfoPtr pFontInfo, FontFilePtr file );
8123a0898aSmrg
8241c30155Smrgextern void FontCharInkMetrics ( FontPtr pFont, CharInfoPtr pCI,
8323a0898aSmrg				 xCharInfo *pInk );
8441c30155Smrgextern void FontCharReshape ( FontPtr pFont, CharInfoPtr pSrc,
8523a0898aSmrg			      CharInfoPtr pDst );
8623a0898aSmrg
8723a0898aSmrg#endif				/* BDFINT_H */
88