pango r2583 - in trunk: . pango



Author: rhult
Date: Tue Mar 11 18:05:43 2008
New Revision: 2583
URL: http://svn.gnome.org/viewvc/pango?rev=2583&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/pango/pangocairo-atsuifont.c

Modified: trunk/pango/pangocairo-atsuifont.c
==============================================================================
--- trunk/pango/pangocairo-atsuifont.c	(original)
+++ trunk/pango/pangocairo-atsuifont.c	Tue Mar 11 18:05:43 2008
@@ -210,6 +210,7 @@
   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 @@
 
   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);



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