Skip to content

Commit

Permalink
Prevent duplicates in font families list
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Oct 23, 2024
1 parent 530bda9 commit 1735061
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ pub fn init(font_dirs: &[String], font_family: &str) -> Option<(fontdb::Database
} else {
for name in ["DejaVu Sans", "Noto Emoji"] {
if let Some(name) = find_font_family(&font_db, name) {
families.push(name);
if !families.contains(&name) {
families.push(name);
}
}
}

Expand Down

0 comments on commit 1735061

Please sign in to comment.