1 unstable release
Uses old Rust 2015
0.0.1 | Jun 12, 2017 |
---|
#11 in #caption
140KB
3K
SLoC
rofl
Lulz on demand
What?
This here rofl crate implements the tricky and complicated logic necessary for performing the important task of putting text over pictures.
In other words, it makes memes (also known by purists as image macros).
How?
How about that:
let engine = rofl::Engine::new("data/templates", "data/fonts");
let image_macro = ImageMacro {
template: "zoidberg".into(),
captions: vec![
Caption::text_at(VAlign::Top, "Need a meme?"),
Caption::text_at(VAlign::Bottom, "Why not Zoidberg?"),
],
..ImageMacro::default()
};
let output = engine.caption(image_macro)?;
let mut file = fs::OpenOptions::new().write(true).open("zoidberg.png")?;
file.write_all(&*output)?;
Neat, huh?
For an actual application using the crate, check src/server
in this repo.
Dependencies
~11MB
~237K SLoC