source: project/nondescript/gl-font/gl_font.h @ 36667

Last change on this file since 36667 was 3730, checked in by thu, 14 years ago

beginning of unicode support -- code need to be cleaned

File size: 1.1 KB
Line 
1#ifndef GL_FONT_H
2#define GL_FONT_H
3
4#include <GL/gl.h>
5#include <ft2build.h>
6#include FT_FREETYPE_H
7#include FT_GLYPH_H
8
9
10/* opengl memory-kept texture font */
11typedef struct font_s
12{
13  int list_base;
14  GLuint texture_id;
15} font_t;
16
17/* glyph_info_t holds information
18 * about glyph's position in the glyphs buffer.
19 * Stolen from fltk.
20 */
21typedef struct glyph_info_s
22{
23  int x, y, w, h;   /* location of the pixmap in memory */
24  int left, bottom; /* corner of the pixmap relative to glyph origin */
25  float advance;    /* x advance value */
26} glyph_info_t;
27
28/* on-the-fly texture generation for unicode support;
29 * no caching (I guess it should have some caching). */
30typedef struct font_unicode_s
31{
32  FT_Face         face;
33  unsigned char   * image;
34  int             width;
35  int             height;
36  glyph_info_t    glyph_info;
37  GLuint          texture_id;
38} font_unicode_t;
39
40void gl_print_ascii( char * text );
41void gl_print_ansi( char * text );
42void gl_print( font_unicode_t * font, char * text );
43void create_font_from_path_ascii( char * font_path );
44font_unicode_t * create_font_from_path( char * font_path );
45void create_font( void );
46
47#endif /* GL_FONT_H */
48
Note: See TracBrowser for help on using the repository browser.