Skip to content

Commit 2476771

Browse files
authored
Merge pull request #26 from rtsuk/master
Switch benches to use noto font
2 parents 6853acf + 202e385 commit 2476771

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "font-rs"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
license = "Apache-2.0"
55
authors = [ "Raph Levien <[email protected]>" ]
66
keywords = ["font", "truetype", "ttf"]

benches/glyph.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@ extern crate test;
1919
use font_rs::font;
2020
use test::Bencher;
2121

22-
use std::fs::File;
23-
use std::io::Read;
22+
static FONT_DATA: &'static [u8] =
23+
include_bytes!("../fonts/notomono-hinted/NotoMono-Regular.ttf");
2424

2525
fn glyphbench(b: &mut Bencher, size: u32) {
26-
let filename = "misc/wt024.ttf";
27-
let mut file = File::open(filename).unwrap();
28-
let mut data = Vec::new();
29-
file.read_to_end(&mut data).unwrap();
30-
let font = font::parse(&data).unwrap();
31-
b.iter(|| font.render_glyph(6000, size));
26+
let font = font::parse(&FONT_DATA).unwrap();
27+
b.iter(|| font.render_glyph(200, size));
3228
}
3329

3430
#[bench]

misc/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

misc/wt024.ttf

-9.27 MB
Binary file not shown.

0 commit comments

Comments
 (0)