pub struct AxisTag(/* private fields */);
api-level-29
only.Expand description
A 4-byte integer representing an OpenType axis tag.
Implementations§
source§impl AxisTag
impl AxisTag
sourcepub const fn from_be_bytes_checked(
value: [u8; 4]
) -> Result<Self, AxisTagValueError>
pub const fn from_be_bytes_checked( value: [u8; 4] ) -> Result<Self, AxisTagValueError>
Checks whether the given 4-byte array can construct a valid axis tag and returns
[Ok(AxisTag)
] if the array is valid.
Each byte in a tag must be in the range 0x20 to 0x7E. A space character cannot be followed by a non-space character. A tag must have one to four non-space characters. See the OpenType spec for more details.
sourcepub const fn from_be_checked(value: u32) -> Result<Self, AxisTagValueError>
pub const fn from_be_checked(value: u32) -> Result<Self, AxisTagValueError>
Checks whether the given 4-byte array can construct a valid axis tag and returns
[Ok(AxisTag)
] if the array is valid.
See AxisTag::from_be()
for more details.
sourcepub const fn from_be_bytes(value: [u8; 4]) -> Self
pub const fn from_be_bytes(value: [u8; 4]) -> Self
Construct an axis tag from the given 4-byte array. If the resulting axis tag is invalid, this function panics.
See AxisTag::from_be()
for more details.
sourcepub const fn from_be(value: u32) -> Self
pub const fn from_be(value: u32) -> Self
Construct an axis tag from the given 4-byte integer. If the resulting axis tag is invalid, this function panics.
See AxisTag::from_be()
for more details.