font.h revision e24f450b
1/***********************************************************
2Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
3
4                        All Rights Reserved
5
6Permission to use, copy, modify, and distribute this software and its
7documentation for any purpose and without fee is hereby granted,
8provided that the above copyright notice appear in all copies and that
9both that copyright notice and this permission notice appear in
10supporting documentation, and that the name of Digital not be
11used in advertising or publicity pertaining to distribution of the
12software without specific, written prior permission.
13
14DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20SOFTWARE.
21
22******************************************************************/
23
24#ifndef FONT_H
25#define FONT_H
26
27#ifndef BitmapFormatByteOrderMask
28#include	"fsmasks.h"
29#endif
30
31/* data structures */
32#ifndef _XTYPEDEF_FONTPTR
33typedef struct _Font *FontPtr;
34#define _XTYPEDEF_FONTPTR
35#endif
36
37typedef struct _FontInfo *FontInfoPtr;
38typedef struct _FontProp *FontPropPtr;
39typedef struct _ExtentInfo *ExtentInfoPtr;
40typedef struct _FontPathElement *FontPathElementPtr;
41
42#ifndef _XTYPEDEF_CHARINFOPTR
43typedef struct _CharInfo *CharInfoPtr;
44#define _XTYPEDEF_CHARINFOPTR
45#endif
46
47typedef struct _FontNames *FontNamesPtr;
48typedef struct _FontResolution *FontResolutionPtr;
49
50#define NullCharInfo	((CharInfoPtr) 0)
51#define NullFont	((FontPtr) 0)
52#define NullFontInfo	((FontInfoPtr) 0)
53
54 /* draw direction */
55#define LeftToRight 0
56#define RightToLeft 1
57#define BottomToTop 2
58#define TopToBottom 3
59typedef int DrawDirection;
60
61#define NO_SUCH_CHAR	-1
62
63#define	FontAliasType	0x1000
64
65#define	AllocError	80
66#define	StillWorking	81
67#define	FontNameAlias	82
68#define	BadFontName	83
69#define	Suspended	84
70#define	Successful	85
71#define	BadFontPath	86
72#define	BadCharRange	87
73#define	BadFontFormat	88
74#define	FPEResetFailed	89      /* for when an FPE reset won't work */
75
76/* OpenFont flags */
77#define FontLoadInfo	0x0001
78#define FontLoadProps	0x0002
79#define FontLoadMetrics	0x0004
80#define FontLoadBitmaps	0x0008
81#define FontLoadAll	0x000f
82#define	FontOpenSync	0x0010
83#define FontReopen	0x0020
84
85/* Query flags */
86#define	LoadAll		0x1
87#define	FinishRamge	0x2
88#define       EightBitFont    0x4
89#define       SixteenBitFont  0x8
90
91/* Glyph Caching Modes */
92#define CACHING_OFF 0
93#define CACHE_16_BIT_GLYPHS 1
94#define CACHE_ALL_GLYPHS 2
95#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
96extern int glyphCachingMode;
97
98struct _Client;
99
100extern int StartListFontsWithInfo(
101    struct _Client * /*client */,
102    int /* length */,
103    unsigned char * /* pattern */,
104    int /* max_names */
105);
106
107extern FontNamesPtr MakeFontNamesRecord(
108    unsigned /* size */
109);
110
111extern void FreeFontNames(
112    FontNamesPtr /* pFN */
113);
114
115extern int AddFontNamesName(
116    FontNamesPtr /* names */,
117    char * /* name */,
118    int /* length */
119);
120
121#if 0                           /* unused */
122extern int FontToFSError();
123extern FontResolutionPtr GetClientResolution();
124#endif
125
126typedef struct _FontPatternCache *FontPatternCachePtr;
127
128extern FontPatternCachePtr MakeFontPatternCache(void);
129
130extern void FreeFontPatternCache(
131    FontPatternCachePtr /* cache */
132);
133
134extern void EmptyFontPatternCache(
135    FontPatternCachePtr /* cache */
136);
137
138extern void CacheFontPattern(
139    FontPatternCachePtr /* cache */,
140    const char * /* pattern */,
141    int /* patlen */,
142    FontPtr /* pFont */
143);
144extern FontResolutionPtr GetClientResolutions(
145    int * /* num */
146);
147
148extern FontPtr FindCachedFontPattern(
149    FontPatternCachePtr /* cache */,
150    const char * /* pattern */,
151    int /* patlen */
152);
153
154extern void RemoveCachedFontPattern(
155    FontPatternCachePtr /* cache */,
156    FontPtr /* pFont */
157);
158
159typedef enum {
160    Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
161} FontEncoding;
162
163#endif                          /* FONT_H */
164