From 4fa9d5444d4ea2e844d4c70533d7dc82ef583c61 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 21:51:57 +0000 Subject: [PATCH 1/2] feat: subset and embed fonts in SVG output - SVG outputs now embed the glyphs of the fonts they use in a ` +"#, + jb_reg = subset(EMBEDDED_JETBRAINS_NERD_MONO_REGULAR_WOFF2), + jb_bold = subset(EMBEDDED_JETBRAINS_NERD_MONO_BOLD_WOFF2), + jb_ital = subset(EMBEDDED_JETBRAINS_NERD_MONO_ITALIC_WOFF2), + jb_bold_ital = subset(EMBEDDED_JETBRAINS_NERD_MONO_BOLD_ITALIC_WOFF2), + ns_mono = subset(EMBEDDED_NOTO_SANS_MONO_REGULAR_WOFF2), + ns_sym2 = subset(EMBEDDED_NOTO_SANS_SYMBOLS2_REGULAR_WOFF2), + ns_cjk = subset(EMBEDDED_NOTO_SANS_MONO_CJK_JP_SUBSET_WOFF2), + uni_upper = subset(EMBEDDED_UNIFONT_UPPER_WOFF2), + uni_csur = subset(EMBEDDED_UNIFONT_CSUR_WOFF2), + ) +} + /// Tunables for the SVG renderer. #[derive(Debug, Clone)] pub struct SvgOptions { @@ -91,7 +189,7 @@ pub fn spawn_svg_stream( impl Default for SvgOptions { fn default() -> Self { Self { - font_family: "ui-monospace, Menlo, Consolas, 'DejaVu Sans Mono', monospace".to_string(), + font_family: "'JetBrainsMono Nerd Font Mono', 'Noto Sans Mono', 'Noto Sans Symbols 2', 'Noto Sans Mono CJK JP', 'unifont_upper', 'unifont_csur', ui-monospace, Menlo, Consolas, 'DejaVu Sans Mono', monospace".to_string(), font_size: 16.0, } } @@ -188,11 +286,12 @@ pub fn render_svg_to_string(rec: &Recording, opts: &SvgOptions) -> Result -"#, +{style}"#, w = canvas_w, h = canvas_h, font = escape_attr(&opts.font_family), fs = opts.font_size, + style = generate_style_block(&frames) )); // Canvas background. @@ -299,11 +398,12 @@ fn run_svg_stream_worker( s.push_str(&format!( r#" -"#, +{style}"#, w = canvas_w, h = canvas_h, font = escape_attr(&opts.font_family), fs = opts.font_size, + style = generate_style_block(&frames) )); s.push_str(&format!( r#" From e863956e36cdefa7a276b5ab447acdd8ec5d3f92 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 07:12:11 +0000 Subject: [PATCH 2/2] feat: subset and embed fonts in SVG output - SVG outputs now embed the glyphs of the fonts they use in a `