Use Fira Code for font
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Isaac Mills 2025-07-19 10:00:54 -06:00
parent b3ffb51d55
commit 966d56972e
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
8 changed files with 28 additions and 3 deletions

BIN
assets/FiraCode-Bold.woff2 Normal file

Binary file not shown.

Binary file not shown.

15
src/firacode.css Normal file
View file

@ -0,0 +1,15 @@
@font-face {
font-family: 'Fira Code';
src: url('/assets/FiraCode-Bold.woff2') format('woff2');
font-weight: bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Fira Code';
src: url('/assets/FiraCode-Regular.woff2') format('woff2');
font-weight: normal;
font-style: normal;
font-display: swap;
}

View file

@ -8,6 +8,10 @@
</x-section-head>
<div id="cockpit-canvas" style="height: 80vh; margin: 8px; background-color: #000;"></div>
</x-tab.content>
<push name="head">
<link rel="preload" href="/assets/FiraCode-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/FiraCode-Bold.woff2" as="font" type="font/woff2" crossorigin>
</push>
<script>
var interval = setInterval(function () {
if (typeof window.run_cockpit === 'function') {

View file

@ -1,4 +1,5 @@
@import 'apex.css';
@import 'firacode.css';
@custom-media --tablet only screen and (max-width: 1200px);
@custom-media --phone only screen and (max-width: 800px);

View file

@ -1,4 +1,5 @@
@import 'apex.css';
@import 'firacode.css';
@custom-media --tablet only screen and (max-width: 1200px);
@custom-media --phone only screen and (max-width: 800px);

@ -1 +1 @@
Subproject commit c19f3f64781eea425fb2a22f1b64520c2711f445
Subproject commit da35ead8db4a224814f56eb6f86202e7ed261975

View file

@ -23,8 +23,12 @@ extern "C" {
pub fn run(grid_id: &str) {
console_error_panic_hook::set_once();
let backend =
CanvasBackend::new_with_options(CanvasBackendOptions::new().grid_id(grid_id)).unwrap();
let backend = CanvasBackend::new_with_options(
CanvasBackendOptions::new()
.grid_id(grid_id)
.font(String::from("16px Fira Code")),
)
.unwrap();
let terminal = Terminal::new(backend).unwrap();
let app = Rc::new(RefCell::new(App::default()));