29 return access(name,
R_OK) >= 0;
46 if (sscanf(str,
"%[^|]|%[^|]|%d|%[^|]|%d|%[^|]|",
47 name, longname, &type, path, &index, encoding) == 6) {
52 else if (sscanf(str,
"%[^|]|%[^|]|%d||%d|%[^|]|",
53 name, longname, &type, &index, encoding) == 5)
82 if ((capfile =
getenv(
"GRASS_FONT_CAP"))) {
83 if ((fp = fopen(capfile,
"r")) ==
NULL)
84 G_warning(
_(
"%s: Unable to read font definition file; use the default"),
88 sprintf(file,
"%s/etc/fontcap",
G_gisbase());
89 if ((fp = fopen(file,
"r")) ==
NULL)
90 G_warning(
_(
"%s: No font definition file"), file);
94 while (fgets(buf,
sizeof(buf), fp) && !feof(fp)) {
106 fonts[fonts_count++] = cap;
131 for (i = 0; ftcap[i].
name; i++) {
struct GFONT_CAP * parse_fontcap(void)
Parse fontcaps.
void G_free(void *)
Free allocated memory.
int parse_fontcap_entry(struct GFONT_CAP *e, const char *str)
Parse fontcap entry.
void free_fontcap(struct GFONT_CAP *ftcap)
Free allocated GFONT_CAP structure.
int font_exists(const char *name)
Check if font exists.
const char * G_gisbase(void)
Get full path name of the top level module directory.
void G_warning(const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.