4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2008 Blender Foundation.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file blender/blenfont/intern/blf_internal_types.h
33 #ifndef BLF_INTERNAL_TYPES_H
34 #define BLF_INTERNAL_TYPES_H
36 typedef struct GlyphCacheBLF {
37 struct GlyphCacheBLF *next;
38 struct GlyphCacheBLF *prev;
49 /* texture array, to draw the glyphs. */
52 /* size of the array. */
55 /* and the last texture, aka. the current texture. */
58 /* like bftgl, we draw every glyph in a big texture, so this is the
59 * current position inside the texture.
64 /* and the space from one to other. */
67 /* and the bigger glyph in the font. */
71 /* next two integer power of two, to build the texture. */
75 /* number of glyphs in the font. */
78 /* number of glyphs that we load here. */
81 /* ascender and descender value. */
86 typedef struct GlyphBLF {
87 struct GlyphBLF *next;
88 struct GlyphBLF *prev;
90 /* and the character, as UTF8 */
93 /* freetype2 index, to speed-up the search. */
102 /* texture id where this glyph is store. */
105 /* position inside the texture where this glyph is store. */
109 /* Bitmap data, from freetype. Take care that this
112 unsigned char *bitmap;
114 /* glyph width and height. */
122 /* X and Y bearing of the glyph.
123 * The X bearing is from the origin to the glyph left bbox edge.
124 * The Y bearing is from the baseline to the top of the glyph edge.
129 /* with value of zero mean that we need build the texture. */
133 typedef struct FontBLF {
137 /* filename or NULL. */
140 /* aspect ratio or scale. */
143 /* initial position for draw the text. */
146 /* angle in degrees. */
149 /* blur: 3 or 5 large kernel */
155 /* and shadow offset. */
162 /* Multiplied this matrix with the current one before
163 * draw the text! see blf_draw__start.
167 /* clipping rectangle. */
170 /* font dpi (default 72). */
176 /* max texture size. */
182 /* list of glyph cache for this font. */
185 /* current glyph cache, size and dpi. */
186 GlyphCacheBLF *glyph_cache;
188 /* fast ascii lookip */
189 GlyphBLF *glyph_ascii_table[256];
191 /* freetype2 lib handle. */
194 /* freetype2 face. */
197 /* for draw to buffer, always set this to NULL after finish! */
200 /* the same but unsigned char */
201 unsigned char *b_cbuf;
203 /* buffer size, keep signed so comparisons with negative values work */
207 /* number of channels. */
210 /* and the color, the alphas is get from the glyph! */
214 typedef struct DirBLF {
218 /* full path where search fonts. */
222 #endif /* BLF_INTERNAL_TYPES_H */