Skip to content

Commit

Permalink
chore: update roarsvg dep
Browse files Browse the repository at this point in the history
Improves alignment of map text on SVG output and avoids
some font allocations.
  • Loading branch information
carrascomj committed Jan 20, 2025
1 parent 4e0f8c2 commit 6cc5330
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
43 changes: 7 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde = "1.0.208"
serde_json = "1.0.125"
proc-macro2 = "1.0.86"
chrono = "0.4.38"
roarsvg = "0.4.1"
roarsvg = "0.5.0"
anyhow = "1.0.80"
thiserror = "1.0.69"
image = "0.25"
Expand Down
6 changes: 4 additions & 2 deletions src/screenshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ fn save_svg_file(
)
.unwrap_or_else(|_| info!("Writing error!"));
}
let writer = writer.add_fonts_source(&fira.data[..]);
let mut writer = writer.add_fonts_source(&assis.data[..]);
let writer = writer.add_fonts_source(fira.data.clone());
let mut writer = writer.add_fonts_source(assis.data.clone());
for (text, font, color, transform, vis) in &text_query {
if Visibility::Hidden == vis {
continue;
Expand All @@ -197,6 +197,7 @@ fn save_svg_file(
color.alpha(),
)),
None,
roarsvg::DominantBaseline::Middle,
)
.unwrap_or_else(|_| info!("Writing error!"));
}
Expand Down Expand Up @@ -258,6 +259,7 @@ fn save_svg_file(
None,
vec![String::from("Assistant"), String::from("Regular")],
font.font_size,
roarsvg::DominantBaseline::Auto,
)
.unwrap(),
);
Expand Down

0 comments on commit 6cc5330

Please sign in to comment.