|
44 | 44 | #define DRAW_CURSOR 0x20 |
45 | 45 | #define DRAW_WIDE 0x40 /* draw wide text */ |
46 | 46 |
|
| 47 | +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
| 48 | + |
| 49 | +#define kCTFontOrientationDefault kCTFontDefaultOrientation |
| 50 | + |
| 51 | + static void |
| 52 | +CTFontDrawGlyphs(CTFontRef fontRef, const CGGlyph glyphs[], |
| 53 | + const CGPoint positions[], UniCharCount count, |
| 54 | + CGContextRef context) |
| 55 | +{ |
| 56 | + CGFontRef cgFontRef = CTFontCopyGraphicsFont(fontRef, NULL); |
| 57 | + CGContextSetFont(context, cgFontRef); |
| 58 | + CGContextShowGlyphsAtPositions(context, glyphs, positions, count); |
| 59 | + CGFontRelease(cgFontRef); |
| 60 | +} |
| 61 | + |
| 62 | +#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
| 63 | + |
47 | 64 | @interface MMCoreTextView (Private) |
48 | 65 | - (MMWindowController *)windowController; |
49 | 66 | - (MMVimController *)vimController; |
@@ -1128,7 +1145,8 @@ - (void)batchDrawData:(NSData *)data |
1128 | 1145 | #define fless(a, b)((a) - (b) < FLT_EPSILON) && (fabs((a) - (b)) > FLT_EPSILON) |
1129 | 1146 |
|
1130 | 1147 | CFIndex skip = 0; |
1131 | | - for (CFIndex i = 0; i < offset && skip + i < length; ++i) { |
| 1148 | + CFIndex i; |
| 1149 | + for (i = 0; i < offset && skip + i < length; ++i) { |
1132 | 1150 | memcpy(&positions[i], &refPositions[skip + i], sizeof(CGSize)); |
1133 | 1151 |
|
1134 | 1152 | if (fequal(ligatureRanges[i].width, regularRanges[skip + i].width)) { |
|
0 commit comments