| 1 |
/* |
| 2 |
|
| 3 |
Copyright 1991, 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 in |
| 12 |
all copies or substantial portions of the Software. |
| 13 |
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 |
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 18 |
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 19 |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 |
|
| 21 |
Except as contained in this notice, the name of The Open Group shall not be |
| 22 |
used in advertising or otherwise to promote the sale, use or other dealings |
| 23 |
in this Software without prior written authorization from The Open Group. |
| 24 |
|
| 25 |
*/ |
| 26 |
|
| 27 |
/* |
| 28 |
* Author: Keith Packard, MIT X Consortium |
| 29 |
*/ |
| 30 |
|
| 31 |
#ifndef _FONTFILE_H_ |
| 32 |
#define _FONTFILE_H_ |
| 33 |
|
| 34 |
#include <X11/fonts/fontxlfd.h> |
| 35 |
|
| 36 |
typedef struct _FontEntry *FontEntryPtr; |
| 37 |
typedef struct _FontTable *FontTablePtr; |
| 38 |
typedef struct _FontName *FontNamePtr; |
| 39 |
typedef struct _FontScaled *FontScaledPtr; |
| 40 |
typedef struct _FontScalableExtra *FontScalableExtraPtr; |
| 41 |
typedef struct _FontScalableEntry *FontScalableEntryPtr; |
| 42 |
typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr; |
| 43 |
typedef struct _FontBitmapEntry *FontBitmapEntryPtr; |
| 44 |
typedef struct _FontAliasEntry *FontAliasEntryPtr; |
| 45 |
typedef struct _FontDirectory *FontDirectoryPtr; |
| 46 |
typedef struct _FontRenderer *FontRendererPtr; |
| 47 |
|
| 48 |
#define NullFontEntry ((FontEntryPtr) 0) |
| 49 |
#define NullFontTable ((FontTablePtr) 0) |
| 50 |
#define NullFontName ((FontNamePtr) 0) |
| 51 |
#define NullFontScaled ((FontScaled) 0) |
| 52 |
#define NullFontScalableExtra ((FontScalableExtra) 0) |
| 53 |
#define NullFontscalableEntry ((FontScalableEntry) 0) |
| 54 |
#define NullFontScaleAliasEntry ((FontScaleAliasEntry) 0) |
| 55 |
#define NullFontBitmapEntry ((FontBitmapEntry) 0) |
| 56 |
#define NullFontAliasEntry ((FontAliasEntry) 0) |
| 57 |
#define NullFontDirectory ((FontDirectoryPtr) 0) |
| 58 |
#define NullFontRenderer ((FontRendererPtr) 0) |
| 59 |
|
| 60 |
#define FONT_ENTRY_SCALABLE 0 |
| 61 |
#define FONT_ENTRY_SCALE_ALIAS 1 |
| 62 |
#define FONT_ENTRY_BITMAP 2 |
| 63 |
#define FONT_ENTRY_ALIAS 3 |
| 64 |
|
| 65 |
#define MAXFONTNAMELEN 1024 |
| 66 |
#define MAXFONTFILENAMELEN 1024 |
| 67 |
|
| 68 |
#define FontDirFile "fonts.dir" |
| 69 |
#define FontAliasFile "fonts.alias" |
| 70 |
#define FontScalableFile "fonts.scale" |
| 71 |
|
| 72 |
extern int FontFileNameCheck ( const char *name ); |
| 73 |
extern int FontFileInitFPE ( FontPathElementPtr fpe ); |
| 74 |
extern int FontFileResetFPE ( FontPathElementPtr fpe ); |
| 75 |
extern int FontFileFreeFPE ( FontPathElementPtr fpe ); |
| 76 |
extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe, |
| 77 |
Mask flags, const char *name, int namelen, |
| 78 |
fsBitmapFormat format, fsBitmapFormatMask fmask, |
| 79 |
XID id, FontPtr *pFont, char **aliasName, |
| 80 |
FontPtr non_cachable_font ); |
| 81 |
extern void FontFileCloseFont ( FontPathElementPtr fpe, FontPtr pFont ); |
| 82 |
extern int FontFileOpenBitmap ( FontPathElementPtr fpe, FontPtr *pFont, |
| 83 |
int flags, FontEntryPtr entry, |
| 84 |
fsBitmapFormat format, |
| 85 |
fsBitmapFormatMask fmask ); |
| 86 |
extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe, |
| 87 |
const char *pat, int len, int max, |
| 88 |
FontNamesPtr names ); |
| 89 |
extern int FontFileStartListFonts ( pointer client, FontPathElementPtr fpe, |
| 90 |
const char *pat, int len, int max, |
| 91 |
pointer *privatep, int mark_aliases ); |
| 92 |
extern int FontFileStartListFontsWithInfo ( pointer client, |
| 93 |
FontPathElementPtr fpe, |
| 94 |
const char *pat, int len, int max, |
| 95 |
pointer *privatep ); |
| 96 |
extern int FontFileListNextFontWithInfo ( pointer client, |
| 97 |
FontPathElementPtr fpe, |
| 98 |
char **namep, int *namelenp, |
| 99 |
FontInfoPtr *pFontInfo, |
| 100 |
int *numFonts, pointer private ); |
| 101 |
extern int FontFileStartListFontsAndAliases ( pointer client, |
| 102 |
FontPathElementPtr fpe, |
| 103 |
const char *pat, int len, int max, |
| 104 |
pointer *privatep ); |
| 105 |
extern int FontFileListNextFontOrAlias ( pointer client, |
| 106 |
FontPathElementPtr fpe, |
| 107 |
char **namep, int *namelenp, |
| 108 |
char **resolvedp, int *resolvedlenp, |
| 109 |
pointer private ); |
| 110 |
extern void FontFileRegisterLocalFpeFunctions ( void ); |
| 111 |
extern void CatalogueRegisterLocalFpeFunctions ( void ); |
| 112 |
|
| 113 |
|
| 114 |
extern FontEntryPtr FontFileAddEntry ( FontTablePtr table, |
| 115 |
FontEntryPtr prototype ); |
| 116 |
extern Bool FontFileAddFontAlias ( FontDirectoryPtr dir, char *aliasName, |
| 117 |
char *fontName ); |
| 118 |
extern Bool FontFileAddFontFile ( FontDirectoryPtr dir, char *fontName, |
| 119 |
char *fileName ); |
| 120 |
extern int FontFileCountDashes ( char *name, int namelen ); |
| 121 |
extern FontEntryPtr FontFileFindNameInDir ( FontTablePtr table, |
| 122 |
FontNamePtr pat ); |
| 123 |
extern FontEntryPtr FontFileFindNameInScalableDir ( FontTablePtr table, |
| 124 |
FontNamePtr pat, |
| 125 |
FontScalablePtr vals ); |
| 126 |
extern int FontFileFindNamesInDir ( FontTablePtr table, FontNamePtr pat, |
| 127 |
int max, FontNamesPtr names ); |
| 128 |
extern int FontFileFindNamesInScalableDir ( FontTablePtr table, |
| 129 |
FontNamePtr pat, int max, |
| 130 |
FontNamesPtr names, |
| 131 |
FontScalablePtr vals, |
| 132 |
int alias_behavior, int *newmax ); |
| 133 |
|
| 134 |
extern void FontFileFreeDir ( FontDirectoryPtr dir ); |
| 135 |
extern void FontFileFreeEntry ( FontEntryPtr entry ); |
| 136 |
extern void FontFileFreeTable ( FontTablePtr table ); |
| 137 |
extern Bool FontFileInitTable ( FontTablePtr table, int size ); |
| 138 |
extern FontDirectoryPtr FontFileMakeDir ( const char *dirName, int size ); |
| 139 |
extern Bool FontFileMatchName ( char *name, int length, FontNamePtr pat ); |
| 140 |
extern char * FontFileSaveString ( char *s ); |
| 141 |
extern void FontFileSortDir ( FontDirectoryPtr dir ); |
| 142 |
extern void FontFileSortTable ( FontTablePtr table ); |
| 143 |
|
| 144 |
extern void FontDefaultFormat ( int *bit, int *byte, int *glyph, int *scan ); |
| 145 |
|
| 146 |
extern Bool FontFileRegisterRenderer ( FontRendererPtr renderer ); |
| 147 |
extern Bool FontFilePriorityRegisterRenderer ( FontRendererPtr renderer, |
| 148 |
int priority ); |
| 149 |
extern FontRendererPtr FontFileMatchRenderer ( char *fileName ); |
| 150 |
|
| 151 |
extern Bool FontFileAddScaledInstance ( FontEntryPtr entry, |
| 152 |
FontScalablePtr vals, FontPtr pFont, |
| 153 |
char *bitmapName ); |
| 154 |
extern void FontFileSwitchStringsToBitmapPointers ( FontDirectoryPtr dir ); |
| 155 |
extern void FontFileRemoveScaledInstance ( FontEntryPtr entry, FontPtr pFont ); |
| 156 |
extern Bool FontFileCompleteXLFD ( FontScalablePtr vals, FontScalablePtr def ); |
| 157 |
extern FontScaledPtr FontFileFindScaledInstance ( FontEntryPtr entry, |
| 158 |
FontScalablePtr vals, |
| 159 |
int noSpecificSize ); |
| 160 |
|
| 161 |
extern Bool FontFileRegisterBitmapSource ( FontPathElementPtr fpe ); |
| 162 |
extern void FontFileUnregisterBitmapSource ( FontPathElementPtr fpe ); |
| 163 |
extern void FontFileEmptyBitmapSource ( void ); |
| 164 |
extern int FontFileMatchBitmapSource ( FontPathElementPtr fpe, |
| 165 |
FontPtr *pFont, int flags, |
| 166 |
FontEntryPtr entry, |
| 167 |
FontNamePtr zeroPat, |
| 168 |
FontScalablePtr vals, |
| 169 |
fsBitmapFormat format, |
| 170 |
fsBitmapFormatMask fmask, |
| 171 |
Bool noSpecificSize ); |
| 172 |
|
| 173 |
extern int FontFileReadDirectory ( const char *directory, FontDirectoryPtr *pdir ); |
| 174 |
extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir ); |
| 175 |
|
| 176 |
#endif /* _FONTFILE_H_ */ |