http://ftp.ksu.edu.tw/FTP/FreeBSD/distfiles/xscreensaver-4.20.tar.gz
[xscreensaver] / hacks / glx / texfont.h
1 /* texfonts, Copyright (c) 2005 Jamie Zawinski <jwz@jwz.org>
2  * Loads X11 fonts into textures for use with OpenGL.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation.  No representations are made about the suitability of this
9  * software for any purpose.  It is provided "as is" without express or 
10  * implied warranty.
11  */
12
13 #ifndef __TEXTURE_FONT_H__
14 #define __TEXTURE_FONT_H__
15
16 typedef struct texture_font_data texture_font_data;
17
18 /* Loads the font named by the X resource "res" and returns
19    a texture-font object.
20 */
21 extern texture_font_data *load_texture_font (Display *, char *res);
22
23 /* Width of the string in pixels.
24  */
25 extern int texture_string_width (texture_font_data *, const char *,
26                                  int *line_height_ret);
27
28 /* Draws the string in the scene at the origin.
29    Newlines and tab stops are honored.
30  */
31 extern void print_texture_string (texture_font_data *, const char *);
32
33 /* Releases the texture font.
34  */
35 extern void free_texture_font (texture_font_data *);
36
37 #endif /* __TEXTURE_FONT_H__ */