diff --git a/src/main/window-manager.ts b/src/main/window-manager.ts index 680c3d314b..78fb829b1a 100644 --- a/src/main/window-manager.ts +++ b/src/main/window-manager.ts @@ -28,13 +28,14 @@ export interface SendToViewArgs { } export class WindowManager extends Singleton { + public mainContentUrl = `http://localhost:${LensProxy.getInstance().port}`; + protected mainWindow: BrowserWindow; protected splashWindow: BrowserWindow; protected windowState: windowStateKeeper.State; protected disposers: Record = {}; @observable activeClusterId: ClusterId; - @observable mainContentUrl = `http://localhost:${LensProxy.getInstance().port}`; constructor() { super(); diff --git a/src/renderer/components/dock/terminal/terminal.ts b/src/renderer/components/dock/terminal/terminal.ts index ca5f36d2d4..c119c071c6 100644 --- a/src/renderer/components/dock/terminal/terminal.ts +++ b/src/renderer/components/dock/terminal/terminal.ts @@ -11,13 +11,12 @@ import type { TabId } from "../dock/store"; import { TerminalApi, TerminalChannels } from "../../../api/terminal-api"; import { ThemeStore } from "../../../theme.store"; import { disposer } from "../../../utils"; -import { isMac, defaultTerminalFontFamily } from "../../../../common/vars"; +import { isMac } from "../../../../common/vars"; import { once } from "lodash"; import { UserStore } from "../../../../common/user-store"; import { clipboard } from "electron"; import logger from "../../../../common/logger"; import type { TerminalConfig } from "../../../../common/user-store/preferences-helpers"; -import RobotoMonoFontUrl from "../../fonts/roboto-mono-nerd.ttf"; export class Terminal { private terminalConfig: TerminalConfig = UserStore.getInstance().terminalConfig; @@ -26,17 +25,6 @@ export class Terminal { return document.getElementById("terminal-init"); } - static async preloadFonts() { - try { - const fontFace = new FontFace(defaultTerminalFontFamily, `url(${RobotoMonoFontUrl})`); - - await fontFace.load(); - document.fonts.add(fontFace); - } catch (error) { - logger.error(`[TERMINAL]: preloading default font failed`, error); - } - } - private xterm: XTerm | null = new XTerm({ cursorBlink: true, cursorStyle: "bar", diff --git a/src/renderer/components/fonts.scss b/src/renderer/components/fonts.scss index a8b8f265da..a0dcadd400 100644 --- a/src/renderer/components/fonts.scss +++ b/src/renderer/components/fonts.scss @@ -13,7 +13,8 @@ font-style: normal; font-weight: 400; font-display: block; - src: url("../fonts/MaterialIcons-Regular.ttf") format("truetype"); + src: url("./fonts/MaterialIcons-Regular.woff2") format("woff"); + src: url("./fonts/MaterialIcons-Regular.ttf") format("truetype"); } // Patched RobotoMono font with icons @@ -21,6 +22,5 @@ // https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/RobotoMono @font-face { font-family: 'RobotoMono'; - src: local('RobotoMono'), - url('fonts/roboto-mono-nerd.ttf') format('truetype'); + src: local('RobotoMono'), url('./fonts/roboto-mono-nerd.ttf') format('truetype'); } diff --git a/src/renderer/fonts/MaterialIcons-Regular.ttf b/src/renderer/components/fonts/MaterialIcons-Regular.ttf similarity index 100% rename from src/renderer/fonts/MaterialIcons-Regular.ttf rename to src/renderer/components/fonts/MaterialIcons-Regular.ttf diff --git a/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.ts b/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.ts index 71d71cf8be..3fa3ebd5a6 100644 --- a/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.ts +++ b/src/renderer/frames/cluster-frame/init-cluster-frame/init-cluster-frame.ts @@ -5,7 +5,6 @@ import type { Cluster } from "../../../../common/cluster/cluster"; import type { CatalogEntityRegistry } from "../../../api/catalog-entity-registry"; import logger from "../../../../main/logger"; -import { Terminal } from "../../../components/dock/terminal/terminal"; import type { KubernetesCluster } from "../../../../common/catalog-entities"; import { Notifications } from "../../../components/notifications"; import type { AppEvent } from "../../../../common/app-event-bus/event-bus"; @@ -40,7 +39,6 @@ export const initClusterFrame = `${logPrefix} Init dashboard, clusterId=${hostedCluster.id}, frameId=${frameRoutingId}`, ); - await Terminal.preloadFonts(); await requestSetClusterFrameId(hostedCluster.id); await hostedCluster.whenReady; // cluster.activate() is done at this point diff --git a/src/renderer/template.html b/src/renderer/template.html index fd4d35c5a6..85e7b892bc 100755 --- a/src/renderer/template.html +++ b/src/renderer/template.html @@ -2,6 +2,9 @@ + + +