diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-05-13 11:26:51 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-05-13 11:26:51 +0200 |
| commit | 33733fd1efda760d65ff9124b6d143a147edbd11 (patch) | |
| tree | fd378b66417c03179ba0230cbe74649069940886 /src/env/mod.rs | |
| parent | 3e03667c37b86f0dfe9111c09e3bc2ea0ae70291 (diff) | |
Expose units_per_em and raw face id
Diffstat (limited to 'src/env/mod.rs')
| -rw-r--r-- | src/env/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/env/mod.rs b/src/env/mod.rs index af3872dd..c8ba46ec 100644 --- a/src/env/mod.rs +++ b/src/env/mod.rs @@ -190,6 +190,19 @@ pub struct FaceId(u32); 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 { + Self(v) + } + + /// Convert into the raw underlying value. + pub fn into_raw(self) -> u32 { + self.0 + } } /// A unique identifier for a loaded resource. |
