pub(crate) struct Scale {
x_mult: i64,
y_mult: i64,
x_multf: f32,
y_multf: f32,
}Fields§
§x_mult: i64§y_mult: i64§x_multf: f32§y_multf: f32Implementations§
Source§impl Scale
impl Scale
pub(crate) fn new(scale: Option<(i32, i32)>, upem: i32) -> Self
pub(crate) fn scale_x(&self, x: i32) -> i32
pub(crate) fn scale_y(&self, y: i32) -> i32
Sourcepub(crate) fn scale_x_f(&self, x: f32) -> i32
pub(crate) fn scale_x_f(&self, x: f32) -> i32
Scales a fractional (font-unit) value, matching HarfBuzz’s em_scalef
(roundf(v * scale / upem)).
pub(crate) fn scale_y_f(&self, y: f32) -> i32
Sourcepub(crate) fn scale_extents(&self, extents: GlyphExtents) -> GlyphExtents
pub(crate) fn scale_extents(&self, extents: GlyphExtents) -> GlyphExtents
Scales glyph extents using HarfBuzz’s corner-based float arithmetic: floor the origin corners and ceil the far corners before deriving the final width/height. hb_font_t::scale_glyph_extents: https://github.com/harfbuzz/harfbuzz/blob/88adc6437ef561486a5adf1822410297ef4a852b/src/hb-font.hh#L201’
fn mult_from_scale(scale: i32, upem: i32) -> i64
fn scale_by_mult(value: i32, mult: i64) -> i32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnsafeUnpin for Scale
impl UnwindSafe for Scale
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