From ce41b175ee961914f7ecca8c5e4262644207152b Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:11:50 -0800 Subject: [PATCH] Remove cyclic dep --- .../customGlyphs/CustomGlyphDefinitions.ts | 5 ++- .../src/customGlyphs/CustomGlyphRasterizer.ts | 28 +---------------- addons/addon-webgl/src/customGlyphs/Types.ts | 31 +++++++++++++++++++ 3 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 addons/addon-webgl/src/customGlyphs/Types.ts diff --git a/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts b/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts index 7f89e98d..aa3ef321 100644 --- a/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts +++ b/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts @@ -3,9 +3,12 @@ * @license MIT */ +import { CustomGlyphVectorType, type CustomGlyphDrawFunctionDefinition, type CustomGlyphPatternDefinition, type ICustomGlyphSolidOctantBlockVector, type ICustomGlyphVectorShape } from 'customGlyphs/Types'; + /* eslint-disable @typescript-eslint/naming-convention */ -import { CustomGlyphVectorType, type CustomGlyphDrawFunctionDefinition, type ICustomGlyphSolidOctantBlockVector, type ICustomGlyphVectorShape, type CustomGlyphPatternDefinition } from 'customGlyphs/CustomGlyphRasterizer'; +export const unifiedCharDefinitions: { [index: string]: ICustomGlyphVectorShape[] | undefined } = { +}; export const blockElementDefinitions: { [index: string]: ICustomGlyphSolidOctantBlockVector[] | undefined } = { // Block elements (0x2580-0x2590) diff --git a/addons/addon-webgl/src/customGlyphs/CustomGlyphRasterizer.ts b/addons/addon-webgl/src/customGlyphs/CustomGlyphRasterizer.ts index 8c77bdd7..e84883dd 100644 --- a/addons/addon-webgl/src/customGlyphs/CustomGlyphRasterizer.ts +++ b/addons/addon-webgl/src/customGlyphs/CustomGlyphRasterizer.ts @@ -5,33 +5,7 @@ import { throwIfFalsy } from 'browser/renderer/shared/RendererUtils'; import { blockElementDefinitions, blockShadeComboDefinitions, boxDrawingDefinitions, patternCharacterDefinitions, powerlineDefinitions, rectangularShadeDefinitions, symbolsForLegacyComputingDefinitions } from 'customGlyphs/CustomGlyphDefinitions'; - -export interface ICustomGlyphSolidOctantBlockVector { - x: number; - y: number; - w: number; - h: number; -} - -/** - * @param xp The percentage of 15% of the x axis. - * @param yp The percentage of 15% of the x axis on the y axis. - */ -export type CustomGlyphDrawFunctionDefinition = (xp: number, yp: number) => string; - -export interface ICustomGlyphVectorShape { - d: string; - type: CustomGlyphVectorType; - leftPadding?: number; - rightPadding?: number; -} - -export const enum CustomGlyphVectorType { - FILL, - STROKE -} - -export type CustomGlyphPatternDefinition = number[][]; +import { CustomGlyphVectorType, type CustomGlyphDrawFunctionDefinition, type CustomGlyphPatternDefinition, type ICustomGlyphSolidOctantBlockVector, type ICustomGlyphVectorShape } from 'customGlyphs/Types'; /** * Try drawing a custom block element or box drawing character, returning whether it was diff --git a/addons/addon-webgl/src/customGlyphs/Types.ts b/addons/addon-webgl/src/customGlyphs/Types.ts new file mode 100644 index 00000000..d4aebc73 --- /dev/null +++ b/addons/addon-webgl/src/customGlyphs/Types.ts @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2021 The xterm.js authors. All rights reserved. + * @license MIT + */ + +export interface ICustomGlyphSolidOctantBlockVector { + x: number; + y: number; + w: number; + h: number; +} + +/** + * @param xp The percentage of 15% of the x axis. + * @param yp The percentage of 15% of the x axis on the y axis. + */ +export type CustomGlyphDrawFunctionDefinition = (xp: number, yp: number) => string; + +export interface ICustomGlyphVectorShape { + d: string; + type: CustomGlyphVectorType; + leftPadding?: number; + rightPadding?: number; +} + +export const enum CustomGlyphVectorType { + FILL, + STROKE +} + +export type CustomGlyphPatternDefinition = number[][];