pub struct Scale26Dot6 {
scale: Fixed,
is_scaled: bool,
}Expand description
Scales font units to 26.6 fixed point, reproducing FreeType’s arithmetic.
Fields§
§scale: Fixed§is_scaled: boolImplementations§
Source§impl Scale26Dot6
impl Scale26Dot6
Sourcepub fn new(ppem: Option<f32>, units_per_em: u16) -> Self
pub fn new(ppem: Option<f32>, units_per_em: u16) -> Self
Creates a scale for the given size in pixels per em.
None produces an unscaled outline with coordinates expressed in 26.6.
Sourcepub fn to_bits(self) -> i32
pub fn to_bits(self) -> i32
The scale factor that converts font units to scaled 26.6, in 16.16.
Sourcefn mul(&self, value: i32) -> F26Dot6
fn mul(&self, value: i32) -> F26Dot6
Multiplies a raw value, in font units or 26.6, by the scale factor.
The factor converts as it scales, so this serves both cases.
fn mul_point(&self, value: Point<i32>) -> Point<F26Dot6>
Trait Implementations§
Source§impl Clone for Scale26Dot6
impl Clone for Scale26Dot6
Source§fn clone(&self) -> Scale26Dot6
fn clone(&self) -> Scale26Dot6
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Scale26Dot6
Source§impl Debug for Scale26Dot6
impl Debug for Scale26Dot6
Source§impl Scale for Scale26Dot6
impl Scale for Scale26Dot6
Source§const NEEDS_UNSCALED: bool = true
const NEEDS_UNSCALED: bool = true
True if the scale keeps a parallel copy of the points in font units,
which hinting needs and which sparse delta interpolation uses as its
reference coordinates.
Source§fn is_scaled(&self) -> bool
fn is_scaled(&self) -> bool
True if a size was supplied. When false the outline comes back in font
units, expressed in
Self::Coord.Source§fn phantom_from_font_units(&self, value: i32) -> F26Dot6
fn phantom_from_font_units(&self, value: i32) -> F26Dot6
Converts a font unit value into the representation phantom points use
before they are scaled.
Source§fn coord_to_hinting_raw(&self, value: F26Dot6) -> i32
fn coord_to_hinting_raw(&self, value: F26Dot6) -> i32
Reinterprets an output coordinate as the integer a hinter’s font unit
buffer holds. Read more
Source§fn scale_phantom(&self, point: Point<F26Dot6>) -> Point<F26Dot6>
fn scale_phantom(&self, point: Point<F26Dot6>) -> Point<F26Dot6>
Scales a phantom point that still holds font units.
Source§fn add_phantom_delta(
&self,
point: Point<F26Dot6>,
delta: Point<Fixed>,
) -> Point<F26Dot6>
fn add_phantom_delta( &self, point: Point<F26Dot6>, delta: Point<Fixed>, ) -> Point<F26Dot6>
Adds a composite glyph’s phantom point delta.
Source§fn round_phantom(&self, point: Point<F26Dot6>) -> Point<F26Dot6>
fn round_phantom(&self, point: Point<F26Dot6>) -> Point<F26Dot6>
Rounds a phantom point, which FreeType does before hinting.
Source§fn load_empty_phantom(
&self,
phantom: &mut [Point<F26Dot6>; 4],
deltas: Option<[Point<Fixed>; 4]>,
)
fn load_empty_phantom( &self, phantom: &mut [Point<F26Dot6>; 4], deltas: Option<[Point<Fixed>; 4]>, )
Sets the phantom points of a glyph with no outline. Read more
Source§fn load_simple_points(
&self,
pass: SimplePass<'_, '_, Self>,
) -> Result<[Point<F26Dot6>; 4], Error>
fn load_simple_points( &self, pass: SimplePass<'_, '_, Self>, ) -> Result<[Point<F26Dot6>; 4], Error>
Reads a simple glyph’s points, applies variation deltas, appends the
phantom points and writes the scaled result. Read more
Auto Trait Implementations§
impl Freeze for Scale26Dot6
impl RefUnwindSafe for Scale26Dot6
impl Send for Scale26Dot6
impl Sync for Scale26Dot6
impl Unpin for Scale26Dot6
impl UnsafeUnpin for Scale26Dot6
impl UnwindSafe for Scale26Dot6
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