letrs

Crates.ioletrs
lib.rsletrs
version0.1.0
created_at2025-12-23 15:46:36.932291+00
updated_at2025-12-23 15:46:36.932291+00
descriptionParse and render with FIGlet fonts
homepage
repositoryhttps://github.com/ronnodas/letrs
max_upload_size
id2001772
size124,447
Ronno Das (ronnodas)

documentation

README

letrs

A library for parsing FIGfonts and rendering text using these fonts.

Features

  • Horizontal kerning/fitting and smushing
  • Vertical fitting and smushing (no other rust crate seems to support this!)
  • Alignment for multi-line output
  • Automatic line breaking depending on maximum width

Example

let rendered: String = Font::standard().renderer().render("Hello, world!");
let expected = concat!(
r" _   _      _ _                             _     _ _ ", "\n",
r"| | | | ___| | | ___    __      _____  _ __| | __| | |", "\n",
r"| |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` | |", "\n",
r"|  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |_|", "\n",
r"|_| |_|\___|_|_|\___( )   \_/\_/ \___/|_|  |_|\__,_(_)", "\n",
r"                    |/                                "
);
assert_eq!(rendered, expected);
Commit count: 0

cargo fmt