Struct read_fonts::tables::glyf::PointFlags
source · pub struct PointFlags(/* private fields */);
Expand description
Flags describing the properties of a point.
Some properties, such as on- and off-curve flags are intrinsic to the point itself. Others, designated as markers are set and cleared while an outline is being transformed during variation application and hinting.
Implementations§
source§impl PointFlags
impl PointFlags
sourcepub const fn off_curve_quad() -> Self
pub const fn off_curve_quad() -> Self
Creates a new off curve quadratic point flag.
sourcepub const fn off_curve_cubic() -> Self
pub const fn off_curve_cubic() -> Self
Creates a new off curve cubic point flag.
sourcepub const fn from_bits(bits: u8) -> Self
pub const fn from_bits(bits: u8) -> Self
Creates a point flag from the given bits. These are truncated to ignore markers.
sourcepub const fn is_on_curve(self) -> bool
pub const fn is_on_curve(self) -> bool
Returns true if this is an on curve point.
sourcepub const fn is_off_curve_quad(self) -> bool
pub const fn is_off_curve_quad(self) -> bool
Returns true if this is an off curve quadratic point.
sourcepub const fn is_off_curve_cubic(self) -> bool
pub const fn is_off_curve_cubic(self) -> bool
Returns true if this is an off curve cubic point.
pub const fn is_off_curve(self) -> bool
sourcepub fn flip_on_curve(&mut self)
pub fn flip_on_curve(&mut self)
Flips the state of the on curve flag.
This is used for the TrueType FLIPPT
instruction.
sourcepub fn set_on_curve(&mut self)
pub fn set_on_curve(&mut self)
Enables the on curve flag.
This is used for the TrueType FLIPRGON
instruction.
sourcepub fn clear_on_curve(&mut self)
pub fn clear_on_curve(&mut self)
Disables the on curve flag.
This is used for the TrueType FLIPRGOFF
instruction.
sourcepub fn has_marker(self, marker: PointMarker) -> bool
pub fn has_marker(self, marker: PointMarker) -> bool
Returns true if the given marker is set for this point.
sourcepub fn set_marker(&mut self, marker: PointMarker)
pub fn set_marker(&mut self, marker: PointMarker)
Applies the given marker to this point.
sourcepub fn clear_marker(&mut self, marker: PointMarker)
pub fn clear_marker(&mut self, marker: PointMarker)
Clears the given marker for this point.
sourcepub const fn without_markers(self) -> Self
pub const fn without_markers(self) -> Self
Returns a copy with all markers cleared.
Trait Implementations§
source§impl Clone for PointFlags
impl Clone for PointFlags
source§fn clone(&self) -> PointFlags
fn clone(&self) -> PointFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PointFlags
impl Debug for PointFlags
source§impl Default for PointFlags
impl Default for PointFlags
source§fn default() -> PointFlags
fn default() -> PointFlags
source§impl PartialEq for PointFlags
impl PartialEq for PointFlags
impl AnyBitPattern for PointFlags
impl Copy for PointFlags
impl Eq for PointFlags
impl NoUninit for PointFlags
impl StructuralPartialEq for PointFlags
Auto Trait Implementations§
impl Freeze for PointFlags
impl RefUnwindSafe for PointFlags
impl Send for PointFlags
impl Sync for PointFlags
impl Unpin for PointFlags
impl UnwindSafe for PointFlags
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)