diff options
Diffstat (limited to 'src/list_fonts.rs')
-rw-r--r-- | src/list_fonts.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/list_fonts.rs b/src/list_fonts.rs index c418bc02..c7cd60ca 100644 --- a/src/list_fonts.rs +++ b/src/list_fonts.rs @@ -69,12 +69,31 @@ pub struct Variant { index: usize, } +impl Variant { + #[inline] + pub fn filepath(&self) -> &::std::path::Path { + self.file.as_path() + } +} + #[derive(Debug)] pub struct Family { name: String, variants: Vec<Variant>, } +impl Family { + #[inline] + pub fn name(&self) -> &str { + &self.name[..] + } + + #[inline] + pub fn variants(&self) -> &[Variant] { + &self.variants[..] + } +} + static FILE: &'static [u8] = b"file\0"; static FAMILY: &'static [u8] = b"family\0"; static INDEX: &'static [u8] = b"index\0"; |