🍮 Add custom font support (#43)
* 🍮 Add custom font support
* Revert incorrect change
This commit is contained in:
parent
425f741982
commit
6249b0e037
1 changed files with 7 additions and 3 deletions
|
|
@ -16,13 +16,10 @@ pub struct FontSystem{
|
|||
|
||||
impl FontSystem {
|
||||
pub fn new() -> Self {
|
||||
//TODO: get locale from argument?
|
||||
let locale = "en-US".to_string();
|
||||
|
||||
//TODO: allow loading fonts from memory
|
||||
let mut db = fontdb::Database::new();
|
||||
{
|
||||
//TODO: configurable default fonts
|
||||
db.set_monospace_family("Fira Mono");
|
||||
db.set_sans_serif_family("Fira Sans");
|
||||
db.set_serif_family("DejaVu Serif");
|
||||
|
|
@ -34,6 +31,13 @@ impl FontSystem {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_with_locale_and_db(locale: &str, db: fontdb::Database) -> Self {
|
||||
Self {
|
||||
locale: locale.to_string(),
|
||||
db
|
||||
}
|
||||
}
|
||||
|
||||
pub fn locale(&self) -> &str {
|
||||
&self.locale
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue