font_or_actual

Function font_or_actual 

Source
fn font_or_actual(
    font_value: f64,
    font_metric_name: &str,
    actual_value: f64,
    actual_metric_name: &str,
) -> Result<f64, KeyPaintError>
Expand description

Return the distance between the baseline of some measured text and the bottom of whatever would be avove it. We use font ascent instead of actual ascent, so that we get an appropriate amount of space between lines. This also gives us some consistency of appearance. However, if the font ascent metric is not available, we use the actual ascent with a “fudge factor”.