Put size-loading code in own routine, init revacros and acros at the same time
[svg-meme] / README.md
1 # SVG Meme generator
2
3 ## Synopsis
4
5 The main `src/meme.fcgi` is a rather simple Perl script to generate
6 image macros (from common memes —not included— as well as from any
7 ‘base’ image you would care about). The script can be used from the
8 command-line as well as a CGI or FastCGI script (note: FastCGI untested
9 for the time being).
10
11 The script needs an index of ‘allowed’ base images (and their
12 dimensions, in pixel). The list can be generated with the attached
13 `gen-sizes.sh` shell script (relies on `identify` from ImageMagick).
14
15 CGI parameters are `m` for the base image name, `t` for the text, `sep`
16 for the separator and `fs` for the font size.
17
18 The default base image is taken to be the first in the hash of known
19 base images (and is therefore random for each script execution). The
20 default text is `TOP TEST//BOTTOM TEST`, the default separator is `/`
21 and the default font size is computed automatically based on a few image
22 and text properties.
23
24 The separator is used to split the text into multiple lines. Empty lines
25 act as ‘fillers’, so that the default sample text results in `TOP TEST`
26 on the first line and `BOTTOM TEST` at the bottom of the image.
27
28 The default font size can be overridden by specifying a single numerical
29 value in `fs`. The font size in individual lines can be overridden by
30 using an `fs` pattern that follows the line structure. E.g., `fs=90/`
31 will print the top line in size 90 and all other lines in the default
32 font size. Non-numeric (according to Perl) font sizes are ignored.
33
34 # Copyright
35
36 Copyright (C) 2013 Giuseppe Bilotta
37
38 # License
39
40 Distributed under the terms of the Artistic License, see `Artistic` in
41 the repository root.
42
43