font.h revision fa2b3b63
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
64#define	FontAliasType	0x1000
65
66#define	AllocError	80
67#define	StillWorking	81
68#define	FontNameAlias	82
69#define	BadFontName	83
70#define	Suspended	84
71#define	Successful	85
72#define	BadFontPath	86
73#define	BadCharRange	87
74#define	BadFontFormat	88
75#define	FPEResetFailed	89	/* for when an FPE reset won't work */
76
77/* OpenFont flags */
78#define FontLoadInfo	0x0001
79#define FontLoadProps	0x0002
80#define FontLoadMetrics	0x0004
81#define FontLoadBitmaps	0x0008
82#define FontLoadAll	0x000f
83#define	FontOpenSync	0x0010
84#define FontReopen	0x0020
85
86/* Query flags */
87#define	LoadAll		0x1
88#define	FinishRamge	0x2
89#define       EightBitFont    0x4
90#define       SixteenBitFont  0x8
91
92/* Glyph Caching Modes */
93#define CACHING_OFF 0
94#define CACHE_16_BIT_GLYPHS 1
95#define CACHE_ALL_GLYPHS 2
96#define DEFAULT_GLYPH_CACHING_MODE CACHE_16_BIT_GLYPHS
97extern int glyphCachingMode;
98
99struct _Client;
100
101extern int StartListFontsWithInfo(
102    struct _Client * /*client*/,
103    int /*length*/,
104    unsigned char * /*pattern*/,
105    int /*max_names*/
106);
107
108extern FontNamesPtr MakeFontNamesRecord(
109    unsigned /* size */
110);
111
112extern void FreeFontNames(
113    FontNamesPtr /* pFN*/
114);
115
116extern int  AddFontNamesName(
117    FontNamesPtr /* names */,
118    char * /* name */,
119    int /* length */
120);
121
122#if 0 /* unused */
123extern int  FontToFSError();
124extern FontResolutionPtr GetClientResolution();
125#endif
126
127typedef struct _FontPatternCache    *FontPatternCachePtr;
128
129extern FontPatternCachePtr  MakeFontPatternCache (
130    void
131);
132
133extern void		    FreeFontPatternCache (
134    FontPatternCachePtr /* cache */
135);
136
137extern void		    EmptyFontPatternCache (
138    FontPatternCachePtr /* cache */
139);
140
141extern void		    CacheFontPattern (
142    FontPatternCachePtr /* cache */,
143    const char * /* pattern */,
144    int /* patlen */,
145    FontPtr /* pFont */
146);
147extern FontResolutionPtr GetClientResolutions(
148    int * /* num */
149);
150
151extern FontPtr		    FindCachedFontPattern (
152    FontPatternCachePtr /* cache */,
153    const char * /* pattern */,
154    int /* patlen */
155);
156
157extern void		    RemoveCachedFontPattern (
158    FontPatternCachePtr /* cache */,
159    FontPtr /* pFont */
160);
161
162typedef enum {
163    Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
164}           FontEncoding;
165
166#endif				/* FONT_H */
167