diff --git a/public/fonts/NERD-FONTS-LICENSE.txt b/public/fonts/NERD-FONTS-LICENSE.txt new file mode 100644 index 0000000..06eb073 --- /dev/null +++ b/public/fonts/NERD-FONTS-LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ryan L McIntyre + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/public/fonts/SymbolsNerdFontMono-Regular.woff2 b/public/fonts/SymbolsNerdFontMono-Regular.woff2 new file mode 100644 index 0000000..e92681b Binary files /dev/null and b/public/fonts/SymbolsNerdFontMono-Regular.woff2 differ diff --git a/src/index.css b/src/index.css index 6e9e00f..5451c68 100644 --- a/src/index.css +++ b/src/index.css @@ -1,5 +1,13 @@ @import "tailwindcss"; +@font-face { + font-family: 'Symbols Nerd Font Mono'; + src: url('/fonts/SymbolsNerdFontMono-Regular.woff2') format('woff2'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + @theme { --color-page: #0D0E10; --color-card: #141518; diff --git a/src/lib/terminalPrefs.ts b/src/lib/terminalPrefs.ts index fa5f384..b9b6947 100644 --- a/src/lib/terminalPrefs.ts +++ b/src/lib/terminalPrefs.ts @@ -38,7 +38,7 @@ export interface TabState { const PREFS_KEY = 'archnest-terminal-prefs' export function defaultPrefs(): TerminalPrefs { - return { themeName: TERM_THEMES[0].name, fontSize: 13, fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace' } + return { themeName: TERM_THEMES[0].name, fontSize: 13, fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace, "Symbols Nerd Font Mono"' } } export function loadPrefs(): TerminalPrefs { diff --git a/src/pages/Terminal.tsx b/src/pages/Terminal.tsx index a4948c7..46c0026 100644 --- a/src/pages/Terminal.tsx +++ b/src/pages/Terminal.tsx @@ -8,10 +8,15 @@ const GOLD = '#C8A434' const TEXT_SECONDARY = '#7A7D85' const FONT_SIZES = [11, 12, 13, 14, 15, 16] +// "Symbols Nerd Font Mono" is appended as a glyph-only fallback to every option, so +// distro icons / git branch / etc. from prompts like Starship render instead of +// showing as boxes — it has no letterforms of its own, so it never overrides the +// chosen base font for normal text. +const NERD_FALLBACK = '"Symbols Nerd Font Mono"' const FONT_FAMILIES = [ - { name: 'Monospace', value: 'ui-monospace, SFMono-Regular, Menlo, monospace' }, - { name: 'Fira Code', value: '"Fira Code", ui-monospace, monospace' }, - { name: 'JetBrains Mono', value: '"JetBrains Mono", ui-monospace, monospace' }, + { name: 'Monospace', value: `ui-monospace, SFMono-Regular, Menlo, monospace, ${NERD_FALLBACK}` }, + { name: 'Fira Code', value: `"Fira Code", ui-monospace, monospace, ${NERD_FALLBACK}` }, + { name: 'JetBrains Mono', value: `"JetBrains Mono", ui-monospace, monospace, ${NERD_FALLBACK}` }, ] export default function Terminal() {