[GRASS-dev] Error in redrawing text layer in gis.m

Michael Barton wrote:

The script was resetting GRASS_FONT after running d.text.new. If GRASS_FONT
was not initially set, the script tried to set it to "". This caused a
failure in running d.frame -e for some reason.

Note that "d.frame -e" is redundant when using direct rendering. Every
d.* command starts with a single full-screen frame.

--
Glynn Clements <glynn@gclements.plus.com>

Great. Very glad you're not stuck with Arc.

As with most bugs, the main issue is figuring out exactly what went wrong...and this can take a LONG time.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

-----Original Message-----
From: Patton, Eric [mailto:epatton@nrcan.gc.ca]
Sent: Fri 11/17/2006 12:14 PM
To: Michael Barton; Hamish
Cc: grass-dev@grass.itc.it
Subject: RE: [GRASS-dev] Error in redrawing text layer in gis.m

Yes! I very happy to report this bug has been vanquished. Thanks very much Michael! Now I don't have to do all my figures in Arc.

Cheers,

~ Eric.

-----Original Message-----
From: Michael Barton
To: Patton, Eric; Hamish
Cc: grass-dev@grass.itc.it
Sent: 11/17/2006 1:30 PM
Subject: Re: [GRASS-dev] Error in redrawing text layer in gis.m

I think I found and fixed it.

It was not in grid but in the font setting environmental variable in
dtext.tcl.

The script was resetting GRASS_FONT after running d.text.new. If
GRASS_FONT
was not initially set, the script tried to set it to "". This caused a
failure in running d.frame -e for some reason. Anyway, if GRASS_FONT is
initially not set, it is unset (rather than being set to "") after
running
d.text. I think this fixes the problem.

Please test and let me know.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: "Patton, Eric" <epatton@nrcan.gc.ca>
Date: Fri, 17 Nov 2006 09:03:35 -0500
To: Hamish <hamish_nospam@yahoo.com>, Michael Barton

<michael.barton@asu.edu>

Cc: <grass-dev@grass.itc.it>
Conversation: [GRASS-dev] Error in redrawing text layer in gis.m
Subject: RE: [GRASS-dev] Error in redrawing text layer in gis.m

HB:

Eric: any reason you aren't letting d.grid label the lines for you?
It should be formatted and rotated nicely (e.g. 44:26N)
(i.e. is there something about that you think could be improved?)

The geogrid tool in gis.m doesn't allow you to change the font size.

So I

wanted to draw a lat-long grid over my UTM map display, but turn off

graticule

labels so I could use a dedicated text layer with larger labels

instead. Like

for making screenshots and figures for reports - the default text size

of the

geogrid labels are too small to read without squinting.

PS - the text tool is the third button from the right on the top row

of

buttons in gis.m.

~ Eric.

So I can take this out of commonlayer too. Thanks.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

-----Original Message-----
From: Glynn Clements [mailto:glynn@gclements.plus.com]
Sent: Fri 11/17/2006 1:37 PM
To: Michael Barton
Cc: Patton, Eric; Hamish; grass-dev@grass.itc.it
Subject: Re: [GRASS-dev] Error in redrawing text layer in gis.m

Michael Barton wrote:

The script was resetting GRASS_FONT after running d.text.new. If GRASS_FONT
was not initially set, the script tried to set it to "". This caused a
failure in running d.frame -e for some reason.

Note that "d.frame -e" is redundant when using direct rendering. Every
d.* command starts with a single full-screen frame.

--
Glynn Clements <glynn@gclements.plus.com>

Patton, Eric wrote:

HB:
>Eric: any reason you aren't letting d.grid label the lines for you?
>It should be formatted and rotated nicely (e.g. 44:26N)
>(i.e. is there something about that you think could be improved?)

The geogrid tool in gis.m doesn't allow you to change the font size.
So I wanted to draw a lat-long grid over my UTM map display, but turn
off graticule labels so I could use a dedicated text layer with larger
labels instead. Like for making screenshots and figures for reports -
the default text size of the geogrid labels are too small to read
without squinting.

