confused about pango_cairo_font_map_set_resolution API



Hi,

I'm slightly confused about the pango_cairo_font_map_set_resolution
function and friends, mainly because it only takes one argument, namely
a scaling factor between em*1/72 (font size in inch (why oh why?!)) and
pixels. Given that my monitor (and probably other output media) has a
different resolution in x and y direction this seems weird. So:

a) pango_cairo_font_map_set_resolution should take one factor for the x
direction and one for the y direction

I tried to set the resolution to 1 and define a cairo_matrix_t that
scales the font without sheering effects when rotating. I realised that
pango_cairo_font_map_set_resolution actually determines the grid onto
which the font is rendered. Hence, given a grid of one inch doesn't
produce anything useful. Similarly, setting the scaling factor to, say,
1024 "DPI" and scaling it down before rendering will result in awful
looking fonts since hinting is all messed up. So:

b) pango_cairo_font_map_set_resolution is the only way to set the
scaling factor for a font without messing up the font.

And then there is a pango_cairo_context_set_resolution. From the
documentation one can guess that it is either this factor *or* the one
set with pango_cairo_font_map_set_resolution that determines the
resolution. I wonder:

c) What is the purpose/semantics of pango_cairo_context_set_resolution?
If I create two contexts and override the resolution of the FontMap in
one context, will the font be re-rendered or will I get a scaled version
of the resolution that was set in the FontMap?

I know it seems a bit pedantic complaining about different x and y
resolutions, but I would greatly appreciate some clarification as to how
correctly render fonts.

Thanks,
Axel.





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