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

Markus Neteler neteler at itc.it
Tue Jul 31 03:52:38 EDT 2007



Glynn Clements wrote:
> 
> 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, is there a reason to wipe the font out in D_clear_window()? I would
set if for the entire session (or longer) (otherwise use d.font again).
If it is due to technical constraints, should I modify the d.redraw/d.out.*
to first grab the font setting and then restore it after d.erase?
I would like to avoid that I have to hack a couple of GRASS scripts
locally to keep the font setting in the monitor.

Markus
-- 
View this message in context: http://www.nabble.com/d.out.file-and-d.font-issue-tf4169926.html#a11919720
Sent from the Grass - Dev mailing list archive at Nabble.com.




More information about the grass-dev mailing list