diff -u -r ../orig/pango-1.28.3/modules/basic/basic-atsui.c ./modules/basic/basic-atsui.c
--- ../orig/pango-1.28.3/modules/basic/basic-atsui.c	2010-07-01 16:00:29.000000000 +0200
+++ ./modules/basic/basic-atsui.c	2011-03-20 12:22:11.000000000 +0100
@@ -22,7 +22,11 @@
 #include "config.h"
 #include <glib.h>
 #include <string.h>
+#ifndef __LP64
 #include <Carbon/Carbon.h>
+#else
+#include <Cocoa/Cocoa.h>
+#endif
 #include "pango-engine.h"
 #include "pango-utils.h"
 #include "pango-fontmap.h"
@@ -76,6 +80,7 @@
 		    const PangoAnalysis *analysis,
 		    PangoGlyphString    *glyphs)
 {
+#ifndef __LP64__
   gunichar2 *utf16;
   long n16;
   ATSUTextLayout text_layout;
@@ -170,6 +175,65 @@
   ATSUDisposeTextLayout (text_layout);
 
   g_free (utf16);
+#else
+  gunichar2  *utf16;
+  long        n16;
+
+  utf16 = g_utf8_to_utf16 (text, length, NULL, &n16, NULL);
+
+  CGGlyph     cgglyphs[n16];
+  CTFontRef   ctfont = pango_atsui_font_get_ctfont (PANGO_ATSUI_FONT (font));
+  gboolean    err;
+  int         i;
+  const char *p;
+
+  err = CTFontGetGlyphsForCharacters
+    (ctfont, utf16, cgglyphs, n16);
+  pango_glyph_string_set_size (glyphs, n16);
+  p = text;
+
+  for (i = 0; i < n16; i++)
+  {
+    gunichar wc = utf16[i];
+    gunichar mirrored_ch;
+
+    if (analysis->level % 2)
+      if (pango_get_mirror_char (wc, &mirrored_ch))
+        wc = mirrored_ch;
+
+    if (wc == 0xa0)	/* non-break-space */
+      wc = 0x20;
+
+    if (pango_is_zero_width (wc)) {
+      set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY);
+    }
+    else
+    {
+      set_glyph (font, glyphs, i, p - text, cgglyphs[i]);
+
+      if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
+      {
+        if (i > 0)
+        {
+          PangoRectangle logical_rect, ink_rect;
+
+	  glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width,
+	                                          glyphs->glyphs[i].geometry.width);
+          glyphs->glyphs[i-1].geometry.width = 0;
+	  glyphs->log_clusters[i] = glyphs->log_clusters[i-1];
+
+	  /* Some heuristics to try to guess how overstrike glyphs are
+	   * done and compensate
+	   */
+	  pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect);
+	  if (logical_rect.width == 0 && ink_rect.x == 0)
+	    glyphs->glyphs[i].geometry.x_offset = (glyphs->glyphs[i].geometry.width - ink_rect.width) / 2;
+	}
+      }
+    }
+    p = g_utf8_next_char (p);
+  }
+#endif
 }
 
 static void
diff -u -r ../orig/pango-1.28.3/pango/module-defs.h ./pango/module-defs.h
--- ../orig/pango-1.28.3/pango/module-defs.h	2010-09-29 13:02:42.000000000 +0200
+++ ./pango/module-defs.h	2011-03-20 12:19:06.000000000 +0100
@@ -2,3 +2,8 @@
 
 #include "modules.h"
 
+extern void         _pango_basic_atsui_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern PangoEngine *_pango_basic_atsui_script_engine_init (GTypeModule *module);
+extern void         _pango_basic_atsui_script_engine_exit (void);
+extern void         _pango_basic_atsui_script_engine_create (const char *id);
+
diff -u -r ../orig/pango-1.28.3/pango/pangoatsui-private.h ./pango/pangoatsui-private.h
--- ../orig/pango-1.28.3/pango/pangoatsui-private.h	2010-02-09 13:06:28.000000000 +0100
+++ ./pango/pangoatsui-private.h	2011-03-20 12:18:57.000000000 +0100
@@ -95,8 +95,13 @@
                                                               gpointer           context_key);
 void                  _pango_atsui_font_set_cgfont           (PangoATSUIFont    *font,
                                                               CGFontRef         font_id);
+#ifndef __LP64__
 void                  _pango_atsui_font_set_atsfont          (PangoATSUIFont    *font,
                                                               ATSFontRef        font_ref);
+#else
+void                  _pango_atsui_font_set_ctfont          (PangoATSUIFont    *font,
+                                                             CTFontRef        font_ref);
+#endif
 
 G_END_DECLS
 
