117ca54c3Smrg/***********************************************************
217ca54c3SmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
317ca54c3Smrg
417ca54c3Smrg                        All Rights Reserved
517ca54c3Smrg
617ca54c3SmrgPermission to use, copy, modify, and distribute this software and its
717ca54c3Smrgdocumentation for any purpose and without fee is hereby granted,
817ca54c3Smrgprovided that the above copyright notice appear in all copies and that
917ca54c3Smrgboth that copyright notice and this permission notice appear in
1017ca54c3Smrgsupporting documentation, and that the name of Digital not be
1117ca54c3Smrgused in advertising or publicity pertaining to distribution of the
1217ca54c3Smrgsoftware without specific, written prior permission.
1317ca54c3Smrg
1417ca54c3SmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
1517ca54c3SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
1617ca54c3SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
1717ca54c3SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1817ca54c3SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1917ca54c3SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2017ca54c3SmrgSOFTWARE.
2117ca54c3Smrg
2217ca54c3Smrg******************************************************************/
2317ca54c3Smrg
2417ca54c3Smrg#ifndef FONT_H
2517ca54c3Smrg#define FONT_H
2617ca54c3Smrg
2717ca54c3Smrg#include <X11/Xfuncproto.h>
2817ca54c3Smrg
2917ca54c3Smrg#ifndef BitmapFormatByteOrderMask
3017ca54c3Smrg#include	"fsmasks.h"
3117ca54c3Smrg#endif
3217ca54c3Smrg
3317ca54c3Smrg/* data structures */
3417ca54c3Smrg#ifndef _XTYPEDEF_FONTPTR
3517ca54c3Smrgtypedef struct _Font *FontPtr;
3617ca54c3Smrg#define _XTYPEDEF_FONTPTR
3717ca54c3Smrg#endif
3817ca54c3Smrg
3917ca54c3Smrgtypedef struct _FontInfo *FontInfoPtr;
4017ca54c3Smrgtypedef struct _FontProp *FontPropPtr;
4117ca54c3Smrgtypedef struct _ExtentInfo *ExtentInfoPtr;
4217ca54c3Smrgtypedef struct _FontPathElement *FontPathElementPtr;
4317ca54c3Smrg
4417ca54c3Smrg#ifndef _XTYPEDEF_CHARINFOPTR
4517ca54c3Smrgtypedef struct _CharInfo *CharInfoPtr;
4617ca54c3Smrg#define _XTYPEDEF_CHARINFOPTR
4717ca54c3Smrg#endif
4817ca54c3Smrg
4917ca54c3Smrgtypedef struct _FontNames *FontNamesPtr;
5017ca54c3Smrgtypedef struct _FontResolution *FontResolutionPtr;
5117ca54c3Smrg
5217ca54c3Smrg#define NullCharInfo	((CharInfoPtr) 0)
5317ca54c3Smrg#define NullFont	((FontPtr) 0)
5417ca54c3Smrg#define NullFontInfo	((FontInfoPtr) 0)
5517ca54c3Smrg
5617ca54c3Smrg /* draw direction */
5717ca54c3Smrg#define LeftToRight 0
5817ca54c3Smrg#define RightToLeft 1
5917ca54c3Smrg#define BottomToTop 2
6017ca54c3Smrg#define TopToBottom 3
6117ca54c3Smrgtypedef int DrawDirection;
6217ca54c3Smrg
6317ca54c3Smrg#define NO_SUCH_CHAR	-1
6417ca54c3Smrg
6517ca54c3Smrg
6617ca54c3Smrg#define	FontAliasType	0x1000
6717ca54c3Smrg
6817ca54c3Smrg#define	AllocError	80
6917ca54c3Smrg#define	StillWorking	81
7017ca54c3Smrg#define	FontNameAlias	82
7117ca54c3Smrg#define	BadFontName	83
7217ca54c3Smrg#define	Suspended	84
7317ca54c3Smrg#define	Successful	85
7417ca54c3Smrg#define	BadFontPath	86
7517ca54c3Smrg#define	BadCharRange	87
7617ca54c3Smrg#define	BadFontFormat	88
7717ca54c3Smrg#define	FPEResetFailed	89	/* for when an FPE reset won't work */
7817ca54c3Smrg
7917ca54c3Smrg/* OpenFont flags */
8017ca54c3Smrg#define FontLoadInfo	0x0001
8117ca54c3Smrg#define FontLoadProps	0x0002
8217ca54c3Smrg#define FontLoadMetrics	0x0004
8317ca54c3Smrg#define FontLoadBitmaps	0x0008
8417ca54c3Smrg#define FontLoadAll	0x000f
8517ca54c3Smrg#define	FontOpenSync	0x0010
8617ca54c3Smrg#define FontReopen	0x0020
8717ca54c3Smrg
8817ca54c3Smrg/* Query flags */
8917ca54c3Smrg#define	LoadAll		0x1
9017ca54c3Smrg#define	FinishRamge	0x2
9117ca54c3Smrg#define       EightBitFont    0x4
9217ca54c3Smrg#define       SixteenBitFont  0x8
9317ca54c3Smrg
9417ca54c3Smrg/* Glyph Caching Modes */
9517ca54c3Smrg#define CACHING_OFF 0
9617ca54c3Smrg#define CACHE_16_BIT_GLYPHS 1
9717ca54c3Smrg#define CACHE_ALL_GLYPHS 2
9817ca54c3Smrg#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
9917ca54c3Smrgextern int glyphCachingMode;
10017ca54c3Smrg
10117ca54c3Smrgstruct _Client;
10217ca54c3Smrg
10317ca54c3Smrgextern int StartListFontsWithInfo(
10417ca54c3Smrg    struct _Client * /*client*/,
10517ca54c3Smrg    int /*length*/,
10617ca54c3Smrg    unsigned char * /*pattern*/,
10717ca54c3Smrg    int /*max_names*/
10817ca54c3Smrg);
10917ca54c3Smrg
11017ca54c3Smrgextern FontNamesPtr MakeFontNamesRecord(
11117ca54c3Smrg    unsigned /* size */
11217ca54c3Smrg);
11317ca54c3Smrg
11417ca54c3Smrgextern void FreeFontNames(
11517ca54c3Smrg    FontNamesPtr /* pFN*/
11617ca54c3Smrg);
11717ca54c3Smrg
11817ca54c3Smrgextern int  AddFontNamesName(
11917ca54c3Smrg    FontNamesPtr /* names */,
12017ca54c3Smrg    char * /* name */,
12117ca54c3Smrg    int /* length */
12217ca54c3Smrg);
12317ca54c3Smrg
12417ca54c3Smrg#if 0 /* unused */
12517ca54c3Smrgextern int  FontToFSError();
12617ca54c3Smrgextern FontResolutionPtr GetClientResolution();
12717ca54c3Smrg#endif
12817ca54c3Smrg
12917ca54c3Smrgtypedef struct _FontPatternCache    *FontPatternCachePtr;
13017ca54c3Smrg
13117ca54c3Smrgextern FontPatternCachePtr  MakeFontPatternCache (
13217ca54c3Smrg    void
13317ca54c3Smrg);
13417ca54c3Smrg
13517ca54c3Smrgextern void		    FreeFontPatternCache (
13617ca54c3Smrg    FontPatternCachePtr /* cache */
13717ca54c3Smrg);
13817ca54c3Smrg
13917ca54c3Smrgextern void		    EmptyFontPatternCache (
14017ca54c3Smrg    FontPatternCachePtr /* cache */
14117ca54c3Smrg);
14217ca54c3Smrg
14317ca54c3Smrgextern void		    CacheFontPattern (
14417ca54c3Smrg    FontPatternCachePtr /* cache */,
14517ca54c3Smrg    const char * /* pattern */,
14617ca54c3Smrg    int /* patlen */,
14717ca54c3Smrg    FontPtr /* pFont */
14817ca54c3Smrg);
14917ca54c3Smrgextern _X_EXPORT FontResolutionPtr GetClientResolutions(
15017ca54c3Smrg    int * /* num */
15117ca54c3Smrg);
15217ca54c3Smrg
15317ca54c3Smrgextern FontPtr		    FindCachedFontPattern (
15417ca54c3Smrg    FontPatternCachePtr /* cache */,
15517ca54c3Smrg    const char * /* pattern */,
15617ca54c3Smrg    int /* patlen */
15717ca54c3Smrg);
15817ca54c3Smrg
15917ca54c3Smrgextern void		    RemoveCachedFontPattern (
16017ca54c3Smrg    FontPatternCachePtr /* cache */,
16117ca54c3Smrg    FontPtr /* pFont */
16217ca54c3Smrg);
16317ca54c3Smrg
16417ca54c3Smrgtypedef enum {
16517ca54c3Smrg    Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
16617ca54c3Smrg}           FontEncoding;
16717ca54c3Smrg
16817ca54c3Smrg#endif				/* FONT_H */
169