@xterm/xterm 5.6.0-beta.83 → 5.6.0-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "5.6.0-beta.
|
|
4
|
+
"version": "5.6.0-beta.85",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ws": "^8.2.3",
|
|
108
108
|
"xterm-benchmark": "^0.3.1"
|
|
109
109
|
},
|
|
110
|
-
"commit": "
|
|
110
|
+
"commit": "015180586404511a08f8810b1838de082d84e7f8"
|
|
111
111
|
}
|
|
@@ -103,6 +103,7 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
public dispose(): void {
|
|
106
|
+
this._tmpCanvas.remove();
|
|
106
107
|
for (const page of this.pages) {
|
|
107
108
|
page.canvas.remove();
|
|
108
109
|
}
|
|
@@ -122,7 +123,7 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
122
123
|
for (let i = 33; i < 126; i++) {
|
|
123
124
|
queue.enqueue(() => {
|
|
124
125
|
if (!this._cacheMap.get(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT)) {
|
|
125
|
-
const rasterizedGlyph = this._drawToCache(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT);
|
|
126
|
+
const rasterizedGlyph = this._drawToCache(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT, false, undefined);
|
|
126
127
|
this._cacheMap.set(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT, rasterizedGlyph);
|
|
127
128
|
}
|
|
128
129
|
});
|
|
@@ -242,12 +243,12 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
public getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph {
|
|
246
|
-
return this._getFromCacheMap(this._cacheMapCombined, chars, bg, fg, ext, restrictToCellHeight);
|
|
246
|
+
public getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean, domContainer: HTMLElement | undefined): IRasterizedGlyph {
|
|
247
|
+
return this._getFromCacheMap(this._cacheMapCombined, chars, bg, fg, ext, restrictToCellHeight, domContainer);
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
public getRasterizedGlyph(code: number, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph {
|
|
250
|
-
return this._getFromCacheMap(this._cacheMap, code, bg, fg, ext, restrictToCellHeight);
|
|
250
|
+
public getRasterizedGlyph(code: number, bg: number, fg: number, ext: number, restrictToCellHeight: boolean, domContainer: HTMLElement | undefined): IRasterizedGlyph {
|
|
251
|
+
return this._getFromCacheMap(this._cacheMap, code, bg, fg, ext, restrictToCellHeight, domContainer);
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
/**
|
|
@@ -259,11 +260,12 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
259
260
|
bg: number,
|
|
260
261
|
fg: number,
|
|
261
262
|
ext: number,
|
|
262
|
-
restrictToCellHeight: boolean
|
|
263
|
+
restrictToCellHeight: boolean,
|
|
264
|
+
domContainer: HTMLElement | undefined
|
|
263
265
|
): IRasterizedGlyph {
|
|
264
266
|
$glyph = cacheMap.get(key, bg, fg, ext);
|
|
265
267
|
if (!$glyph) {
|
|
266
|
-
$glyph = this._drawToCache(key, bg, fg, ext, restrictToCellHeight);
|
|
268
|
+
$glyph = this._drawToCache(key, bg, fg, ext, restrictToCellHeight, domContainer);
|
|
267
269
|
cacheMap.set(key, bg, fg, ext, $glyph);
|
|
268
270
|
}
|
|
269
271
|
return $glyph;
|
|
@@ -423,12 +425,20 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
423
425
|
return this._config.colors.contrastCache;
|
|
424
426
|
}
|
|
425
427
|
|
|
426
|
-
private _drawToCache(codeOrChars: number | string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean
|
|
428
|
+
private _drawToCache(codeOrChars: number | string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean, domContainer: HTMLElement | undefined): IRasterizedGlyph {
|
|
427
429
|
const chars = typeof codeOrChars === 'number' ? String.fromCharCode(codeOrChars) : codeOrChars;
|
|
428
430
|
|
|
429
431
|
// Uncomment for debugging
|
|
430
432
|
// console.log(`draw to cache "${chars}"`, bg, fg, ext);
|
|
431
433
|
|
|
434
|
+
// Attach the canvas to the DOM in order to inherit font-feature-settings
|
|
435
|
+
// from the parent elements. This is necessary for ligatures and variants to
|
|
436
|
+
// work.
|
|
437
|
+
if (domContainer && this._tmpCanvas.parentElement !== domContainer) {
|
|
438
|
+
this._tmpCanvas.style.display = 'none';
|
|
439
|
+
domContainer.append(this._tmpCanvas);
|
|
440
|
+
}
|
|
441
|
+
|
|
432
442
|
// Allow 1 cell width per character, with a minimum of 2 (CJK), plus some padding. This is used
|
|
433
443
|
// to draw the glyph to the canvas as well as to restrict the bounding box search to ensure
|
|
434
444
|
// giant ligatures (eg. =====>) don't impact overall performance.
|
|
@@ -108,8 +108,8 @@ export interface ITextureAtlas extends IDisposable {
|
|
|
108
108
|
* Clear all glyphs from the texture atlas.
|
|
109
109
|
*/
|
|
110
110
|
clearTexture(): void;
|
|
111
|
-
getRasterizedGlyph(code: number, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph;
|
|
112
|
-
getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean): IRasterizedGlyph;
|
|
111
|
+
getRasterizedGlyph(code: number, bg: number, fg: number, ext: number, restrictToCellHeight: boolean, domContainer: HTMLElement | undefined): IRasterizedGlyph;
|
|
112
|
+
getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number, restrictToCellHeight: boolean, domContainer: HTMLElement | undefined): IRasterizedGlyph;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/**
|