bundle JetBrains Mono for terminal panes

Vendor the 4 core weights (Regular, Italic, Bold, BoldItalic) of
JetBrains Mono v2.304 under app/assets/fonts/jetbrains_mono/, ~1 MB
total. OFL license checked in alongside. Declared as the
JetBrainsMono family in pubspec so Flutter bundles it automatically.

app/lib/widgets/src/typography.dart exposes clideMonoFamily plus a
platform-ordered fallback chain (SF Mono / Menlo / Monaco →
JetBrains Mono system install / Fira Code / Hack / DejaVu / Liberation →
Cascadia / Consolas → monospace) for web builds and test harnesses
that don't load asset fonts. Terminal widgets pick both up via a
single import.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-22 08:02:10 +02:00
co-authored by Claude
parent 0412a2284a
commit 7bdeb9ab24
9 changed files with 152 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
/// Typography constants shared across widgets.
///
/// Terminal panes, diff views, and any other monospace surface should
/// import from here rather than hardcoding a family. The fallback chain
/// exists for web builds + platforms where the bundled `JetBrainsMono`
/// asset isn't picked up (rare, but possible during `flutter test` if
/// assets aren't declared in the harness).
library;
/// The bundled monospace family. Always resolved first.
const String clideMonoFamily = 'JetBrainsMono';
/// System fallback chain. Ordered by platform prevalence + quality of
/// programming-ligature / box-drawing coverage.
const List<String> clideMonoFamilyFallback = [
// macOS
'SF Mono',
'Menlo',
'Monaco',
// Linux
'JetBrains Mono', // if the user has it system-installed under the
// canonical PostScript name
'Fira Code',
'Hack',
'DejaVu Sans Mono',
'Liberation Mono',
// Windows
'Cascadia Code',
'Consolas',
// Last resort
'monospace',
];