8 static int font_type = GFONT_STROKE;
10 static void stroke_set(
const char *filename)
13 font_type = GFONT_STROKE;
16 static void freetype_set(
const char *filename,
int index)
19 font_type = GFONT_FREETYPE;
28 freetype_set(name, 0);
34 for (i = 0;
ftcap[i].name; i++)
35 if (strcmp(name,
ftcap[i].name) == 0) {
42 stroke_set(
ftcap[i].name);
59 return font_type == GFONT_FREETYPE;
62 static void font_list(
char ***list,
int *
count,
int verbose)
68 for (i = 0;
ftcap[i].name; i++) ;
72 fonts = G_malloc(num_fonts *
sizeof(
const char *));
74 for (i = 0; i < num_fonts; i++) {
75 struct GFONT_CAP *p = &
ftcap[i];
80 sprintf(buf,
"%s|%s|%d|%s|%d|%s|",
81 p->name, p->longname, p->type,
82 p->path, p->index, p->encoding);
96 font_list(list, count, 0);
101 font_list(list, count, 1);
108 for (i = 0; i <
count; i++)
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
void G_free(void *buf)
Free allocated memory.
char * G_store(const char *s)
Copy string to allocated memory.
int font_init(const char *)
void COM_Font_init_charset(const char *)
int font_init_freetype(const char *, int)
void COM_Font_list(char ***, int *)
void free_font_list(char **fonts, int num_fonts)
void COM_Font_info(char ***, int *)
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
int G_is_absolute_path(const char *path)
Checks if a specified path looks like an absolute path on the host system.
int font_is_freetype(void)
int font_exists(const char *name)
void COM_Font_get(const char *)
int font_init_charset(const char *)