Skip to content

Commit 8a5fc88

Browse files
committed
Merge pull request #190 from rhendric/fix/remove_legacy_stuff
Restore 10.6 support
2 parents 0892c04 + 25316b2 commit 8a5fc88

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/MacVim/MMCoreTextView.m

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@
4444
#define DRAW_CURSOR 0x20
4545
#define DRAW_WIDE 0x40 /* draw wide text */
4646

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+
4764
@interface MMCoreTextView (Private)
4865
- (MMWindowController *)windowController;
4966
- (MMVimController *)vimController;
@@ -1128,7 +1145,8 @@ - (void)batchDrawData:(NSData *)data
11281145
#define fless(a, b)((a) - (b) < FLT_EPSILON) && (fabs((a) - (b)) > FLT_EPSILON)
11291146

11301147
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) {
11321150
memcpy(&positions[i], &refPositions[skip + i], sizeof(CGSize));
11331151

11341152
if (fequal(ligatureRanges[i].width, regularRanges[skip + i].width)) {

0 commit comments

Comments
 (0)