Re: Cairo-Pango problems when scaling text



On Thu, 11 May 2006, it was written:

> Hi everyone,
>
> I'm having problems when scaling a Pango layout in Cairo. As I zoom in
> (using a matrix transformation), the letters in layout's text get more
> and more cramped. I've lost a good amount hours already on this issue. :-(
>
> I've also made a simple test application showing the problem (it's
> attached to this e-mail), so you guys can have a clear view on what I'm
> trying to do and the resulting misbehavior.
>
> What am I doing wrong?
>
> Regards,
> Daniel d'Andrada T. de Carvalho


I'm pretty sure now that this is a bug in pangocairo.  This seems
to be the cause for Damon's problem too.

If I understand it correctly, this is what happening:

  - When you choose a font size of 10pt, and a ctm that scales
5x5, the font size loaded by cairo at size 50pt, but glyph
metrics returned are scaled down by 5, and so dimensionally, they
correspond to a 10pt font.

  - In pango_fc_font_kern_glyphs and/or pango-ot-buffer.c:apply_gpos_*
the glyph positioning applied corresponds to a 50pt font, as no
distinction between font matrix and ctm is made here.

  - The glyphs are drawn to the cairo context using the 5x5
scaled ctm, making the 50pt positioning effectively a 250pt
positioning.


Filed this bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=341481

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
	-- Dan Bern, "New American Language"



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