M7: doc comments on the font scan's folders and scan_dir (#298)

This commit is contained in:
AganzeFelicite
2026-10-22 09:00:37 +02:00
parent d68a2c54c5
commit b13e5c4ff3
+4
View File
@@ -731,6 +731,7 @@ impl FontDb {
}
}
/// The folders this platform keeps installed and activated fonts in, walked by the font scan.
fn system_font_dirs() -> Vec<std::path::PathBuf> {
#[allow(unused_mut)]
let mut v: Vec<std::path::PathBuf> = Vec::new();
@@ -794,6 +795,9 @@ fn unix_user_font_dirs(home: Option<std::ffi::OsString>, data_home: Option<std::
dirs
}
/// Adds the faces of every font file under `dir` (up to six folders deep) to `out`, keyed by
/// lowercased family: files named `.ttf`, `.otf`, `.ttc` or `.otc`, and files without an extension
/// that start with a font signature.
fn scan_dir(dir: &std::path::Path, depth: usize, out: &mut BTreeMap<String, (String, Vec<Pending>)>) {
if depth > 6 {
return;