2
/****************************************************************************
5
* AUTHOR(S): James Westervelt (CERL) (original contributor)
6
* Markus Neteler <neteler itc.it>,
7
* Bernhard Reiter <bernhard intevation.de>,
8
* Huidae Cho <grass4u gmail.com>,
9
* Eric G. Miller <egm2 jps.net>,
10
* Glynn Clements <glynn gclements.plus.com>,
11
* Jan-Oliver Wagner <jan intevation.de>
12
* PURPOSE: user selection of font for graphics monitor text
13
* COPYRIGHT: (C) 1999-2008 by the GRASS Development Team
15
* This program is free software under the GNU General Public
16
* License (>=v2). Read the file COPYING that comes with GRASS
20
* d.fontlist gets the list via D_font_list(), which calls COM_Font_list(),
21
* which first reads the fonts from the file specified by $GRASS_FONT_CAP
22
* (falling back to $GISBASE/etc/fontcap), then adds any fonts obtained by
23
* the driver's Font_list method if provided (currently, only the cairo
24
* driver implements this method).
26
*****************************************************************************/
30
#include <grass/gis.h>
31
#include <grass/display.h>
32
#include <grass/glocale.h>
34
int main(int argc, char **argv)
36
struct GModule *module;
37
struct Flag *flagl, *flagL;
44
module = G_define_module();
45
G_add_keyword(_("display"));
46
G_add_keyword(_("settings"));
47
module->description = _("Lists the available fonts.");
49
flagl = G_define_flag();
51
flagl->description = _("List fonts (default; provided for compatibility with d.font)");
53
flagL = G_define_flag();
55
flagL->description = _("List fonts verbosely");
57
if (G_parser(argc, argv))
63
D_font_info(&list, &count);
65
D_font_list(&list, &count);
67
for (i = 0; i < count; i++)
68
fprintf(stdout, "%s\n", list[i]);