diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-01 12:46:01 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-01 12:55:07 +0200 |
| commit | 7218892c722ca583297c0ebbda350bdf6f16d3ce (patch) | |
| tree | 27ebbfaf0662c1e0dd01e7c5e9e360ab288cae4d /src/font.rs | |
| parent | 9bdb0bdeffa5e4b6da9e3f6d3c1b79c506005fc5 (diff) | |
Refactor path handling
Diffstat (limited to 'src/font.rs')
| -rw-r--r-- | src/font.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/font.rs b/src/font.rs index 69a30900..516d4bbe 100644 --- a/src/font.rs +++ b/src/font.rs @@ -6,8 +6,7 @@ use std::fmt::{self, Debug, Display, Formatter}; use serde::{Deserialize, Serialize}; use crate::geom::Length; -use crate::loading::Buffer; -use crate::loading::Loader; +use crate::loading::{Buffer, Loader}; /// A font face. pub struct Face { @@ -171,7 +170,7 @@ impl FontCache { let mut families = HashMap::<String, Vec<FaceId>>::new(); for (i, info) in loader.faces().iter().enumerate() { - let id = FaceId(i as u32); + let id = FaceId(i as u64); faces.push(None); families .entry(info.family.to_lowercase()) @@ -259,22 +258,19 @@ impl FontCache { /// A unique identifier for a loaded font face. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] -pub struct FaceId(u32); +pub struct FaceId(u64); impl FaceId { - /// A blank initialization value. - pub const MAX: Self = Self(u32::MAX); - /// Create a face id from the raw underlying value. /// /// This should only be called with values returned by /// [`into_raw`](Self::into_raw). - pub fn from_raw(v: u32) -> Self { + pub fn from_raw(v: u64) -> Self { Self(v) } /// Convert into the raw underlying value. - pub fn into_raw(self) -> u32 { + pub fn into_raw(self) -> u64 { self.0 } } |
