Skip to content
LineMetrics

LineMetrics

Mojo struct 🡭

LineMetrics

@memory_only
struct LineMetrics

This face’s line metrics at its current size, in pixels. ascender/descender are signed, descender negative per hhea’s convention; line_height is the recommended baseline-to-baseline distance for stacked lines.

Fields

  • ascender (Float64)
  • descender (Float64)
  • line_height (Float64)

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable

Methods

__init__

fn def __init__(out self, ascender: Float64, descender: Float64, line_height: Float64)

This face’s line metrics at its current pixel size.

Args:

  • ascender (Float64): Distance above the baseline, positive.
  • descender (Float64): Distance below the baseline, negative.
  • line_height (Float64): Recommended baseline-to-baseline distance for stacked lines.
  • self (Self)

Returns:

Self