Skip to main content

SpanMergingDebugger

Struct SpanMergingDebugger 

Source
pub struct SpanMergingDebugger {
    pub current_page: usize,
    pub gap_decisions: Vec<GapDecision>,
    pub threshold_computations: Vec<ThresholdComputation>,
    pub page_stats: Vec<PageGapStats>,
    pub total_spaces_inserted: usize,
    pub spaces_by_adaptive: usize,
    pub spaces_by_heuristic: usize,
    pub spaces_by_both: usize,
}
Available on crate feature debug-span-merging only.
Expand description

Debugger for span merging analysis.

Collects detailed information about each span merging decision and generates formatted reports.

Fields§

§current_page: usize

Current page being processed

§gap_decisions: Vec<GapDecision>

Gap decisions for current page

§threshold_computations: Vec<ThresholdComputation>

Threshold computations per page

§page_stats: Vec<PageGapStats>

Gap statistics per page

§total_spaces_inserted: usize

Total spaces inserted

§spaces_by_adaptive: usize

Spaces inserted by adaptive threshold

§spaces_by_heuristic: usize

Spaces inserted by heuristic

§spaces_by_both: usize

Spaces inserted by both

Implementations§

Source§

impl SpanMergingDebugger

Source

pub fn new() -> Self

Create a new debugger instance.

Source

pub fn set_page(&mut self, page_num: usize)

Set the current page being processed.

Source

pub fn record_threshold( &mut self, config_name: &str, multiplier: f32, min_threshold: f32, max_threshold: f32, median_gap: f32, computed_raw: f32, computed_final: f32, used_bimodal: bool, reason: &str, )

Record a threshold computation.

Source

pub fn record_page_stats(&mut self, stats: PageGapStats)

Record page gap statistics.

Source

pub fn record_gap_decision( &mut self, gap_index: usize, left_text: &str, right_text: &str, gap_pt: f32, font_size: f32, space_threshold_pt: f32, adaptive_threshold_pt: f32, needs_space_by_gap: bool, needs_space_by_heuristic: bool, needs_space_by_adaptive: bool, space_inserted: bool, )

Record a gap decision.

Source

pub fn generate_page_report(&self, page_num: usize) -> String

Generate formatted report for a specific page.

Source

pub fn generate_summary(&self) -> String

Generate summary report.

Trait Implementations§

Source§

impl Debug for SpanMergingDebugger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpanMergingDebugger

Source§

fn default() -> SpanMergingDebugger

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,