Skip to content

Commit 17f3c3d

Browse files
authored
Merge pull request #1356 from ychin/coretext-rendering-fixes-composing-chars-clipping
Fix misc CoreText rendering bugs and issues with clipping and composing characters
2 parents 233e188 + d1c8e61 commit 17f3c3d

File tree

8 files changed

+258
-70
lines changed

8 files changed

+258
-70
lines changed

runtime/doc/gui_mac.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ KEY VALUE ~
290290
*MMNoTitleBarWindow* hide title bar [bool]
291291
*MMTitlebarAppearsTransparent* enable a transparent titlebar [bool]
292292
*MMAppearanceModeSelection* dark mode selection (|macvim-dark-mode|)[bool]
293+
*MMRendererClipToRow* clip tall characters to the row they are on [bool]
293294
*MMSmoothResize* allow smooth resizing of MacVim window [bool]
294295
*MMShareFindPboard* share search text to Find Pasteboard [bool]
295296
*MMShowAddTabButton* enable "add tab" button on tabline [bool]

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,6 +5498,7 @@ MMNoFontSubstitution gui_mac.txt /*MMNoFontSubstitution*
54985498
MMNoTitleBarWindow gui_mac.txt /*MMNoTitleBarWindow*
54995499
MMNonNativeFullScreenSafeAreaBehavior gui_mac.txt /*MMNonNativeFullScreenSafeAreaBehavior*
55005500
MMNonNativeFullScreenShowMenu gui_mac.txt /*MMNonNativeFullScreenShowMenu*
5501+
MMRendererClipToRow gui_mac.txt /*MMRendererClipToRow*
55015502
MMShareFindPboard gui_mac.txt /*MMShareFindPboard*
55025503
MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton*
55035504
MMSmoothResize gui_mac.txt /*MMSmoothResize*

src/MacVim/Base.lproj/Preferences.xib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@
425425
<button id="A48-s0-kdR" userLabel="Preserve Line Spacing">
426426
<rect key="frame" x="189" y="-1" width="244" height="18"/>
427427
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
428-
<string key="toolTip">Some fonts have non-standard built-in line spacings (anything other than 1). If this is checked, MacVim will use the font's specified line spacing to calculate line height. Otherwise, it will just set it to 1, which helps if you would like a more compact spacing without having to install another font.</string>
429-
<buttonCell key="cell" type="check" title="Preserve font line spacing" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="SeR-yl-Gtz" userLabel="Preserve Line Spacing">
428+
<string key="toolTip">macOS can sometimes use a conservative approach to calculating line spacing for a font (by setting a 1.2 line spacing). This could potentially lead to line spacing feeling too wide. Unchecking this will use a tighter calculation and use a 1.0 line spacing instead.</string>
429+
<buttonCell key="cell" type="check" title="Use macOS line spacing calculation" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="SeR-yl-Gtz" userLabel="Preserve Line Spacing">
430430
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
431431
<font key="font" metaFont="system"/>
432432
</buttonCell>

src/MacVim/MMAppController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ + (void)initialize
260260
[NSNumber numberWithBool:YES], MMShareFindPboardKey,
261261
[NSNumber numberWithBool:NO], MMSmoothResizeKey,
262262
[NSNumber numberWithBool:NO], MMCmdLineAlignBottomKey,
263+
[NSNumber numberWithBool:NO], MMRendererClipToRowKey,
263264
[NSNumber numberWithBool:YES], MMAllowForceClickLookUpKey,
264265
[NSNumber numberWithBool:NO], MMUpdaterPrereleaseChannelKey,
265266
nil];

src/MacVim/MMCoreTextView.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
@class MMTextViewHelper;
1414

15+
NS_ASSUME_NONNULL_BEGIN
16+
1517

1618
/// The main text view that manages drawing Vim's content using Core Text, and
1719
/// handles input. We are using this instead of NSTextView because of the
@@ -84,7 +86,7 @@
8486
//
8587
// NSFontChanging methods
8688
//
87-
- (void)changeFont:(id)sender;
89+
- (void)changeFont:(nullable id)sender;
8890

8991
//
9092
// NSMenuItemValidation
@@ -100,7 +102,7 @@
100102
- (IBAction)paste:(id)sender;
101103
- (IBAction)undo:(id)sender;
102104
- (IBAction)redo:(id)sender;
103-
- (IBAction)selectAll:(id)sender;
105+
- (IBAction)selectAll:(nullable id)sender;
104106

105107
//
106108
// MMTextStorage methods
@@ -186,3 +188,5 @@
186188
@interface MMCoreTextView (ToolTip)
187189
- (void)setToolTipAtMousePoint:(NSString *)string;
188190
@end
191+
192+
NS_ASSUME_NONNULL_END

src/MacVim/MMCoreTextView.m

Lines changed: 245 additions & 66 deletions
Large diffs are not rendered by default.

src/MacVim/Miscellaneous.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ extern NSString *MMNonNativeFullScreenShowMenuKey;
6161
extern NSString *MMNonNativeFullScreenSafeAreaBehaviorKey;
6262
extern NSString *MMSmoothResizeKey;
6363
extern NSString *MMCmdLineAlignBottomKey;
64+
extern NSString *MMRendererClipToRowKey;
6465
extern NSString *MMAllowForceClickLookUpKey;
6566
extern NSString *MMUpdaterPrereleaseChannelKey;
6667

src/MacVim/Miscellaneous.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
NSString *MMNonNativeFullScreenSafeAreaBehaviorKey = @"MMNonNativeFullScreenSafeAreaBehavior";
5858
NSString *MMSmoothResizeKey = @"MMSmoothResize";
5959
NSString *MMCmdLineAlignBottomKey = @"MMCmdLineAlignBottom";
60+
NSString *MMRendererClipToRowKey = @"MMRendererClipToRow";
6061
NSString *MMAllowForceClickLookUpKey = @"MMAllowForceClickLookUp";
6162
NSString *MMUpdaterPrereleaseChannelKey = @"MMUpdaterPrereleaseChannel";
6263

0 commit comments

Comments
 (0)