changeset 73993:a019988291b9

[USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if CGContextShowGlyphsWithAdvances is available.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Tue, 14 Nov 2006 08:22:19 +0000
parents 531d6c96fc70
children 88d63648c784
files src/macterm.c
diffstat 1 files changed, 23 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Tue Nov 14 08:22:04 2006 +0000
+++ b/src/macterm.c	Tue Nov 14 08:22:19 2006 +0000
@@ -1360,20 +1360,31 @@
   if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold)
     CGContextSetShouldAntialias (context, false);
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGContextSetTextPosition (context, gx, gy);
-  CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
-  if (overstrike_p)
-    {
-      CGContextSetTextPosition (context, gx + 1.0f, gy);
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGContextShowGlyphsWithAdvances != NULL)
+#endif
+    {
+      CGContextSetTextPosition (context, gx, gy);
       CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
-    }
-#else
-  for (i = 0; i < nchars; i++)
-    {
-      CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
       if (overstrike_p)
-	CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
-      gx += advances[i].width;
+	{
+	  CGContextSetTextPosition (context, gx + 1.0f, gy);
+	  CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
+	}
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif	/* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      for (i = 0; i < nchars; i++)
+	{
+	  CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
+	  if (overstrike_p)
+	    CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
+	  gx += advances[i].width;
+	}
     }
 #endif
 #if USE_CG_DRAWING