[GRASS-dev] d.out.file and d.font issue

Glynn Clements glynn at gclements.plus.com
Tue Jul 31 00:27:00 EDT 2007


Markus Neteler wrote:

> I tried to make a nice GRASS monitor dump with d.out.file but
> realized that the freetype fonts are only approximated:
> 
> # spearfish
> g.region rast=elevation.dem -p
> d.mon x0
> d.font FreeSans
> d.rast elevation.dem
> echo "Spearfish elevation" | d.text col=black
> # ... looks nice
> 
> d.out.file demo res=2 format=png
> display demo.png
> # ... looks say, different
> 
> This is probably know - or is it a non-feature?
> ###########
> 
> (Un ?)related: a monitor de-/reselect doesn't make survive the 
> font selection:
> 
> g.region rast=elevation.dem -p
> d.mon x0
> d.font FreeSans
> d.rast elevation.dem
> echo "Spearfish elevation" | d.text col=black
> # ... looks nice
> 
> d.mon x1
> d.mon sel=x0
> d.redraw    # or resize
> 
> Probably the d.out.file problem is related to this. Does D_add_to_list()
> fail or
> something like that?

Unless called with -o, d.rast erases the screen, which removes the
font setting (the monitor remembers the actual font setting, but the
information is removed from the "pads", which is what d.save uses):

[display/d.rast/display.c lines 38-40]

    /* cell maps wipe out a picture, so we clear info on the window too */
    if (!overlay)
	D_clear_window();

Try running d.font *after* d.rast.

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




More information about the grass-dev mailing list