Skip to main content

rich_typography_rs/
lib.rs

1//! Large decorative text rendering using Unicode box-drawing glyphs.
2//!
3//! A Rust port of Python's [rich-typography](https://github.com/mtkalms/rich-typography)
4//! by mtkalms, built on top of [rich-rs](https://github.com/mrsaraiva/rich-rs).
5//!
6//! # Quick start
7//!
8//! ```no_run
9//! use std::sync::Arc;
10//! use rich_typography_rs::{Font, Typography};
11//!
12//! let font = Arc::new(Font::builtin("condensedsemi").unwrap().clone());
13//! let t = Typography::new("Hello!", Default::default(), font, 0, true, true, None);
14//!
15//! let mut console = rich_rs::Console::new();
16//! console.print(&t, None, None, None, false, "\n").unwrap();
17//! ```
18
19mod glyph;
20mod line;
21mod font;
22mod typography;
23
24pub use glyph::{Glyph, Glyphs};
25pub use line::{LineStyle, LineStyleOverride, LineType};
26pub use font::{Font, FontError};
27pub use typography::{LigatureStyleMethod, Typography};
28
29// Re-export commonly used rich-rs types so users don't need to depend on it directly.
30pub use rich_rs::{
31    Console, ConsoleOptions, JustifyMethod, Measurement, OverflowMethod, Renderable, Segment,
32    Segments, Span, Style, Text,
33};