.gitignore added
[dotfiles/.git] / .local / include / python3.9 / pygame / freetype.h
1 /*
2   pygame - Python Game Library
3   Copyright (C) 2009 Vicent Marti
4
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Library General Public
7   License as published by the Free Software Foundation; either
8   version 2 of the License, or (at your option) any later version.
9
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Library General Public License for more details.
14
15   You should have received a copy of the GNU Library General Public
16   License along with this library; if not, write to the Free
17   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19 */
20 #ifndef _PYGAME_FREETYPE_INTERNAL_H_
21 #define _PYGAME_FREETYPE_INTERNAL_H_
22
23 #define PGFT_PYGAME1_COMPAT
24 #define HAVE_PYGAME_SDL_VIDEO
25 #define HAVE_PYGAME_SDL_RWOPS
26
27 #include "pgcompat.h"
28 #include "pgplatform.h"
29 #include <Python.h>
30
31 #include <ft2build.h>
32 #include FT_FREETYPE_H
33 #include FT_CACHE_H
34 #include FT_XFREE86_H
35 #include FT_TRIGONOMETRY_H
36
37 /**********************************************************
38  * Global module constants
39  **********************************************************/
40
41 /* Render styles */
42 #define FT_STYLE_NORMAL     0x00
43 #define FT_STYLE_STRONG     0x01
44 #define FT_STYLE_OBLIQUE    0x02
45 #define FT_STYLE_UNDERLINE  0x04
46 #define FT_STYLE_WIDE       0x08
47 #define FT_STYLE_DEFAULT    0xFF
48
49 /* Bounding box modes */
50 #define FT_BBOX_EXACT           FT_GLYPH_BBOX_SUBPIXELS
51 #define FT_BBOX_EXACT_GRIDFIT   FT_GLYPH_BBOX_GRIDFIT
52 #define FT_BBOX_PIXEL           FT_GLYPH_BBOX_TRUNCATE
53 #define FT_BBOX_PIXEL_GRIDFIT   FT_GLYPH_BBOX_PIXELS
54
55 /* Rendering flags */
56 #define FT_RFLAG_NONE                  (0)
57 #define FT_RFLAG_ANTIALIAS             (1 << 0)
58 #define FT_RFLAG_AUTOHINT              (1 << 1)
59 #define FT_RFLAG_VERTICAL              (1 << 2)
60 #define FT_RFLAG_HINTED                (1 << 3)
61 #define FT_RFLAG_KERNING               (1 << 4)
62 #define FT_RFLAG_TRANSFORM             (1 << 5)
63 #define FT_RFLAG_PAD                   (1 << 6)
64 #define FT_RFLAG_ORIGIN                (1 << 7)
65 #define FT_RFLAG_UCS4                  (1 << 8)
66 #define FT_RFLAG_USE_BITMAP_STRIKES    (1 << 9)
67 #define FT_RFLAG_DEFAULTS              (FT_RFLAG_HINTED | \
68                                         FT_RFLAG_USE_BITMAP_STRIKES | \
69                                         FT_RFLAG_ANTIALIAS)
70
71
72 #define FT_RENDER_NEWBYTEARRAY      0x0
73 #define FT_RENDER_NEWSURFACE        0x1
74 #define FT_RENDER_EXISTINGSURFACE   0x2
75
76 /**********************************************************
77  * Global module types
78  **********************************************************/
79
80 typedef struct _scale_s {
81     FT_UInt x, y;
82 } Scale_t;
83 typedef FT_Angle Angle_t;
84
85 struct fontinternals_;
86 struct freetypeinstance_;
87
88 typedef struct {
89     FT_Long font_index;
90     FT_Open_Args open_args;
91 } pgFontId;
92
93 typedef struct {
94     PyObject_HEAD
95     pgFontId id;
96     PyObject *path;
97     int is_scalable;
98     int is_bg_col_set;
99
100     Scale_t face_size;
101     FT_Int16 style;
102     FT_Int16 render_flags;
103     double strength;
104     double underline_adjustment;
105     FT_UInt resolution;
106     Angle_t rotation;
107     FT_Matrix transform;
108     FT_Byte fgcolor[4];
109     FT_Byte bgcolor[4];
110
111     struct freetypeinstance_ *freetype;  /* Personal reference */
112     struct fontinternals_ *_internals;
113 } pgFontObject;
114
115 #define pgFont_IS_ALIVE(o) \
116     (((pgFontObject *)(o))->_internals != 0)
117
118 /* import public API */
119 #include "include/pygame_freetype.h"
120
121 #define PYGAMEAPI_FREETYPE_NUMSLOTS 2
122
123 #endif /* ~_PYGAME_FREETYPE_INTERNAL_H_ */