Skip to content

Commit

Permalink
correct windows self usage
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Mar 29, 2024
1 parent 47fbd61 commit 7071fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sugarloaf/src/font/loader/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ pub fn load(db: &mut Database) {

if let Some(ref system_root) = std::env::var_os("SYSTEMROOT") {
let system_root_path = std::path::Path::new(system_root);
self.load_fonts_dir(system_root_path.join("Fonts"));
db.load_fonts_dir(system_root_path.join("Fonts"));
} else {
self.load_fonts_dir("C:\\Windows\\Fonts\\");
db.load_fonts_dir("C:\\Windows\\Fonts\\");
}

if let Ok(ref home) = std::env::var("USERPROFILE") {
let home_path = std::path::Path::new(home);
self.load_fonts_dir(home_path.join("AppData\\Local\\Microsoft\\Windows\\Fonts"));
self.load_fonts_dir(
db.load_fonts_dir(home_path.join("AppData\\Local\\Microsoft\\Windows\\Fonts"));
db.load_fonts_dir(
home_path.join("AppData\\Roaming\\Microsoft\\Windows\\Fonts"),
);
}
Expand Down

0 comments on commit 7071fee

Please sign in to comment.