Self-host VictorMono Nerd Font icons for the terminal + editor
- Add Symbols-Only Nerd Font Mono (woff2) under public/fonts; @font-face scoped by unicode-range to the Nerd Font glyph ranges, so the ~1.1MB file only loads when an icon actually renders (latin text stays on Victor Mono) - Terminal + editor font stacks fall back to it for icons; terminal prewarms it and repaints so powerline/oh-my-posh/eza/nvim icons show - No server/env changes; ships in the spoon-next image (public/)
This commit is contained in:
@@ -20,7 +20,7 @@ const MonacoEditor = dynamic(async () => await import('@monaco-editor/react'), {
|
||||
});
|
||||
|
||||
const EDITOR_FONT_FAMILY =
|
||||
"var(--font-victor-mono), 'Geist Mono', ui-monospace, SFMono-Regular, monospace";
|
||||
"var(--font-victor-mono), 'Symbols Nerd Font Mono', 'Geist Mono', ui-monospace, SFMono-Regular, monospace";
|
||||
|
||||
type MonacoEditorInstance = {
|
||||
getModel?: () => unknown;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Button } from '@spoon/ui';
|
||||
import '@xterm/xterm/css/xterm.css';
|
||||
|
||||
const TERMINAL_FONT =
|
||||
"var(--font-victor-mono), 'Geist Mono', ui-monospace, monospace";
|
||||
"var(--font-victor-mono), 'Symbols Nerd Font Mono', 'Geist Mono', ui-monospace, monospace";
|
||||
|
||||
type Status = 'connecting' | 'connected' | 'closed' | 'error' | 'unconfigured';
|
||||
|
||||
@@ -146,6 +146,15 @@ export const WorkspaceTerminal = ({
|
||||
fit.fit();
|
||||
termRef.current = term;
|
||||
|
||||
// Pull in the Nerd Font icon glyphs (loaded lazily by unicode-range) and
|
||||
// repaint once ready so powerline/oh-my-posh/eza icons render.
|
||||
void document.fonts
|
||||
.load("16px 'Symbols Nerd Font Mono'", '\ue0b0')
|
||||
.then(() => {
|
||||
if (!isAborted()) term.refresh(0, term.rows - 1);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
|
||||
const sendResize = () => {
|
||||
if (ws?.readyState !== WebSocket.OPEN) return;
|
||||
ws.send(
|
||||
|
||||
Reference in New Issue
Block a user