summaryrefslogtreecommitdiff
path: root/src/loading/fs.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-09-19 11:31:37 +0200
committerLaurenz <laurmaedje@gmail.com>2022-09-19 11:36:59 +0200
commit30be75c6687f1e03cf867d258b3ddba353cc7aa2 (patch)
tree51afd42ae8875811ae51974e66681a17990de7f2 /src/loading/fs.rs
parent4ec3bcee487c1567bc6551f81d4f69eee4379076 (diff)
Renaming
`Face` -> `Font` `FaceId` -> `FontId` `SourceFile` -> `Source`
Diffstat (limited to 'src/loading/fs.rs')
-rw-r--r--src/loading/fs.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/loading/fs.rs b/src/loading/fs.rs
index c1576e86..70ab5e53 100644
--- a/src/loading/fs.rs
+++ b/src/loading/fs.rs
@@ -7,19 +7,19 @@ use same_file::Handle;
use walkdir::WalkDir;
use super::{FileHash, Loader};
-use crate::font::FaceInfo;
+use crate::font::FontInfo;
/// Loads fonts and files from the local file system.
///
/// _This is only available when the `fs` feature is enabled._
pub struct FsLoader {
- faces: Vec<FaceInfo>,
+ fonts: Vec<FontInfo>,
}
impl FsLoader {
/// Create a new loader without any fonts.
pub fn new() -> Self {
- Self { faces: vec![] }
+ Self { fonts: vec![] }
}
/// Builder-style variant of [`search_system`](Self::search_system).
@@ -100,24 +100,24 @@ impl FsLoader {
}
}
- /// Index the font faces in the file at the given path.
+ /// Index the fonts in the file at the given path.
///
- /// The file may form a font collection and contain multiple font faces,
+ /// The file may form a font collection and contain multiple fonts,
/// which will then all be indexed.
fn search_file(&mut self, path: impl AsRef<Path>) {
let path = path.as_ref();
let path = path.strip_prefix(".").unwrap_or(path);
if let Ok(file) = File::open(path) {
if let Ok(mmap) = unsafe { Mmap::map(&file) } {
- self.faces.extend(FaceInfo::from_data(path, &mmap));
+ self.fonts.extend(FontInfo::from_data(path, &mmap));
}
}
}
}
impl Loader for FsLoader {
- fn faces(&self) -> &[FaceInfo] {
- &self.faces
+ fn fonts(&self) -> &[FontInfo] {
+ &self.fonts
}
fn resolve(&self, path: &Path) -> io::Result<FileHash> {