提交 50e1d67a 编写于 作者: A Alex Dima

Fixes #11366: Revert the code around terminal.integrated.fontWeight

上级 1a60e57a
......@@ -64,10 +64,6 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('terminal.integrated.fontFamily', "Controls the font family of the terminal, this defaults to editor.fontFamily's value."),
'type': 'string'
},
'terminal.integrated.fontWeight': {
'description': nls.localize('terminal.integrated.fontWeight', "Controls the font weight of the terminal, this defaults to editor.fontWeight's value."),
'type': 'string'
},
'terminal.integrated.fontLigatures': {
'description': nls.localize('terminal.integrated.fontLigatures', "Controls whether font ligatures are enabled in the terminal."),
'type': 'boolean',
......
......@@ -43,7 +43,6 @@ export interface ITerminalConfiguration {
},
cursorBlinking: boolean,
fontFamily: string,
fontWeight: string,
fontLigatures: boolean,
fontSize: number,
lineHeight: number,
......
......@@ -71,7 +71,6 @@ const DEFAULT_ANSI_COLORS = {
export interface ITerminalFont {
fontFamily: string;
fontWeight: string;
fontSize: string;
lineHeight: number;
charWidth: number;
......@@ -100,7 +99,7 @@ export class TerminalConfigHelper {
return DEFAULT_ANSI_COLORS[baseThemeId];
}
private measureFont(fontFamily: string, fontWeight: string,fontSize: number, lineHeight: number): ITerminalFont {
private measureFont(fontFamily: string, fontSize: number, lineHeight: number): ITerminalFont {
// Create charMeasureElement if it hasn't been created or if it was orphaned by its parent
if (!this.charMeasureElement || !this.charMeasureElement.parentElement) {
this.charMeasureElement = this.panelContainer.div().getHTMLElement();
......@@ -108,7 +107,6 @@ export class TerminalConfigHelper {
let style = this.charMeasureElement.style;
style.display = 'block';
style.fontFamily = fontFamily;
style.fontWeight = fontWeight;
style.fontSize = fontSize + 'px';
style.height = Math.floor(lineHeight * fontSize) + 'px';
this.charMeasureElement.innerText = 'X';
......@@ -118,7 +116,6 @@ export class TerminalConfigHelper {
let charHeight = Math.ceil(rect.height);
return {
fontFamily,
fontWeight,
fontSize: fontSize + 'px',
lineHeight,
charWidth,
......@@ -127,7 +124,7 @@ export class TerminalConfigHelper {
}
/**
* Gets the font information based on the terminal.integrated.fontFamily, terminal.integrated.fontWeight
* Gets the font information based on the terminal.integrated.fontFamily
* terminal.integrated.fontSize, terminal.integrated.lineHeight configuration properties
*/
public getFont(): ITerminalFont {
......@@ -135,14 +132,13 @@ export class TerminalConfigHelper {
let editorConfig = this.configurationService.getConfiguration<IConfiguration>();
let fontFamily = terminalConfig.fontFamily || editorConfig.editor.fontFamily;
let fontWeight = terminalConfig.fontWeight || editorConfig.editor.fontWeight;
let fontSize = this.toInteger(terminalConfig.fontSize, 0) || editorConfig.editor.fontSize;
if (fontSize <= 0) {
fontSize = DefaultConfig.editor.fontSize;
}
let lineHeight = this.toInteger(terminalConfig.lineHeight, DEFAULT_LINE_HEIGHT);
return this.measureFont(fontFamily, fontWeight, fontSize, lineHeight <= 0 ? DEFAULT_LINE_HEIGHT : lineHeight);
return this.measureFont(fontFamily, fontSize, lineHeight <= 0 ? DEFAULT_LINE_HEIGHT : lineHeight);
}
public getFontLigaturesEnabled(): boolean {
......
......@@ -330,7 +330,6 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
if (!this.font || this.fontsDiffer(this.font, newFont)) {
this.fontStyleElement.innerHTML = '.monaco-workbench .panel.integrated-terminal .xterm {' +
`font-family: ${newFont.fontFamily};` +
`font-weight: ${newFont.fontWeight};` +
`font-size: ${newFont.fontSize};` +
`line-height: ${newFont.lineHeight};` +
'}';
......@@ -344,7 +343,6 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
return a.charHeight !== b.charHeight ||
a.charWidth !== b.charWidth ||
a.fontFamily !== b.fontFamily ||
a.fontWeight !== b.fontWeight ||
a.fontSize !== b.fontSize ||
a.lineHeight !== b.lineHeight;
}
......
......@@ -61,40 +61,6 @@ suite('Workbench - TerminalConfigHelper', () => {
assert.equal(configHelper.getFont().fontFamily, 'foo', 'editor.fontFamily should be the fallback when terminal.integrated.fontFamily not set');
});
test('TerminalConfigHelper - getFont fontWeight', function () {
let configurationService: IConfigurationService;
let configHelper: TerminalConfigHelper;
configurationService = new MockConfigurationService({
editor: {
fontFamily: 'foo',
fontWeight: 'lighter'
},
terminal: {
integrated: {
fontFamily: 'bar',
fontWeight: 'bold'
}
}
});
configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, fixture);
assert.equal(configHelper.getFont().fontWeight, 'bold', 'terminal.integrated.fontWeight should be selected over editor.fontWeight');
configurationService = new MockConfigurationService({
editor: {
fontFamily: 'foo',
fontWeight: 'lighter'
},
terminal: {
integrated: {
fontFamily: 0
}
}
});
configHelper = new TerminalConfigHelper(Platform.Linux, configurationService, fixture);
assert.equal(configHelper.getFont().fontWeight, 'lighter', 'editor.fontWeight should be the fallback when terminal.integrated.fontWeight not set');
});
test('TerminalConfigHelper - getFont fontSize', function () {
let configurationService: IConfigurationService;
let configHelper: TerminalConfigHelper;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册