[GRASS-SVN] r32606 - in grass/trunk/display: . d.fontlist

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 7 03:28:19 EDT 2008


Author: glynn
Date: 2008-08-07 03:28:18 -0400 (Thu, 07 Aug 2008)
New Revision: 32606

Added:
   grass/trunk/display/d.fontlist/
   grass/trunk/display/d.fontlist/Makefile
   grass/trunk/display/d.fontlist/description.html
   grass/trunk/display/d.fontlist/main.c
Modified:
   grass/trunk/display/Makefile
Log:
Add d.fontlist


Modified: grass/trunk/display/Makefile
===================================================================
--- grass/trunk/display/Makefile	2008-08-07 06:13:28 UTC (rev 32605)
+++ grass/trunk/display/Makefile	2008-08-07 07:28:18 UTC (rev 32606)
@@ -7,6 +7,7 @@
 	d.colortable \
 	d.erase \
 	d.font \
+	d.fontlist \
 	d.geodesic \
 	d.graph \
 	d.grid \


Property changes on: grass/trunk/display/d.fontlist
___________________________________________________________________
Name: svn:ignore
   + *.tmp.html
*OBJ*


Added: grass/trunk/display/d.fontlist/Makefile
===================================================================
--- grass/trunk/display/d.fontlist/Makefile	                        (rev 0)
+++ grass/trunk/display/d.fontlist/Makefile	2008-08-07 07:28:18 UTC (rev 32606)
@@ -0,0 +1,10 @@
+MODULE_TOPDIR = ../..
+
+PGM = d.fontlist
+
+LIBES     = $(RASTERLIB) $(GISLIB)
+DEPENDENCIES= $(RASTERDEP) $(GISDEP)
+
+include $(MODULE_TOPDIR)/include/Make/Module.make
+
+default: cmd

Added: grass/trunk/display/d.fontlist/description.html
===================================================================
--- grass/trunk/display/d.fontlist/description.html	                        (rev 0)
+++ grass/trunk/display/d.fontlist/description.html	2008-08-07 07:28:18 UTC (rev 32606)
@@ -0,0 +1,15 @@
+<H2>DESCRIPTION</H2>
+
+<EM>d.fontlist</EM> outputs a list of available fonts for use with
+GRASS display commands.
+
+<H2>SEE ALSO</H2>
+
+<EM><A HREF="d.text.html">d.text</A></EM><br>
+<EM><A HREF="parser.html">parser</A></EM>
+
+<H2>AUTHOR</H2>
+
+Glynn Clements
+
+<p><i>Last changed: $Date: 2008-06-28 00:01:20 +0100 (Sat, 28 Jun 2008) $</i>

Added: grass/trunk/display/d.fontlist/main.c
===================================================================
--- grass/trunk/display/d.fontlist/main.c	                        (rev 0)
+++ grass/trunk/display/d.fontlist/main.c	2008-08-07 07:28:18 UTC (rev 32606)
@@ -0,0 +1,67 @@
+
+/****************************************************************************
+ *
+ * MODULE:       d.fontlist
+ * AUTHOR(S):    James Westervelt (CERL) (original contributor)
+ *               Markus Neteler <neteler itc.it>,
+ *               Bernhard Reiter <bernhard intevation.de>, 
+ *               Huidae Cho <grass4u gmail.com>, 
+ *               Eric G. Miller <egm2 jps.net>, 
+ *               Glynn Clements <glynn gclements.plus.com>, 
+ *               Jan-Oliver Wagner <jan intevation.de>
+ * PURPOSE:      user selection of font for graphics monitor text
+ * COPYRIGHT:    (C) 1999-2008 by the GRASS Development Team
+ *
+ *               This program is free software under the GNU General Public
+ *               License (>=v2). Read the file COPYING that comes with GRASS
+ *               for details.
+ *
+ *****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <grass/gis.h>
+#include <grass/raster.h>
+#include <grass/glocale.h>
+
+int main(int argc, char **argv)
+{
+    struct GModule *module;
+    struct Flag *flagl, *flagL;
+    char **list;
+    int count;
+    int i;
+
+    G_gisinit(argv[0]);
+
+    module = G_define_module();
+    module->keywords = _("display");
+    module->description = _("Lists the available fonts.");
+
+    flagl = G_define_flag();
+    flagl->key = 'l';
+    flagl->description = _("List fonts (default; provided for compatibility with d.font)");
+
+    flagL = G_define_flag();
+    flagL->key = 'L';
+    flagL->description = _("List fonts verbosely");
+
+    if (argc > 1 && G_parser(argc, argv))
+	exit(EXIT_FAILURE);
+
+    if (R_open_driver() != 0)
+	G_fatal_error(_("No graphics device selected"));
+
+    if (flagL->answer)
+	R_font_info(&list, &count);
+    else
+	R_font_list(&list, &count);
+
+    for (i = 0; i < count; i++)
+	fprintf(stdout, "%s\n", list[i]);
+
+    R_close_driver();
+
+    exit(EXIT_SUCCESS);
+}
+



More information about the grass-commit mailing list