diff -u -r ../orig/pango-1.28.3/pango/pangoatsui.c ./pango/pangoatsui.c
--- ../orig/pango-1.28.3/pango/pangoatsui.c	2010-02-09 13:06:28.000000000 +0100
+++ ./pango/pangoatsui.c	2011-03-20 12:18:57.000000000 +0100
@@ -33,8 +33,11 @@
   gpointer context_key;
 
   CGFontRef font_id;
+#ifndef __LP64__
   ATSFontRef font_ref;
-
+#else
+  CTFontRef font_ref;
+#endif
   PangoFontMap *fontmap;
 };
 
@@ -185,6 +188,7 @@
   priv->font_id = font_id;
 }
 
+#ifndef __LP64__
 void
 _pango_atsui_font_set_atsfont (PangoATSUIFont *font,
                                ATSFontRef      font_ref)
@@ -193,6 +197,16 @@
 
   priv->font_ref = font_ref;
 }
+#else
+void
+_pango_atsui_font_set_ctfont (PangoATSUIFont *font,
+                              CTFontRef      font_ref)
+{
+  PangoATSUIFontPrivate *priv = font->priv;
+
+  priv->font_ref = font_ref;
+}
+#endif
 
 /**
  * pango_atsui_font_get_cgfont:
@@ -212,6 +226,7 @@
   return priv->font_id;
 }
 
+#ifndef __LP64__
 /**
  * pango_atsui_font_get_atsfont:
  * @font: A #PangoATSUIFont
@@ -229,3 +244,22 @@
 
   return priv->font_ref;
 }
+#else
+/**
+ * pango_atsui_font_get_ctfont:
+ * @font: A #PangoATSUIFont
+ *
+ * Returns the CTFontRef of a font.
+ *
+ * Return value: the CTFontRef associated to @font.
+ *
+ * Since: 1.28
+ */
+CTFontRef
+pango_atsui_font_get_ctfont (PangoATSUIFont *font)
+{
+  PangoATSUIFontPrivate *priv = font->priv;
+
+  return priv->font_ref;
+}
+#endif
diff -u -r ../orig/pango-1.28.3/pango/pangoatsui.h ./pango/pangoatsui.h
--- ../orig/pango-1.28.3/pango/pangoatsui.h	2010-02-09 13:06:28.000000000 +0100
+++ ./pango/pangoatsui.h	2011-03-20 12:18:57.000000000 +0100
@@ -69,8 +69,11 @@
 #endif /* PANGO_ENABLE_BACKEND */
 
 CGFontRef  pango_atsui_font_get_cgfont  (PangoATSUIFont *font);
+#ifndef __LP64__
 ATSFontRef pango_atsui_font_get_atsfont (PangoATSUIFont *font);
-
+#else
+CTFontRef pango_atsui_font_get_ctfont (PangoATSUIFont *font);
+#endif
 #endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */
 
 GType      pango_atsui_font_get_type         (void) G_GNUC_CONST;
diff -u -r ../orig/pango-1.28.3/pango/pangocairo-atsuifont.c ./pango/pangocairo-atsuifont.c
--- ../orig/pango-1.28.3/pango/pangocairo-atsuifont.c	2010-07-01 16:00:29.000000000 +0200
+++ ./pango/pangocairo-atsuifont.c	2011-03-20 12:18:57.000000000 +0100
@@ -88,34 +88,11 @@
   return cairo_quartz_font_face_create_for_cgfont (font_id);
 }
 
-static int
-max_glyph_width (PangoLayout *layout)
-{
-  int max_width = 0;
-  GSList *l, *r;
-
-  for (l = pango_layout_get_lines_readonly (layout); l; l = l->next)
-    {
-      PangoLayoutLine *line = l->data;
-
-      for (r = line->runs; r; r = r->next)
-	{
-	  PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs;
-	  int i;
-
-	  for (i = 0; i < glyphs->num_glyphs; i++)
-	    if (glyphs->glyphs[i].geometry.width > max_width)
-	      max_width = glyphs->glyphs[i].geometry.width;
-	}
-    }
-
-  return max_width;
-}
-
 static PangoFontMetrics *
 pango_cairo_atsui_font_create_base_metrics_for_context (PangoCairoFont *font,
 							PangoContext   *context)
 {
+#ifndef __LP64__
   PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font;
   PangoATSUIFont *afont = (PangoATSUIFont *) font;
   ATSFontRef ats_font;
@@ -137,6 +114,26 @@
   metrics->strikethrough_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE;
 
   return metrics;
+#else
+  CTFontRef font_ref;
+  PangoFontMetrics *metrics;
+  CGFloat value;
+
+  metrics = pango_font_metrics_new ();
+
+  font_ref = pango_atsui_font_get_ctfont ((PangoATSUIFont*)font);
+  value = CTFontGetAscent (font_ref);
+  //printf ("ascent is %f\n", value);
+  metrics->ascent = value * PANGO_SCALE;
+  metrics->descent = CTFontGetDescent (font_ref) * PANGO_SCALE;
+  metrics->underline_position = CTFontGetUnderlinePosition (font_ref) * PANGO_SCALE;
+  metrics->underline_thickness = CTFontGetUnderlineThickness (font_ref) * PANGO_SCALE;
+
+  metrics->strikethrough_position = metrics->ascent / 3;
+  metrics->strikethrough_thickness = metrics->underline_thickness;
+
+  return metrics;
+#endif
 }
 
 static PangoFontDescription *
