#vulkan #text #raster #shaper

ilmenite

A rust library for shaping, placing, and rasterizing text primarily for Basalt

12 releases (breaking)

0.8.0 Dec 7, 2021
0.7.0 Oct 4, 2021
0.6.0 Aug 2, 2021
0.5.1 Jul 30, 2021
0.0.0 Dec 15, 2019

#131 in GUI

35 downloads per month
Used in basalt

MIT license

94KB
2.5K SLoC

Many features are incomplete. This crate is a WIP!

A rust library for shaping, placing, and rasterizing text primarily for Basalt.

let ilmenite = Ilmenite::new();

ilmenite.add_font(ImtFont::from_file(
	"MyFont",
	ImtWeight::Normal, 
	ImtRasterOps::default(),
	device,
	queue,
	"MyFont.ttf"
).unwrap());

let glyphs = ilmenite.glyphs_for_text(
	"MyFont",
	ImtWeight::Normal,
	12.0,
	None,
	"Hello World!"
).unwrap();

lib.rs:

let ilmenite = Ilmenite::new();

ilmenite.add_font(
    ImtFont::from_file(
        "MyFont",
        ImtWeight::Normal,
        ImtRasterOpts::default(),
        device,
        queue,
        "MyFont.ttf",
    )
    .unwrap(),
);

let glyphs = ilmenite
    .glyphs_for_text("MyFont", ImtWeight::Normal, 12.0, None, "Hello World!")
    .unwrap();

Dependencies

~45MB
~1M SLoC