chiark / gitweb /
clock: svg: Break out "font", nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 16:48:07 +0000 (16:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 21:42:20 +0000 (21:42 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/clock.rs

index 4113d5e0fe4c1c08a21ad4d366f44acbcb18bb51..0eded2fe4819e9b7ce21a029b8d94f5e66231b19 100644 (file)
@@ -304,10 +304,13 @@ impl PieceTrait for Clock {
       let mins_pad = iter::repeat("&nbsp;").take(3 - mins.len())
         .collect::<String>();
 
+      let font = r##"
+  font-family="Latin Modern Mono, monospace" font-size="6" font-weight="700"
+             "##;
       write!(f, r##"
-  <text x="1"  y="{}" font-family="Latin Modern Mono, monospace" font-size="6"
-   font-weight="700" fill="{}" >{}{}{}{:02}</text>"##,
+  <text x="1"  y="{}" {} fill="{}" >{}{}{}{:02}</text>"##,
              y,
+             font,
              show.text,
              mins_pad, mins, show.sigil, secs
       )?;