From 3be97841a3c91178b7a3e88425a0c32498150b41 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 19 Aug 2021 05:19:28 -0700 Subject: [PATCH] Rename setting customGlyphs --- addons/xterm-addon-webgl/src/atlas/CharAtlasUtils.ts | 4 ++-- addons/xterm-addon-webgl/src/atlas/Types.d.ts | 2 +- addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts | 2 +- src/browser/Terminal.ts | 2 +- src/browser/renderer/BaseRenderLayer.ts | 4 ++-- src/common/services/OptionsService.ts | 2 +- src/common/services/Services.ts | 2 +- typings/xterm-headless.d.ts | 10 +++++----- typings/xterm.d.ts | 10 +++++----- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/xterm-addon-webgl/src/atlas/CharAtlasUtils.ts b/addons/xterm-addon-webgl/src/atlas/CharAtlasUtils.ts index 6a4783383..962eb7b34 100644 --- a/addons/xterm-addon-webgl/src/atlas/CharAtlasUtils.ts +++ b/addons/xterm-addon-webgl/src/atlas/CharAtlasUtils.ts @@ -28,7 +28,7 @@ export function generateConfig(scaledCellWidth: number, scaledCellHeight: number contrastCache: colors.contrastCache }; return { - customBlockAndBoxCharacters: terminal.getOption('customBlockAndBoxCharacters'), + customGlyphs: terminal.getOption('customGlyphs'), devicePixelRatio: window.devicePixelRatio, letterSpacing: terminal.getOption('letterSpacing'), lineHeight: terminal.getOption('lineHeight'), @@ -54,7 +54,7 @@ export function configEquals(a: ICharAtlasConfig, b: ICharAtlasConfig): boolean } } return a.devicePixelRatio === b.devicePixelRatio && - a.customBlockAndBoxCharacters === b.customBlockAndBoxCharacters && + a.customGlyphs === b.customGlyphs && a.lineHeight === b.lineHeight && a.letterSpacing === b.letterSpacing && a.fontFamily === b.fontFamily && diff --git a/addons/xterm-addon-webgl/src/atlas/Types.d.ts b/addons/xterm-addon-webgl/src/atlas/Types.d.ts index acbe3c71b..8d2870cde 100644 --- a/addons/xterm-addon-webgl/src/atlas/Types.d.ts +++ b/addons/xterm-addon-webgl/src/atlas/Types.d.ts @@ -17,7 +17,7 @@ export interface IGlyphIdentifier { } export interface ICharAtlasConfig { - customBlockAndBoxCharacters: boolean; + customGlyphs: boolean; devicePixelRatio: number; letterSpacing: number; lineHeight: number; diff --git a/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts b/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts index 557e23ef2..4c45fce18 100644 --- a/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts +++ b/addons/xterm-addon-webgl/src/atlas/WebglCharAtlas.ts @@ -393,7 +393,7 @@ export class WebglCharAtlas implements IDisposable { // Draw custom characters if applicable let drawSuccess = false; - if (this._config.customBlockAndBoxCharacters !== false) { + if (this._config.customGlyphs !== false) { drawSuccess = tryDrawCustomChar(this._tmpCtx, chars, TMP_CANVAS_GLYPH_PADDING, TMP_CANVAS_GLYPH_PADDING, this._config.scaledCellWidth, this._config.scaledCellHeight); } diff --git a/src/browser/Terminal.ts b/src/browser/Terminal.ts index 3ab343da5..dde4a1b6e 100644 --- a/src/browser/Terminal.ts +++ b/src/browser/Terminal.ts @@ -224,7 +224,7 @@ export class Terminal extends CoreTerminal implements ITerminal { // The DOM renderer needs a row refresh to update the cursor styles this.refresh(this.buffer.y, this.buffer.y); break; - case 'customBlockAndBoxCharacters': + case 'customGlyphs': case 'drawBoldTextInBrightColors': case 'letterSpacing': case 'lineHeight': diff --git a/src/browser/renderer/BaseRenderLayer.ts b/src/browser/renderer/BaseRenderLayer.ts index 117213eb3..448451d01 100644 --- a/src/browser/renderer/BaseRenderLayer.ts +++ b/src/browser/renderer/BaseRenderLayer.ts @@ -263,7 +263,7 @@ export abstract class BaseRenderLayer implements IRenderLayer { // Draw custom characters if applicable let drawSuccess = false; - if (this._optionsService.options.customBlockAndBoxCharacters !== false) { + if (this._optionsService.options.customGlyphs !== false) { drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight); } @@ -387,7 +387,7 @@ export abstract class BaseRenderLayer implements IRenderLayer { // Draw custom characters if applicable let drawSuccess = false; - if (this._optionsService.options.customBlockAndBoxCharacters !== false) { + if (this._optionsService.options.customGlyphs !== false) { drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight); } diff --git a/src/common/services/OptionsService.ts b/src/common/services/OptionsService.ts index 062166bc9..5add82833 100644 --- a/src/common/services/OptionsService.ts +++ b/src/common/services/OptionsService.ts @@ -21,7 +21,7 @@ export const DEFAULT_OPTIONS: ITerminalOptions = Object.freeze({ cursorBlink: false, cursorStyle: 'block', cursorWidth: 1, - customBlockAndBoxCharacters: true, + customGlyphs: true, bellSound: DEFAULT_BELL_SOUND, bellStyle: 'none', drawBoldTextInBrightColors: true, diff --git a/src/common/services/Services.ts b/src/common/services/Services.ts index 07615a413..2190a0f8f 100644 --- a/src/common/services/Services.ts +++ b/src/common/services/Services.ts @@ -244,7 +244,7 @@ export interface ITerminalOptions { cursorBlink: boolean; cursorStyle: 'block' | 'underline' | 'bar'; cursorWidth: number; - customBlockAndBoxCharacters: boolean; + customGlyphs: boolean; disableStdin: boolean; drawBoldTextInBrightColors: boolean; fastScrollModifier: 'alt' | 'ctrl' | 'shift' | undefined; diff --git a/typings/xterm-headless.d.ts b/typings/xterm-headless.d.ts index dc886aa1d..13a321261 100644 --- a/typings/xterm-headless.d.ts +++ b/typings/xterm-headless.d.ts @@ -79,12 +79,12 @@ declare module 'xterm-headless' { cursorWidth?: number; /** - * Whether to draw custom block element and box drawing characters instead of using the font. - * This should typically result in better rendering with continuous lines. Note that this - * doesn't work with the DOM renderer which renders all characters using the font. The default - * is true. + * Whether to draw custom glyphs for block element and box drawing characters instead of using + * the font. This should typically result in better rendering with continuous lines, even when + * line height and letter spacing is used. Note that this doesn't work with the DOM renderer + * which renders all characters using the font. The default is true. */ - customBlockAndBoxCharacters?: boolean; + customGlyphs?: boolean; /** * Whether input should be disabled. diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index f6fbe709d..ba2be9881 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -91,12 +91,12 @@ declare module 'xterm' { cursorWidth?: number; /** - * Whether to draw custom block element and box drawing characters instead of using the font. - * This should typically result in better rendering with continuous lines. Note that this - * doesn't work with the DOM renderer which renders all characters using the font. The default - * is true. + * Whether to draw custom glyphs for block element and box drawing characters instead of using + * the font. This should typically result in better rendering with continuous lines, even when + * line height and letter spacing is used. Note that this doesn't work with the DOM renderer + * which renders all characters using the font. The default is true. */ - customBlockAndBoxCharacters?: boolean; + customGlyphs?: boolean; /** * Whether input should be disabled.