Skip to content

Commit 6f8f368

Browse files
committed
chore: update benchmarks now that fonts are fixed
Signed-off-by: Sam Gammon <[email protected]>
1 parent 773732d commit 6f8f368

File tree

6 files changed

+73
-49
lines changed

6 files changed

+73
-49
lines changed

Cargo.lock

Lines changed: 67 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ reflink-copy = "0.1.24"
137137
regex = "1.11.1"
138138
reqwest = "0.12.12"
139139
reqwest-middleware = "0.4.1"
140-
resvg = "0.29.0"
140+
resvg = "0.32.0"
141141
rkyv = "0.8.10"
142142
sentry = "0.36.0"
143143
serde = "1.0.218"

assets/benchmarks-cold-cache.png

61.1 KB
Loading
67.4 KB
Loading

assets/benchmarks-warm-cache.png

55.5 KB
Loading

examples/render-benchmarks.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66

77
use backon::{BlockingRetryable, ConstantBuilder};
88
use miette::{IntoDiagnostic, Result};
9-
use resvg::usvg_text_layout::{TreeTextToPath, fontdb};
9+
use resvg::usvg::{TreeParsing, TreeTextToPath, fontdb};
1010
use serde::Deserialize;
1111

1212
fn main() -> Result<()> {
@@ -146,7 +146,7 @@ fn plot_benchmark(heading: &str, results: &BenchmarkResults) -> Result<String> {
146146
fn render_to_png(data: &str, path: &Path, fontdb: &fontdb::Database) -> Result<()> {
147147
let mut tree = resvg::usvg::Tree::from_str(data, &Default::default()).into_diagnostic()?;
148148
tree.convert_text(fontdb);
149-
let fit_to = resvg::usvg::FitTo::Width(1600);
149+
let fit_to = resvg::FitTo::Width(1600);
150150
let size = fit_to
151151
.fit_to(tree.size.to_screen_size())
152152
.ok_or_else(|| miette::miette!("failed to fit to screen size"))?;
@@ -166,11 +166,11 @@ fn render_to_png(data: &str, path: &Path, fontdb: &fontdb::Database) -> Result<(
166166
fn load_fonts() -> fontdb::Database {
167167
let mut fontdb = fontdb::Database::new();
168168
fontdb.load_system_fonts();
169-
fontdb.set_serif_family("Times New Roman");
170-
fontdb.set_sans_serif_family("Arial");
169+
fontdb.set_serif_family("FreeSerif");
170+
fontdb.set_sans_serif_family("Noto Sans");
171171
fontdb.set_cursive_family("Comic Sans MS");
172172
fontdb.set_fantasy_family("Impact");
173-
fontdb.set_monospace_family("Courier New");
173+
fontdb.set_monospace_family("Ubuntu Mono");
174174

175175
fontdb
176176
}

0 commit comments

Comments
 (0)