use-type-rhythm 0.0.1

Primitive type-rhythm helpers
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented1 out of 9 items with examples
  • Size
  • Source code size: 6.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 382.61 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-typography
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive vertical rhythm helpers.

These helpers expose a small baseline grid model for deterministic layout calculations.

Examples

use use_type_rhythm::{TypeRhythm, baseline_grid, snap_to_baseline};

let rhythm = TypeRhythm::new(16.0, 24.0).unwrap();

assert_eq!(rhythm.baseline_unit(), 24.0);
assert_eq!(rhythm.snap_to_baseline(37.0).unwrap(), 48.0);
assert_eq!(rhythm.lines_for_height(72.0).unwrap(), 3.0);
assert_eq!(baseline_grid(24.0, 3).unwrap(), vec![24.0, 48.0, 72.0]);
assert_eq!(snap_to_baseline(37.0, 24.0).unwrap(), 48.0);