upload tizen2.0 source
[framework/uifw/xorg/lib/libxfont.git] / src / FreeType / ft.h
1 /*
2 Copyright (c) 1997 by Mark Leisher
3 Copyright (c) 1998-2002 by Juliusz Chroboczek
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 THE SOFTWARE.
22 */
23
24 #ifndef _FT_H_
25 #define _FT_H_
26
27 #include <X11/Xfuncproto.h>
28
29 #define FREETYPE_VERSION (FREETYPE_MAJOR * 1000000 + FREETYPE_MINOR * 1000 + FREETYPE_PATCH)
30
31 #undef DEBUG_TRUETYPE
32
33 #ifdef DEBUG_TRUETYPE
34 #define MUMBLE ErrorF
35 #else
36 #define MUMBLE(...)
37 #endif
38
39 #undef MAX
40 #define MAX(h,i) ((h) > (i) ? (h) : (i))
41 #define ADJUSTMAX(m,v) if((v)>(m)) (m)=(v)
42 #undef MIN
43 #define MIN(l,o) ((l) < (o) ? (l) : (o))
44 #define ADJUSTMIN(m,v) if ((v)<(m)) (m)=(v)
45
46 /* When comparing floating point values, we want to ignore small errors. */
47 #define NEGLIGIBLE ((double)0.001)
48 /* Are x and y significantly different? */
49 #define DIFFER(x,y) (fabs((x)-(y))>=NEGLIGIBLE*fabs(x))
50 /* Is x significantly different from 0 w.r.t. y? */
51 #define DIFFER0(x,y) (fabs(x)>=NEGLIGIBLE*fabs(y))
52
53 #ifndef ABS
54 #define ABS(x) ((x) >= 0 ? (x) : -(x))
55 #endif
56
57 /* Two to the sixteenth power, as a double. */
58 #define TWO_SIXTEENTH ((double)(1<<16))
59 #define TWO_SIXTH ((double)(1<<6))
60
61 /* Data structures used across files */
62
63 typedef struct _FTMapping
64 {
65     int named;
66     FT_CharMap cmap;
67     int base;
68     struct _FontMap *mapping;     /* allow inclusion without fontenc.h */
69 } FTMappingRec, *FTMappingPtr;
70
71 /* Prototypes */
72
73 /* ftfuncs.c */
74
75 /* ftenc.c */
76
77 int FTPickMapping(char*, int, char*, FT_Face, FTMappingPtr);
78 unsigned FTRemap(FT_Face face, FTMappingPtr, unsigned code);
79
80 /* fttools.c */
81
82 int FTtoXReturnCode(int);
83 int FTGetEnglishName(FT_Face, int, char *, int);
84
85 extern void ErrorF(const char*, ...);
86
87 #endif /* _FT_H_ */