-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const DEMO_TTF: &[u8] = include_bytes!("./fonts/Tuffy.ttf"); | ||
use std::sync::Arc; | ||
|
||
#[test] | ||
fn add_fonts_and_get_ids_back() { | ||
env_logger::init(); | ||
let mut font_db = fontdb::Database::new(); | ||
let ids = font_db.load_font_source(fontdb::Source::Binary(Arc::new(DEMO_TTF))); | ||
|
||
assert_eq!(ids.len(), 1); | ||
let id = ids[0]; | ||
|
||
let font = font_db.face(id).unwrap(); | ||
assert!(font.families.iter().any(|(name, _)| name == "Tuffy")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
We, the copyright holders of this work, hereby release it into the | ||
public domain. This applies worldwide. | ||
|
||
In case this is not legally possible, | ||
|
||
We grant any entity the right to use this work for any purpose, without | ||
any conditions, unless such conditions are required by law. | ||
|
||
Thatcher Ulrich <tu@tulrich.com> http://tulrich.com | ||
Karoly Barta bartakarcsi@gmail.com | ||
Michael Evans http://www.evertype.com |
Binary file not shown.