mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75aa777464 | |||
| 7d882ca4cf | |||
| be0e27b5c8 | |||
| 5f465202e8 | |||
| dfda18a956 | |||
| 77bf482db4 | |||
| 44244c1e5e | |||
| 81a64f5848 | |||
| d760cc0dd8 |
@@ -1256,7 +1256,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>80</string>
|
||||
<string>81</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -1993,8 +1993,10 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
const void *bytes = [data bytes];
|
||||
int idx = *((int*)bytes) + 1;
|
||||
send_tabline_menu_event(idx, TABLINE_MENU_CLOSE);
|
||||
[self redrawScreen];
|
||||
} else if (AddNewTabMsgID == msgid) {
|
||||
send_tabline_menu_event(0, TABLINE_MENU_NEW);
|
||||
[self redrawScreen];
|
||||
} else if (DraggedTabMsgID == msgid) {
|
||||
if (!data) return;
|
||||
const void *bytes = [data bytes];
|
||||
|
||||
+49
-13
@@ -317,7 +317,18 @@ defaultAdvanceForFont(NSFont *font)
|
||||
// NOTE: No need to set point size etc. since this is taken from the
|
||||
// regular font when drawing.
|
||||
[fontWide release];
|
||||
fontWide = [newFont retain];
|
||||
|
||||
// Use 'Apple Color Emoji' font for rendering emoji
|
||||
CGFloat size = [newFont pointSize];
|
||||
NSFontDescriptor *emojiDesc = [NSFontDescriptor
|
||||
fontDescriptorWithName:@"Apple Color Emoji" size:size];
|
||||
NSFontDescriptor *newFontDesc = [newFont fontDescriptor];
|
||||
NSDictionary *attrs = [NSDictionary
|
||||
dictionaryWithObject:[NSArray arrayWithObject:newFontDesc]
|
||||
forKey:NSFontCascadeListAttribute];
|
||||
NSFontDescriptor *desc =
|
||||
[emojiDesc fontDescriptorByAddingAttributes:attrs];
|
||||
fontWide = [[NSFont fontWithDescriptor:desc size:size] retain];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1028,6 +1039,22 @@ lookupFont(NSMutableArray *fontCache, const unichar *chars, UniCharCount count,
|
||||
return newFontRef;
|
||||
}
|
||||
|
||||
static UniCharCount
|
||||
gatherGlyphs(CGGlyph glyphs[], UniCharCount count)
|
||||
{
|
||||
// Gather scattered glyphs that was happended by Surrogate pair chars
|
||||
UniCharCount glyphCount = 0;
|
||||
NSUInteger pos = 0;
|
||||
NSUInteger i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
if (glyphs[i] != 0) {
|
||||
++glyphCount;
|
||||
glyphs[pos++] = glyphs[i];
|
||||
}
|
||||
}
|
||||
return glyphCount;
|
||||
}
|
||||
|
||||
static void
|
||||
ligatureGlyphsForChars(const unichar *chars, CGGlyph *glyphs, CGPoint *positions, UniCharCount *length, CTFontRef font )
|
||||
{
|
||||
@@ -1093,15 +1120,13 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
{
|
||||
if (CTFontGetGlyphsForCharacters(fontRef, chars, glyphs, length)) {
|
||||
// All chars were mapped to glyphs, so draw all at once and return.
|
||||
length = gatherGlyphs(glyphs, length);
|
||||
if (useLigatures) {
|
||||
memset(glyphs, 0, sizeof(CGGlyph) * length);
|
||||
ligatureGlyphsForChars(chars, glyphs, positions, &length, fontRef);
|
||||
}
|
||||
|
||||
CGFontRef cgFontRef = CTFontCopyGraphicsFont(fontRef, NULL);
|
||||
CGContextSetFont(context, cgFontRef);
|
||||
CGContextShowGlyphsAtPositions(context, glyphs, positions, length);
|
||||
CGFontRelease(cgFontRef);
|
||||
CTFontDrawGlyphs(fontRef, glyphs, positions, length, context);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1113,23 +1138,34 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
// Draw as many consecutive glyphs as possible in the current font
|
||||
// (if a glyph is 0 that means it does not exist in the current
|
||||
// font).
|
||||
BOOL surrogatePair = NO;
|
||||
while (*g && g < glyphsEnd) {
|
||||
++g;
|
||||
++c;
|
||||
if (CFStringIsSurrogateHighCharacter(*c)) {
|
||||
surrogatePair = YES;
|
||||
g += 2;
|
||||
c += 2;
|
||||
} else {
|
||||
++g;
|
||||
++c;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
|
||||
int count = g-glyphs;
|
||||
CGFontRef cgFontRef = CTFontCopyGraphicsFont(fontRef, NULL);
|
||||
CGContextSetFont(context, cgFontRef);
|
||||
CGContextShowGlyphsAtPositions(context, glyphs, positions, count);
|
||||
CGFontRelease(cgFontRef);
|
||||
if (surrogatePair)
|
||||
count = gatherGlyphs(glyphs, count);
|
||||
CTFontDrawGlyphs(fontRef, glyphs, positions, count, context);
|
||||
} else {
|
||||
// Skip past as many consecutive chars as possible which cannot be
|
||||
// drawn in the current font.
|
||||
while (0 == *g && g < glyphsEnd) {
|
||||
++g;
|
||||
++c;
|
||||
if (CFStringIsSurrogateHighCharacter(*c)) {
|
||||
g += 2;
|
||||
c += 2;
|
||||
} else {
|
||||
++g;
|
||||
++c;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -4301,7 +4301,7 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
else
|
||||
if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
|
||||
macosx_deployment_target=`/usr/bin/sw_vers -productVersion`
|
||||
macosx_deployment_target=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
|
||||
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$macosx_deployment_target"
|
||||
fi
|
||||
fi
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
LDFLAGS="$save_ldflags" ])
|
||||
else
|
||||
if test -z "$MACOSX_DEPLOYMENT_TARGET"; then
|
||||
macosx_deployment_target=`/usr/bin/sw_vers -productVersion`
|
||||
macosx_deployment_target=`/usr/bin/sw_vers -productVersion|/usr/bin/sed -e 's/^\([[0-9]]*\.[[0-9]]*\).*/\1/'`
|
||||
XCODEFLAGS="$XCODEFLAGS MACOSX_DEPLOYMENT_TARGET=$macosx_deployment_target"
|
||||
fi
|
||||
fi
|
||||
|
||||
+5
-7
@@ -1244,8 +1244,10 @@ utf_char2cells(c)
|
||||
static struct interval doublewidth[] =
|
||||
{
|
||||
{0x1100, 0x115f},
|
||||
{0x2329, 0x232a},
|
||||
{0x2e80, 0x2e99},
|
||||
{0x2300, 0x23ff},
|
||||
{0x2700, 0x27bf},
|
||||
{0x2b00, 0x2bff},
|
||||
{0x2e00, 0x2e99},
|
||||
{0x2e9b, 0x2ef3},
|
||||
{0x2f00, 0x2fd5},
|
||||
{0x2ff0, 0x2ffb},
|
||||
@@ -1271,11 +1273,7 @@ utf_char2cells(c)
|
||||
{0xfe68, 0xfe6b},
|
||||
{0xff01, 0xff60},
|
||||
{0xffe0, 0xffe6},
|
||||
{0x1b000, 0x1b001},
|
||||
{0x1f200, 0x1f202},
|
||||
{0x1f210, 0x1f23a},
|
||||
{0x1f240, 0x1f248},
|
||||
{0x1f250, 0x1f251},
|
||||
{0x10000, 0x1fffd},
|
||||
{0x20000, 0x2fffd},
|
||||
{0x30000, 0x3fffd}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user