aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-11-14 08:22:19 +0000
committerYAMAMOTO Mitsuharu2006-11-14 08:22:19 +0000
commit1d4412cd77807223a33c0f6cd0aee0568e7e0e44 (patch)
tree28c20ab23c22f797a7e2973eaab200a0a59af203 /src
parent74e537fb6901a1514514bcdc20582ad0ffb538a2 (diff)
downloademacs-1d4412cd77807223a33c0f6cd0aee0568e7e0e44.tar.gz
emacs-1d4412cd77807223a33c0f6cd0aee0568e7e0e44.zip
[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')
-rw-r--r--src/macterm.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 97a87cd3d3a..e36fafa2740 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)
1360 if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) 1360 if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold)
1361 CGContextSetShouldAntialias (context, false); 1361 CGContextSetShouldAntialias (context, false);
1362#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 1362#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
1363 CGContextSetTextPosition (context, gx, gy); 1363#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
1364 CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); 1364 if (CGContextShowGlyphsWithAdvances != NULL)
1365 if (overstrike_p) 1365#endif
1366 { 1366 {
1367 CGContextSetTextPosition (context, gx + 1.0f, gy); 1367 CGContextSetTextPosition (context, gx, gy);
1368 CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); 1368 CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
1369 if (overstrike_p)
1370 {
1371 CGContextSetTextPosition (context, gx + 1.0f, gy);
1372 CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
1373 }
1369 } 1374 }
1370#else 1375#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
1371 for (i = 0; i < nchars; i++) 1376 else
1377#endif
1378#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
1379#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
1372 { 1380 {
1373 CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1); 1381 for (i = 0; i < nchars; i++)
1374 if (overstrike_p) 1382 {
1375 CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1); 1383 CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
1376 gx += advances[i].width; 1384 if (overstrike_p)
1385 CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
1386 gx += advances[i].width;
1387 }
1377 } 1388 }
1378#endif 1389#endif
1379#if USE_CG_DRAWING 1390#if USE_CG_DRAWING