diff options
author | YAMAMOTO Mitsuharu <[email protected]> | 2006-11-14 08:22:19 +0000 |
---|---|---|
committer | YAMAMOTO Mitsuharu <[email protected]> | 2006-11-14 08:22:19 +0000 |
commit | 1d4412cd77807223a33c0f6cd0aee0568e7e0e44 (patch) | |
tree | 28c20ab23c22f797a7e2973eaab200a0a59af203 /src/macterm.c | |
parent | 74e537fb6901a1514514bcdc20582ad0ffb538a2 (diff) |
[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.
Diffstat (limited to 'src/macterm.c')
-rw-r--r-- | src/macterm.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/macterm.c b/src/macterm.c index 97a87cd3d3..e36fafa274 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -1360,20 +1360,31 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p) 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) +#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 + if (CGContextShowGlyphsWithAdvances != NULL) +#endif { - CGContextSetTextPosition (context, gx + 1.0f, gy); + CGContextSetTextPosition (context, gx, gy); CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); + if (overstrike_p) + { + CGContextSetTextPosition (context, gx + 1.0f, gy); + CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); + } } -#else - for (i = 0; i < nchars; i++) +#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 { - CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1); - if (overstrike_p) - CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1); - gx += advances[i].width; + 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 |