@@ -10,14 +10,12 @@ import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/ed
10
10
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
11
11
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration' ;
12
12
import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
13
- import { ITerminalConfiguration , ITerminalConfigHelper , ITerminalFont , IShellLaunchConfig , IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY , TERMINAL_CONFIG_SECTION } from 'vs/workbench/parts/terminal/common/terminal' ;
13
+ import { ITerminalConfiguration , ITerminalConfigHelper , ITerminalFont , IShellLaunchConfig , IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY , TERMINAL_CONFIG_SECTION , DEFAULT_LETTER_SPACING , DEFAULT_LINE_HEIGHT , MINIMUM_LETTER_SPACING } from 'vs/workbench/parts/terminal/common/terminal' ;
14
14
import Severity from 'vs/base/common/severity' ;
15
15
import { isFedora } from 'vs/workbench/parts/terminal/node/terminal' ;
16
16
import { Terminal as XTermTerminal } from 'vscode-xterm' ;
17
17
import { INotificationService } from 'vs/platform/notification/common/notification' ;
18
18
19
- const DEFAULT_LINE_HEIGHT = 1.0 ;
20
-
21
19
const MINIMUM_FONT_SIZE = 6 ;
22
20
const MAXIMUM_FONT_SIZE = 25 ;
23
21
@@ -50,7 +48,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
50
48
this . config = this . _configurationService . getValue < ITerminalConfiguration > ( TERMINAL_CONFIG_SECTION ) ;
51
49
}
52
50
53
- private _measureFont ( fontFamily : string , fontSize : number , lineHeight : number ) : ITerminalFont {
51
+ private _measureFont ( fontFamily : string , fontSize : number , letterSpacing : number , lineHeight : number ) : ITerminalFont {
54
52
// Create charMeasureElement if it hasn't been created or if it was orphaned by its parent
55
53
if ( ! this . _charMeasureElement || ! this . _charMeasureElement . parentElement ) {
56
54
this . _charMeasureElement = document . createElement ( 'div' ) ;
@@ -74,6 +72,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
74
72
this . _lastFontMeasurement = {
75
73
fontFamily,
76
74
fontSize,
75
+ letterSpacing,
77
76
lineHeight,
78
77
charWidth : rect . width ,
79
78
charHeight : Math . ceil ( rect . height )
@@ -98,12 +97,14 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
98
97
}
99
98
100
99
let fontSize = this . _toInteger ( this . config . fontSize , MINIMUM_FONT_SIZE , MAXIMUM_FONT_SIZE , EDITOR_FONT_DEFAULTS . fontSize ) ;
100
+ const letterSpacing = this . config . letterSpacing ? Math . max ( Math . floor ( this . config . letterSpacing ) , MINIMUM_LETTER_SPACING ) : DEFAULT_LETTER_SPACING ;
101
101
const lineHeight = this . config . lineHeight ? Math . max ( this . config . lineHeight , 1 ) : DEFAULT_LINE_HEIGHT ;
102
102
103
103
if ( excludeDimensions ) {
104
104
return {
105
105
fontFamily,
106
106
fontSize,
107
+ letterSpacing,
107
108
lineHeight
108
109
} ;
109
110
}
@@ -114,6 +115,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
114
115
return {
115
116
fontFamily,
116
117
fontSize,
118
+ letterSpacing,
117
119
lineHeight,
118
120
charHeight : xterm . charMeasure . height ,
119
121
charWidth : xterm . charMeasure . width
@@ -122,7 +124,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
122
124
}
123
125
124
126
// Fall back to measuring the font ourselves
125
- return this . _measureFont ( fontFamily , fontSize , lineHeight ) ;
127
+ return this . _measureFont ( fontFamily , fontSize , letterSpacing , lineHeight ) ;
126
128
}
127
129
128
130
public setWorkspaceShellAllowed ( isAllowed : boolean ) : void {
0 commit comments