pub struct ControlBoundsSink {
bounds: Option<BoundingBox<Fixed>>,
}Expand description
Sink that measures the box a drawing stays within.
A curve counts through its control points rather than the path they describe, so one bulging inside its hull measures larger than it draws. That is a control box, which is what HarfBuzz reports for a charstring and what costs no arithmetic to find. Solving each curve would tighten the box and is not worth what it costs to a caller asking where a glyph roughly sits.
Nothing drawn leaves bounding_box empty, which is
the answer for a glyph with no ink rather than a box of no size at the
origin. The pen that measures a drawn outline the same way is
ControlBoundsSink.
Fields§
§bounds: Option<BoundingBox<Fixed>>Implementations§
Source§impl ControlBoundsSink
impl ControlBoundsSink
Sourcepub fn bounding_box(&self) -> Option<BoundingBox<Fixed>>
pub fn bounding_box(&self) -> Option<BoundingBox<Fixed>>
Returns the bounding box collected by this sink.
fn update_bounds(&mut self, x: Fixed, y: Fixed)
Trait Implementations§
Source§impl Clone for ControlBoundsSink
impl Clone for ControlBoundsSink
Source§fn clone(&self) -> ControlBoundsSink
fn clone(&self) -> ControlBoundsSink
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 moreSource§impl CommandSink for ControlBoundsSink
impl CommandSink for ControlBoundsSink
fn move_to(&mut self, x: Fixed, y: Fixed)
fn line_to(&mut self, x: Fixed, y: Fixed)
fn curve_to( &mut self, cx0: Fixed, cy0: Fixed, cx1: Fixed, cy1: Fixed, x: Fixed, y: Fixed, )
fn close(&mut self)
Source§fn hint_mask(&mut self, mask: &[u8])
fn hint_mask(&mut self, mask: &[u8])
Bitmask defining the hints that should be made active for the
commands that follow.
Source§fn counter_mask(&mut self, mask: &[u8])
fn counter_mask(&mut self, mask: &[u8])
Bitmask defining the counter hints that should be made active for the
commands that follow.
Source§fn clear_hints(&mut self)
fn clear_hints(&mut self)
Clear accumulated stem hints and all data derived from them.
Source§impl Debug for ControlBoundsSink
impl Debug for ControlBoundsSink
Source§impl Default for ControlBoundsSink
impl Default for ControlBoundsSink
Source§fn default() -> ControlBoundsSink
fn default() -> ControlBoundsSink
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ControlBoundsSink
impl RefUnwindSafe for ControlBoundsSink
impl Send for ControlBoundsSink
impl Sync for ControlBoundsSink
impl Unpin for ControlBoundsSink
impl UnsafeUnpin for ControlBoundsSink
impl UnwindSafe for ControlBoundsSink
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