Merge branch 'devel/x11' into tizen
[platform/upstream/fontsproto.git] / font.h
1 /***********************************************************
2 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
3
4                         All Rights Reserved
5
6 Permission to use, copy, modify, and distribute this software and its
7 documentation for any purpose and without fee is hereby granted,
8 provided that the above copyright notice appear in all copies and that
9 both that copyright notice and this permission notice appear in
10 supporting documentation, and that the name of Digital not be
11 used in advertising or publicity pertaining to distribution of the
12 software without specific, written prior permission.
13
14 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20 SOFTWARE.
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
33 typedef struct _Font *FontPtr;
34 #define _XTYPEDEF_FONTPTR
35 #endif
36
37 typedef struct _FontInfo *FontInfoPtr;
38 typedef struct _FontProp *FontPropPtr;
39 typedef struct _ExtentInfo *ExtentInfoPtr;
40 typedef struct _FontPathElement *FontPathElementPtr;
41
42 #ifndef _XTYPEDEF_CHARINFOPTR
43 typedef struct _CharInfo *CharInfoPtr;
44 #define _XTYPEDEF_CHARINFOPTR
45 #endif
46
47 typedef struct _FontNames *FontNamesPtr;
48 typedef 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
59 typedef 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
97 extern int glyphCachingMode;
98
99 struct _Client;
100
101 extern int StartListFontsWithInfo(
102     struct _Client * /*client*/,
103     int /*length*/,
104     unsigned char * /*pattern*/,
105     int /*max_names*/
106 );
107
108 extern FontNamesPtr MakeFontNamesRecord(
109     unsigned /* size */
110 );
111
112 extern void FreeFontNames(
113     FontNamesPtr /* pFN*/
114 );
115
116 extern int  AddFontNamesName(
117     FontNamesPtr /* names */,
118     char * /* name */,
119     int /* length */
120 );
121
122 #if 0 /* unused */
123 extern int  FontToFSError();
124 extern FontResolutionPtr GetClientResolution();
125 #endif
126
127 typedef struct _FontPatternCache    *FontPatternCachePtr;
128
129 extern FontPatternCachePtr  MakeFontPatternCache (
130     void
131 );
132
133 extern void                 FreeFontPatternCache (
134     FontPatternCachePtr /* cache */
135 );
136
137 extern void                 EmptyFontPatternCache (
138     FontPatternCachePtr /* cache */
139 );
140
141 extern void                 CacheFontPattern (
142     FontPatternCachePtr /* cache */,
143     const char * /* pattern */,
144     int /* patlen */,
145     FontPtr /* pFont */
146 );
147 extern FontResolutionPtr GetClientResolutions(
148     int * /* num */
149 );
150
151 extern FontPtr              FindCachedFontPattern (
152     FontPatternCachePtr /* cache */,
153     const char * /* pattern */,
154     int /* patlen */
155 );
156
157 extern void                 RemoveCachedFontPattern (
158     FontPatternCachePtr /* cache */,
159     FontPtr /* pFont */
160 );
161
162 typedef enum {
163     Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
164 }           FontEncoding;
165
166 #endif                          /* FONT_H */