[GRASS-dev] d.out.file now talks to the PostScript driver

Hamish hamish_nospam at yahoo.com
Wed May 16 03:07:43 EDT 2007


Michael Barton wrote:
> The display in the TclTk and wxPython GUI is generated by sending
> all d.* commands directly to the PNG driver. So d.save never captures
> these display commands. For this reason, d.out.file will not work with
> the GUI.

I have now added a test in d.out.file to make sure that the current
monitor is an xmon. (and a warning if attempting EPS + d.frame)

Theoretically it may be possible to do PNG->HTMLmap driver with d.save,
but I have no idea so leave that for someone to try by hand if they want
it.


> The high resolution in d.out.file is a bit of a problem. It achieves
> this by setting the size of the output graphic to some multiple of its
> current width and height in pixels before rendering to the PNG driver.
> This can put more pixels into the output graphic file. However, it
> also causes problems with vectors (lines get increasingly thin with
> increased resolution), scales (the scales get shorter vertically and
> type gets smaller), and possible some other features.

notes:
* but the horizontal scale length information should remain correct.
* things like "d.text size=" and d.legend will scale font size as a
percentage of the frame size, so they'll be ok. Things that force a
font size of "10" won't be.
* you can partially work around the thin-line problem with 'd.vect
width='
that won't help d.grid though where both fonts and lines will be shrunk.
* The PS driver doesn't suffer from this, only the PNG driver.


I figured out my d.out.file d.font problem. I was calling it before
d.frame.quarter, which erases the display including the font setting.

d.font Vera
d.erase -f
echo "A" | d.text color=black size=40 at=50,50
 # draws in TTF
d.out.file A
 # draws using default scale font

d.erase -f
d.font Vera
echo "A" | d.text color=black size=40 at=50,50
 # draws using TTF
d.out.file A --overwrite
 # draws using TTF

So d.erase removes the explicit "d.font" call, and the XDRIVER has
sticky memory about what the font setting is. But the other drivers
don't. And that's understandable once you think about it- the other
drivers you refresh by stop= and start=, while the xmon driver remains
open and in whatever state you left it in.
aka "d.erase" != "d.mon stop="


TTF output from the PNG driver is Very Nice (same as in GUI) -- much
better than in the xmon display window. TTF output in the PS driver is
very unnice -- it comes out horribly pixelated. Stroke fonts with the PS
driver generally look ok, especially if you use "d.text -b".


In other news I just added a new brighten= option to d.his.
(for the new d.out.file 4-pane example)


Hamish




More information about the grass-dev mailing list