9#define FONT_COLOUR_CODE '#'
11#define FONT_FLAG_DONTREUSE (1<<1)
16typedef struct glFont_s {
27typedef struct glFontRestore_s {
40typedef struct glPrintLineIterator_s {
56int gl_fontInit(
glFont* font,
const char *fname,
const unsigned int h,
const char *prefix,
unsigned int flags );
58int gl_fontAddFallbackFont(
glFont* font,
const glFont *f );
66 const double x,
const double y,
67 const glColour*
c,
const double outlineR ,
const char *text);
69 const glColour*
c,
const double outlineR ,
const char *text );
71 const double x,
const double y,
72 const glColour*
c,
const double outlineR ,
const char *text);
74 double x,
const double y,
75 const glColour*
c,
const double outlineR ,
const char *text);
77 const int width,
const int height,
78 double bx,
double by,
int line_height,
79 const glColour*
c,
const double outlineR,
const char *text);
81 const double x,
const double y,
82 const glColour*
c,
const char *text);
88PRINTF_FORMAT( 5, 6 ) void gl_print( const
glFont *ft_font,
double x,
double y,
89 const glColour *
c, const
char *fmt, ... );
91PRINTF_FORMAT( 6, 7 )
int gl_printMax( const
glFont *ft_font, const
int max,
93 const glColour *
c, const
char *fmt, ... );
95PRINTF_FORMAT( 6, 7 )
int gl_printMid( const
glFont *ft_font, const
int width,
97 const glColour*
c, const
char *fmt, ... );
99PRINTF_FORMAT( 8, 9 )
int gl_printText( const
glFont *ft_font,
100 int width,
int height,
101 double bx,
double by,
int line_height,
102 const glColour*
c, const
char *fmt, ... );
107int gl_printWidthRaw( const
glFont *ft_font, const
char *text );
108PRINTF_FORMAT( 2, 3 )
int gl_printWidth( const
glFont *ft_font, const
char *fmt, ... );
109int gl_printHeightRaw( const
glFont *ft_font,
int width, const
char *text );
110PRINTF_FORMAT( 3, 4 )
int gl_printHeight( const
glFont *ft_font,
int width, const
char *fmt, ... );
111int gl_printLinesRaw( const
glFont *ft_font,
int width, const
char *text );
112PRINTF_FORMAT( 3, 4 )
int gl_printLines( const
glFont *ft_font,
int width, const
char *fmt, ... );
115void gl_printRestoreClear (
void);
117void gl_printRestoreLast (
void);
119void gl_printStoreMax(
glFontRestore *restore, const
char *text,
int max );
120void gl_printStore(
glFontRestore *restore, const
char *text );
123void gl_fontSetFilter( const
glFont *ft_font, GLint min, GLint mag );
void gl_printRaw(const glFont *ft_font, double x, double y, const glColour *c, double outlineR, const char *text)
Prints text on screen.
int gl_printMidRaw(const glFont *ft_font, int width, double x, double y, const glColour *c, double outlineR, const char *text)
Displays text centered in position and width.
int gl_fontAddFallback(glFont *font, const char *fname, const char *prefix)
Adds a fallback font to a font.
int gl_printTextRaw(const glFont *ft_font, const int width, const int height, double bx, double by, int line_height, const glColour *c, double outlineR, const char *text)
Prints a block of text that fits in the dimensions given.
void gl_freeFont(glFont *font)
Frees a loaded font. Caution: its glFontStash still has a slot in avail_fonts. At the time of writing...
void gl_printRawH(const glFont *ft_font, const mat4 *H, const glColour *c, const double outlineR, const char *text)
Prints text on screen using a transformation matrix.
int gl_printMaxRaw(const glFont *ft_font, const int max, double x, double y, const glColour *c, double outlineR, const char *text)
Behaves like gl_printRaw but stops displaying text after a certain distance.
int gl_fontInit(glFont *font, const char *fname, const unsigned int h, const char *prefix, unsigned int flags)
Initializes a font.
void gl_fontExit(void)
Frees all resources associated with the font system. This also resets font ID tracking,...
void gl_printMarkerRaw(const glFont *ft_font, double x, double y, const glColour *c, const char *text)
Wrapper for gl_printRaw for map overlay markers.
Evil hack to allow restoring, yes it makes me cry myself to sleep.
Represents a font in memory.
The state of a line iteration. This matches the process of rendering text into an on-screen box: An e...