From http://www.jwz.org/xscreensaver/xscreensaver-5.31.tar.gz
[xscreensaver] / hacks / glx / texfont.h
index 05c9219a292125ee345ed112a663fde44682750a..a708ae2be6ad344f98faa61cefe2d197258a19d4 100644 (file)
@@ -1,4 +1,4 @@
-/* texfonts, Copyright (c) 2005 Jamie Zawinski <jwz@jwz.org>
+/* texfonts, Copyright (c) 2005-2014 Jamie Zawinski <jwz@jwz.org>
  * Loads X11 fonts into textures for use with OpenGL.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -20,16 +20,29 @@ typedef struct texture_font_data texture_font_data;
 */
 extern texture_font_data *load_texture_font (Display *, char *res);
 
-/* Width of the string in pixels.
+/* Bounding box of the multi-line string, in pixels.
  */
 extern int texture_string_width (texture_font_data *, const char *,
-                                 int *line_height_ret);
+                                 int *height_ret);
 
 /* Draws the string in the scene at the origin.
    Newlines and tab stops are honored.
+   Any numbers inside [] will be rendered as a subscript.
+   Assumes the font has been loaded as with load_texture_font().
  */
 extern void print_texture_string (texture_font_data *, const char *);
 
+/* Draws the string on the window at the given pixel position.
+   Newlines and tab stops are honored.
+   Any numbers inside [] will be rendered as a subscript.
+   Assumes the font has been loaded as with load_texture_font().
+
+   Position is 0 for center, 1 for top left, 2 for bottom left.
+ */
+void print_texture_label (Display *, texture_font_data *,
+                          int window_width, int window_height,
+                          int position, const char *string);
+
 /* Releases the texture font.
  */
 extern void free_texture_font (texture_font_data *);