From 30be75c6687f1e03cf867d258b3ddba353cc7aa2 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 19 Sep 2022 11:31:37 +0200 Subject: Renaming `Face` -> `Font` `FaceId` -> `FontId` `SourceFile` -> `Source` --- src/loading/fs.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/loading/fs.rs') 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, + fonts: Vec, } 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) { 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 { -- cgit v1.2.3