pub struct BcdComponents {
error: Option<Fixed>,
number: i32,
sign: i32,
exponent: i32,
exponent_add: i32,
integer_len: i32,
fraction_len: i32,
}
Expand description
Components for computing a fixed point value for a binary coded decimal number.
Fields§
§error: Option<Fixed>
If overflow or underflow is detected early, then this contains the resulting value and we skip further processing.
number: i32
§sign: i32
§exponent: i32
§exponent_add: i32
§integer_len: i32
§fraction_len: i32
Implementations§
Source§impl BcdComponents
impl BcdComponents
Sourcefn parse(cursor: &mut Cursor<'_>) -> Result<Self, Error>
fn parse(cursor: &mut Cursor<'_>) -> Result<Self, Error>
Parse a binary coded decimal number. See https://gitlab.freedesktop.org/freetype/freetype/-/blob/82090e67c24259c343c83fd9cefe6ff0be7a7eca/src/cff/cffparse.c#L183
Sourcepub fn value(&self, scale_by_1000: bool) -> Fixed
pub fn value(&self, scale_by_1000: bool) -> Fixed
Returns the fixed point value for the precomputed components, optionally using an internal scale factor of 1000 to increase fractional precision.
Sourcefn dynamically_scaled_value(&self) -> (Fixed, i32)
fn dynamically_scaled_value(&self) -> (Fixed, i32)
Returns the fixed point value for the components along with a dynamically determined scale factor.
Use for processing FontMatrix components.
Trait Implementations§
Source§impl Clone for BcdComponents
impl Clone for BcdComponents
Source§fn clone(&self) -> BcdComponents
fn clone(&self) -> BcdComponents
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BcdComponents
impl Debug for BcdComponents
Source§impl Default for BcdComponents
impl Default for BcdComponents
Source§fn default() -> BcdComponents
fn default() -> BcdComponents
Returns the “default value” for a type. Read more
Source§impl From<Fixed> for BcdComponents
impl From<Fixed> for BcdComponents
Source§impl PartialEq for BcdComponents
impl PartialEq for BcdComponents
impl Copy for BcdComponents
impl Eq for BcdComponents
impl StructuralPartialEq for BcdComponents
Auto Trait Implementations§
impl Freeze for BcdComponents
impl RefUnwindSafe for BcdComponents
impl Send for BcdComponents
impl Sync for BcdComponents
impl Unpin for BcdComponents
impl UnwindSafe for BcdComponents
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more