pub struct LineMetrics<'a> {
pub measure_width: &'a dyn Fn(&str) -> Result<u64, String>,
pub max_width_px: u64,
pub uppercase: bool,
}Expand description
Width callback & usable text width for deterministic measured line breaking.
measure_width receives whole candidate lines, including spaces, in rendered
case. Return widths in the same units as max_width_px (normally pixels).
Capture font face & size in the callback; this crate has no font dependency.
The callback should return identical widths for identical text. Errors pass
through wrap_lines & build_cues_with_metrics unchanged.
Fields§
§measure_width: &'a dyn Fn(&str) -> Result<u64, String>§max_width_px: u64§uppercase: boolMeasure uppercase text & count its expanded characters without changing transcript text or returned display lines.
Trait Implementations§
Source§impl<'a> Clone for LineMetrics<'a>
impl<'a> Clone for LineMetrics<'a>
impl<'a> Copy for LineMetrics<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LineMetrics<'a>
impl<'a> !Send for LineMetrics<'a>
impl<'a> !Sync for LineMetrics<'a>
impl<'a> !UnwindSafe for LineMetrics<'a>
impl<'a> Freeze for LineMetrics<'a>
impl<'a> Unpin for LineMetrics<'a>
impl<'a> UnsafeUnpin for LineMetrics<'a>
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