summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hult <richard@imendio.com>2008-03-11 18:05:43 +0000
committerRichard Hult <rhult@src.gnome.org>2008-03-11 18:05:43 +0000
commit15af7e09d1a72384b309ffef0da1fc08383e702f (patch)
tree2a586a8f2d1c65c6ad79ae8b773f90c22f8e0571
parent966ebc8dd1c2b99cf91f14c4351021c1b2ff598e (diff)
downloadpango-15af7e09d1a72384b309ffef0da1fc08383e702f.tar.gz
Adapt the shear matrix for synthesized italic to work with cairo 1.5.13+,
2008-03-11 Richard Hult <richard@imendio.com> * pango/pangocairo-atsuifont.c (_pango_cairo_atsui_font_new): Adapt the shear matrix for synthesized italic to work with cairo 1.5.13+, where the quartz surface has been fixed for transformed text. svn path=/trunk/; revision=2583
-rw-r--r--ChangeLog7
-rw-r--r--pango/pangocairo-atsuifont.c13
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 362a4400..57ccf982 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-11 Richard Hult <richard@imendio.com>
+
+ * pango/pangocairo-atsuifont.c (_pango_cairo_atsui_font_new):
+ Adapt the shear matrix for synthesized italic to work with cairo
+ 1.5.13+, where the quartz surface has been fixed for transformed
+ text.
+
2008-03-10 Behdad Esfahbod <behdad@gnome.org>
* === Released 1.20.0 ===
diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c
index ef7a4b46..23282023 100644
--- a/pango/pangocairo-atsuifont.c
+++ b/pango/pangocairo-atsuifont.c
@@ -210,6 +210,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
ATSUFontID font_id;
double size;
double dpi;
+ double m;
cairo_matrix_t font_matrix;
postscript_name = _pango_atsui_face_get_postscript_name (face);
@@ -281,11 +282,19 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
cafont->size = size;
- /* If necessary, apply a shear matrix, matching what Cocoa does. */
+ /* When synthesizing italics, apply a shear matrix matching what Cocoa
+ * does. Cairo quartz had transformed text wrong before 1.5.13, stay
+ * backwards compatible until pango requires a new enough cairo.
+ */
+ if (cairo_version () >= CAIRO_VERSION_ENCODE(1,5,13))
+ m = -0.25;
+ else
+ m = 0.25;
+
if (synthesize_italic)
cairo_matrix_init (&font_matrix,
1, 0,
- 0.25, 1,
+ m, 1,
0, 0);
else
cairo_matrix_init_identity (&font_matrix);