[GRASS-SVN] r45236 - grass/trunk/display/d.barscale
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 28 08:50:20 EST 2011
Author: neteler
Date: 2011-01-28 05:50:20 -0800 (Fri, 28 Jan 2011)
New Revision: 45236
Modified:
grass/trunk/display/d.barscale/draw_scale.c
grass/trunk/display/d.barscale/main.c
grass/trunk/display/d.barscale/options.h
Log:
Font size support added
Modified: grass/trunk/display/d.barscale/draw_scale.c
===================================================================
--- grass/trunk/display/d.barscale/draw_scale.c 2011-01-28 13:45:19 UTC (rev 45235)
+++ grass/trunk/display/d.barscale/draw_scale.c 2011-01-28 13:50:20 UTC (rev 45236)
@@ -57,7 +57,7 @@
}
};
-int draw_scale(int toptext)
+int draw_scale(int toptext, int size)
{
double meters;
double line_len;
@@ -66,13 +66,11 @@
double t, b, l, r;
int pt, pb, pl, pr;
int i;
- int size;
double xarr[5], yarr[5];
double seg_len;
const struct scale *scales = all_scales[use_feet];
/* Establish text size */
- size = 14;
D_text_size(size, size);
D_setup_unity(0);
Modified: grass/trunk/display/d.barscale/main.c
===================================================================
--- grass/trunk/display/d.barscale/main.c 2011-01-28 13:45:19 UTC (rev 45235)
+++ grass/trunk/display/d.barscale/main.c 2011-01-28 13:50:20 UTC (rev 45236)
@@ -12,7 +12,7 @@
* Hamish Bowman <hamish_b yahoo.com>,
* Jan-Oliver Wagner <jan intevation.de>
* PURPOSE: displays a barscale on graphics monitor
- * COPYRIGHT: (C) 1999-2007 by the GRASS Development Team
+ * COPYRIGHT: (C) 1999-2011 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
@@ -41,9 +41,10 @@
int main(int argc, char **argv)
{
struct GModule *module;
- struct Option *opt1, *opt2, *opt3;
+ struct Option *opt1, *opt2, *opt3, *fsize;
struct Flag *feet, *top, *linescale, *northarrow, *scalebar;
struct Cell_head W;
+ int fontsize;
/* Initialize the GIS calls */
G_gisinit(argv[0]);
@@ -90,6 +91,14 @@
opt3->description =
_("The screen coordinates for top-left corner of label ([0,0] is top-left of frame)");
+ fsize = G_define_option();
+ fsize->key = "fontsize";
+ fsize->type = TYPE_INTEGER;
+ fsize->required = NO;
+ fsize->answer = "14";
+ fsize->options = "1-72";
+ fsize->description = _("Font size for gridline coordinate labels");
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -113,8 +122,8 @@
sscanf(opt3->answers[0], "%lf", &east);
sscanf(opt3->answers[1], "%lf", &north);
+ fontsize = atoi(fsize->answer);
-
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));
@@ -129,7 +138,7 @@
color2 = D_parse_color(opt2->answer, 0);
/* Draw the scale */
- draw_scale(top->answer);
+ draw_scale(top->answer, fontsize);
D_close_driver();
Modified: grass/trunk/display/d.barscale/options.h
===================================================================
--- grass/trunk/display/d.barscale/options.h 2011-01-28 13:45:19 UTC (rev 45235)
+++ grass/trunk/display/d.barscale/options.h 2011-01-28 13:50:20 UTC (rev 45236)
@@ -9,4 +9,4 @@
extern int draw;
/* draw_scale.c */
-int draw_scale(int toptext);
+int draw_scale(int toptext, int fontsize);
More information about the grass-commit
mailing list