-/* texfonts, Copyright (c) 2005-2014 Jamie Zawinski <jwz@jwz.org>
+/* texfonts, Copyright (c) 2005-2015 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
*/
extern texture_font_data *load_texture_font (Display *, char *res);
-/* Bounding box of the multi-line string, in pixels.
+/* Bounding box of the multi-line string, in pixels,
+ and overall ascent/descent of the font.
*/
-extern int texture_string_width (texture_font_data *, const char *,
- int *height_ret);
+extern void texture_string_metrics (texture_font_data *, const char *,
+ XCharStruct *metrics_ret,
+ int *ascent_ret, int *descent_ret);
/* Draws the string in the scene at the origin.
Newlines and tab stops are honored.
int window_width, int window_height,
int position, const char *string);
+/* Renders the given string into the prevailing texture.
+ Returns the metrics of the text, and size of the texture.
+ */
+void string_to_texture (texture_font_data *, const char *,
+ XCharStruct *extents_ret,
+ int *tex_width_ret, int *tex_height_ret);
+
+/* Set the various OpenGL parameters for properly rendering things
+ with a texture generated by string_to_texture().
+ */
+void enable_texture_string_parameters (void);
+
+
/* Releases the texture font.
*/
extern void free_texture_font (texture_font_data *);