| 1 |
/* |
| 2 |
|
| 3 |
Copyright 1990, 1998 The Open Group |
| 4 |
|
| 5 |
Permission to use, copy, modify, distribute, and sell this software and its |
| 6 |
documentation for any purpose is hereby granted without fee, provided that |
| 7 |
the above copyright notice appear in all copies and that both that |
| 8 |
copyright notice and this permission notice appear in supporting |
| 9 |
documentation. |
| 10 |
|
| 11 |
The above copyright notice and this permission notice shall be included |
| 12 |
in all copies or substantial portions of the Software. |
| 13 |
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 |
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
|
| 22 |
Except as contained in this notice, the name of The Open Group shall |
| 23 |
not be used in advertising or otherwise to promote the sale, use or |
| 24 |
other dealings in this Software without prior written authorization |
| 25 |
from The Open Group. |
| 26 |
|
| 27 |
*/ |
| 28 |
|
| 29 |
#ifndef BDFINT_H |
| 30 |
#define BDFINT_H |
| 31 |
|
| 32 |
#define bdfIsPrefix(buf,str) (!strncmp((char *)buf,str,strlen(str))) |
| 33 |
#define bdfStrEqual(s1,s2) (!strcmp(s1,s2)) |
| 34 |
|
| 35 |
#define BDF_GENPROPS 6 |
| 36 |
#define NullProperty ((FontPropPtr)0) |
| 37 |
|
| 38 |
/* |
| 39 |
* This structure holds some properties we need to generate if they aren't |
| 40 |
* specified in the BDF file and some other values read from the file |
| 41 |
* that we'll need to calculate them. We need to keep track of whether |
| 42 |
* or not we've read them. |
| 43 |
*/ |
| 44 |
typedef struct BDFSTAT { |
| 45 |
int linenum; |
| 46 |
char *fileName; |
| 47 |
char fontName[MAXFONTNAMELEN]; |
| 48 |
float pointSize; |
| 49 |
int resolution_x; |
| 50 |
int resolution_y; |
| 51 |
int digitCount; |
| 52 |
int digitWidths; |
| 53 |
int exHeight; |
| 54 |
|
| 55 |
FontPropPtr fontProp; |
| 56 |
FontPropPtr pointSizeProp; |
| 57 |
FontPropPtr resolutionXProp; |
| 58 |
FontPropPtr resolutionYProp; |
| 59 |
FontPropPtr resolutionProp; |
| 60 |
FontPropPtr xHeightProp; |
| 61 |
FontPropPtr weightProp; |
| 62 |
FontPropPtr quadWidthProp; |
| 63 |
BOOL haveFontAscent; |
| 64 |
BOOL haveFontDescent; |
| 65 |
BOOL haveDefaultCh; |
| 66 |
} bdfFileState; |
| 67 |
|
| 68 |
extern void bdfError ( const char * message, ... ) _X_ATTRIBUTE_PRINTF(1, 2); |
| 69 |
extern void bdfWarning ( const char *message, ... ) _X_ATTRIBUTE_PRINTF(1, 2); |
| 70 |
extern unsigned char * bdfGetLine ( FontFilePtr file, unsigned char *buf, |
| 71 |
int len ); |
| 72 |
extern Atom bdfForceMakeAtom ( const char *str, int *size ); |
| 73 |
extern Atom bdfGetPropertyValue ( char *s ); |
| 74 |
extern int bdfIsInteger ( char *str ); |
| 75 |
extern unsigned char bdfHexByte ( unsigned char *s ); |
| 76 |
extern Bool bdfSpecialProperty ( FontPtr pFont, FontPropPtr prop, |
| 77 |
char isString, bdfFileState *bdfState ); |
| 78 |
extern int bdfReadFont( FontPtr pFont, FontFilePtr file, |
| 79 |
int bit, int byte, int glyph, int scan ); |
| 80 |
extern int bdfReadFontInfo( FontInfoPtr pFontInfo, FontFilePtr file ); |
| 81 |
|
| 82 |
extern void FontCharInkMetrics ( FontPtr pFont, CharInfoPtr pCI, |
| 83 |
xCharInfo *pInk ); |
| 84 |
extern void FontCharReshape ( FontPtr pFont, CharInfoPtr pSrc, |
| 85 |
CharInfoPtr pDst ); |
| 86 |
|
| 87 |
#endif /* BDFINT_H */ |