wx.Printout.GetPPIPrinter

Mark Erbaugh wrote:

When run under GTK (Ubuntu Dapper) with
the same hardware (computer and printer), it returns (72,72).

It's probably using PostScript, which is scalable, but uses points as it's coordinates, 72pt = 1".

Howver, printed output from GTK appears smooth and is at a resolution
higher than 72 DPI.

Right, 'cause the rendering happens at the native printer resolution.

I am running Gnome 2.14.3 so it doesn't have libgnomeprint support.

Does this mean that the printer's device context only has a resolution
of 72 dpi, but that at least text is rendered at full printer
resolution? Would this mean that text can be positioned only to the
nearest 1/72"?

It looks that way. The way its "should" work is that you can define coords in floating point (or fixed point fractions), which is what Postscript does. I thought that the PostScriptDC was hard-coded to default to 720 ppi (which then got translated at output to points), so that you'd at least have 1/10th point resolution.

If you're getting a PostScriptDC, you may be able to set that. Here's the doc:

wxPostScriptDC::SetResolution

static void SetResolution(int ppi)

Set resolution (in pixels per inch) that will be used in PostScript output. Default is 720ppi

So something is odd, but I'd try SetResolution, and see what happens.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

It looks like the device context I get back is a generic device context,
wx._gdi.DC. According to Robin that's because the framework has been
updated for multiple printing backends under GTK.

At any rate, wx._gdi.DC doesn't have a SetResolution method.

Is there a way to 'coerce' the generic DC into a PostScriptDC?

Mark

···

On Thu, 2008-03-13 at 10:02 -0700, Christopher Barker wrote:

> Does this mean that the printer's device context only has a
resolution
> of 72 dpi, but that at least text is rendered at full printer
> resolution? Would this mean that text can be positioned only to the
> nearest 1/72"?

It looks that way. The way its "should" work is that you can define
coords in floating point (or fixed point fractions), which is what
Postscript does. I thought that the PostScriptDC was hard-coded to
default to 720 ppi (which then got translated at output to points),
so
that you'd at least have 1/10th point resolution.

If you're getting a PostScriptDC, you may be able to set that. Here's
the doc: