After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 323540 - Scaling the cairo context seems to be wrong
Scaling the cairo context seems to be wrong
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2005-12-08 11:26 UTC by Damon Chaplin
Modified: 2005-12-12 23:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (2.36 KB, text/plain)
2005-12-08 11:27 UTC, Damon Chaplin
Details

Description Damon Chaplin 2005-12-08 11:26:27 UTC
If you use cairo_scale (cr, 2, 2) and then create a PangoLayout and show some
text the glyphs are 4 times the original size rather than 2 times as I'd expect.

I've tested cairo, which seems to scale text OK, so I guess this is a
Pango bug. I'll attach a test case in a sec.
Comment 1 Damon Chaplin 2005-12-08 11:27:47 UTC
Created attachment 55774 [details]
Test case
Comment 2 Behdad Esfahbod 2005-12-09 01:20:29 UTC
Humm, it's trivial to see why this happens:  When creating pango layout with the
scaled cairo context, pango copies the transformation matrix, and scales by
that.  Cairo scales too.  How is it supposed to be Owen?
Comment 3 Behdad Esfahbod 2005-12-12 23:26:00 UTC
Should be fixed now.

2005-12-12  Behdad Esfahbod  <behdad@gnome.org>

        Fix bug #323540.

        * pangofc-fontmap.c (get_scaled_size): The logic in there is moved
        and renamed into pango-utils.

        * pango/pango-types.h,
        * pango/pango-utils.c (pango_matrix_get_font_scale_factor):
        New function.

        * pango/pangocairo-fcfont.c (get_font_size): Divide pixel-size by
        matrix font-scale-factor, since pixel-size is scaled.