Re: Pango device units



On Wed, 2003-08-27 at 19:22, Pawel S. Veselov wrote:
Hi,

a quick one.

What's the ratio between pango device units (points)
and the actual number of pixels, and how to figure it out
programatically ?

Pango units are basically a fixed point number - the
scale is given by PANGO_SCALE (1024 as it happens).

What a value of 1.0 * PANGO_SCALE means is up to the
backend - the current backends all treat it as one pixel,
but a Postscript background would probably use 1 point
instead.

There is a PANGO_PIXELS() macro round that more or less
is:

 nearest_integer (val / PANGO_SCALE)

To convert from a integer number of pixels to a pango,
just multiple by PANGO_SCALE.

Regards,
                                        Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]