Lulz on demand!
This here rofl
crate, aptly named, is capable of the extraordinary feat
of putting text on images. And not just still images: it does cover animated GIFs as well!
In other words, the crate can be used to create memes, which purists generally refer to as image macros.
Much example
extern crate rofl;
# use Error;
# use Write;
# use fs;
#
#
Very concepts
To create memes, you need two types of media resources (in addition to impeccable wit):
- templates -- named images & animated GIFs that we can put text on
- fonts to render the text with (like
"Impact"
or"Comic Sans"
)
Those resources have to be provided to the captioning Engine
.
In the simple above, they are just files contained within some directories.
If you're doing something more complicated --
like a website where users can upload their own images --
you can implement your own Loader
s for templates or even fonts.
A meme is defined by the ImageMacro
structure.
These can be deserialized from JSON or query strings if desired.
Wow
Go forth and meme!