[GRASS-SVN] r58818 - grass/branches/develbranch_6/display/d.text.new

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 30 21:35:09 PST 2014


Author: hamish
Date: 2014-01-30 21:35:08 -0800 (Thu, 30 Jan 2014)
New Revision: 58818

Modified:
   grass/branches/develbranch_6/display/d.text.new/description.html
   grass/branches/develbranch_6/display/d.text.new/main.c
Log:
respect the GRASS_FONTSIZE enviro variable if it is set (see r58817 for comments on G7 strategy)

Modified: grass/branches/develbranch_6/display/d.text.new/description.html
===================================================================
--- grass/branches/develbranch_6/display/d.text.new/description.html	2014-01-31 03:03:32 UTC (rev 58817)
+++ grass/branches/develbranch_6/display/d.text.new/description.html	2014-01-31 05:35:08 UTC (rev 58818)
@@ -63,6 +63,7 @@
 
 </dl>
 
+
 <h2>EXAMPLE</h2>
 
 The following command will print the short phrase "This is
@@ -93,10 +94,16 @@
 suitable for input to <em>d.text</em>.
 
 <p>
-
 <em>d.text</em> needs escape sequences that can be used
 within lines to change colors, boldness, and perhaps size.
 
+<p>
+The font size as given on the command line can be manually overridden
+by setting the <tt>GRASS_FONTSIZE</tt> environment variable. This does
+not affect the ".S" command file sizing. <!-- since you might want to
+use more than one size when using an input file -->
+
+
 <h2>SEE ALSO</h2>
 
 <em><a href="d.font.html">d.font</a></em><br>
@@ -115,4 +122,5 @@
 <p>
 Updates by Huidae Cho
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/branches/develbranch_6/display/d.text.new/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.text.new/main.c	2014-01-31 03:03:32 UTC (rev 58817)
+++ grass/branches/develbranch_6/display/d.text.new/main.c	2014-01-31 05:35:08 UTC (rev 58818)
@@ -134,6 +134,7 @@
     int set_x, set_y;
     double east, north;
     int do_background, fg_color, bg_color;
+    const char *fontsize_override;
 
     /* initialize the GIS calls */
     G_gisinit(argv[0]);
@@ -354,6 +355,10 @@
     prev_x = x;
     prev_y = y;
 
+
+    if ((fontsize_override = getenv("GRASS_FONTSIZE")))
+	sscanf(fontsize_override, "%d", &size);
+
     R_text_size(size, size);
     R_text_rotation((float)(rotation * 180.0 / M_PI));
 



More information about the grass-commit mailing list