ok, makes sense. That font size was hard-coded in d.grid as "9". I've
just added a fontsize= option in CVS so you can make this bigger without
all the extra work of manual placement: better to attack the problem at
the source! The gis.m grid controls will need updating to take advantage
of this.

note you could use another (bigger) font there, use d.font.freetype or
$GRASS_FONT to set it before calling d.grid. Many truetype fonts look
bigger & more readable vs the simple grass ones. e.g. try a bold font.

PS - the text tool is the third button from the right on the top row
of buttons in gis.m.

I haven't updated the GUI in my local source tree which is why I
couldn't see it.

Hamish

HB:

ok, makes sense. That font size was hard-coded in d.grid as "9". I've
just added a fontsize= option in CVS so you can make this bigger without
all the extra work of manual placement: better to attack the problem at
the source! The gis.m grid controls will need updating to take advantage
of this.

Excellent, thanks very much!

HB:

note you could use another (bigger) font there, use d.font.freetype or
$GRASS_FONT to set it before calling d.grid. Many truetype fonts look
bigger & more readable vs the simple grass ones. e.g. try a bold font.

I know; one good about Michael's new text tool is that it has a file browser to load in Grass fonts, X11 truetype, or any other font files located anywhere. Really nice.

~ Eric.

Now I'm just being greedy; is it much more effort to allow bold text on
the graticule labels as well? Should I file a wish instead?

Thanks,
--
Eric Patton
epatton@nrcan.gc.ca

-----Original Message-----
From: Hamish [mailto:hamish_nospam@yahoo.com]
Sent: Saturday, November 18, 2006 7:57 AM
To: Patton, Eric
Cc: michael.barton@asu.edu; grass-dev@grass.itc.it
Subject: Re: [GRASS-dev] Error in redrawing text layer in gis.m

ok, makes sense. That font size was hard-coded in d.grid as "9". I've

just added a fontsize= option in CVS so you can make this bigger without
all the extra work of manual

placement: better to attack the problem at the source! The gis.m grid

controls will need updating to take advantage of this.

note you could use another (bigger) font there, use d.font.freetype or

$GRASS_FONT to set it before calling d.grid. Many truetype fonts look
bigger & more readable vs the simple >grass ones. e.g. try a bold font.

I haven't updated the GUI in my local source tree which is why I

couldn't see it.

Hamish

Patton, Eric wrote:

Now I'm just being greedy; is it much more effort to allow bold text
on the graticule labels as well? Should I file a wish instead?

you can just specify that GRASS should use a bold TrueType font, there's
usually bold versions of a given font in another file:

Times_New_Roman.ttf
Times_New_Roman_Bold.ttf
Times_New_Roman_Bold_Italic.ttf
Times_New_Roman_Italic.ttf

note the "bolding" GRASS text usually just shifts up&to the side 1
pixel & draws the text again, so it looks bolder but not necessarily
any clearer. I'd rather not spread that method into any more modules if
at all possible.

Hamish

Good enough; thanks for the tip Hamish.

~ Eric.

-----Original Message-----
From: Hamish
To: Patton, Eric
Cc: grass-dev@grass.itc.it
Sent: 11/20/2006 6:55 PM
Subject: Re: [GRASS-dev] Error in redrawing text layer in gis.m

Patton, Eric wrote:

Now I'm just being greedy; is it much more effort to allow bold text
on the graticule labels as well? Should I file a wish instead?

you can just specify that GRASS should use a bold TrueType font, there's
usually bold versions of a given font in another file:

Times_New_Roman.ttf
Times_New_Roman_Bold.ttf
Times_New_Roman_Bold_Italic.ttf
Times_New_Roman_Italic.ttf

note the "bolding" GRASS text usually just shifts up&to the side 1
pixel & draws the text again, so it looks bolder but not necessarily
any clearer. I'd rather not spread that method into any more modules if
at all possible.

Hamish