[cairo] dimensionally accurate drawings on screen ?
Axel Simon
A.Simon at kent.ac.uk
Fri Jan 20 13:15:50 PST 2006
On Fri, 2006-01-20 at 12:57 -0800, Carl Worth wrote:
> On Fri, 20 Jan 2006 20:45:04 +0000, Axel Simon wrote:
> >
> > a) you need to specify this scaling factor for all text rendering, too,
> > since Gtk (and Cairo) have a built-in, fixed DPI setting for fonts.
>
> Cairo does not have a built-in, fixed DPI setting for fonts that I am
> aware.
>
> A size passed to something like cairo_set_font_size is a size in
> user-space coordinates, so it is affected by the current
> transformation matrix (as set by things like cairo_scale).
Yes, sorry. I'm used Pango, and it's not easy to see where Pango ends
and Cairo begins. Pango has a font map that has a resolution of 96 dpi
per default (using e.g. pango_cairo_font_map_get_default ()).
Furthermore, you can override this factor by setting a non-zero
resolution in the cairo context, using
pango_cairo_context_set_resolution(). So this scaling factor still
applies between points and cairo units, a possible transformation matrix
is on top of that. That's how I understand it, anyway.
Axel.
More information about the cairo
mailing list