From 7e377ea801397816901105eb13345f1b7b89f035 Mon Sep 17 00:00:00 2001 From: Nathaniel Woods Date: Wed, 14 Aug 2024 09:02:22 -0400 Subject: [PATCH 1/2] Added `UnicodeRanges::as_raw()` to provide access to the underlying raw value for the `ulUnicodeRangeX` fields on the OS/2 table --- src/tables/os2.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tables/os2.rs b/src/tables/os2.rs index 35e09db7..7857b0e3 100644 --- a/src/tables/os2.rs +++ b/src/tables/os2.rs @@ -193,6 +193,11 @@ impl UnicodeRanges { false } } + + /// Returns the raw unicode ranges value + pub fn as_raw(&self) -> u128 { + self.0 + } } fn char_range_index(c: char) -> i8 { From 8855dcdd294f073f953afea596a0e9f97b6d0180 Mon Sep 17 00:00:00 2001 From: Nathaniel Woods Date: Wed, 14 Aug 2024 10:21:53 -0400 Subject: [PATCH 2/2] As per feedback, removing the accessor and changing the tuple from `u128` to `pub u128` --- src/tables/os2.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/tables/os2.rs b/src/tables/os2.rs index 7857b0e3..b8d195dc 100644 --- a/src/tables/os2.rs +++ b/src/tables/os2.rs @@ -181,7 +181,7 @@ impl SelectionFlags { /// [Unicode Ranges](https://docs.microsoft.com/en-us/typography/opentype/spec/os2#ur). #[derive(Clone, Copy, Default, Debug)] -pub struct UnicodeRanges(u128); +pub struct UnicodeRanges(pub u128); impl UnicodeRanges { /// Checks if ranges contain the specified character. @@ -193,11 +193,6 @@ impl UnicodeRanges { false } } - - /// Returns the raw unicode ranges value - pub fn as_raw(&self) -> u128 { - self.0 - } } fn char_range_index(c: char) -> i8 {