Expand description
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);Re-exports§
pub use use_font_size;pub use use_line_height;pub use use_measure;pub use use_modular_scale;pub use use_spacing_scale;pub use use_text_block;pub use use_type_rhythm;pub use use_type_unit;
Structs§
Enums§
- Font
Size Error - Line
Height Error - Measure
Error - Modular
Scale Error - Scale
Ratio - Spacing
Scale Error - Text
Block Error - Type
Rhythm Error - Type
Unit - Type
Unit Error
Functions§
- baseline_
grid - characters_
per_ line - container_
width_ for_ measure - em_
to_ px - estimated_
line_ count - estimated_
text_ height - font_
size_ em_ to_ px - font_
size_ rem_ to_ px - is_
readable_ line_ height - is_
readable_ measure - line_
height_ px - line_
height_ ratio - modular_
scale - pt_
to_ px - px_
to_ em - px_
to_ pt - px_
to_ rem - rem_
to_ px - scale_
down - scale_
up - snap_
to_ baseline - spacing_
step - spacing_
steps