fn baseline_middle(&self, span: &TextSpan) -> Result<u16> {
        let top = span.state.text_rectangle.y - 1;
        let h = span.state.text_rectangle.h;
        let (above, below) = self.offset_vert(span)?;
        let offset = (h - above - below) / 2; // offset for centering
        let y = top + offset + above;
        let ch = self.default_state.char_height();
        // Truncate to line-height boundary
        Ok((y / ch) * ch)
    }
/// Get the baseline of a middle-justified span.
Get the baseline of a middle-justified span.
Get the baseline of a middle - justified span .
fn baseline_middle(&self, span: &TextSpan) -> Result<u16> {
        let top = span.state.text_rectangle.y - 1;
        let h = span.state.text_rectangle.h;
        let (above, below) = self.offset_vert(span)?;
        let offset = (h - above - below) / 2; // offset for centering
        let y = top + offset + above;
        let ch = self.default_state.char_height();
        // Truncate to line-height boundary
        Ok((y / ch) * ch)
    }
fn baseline_middle ( & self , span : & TextSpan ) -> Result < u16 > { let top = span . state . text_rectangle . y - 1 ; let h = span . state . text_rectangle . h ; let ( above , below ) = self . offset_vert ( span ) ? ; let offset = ( h - above - below ) / 2 ; // offset for centering let y = top + offset + above ; let ch = self . default_state . char_height ( ) ; // Truncate to line-height boundary Ok ( ( y / ch ) * ch ) }
Get the baseline of a middle-justified span.
Get the baseline of a middle - justified span .
&self
span
&TextSpan