use-typography 0.0.1

Composable facade crate for RustUse typography primitives
Documentation

Thin facade for the use-typography workspace.

The crate reexports the focused typography crates directly so consumers can opt into one dependency while still using the smaller APIs.

Examples

use use_typography::*;

let font = FontSize::new(18.0).unwrap();
let line_height = LineHeight::new(18.0, 27.0).unwrap();
let scale = modular_scale(18.0, ScaleRatio::MajorThird, -1, 1).unwrap();

assert!((font.rem(16.0).unwrap() - 1.125).abs() < 1.0e-12);
assert!((line_height.ratio() - 1.5).abs() < 1.0e-12);
assert_eq!(scale.len(), 3);