# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1163492539 0 # Node ID a019988291b9a8691445977d7395aefe0c74222c # Parent 531d6c96fc7000c82720b0db6f8907695fd27790 [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. diff -r 531d6c96fc70 -r a019988291b9 src/macterm.c --- 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