pub struct FixedMeasure {
pub char_width: u32,
pub metrics: FontMetrics,
}Expand description
Deterministic measurer for tests: every character is char_width
pixels wide regardless of style.
Not a toy — it is what makes the wrap tests assert exact byte offsets rather than “roughly here”, and it is the reference implementation the Pango one is checked against for monotonicity.
Fields§
§char_width: u32§metrics: FontMetricsImplementations§
Source§impl FixedMeasure
impl FixedMeasure
pub fn new(char_width: u32) -> FixedMeasure
Trait Implementations§
Source§impl Clone for FixedMeasure
impl Clone for FixedMeasure
impl Copy for FixedMeasure
Source§impl Debug for FixedMeasure
impl Debug for FixedMeasure
Source§impl Default for FixedMeasure
impl Default for FixedMeasure
Source§impl TextMeasure for FixedMeasure
impl TextMeasure for FixedMeasure
Source§fn metrics(&self) -> FontMetrics
fn metrics(&self) -> FontMetrics
Metrics at the current scale.
Auto Trait Implementations§
impl Freeze for FixedMeasure
impl RefUnwindSafe for FixedMeasure
impl Send for FixedMeasure
impl Sync for FixedMeasure
impl Unpin for FixedMeasure
impl UnsafeUnpin for FixedMeasure
impl UnwindSafe for FixedMeasure
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