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