#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include "bmpman/bmpman.h"
#include "cfile/cfile.h"
#include "globalincs/def_files.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"
#include "graphics/font.h"
#include "io/key.h"
#include "localization/localize.h"
#include "palman/palman.h"
#include "parse/parselo.h"
Go to the source code of this file.
|
int | gr_force_fit_string (char *str, int max_str, int max_width) |
|
int | get_char_width (ubyte c1, ubyte c2, int *width, int *spacing) |
|
int | get_centered_x (const char *s, bool scaled) |
|
void | gr_char_centered (int x, int y, char chr, ubyte sc1, int resize_mode) |
|
void | gr_print_timestamp (int x, int y, fix timestamp, int resize_mode) |
|
int | gr_get_font_height () |
|
void | gr_get_string_size (int *w1, int *h1, const char *text, int len) |
|
void _cdecl | gr_printf (int x, int y, const char *format,...) |
|
void _cdecl | gr_printf_menu (int x, int y, const char *format,...) |
|
void _cdecl | gr_printf_menu_zoomed (int x, int y, const char *format,...) |
|
void _cdecl | gr_printf_no_resize (int x, int y, const char *format,...) |
|
void | gr_font_close () |
|
int | gr_create_font (char *typeface) |
|
int | gr_get_current_fontnum () |
|
int | gr_get_fontnum (const char *filename) |
|
void | gr_set_font (int fontnum) |
|
void | parse_fonts_tbl (char *only_parse_first_font, size_t only_parse_first_font_size) |
|
void | gr_stuff_first_font (char *first_font, size_t first_font_size) |
|
void | gr_font_init () |
|
int get_centered_x |
( |
const char * |
s, |
|
|
bool |
scaled |
|
) |
| |
Takes the character BEFORE being offset into current font
- Returns
- the letter code
Definition at line 75 of file font.cpp.
Draws a character centered on x
Definition at line 129 of file font.cpp.
int gr_create_font |
( |
char * |
typeface | ) |
|
- Returns
- -1 if couldn't init font, otherwise returns the font id number.
Definition at line 401 of file font.cpp.
int gr_force_fit_string |
( |
char * |
str, |
|
|
int |
max_str, |
|
|
int |
max_width |
|
) |
| |
Crops a string if required to force it to not exceed max_width pixels when printed. Does this by dropping characters at the end of the string and adding '...' to the end.
- Parameters
-
str | string to crop. Modifies this string directly |
max_str | max characters allowed in str |
max_width | number of pixels to limit string to (less than or equal to). |
- Returns
- Returns the width of the string as given by gr_get_string_size().
Definition at line 48 of file font.cpp.
int gr_get_current_fontnum |
( |
| ) |
|
int gr_get_font_height |
( |
| ) |
|
int gr_get_fontnum |
( |
const char * |
filename | ) |
|
void gr_get_string_size |
( |
int * |
w1, |
|
|
int * |
h1, |
|
|
const char * |
text, |
|
|
int |
len |
|
) |
| |
void gr_stuff_first_font |
( |
char * |
first_font, |
|
|
size_t |
first_font_size |
|
) |
| |
void parse_fonts_tbl |
( |
char * |
only_parse_first_font, |
|
|
size_t |
only_parse_first_font_size |
|
) |
| |
font * Current_font = NULL |
char grx_printf_text[2048] |