@@ -180,6 +177,12 @@
 {
 }
 
+#ifndef __LP64__
+#define INVALID_FONT_REF(f)  (f == kATSFontRefUnspecified) 
+#else
+#define INVALID_FONT_REF(f)  (f == NULL) 
+#endif
+
 PangoATSUIFont *
 _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap     *cafontmap,
 			     PangoContext               *context,
@@ -191,20 +194,17 @@
   PangoCairoATSUIFont *cafont;
   PangoATSUIFont *afont;
   CFStringRef cfstr;
+#ifndef __LP64__
   ATSFontRef font_ref;
+#else
+  CTFontRef font_ref;
+#endif
   CGFontRef font_id;
   double size, abs_size;
   double dpi;
   double m;
   cairo_matrix_t font_matrix;
 
-  postscript_name = _pango_atsui_face_get_postscript_name (face);
-  
-  cfstr = CFStringCreateWithCString (NULL, postscript_name,
-				     kCFStringEncodingUTF8);
-  font_ref = ATSFontFindFromPostScriptName (cfstr, kATSOptionFlagsDefault);
-  CFRelease (cfstr);
-
   abs_size = size = pango_units_to_double (pango_font_description_get_size (desc));
 
   if (context)
@@ -222,12 +222,23 @@
   else
     abs_size *= dpi / 72.;
 
+  postscript_name = _pango_atsui_face_get_postscript_name (face);
+  
+  cfstr = CFStringCreateWithCString (NULL, postscript_name,
+				     kCFStringEncodingUTF8);
+#ifndef __LP64__
+  font_ref = ATSFontFindFromPostScriptName (cfstr, kATSOptionFlagsDefault);
+#else
+  font_ref = CTFontCreateWithName (cfstr, size, NULL);
+#endif
+  CFRelease (cfstr);
+
   /* We synthesize italic in two cases. The first is when
    * NSFontManager has handed out a face that it claims has italic but
    * it doesn't. The other is when an italic face is requested that
    * doesn't have a real version.
    */
-  if (font_ref == kATSFontRefUnspecified && 
+  if (INVALID_FONT_REF(font_ref) && 
       pango_font_description_get_style (desc) != PANGO_STYLE_NORMAL)
     {
       NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -239,8 +250,12 @@
 
       converted_font = [[NSFontManager sharedFontManager] convertFont:nsfont
 			toHaveTrait:NSUnitalicFontMask];
+#ifndef __LP64__
       font_ref = ATSFontFindFromPostScriptName ((CFStringRef) [converted_font fontName],
 						kATSOptionFlagsDefault);
+#else
+      font_ref = (CTFontRef) converted_font;
+#endif
 
       [pool release];
 
@@ -249,10 +264,14 @@
   else if (_pango_atsui_face_get_synthetic_italic (face))
     synthesize_italic = TRUE;
 
-  if (font_ref == kATSFontRefUnspecified)
+  if (INVALID_FONT_REF (font_ref))
     return NULL;
 
+#ifndef __LP64__
   font_id = CGFontCreateWithPlatformFont (&font_ref);
+#else
+  font_id = CTFontCopyGraphicsFont (font_ref, NULL);
+#endif
   if (!font_id)
     return NULL;
 
@@ -263,8 +282,11 @@
   _pango_atsui_font_set_face (afont, face);
 
   _pango_atsui_font_set_cgfont (afont, font_id);
+#ifndef __LP64__
   _pango_atsui_font_set_atsfont (afont, font_ref);
-
+#else
+  _pango_atsui_font_set_ctfont (afont, font_ref);
+#endif
   cafont->size = abs_size;
 
   /* When synthesizing italics, apply a shear matrix matching what Cocoa
diff -u -r ../orig/pango-1.28.3/pango/pangocairo-atsuifontmap.c ./pango/pangocairo-atsuifontmap.c
--- ../orig/pango-1.28.3/pango/pangocairo-atsuifontmap.c	2010-02-09 13:06:28.000000000 +0100
+++ ./pango/pangocairo-atsuifontmap.c	2011-03-20 12:18:57.000000000 +0100
@@ -82,8 +82,6 @@
 static void
 pango_cairo_atsui_font_map_finalize (GObject *object)
 {
-  PangoCairoATSUIFontMap *cafontmap = PANGO_CAIRO_ATSUI_FONT_MAP (object);
-
   G_OBJECT_CLASS (pango_cairo_atsui_font_map_parent_class)->finalize (object);
 }
 