gozer
Introduction
gozer is a commandline text rendering utility for creating images from abitrary text in antialised truetype fonts using optional fontstyles, wordwrapping and layout control. gozer uses the imlib2 library to create and save images.
gozer can be used to create text images for webpages, banners or even for viewing files.
Download
Grab 0.7 from cvs (misc/gozer) or get the tarball here. There is also an rpm and an srpm. You will also need to download and install giblib.
Features
gozer has many and varied features, so to give you an example of what it can do, here is gozer's license as rendered by gozer ;-) A simple fontstyle is used for a nice outlined and shadowed effect.
And here is an example of how gozer's fontstyles can vary.
To save me explaining all of the modes and options of gozer, I enclose the output from gozer --help below in the hope it will be informative :-)
Usage: gozer [OPTIONS] file
Where file is the target file for the rendered text.
See man gozer for more detailed information.
Options can also be specified in an rc file , allowing you
to save commonly used options (such as fontpaths) for
reuse. The rc file $HOME/.gozerrc is always read first for default
options, and other rc files can be specified on the commandline.
See RC FILES for information on syntax.
-h, --help display this help and exit.
-v, --version output version information and exit.
-b, --background COL use COL as the background color,
see COLOUR_DEFINITIONS for syntax,
default is transparent (0,0,0,0).
-f, --foreground COL use COL as the foreground color. Default is
white (255,255,255,255).
-F, --font STR draw using font STR. Size is specified with the
name, eg "arial/12" for 12pt arial, default
is 20thcent/16 (a font supplied by gozer).
-G, --bg-file FILE load image FILE and draw the text on it
-j, --justification STR justify text, allowed values for STR are left,
right, center or block. Default is left.
-l, --line-spacing INT separate multiple lines by INT pixels, default 1.
-o, --stdout send image data to STDOUT (for redirection)
-O, --cgi send image data to STDOUT with headers for CGI
For both of these you still need to supply an
output file, so gozer knows what image type to save
as, but the file will be deleted automatically
-p, --fontpath STR colon seperated list of font directories to
search for fonts in. Best used in the RCFILE
to save typing it each time.
-P, --pipe Pipe input text from standard in instead of
reading it from a file
-r, --rc-file STR use STR as an rc file to read for extra options.
-s, --style STR use STR as a file to load a fontstyle from,
see FONTSTYLES for syntax.
-t, --text STR use STR as text to draw.
-T, --textfile STR read text to draw from file STR.
-w, --wrap INT wordwrap the text to INT pixels.
-0, --bg-nocrop set output size to background image size
-1, --bg-scale scale background image
-2, --bg-tile tile background image
RC FILES
rc file syntax is simple. The '#' character at the start
of a line denotes that the line is a comment, otherwise
lines are started with the name of a long option from the
commandline (without prefixing the --), some whitespace
and the value of the option. E.g.
fontpath /usr/share/truetype:/usr/local/share/truetype
NOTE that options in the rc file OVERRIDE those from the
commandline.
COLOUR_DEFINITIONS
You can define colours in 4 ways. Using the html style:
#RRGGBB (in which case alpha defaults to 255),
#RRGGBBAA,
or an alternative style:
r,g,b or r,g,b,a (no spaces between commas please).
eg for white text, either use #ffffff, #ffffffff, "255,255,255" or
"255,255,255,255". For red, #ff0000, #ff0000ff or "255,0,0" etc.
FONTSTYLES
fontstyles can be defined in the EFM syntax (for compatibility only, these
are not as powerful), or the recommended syntax defined here.
The first line contains the line:
#Style
The second, an optional style name,
#NAME mystyle
There follows a list of layers. Each is described by this rule:
RED GREEN BLUE ALPHA X_OFFSET Y_OFFSET
The special values or 0,0,0,0 for red, green, blue and alpha specify the
positioning of the actual text in it's selected colour.
For example, the following style defines a very simple shadow for text:
#Style
#NAME shadow
0 0 0 128 -3 -3
0 0 0 0 0 0
This program is free software - see the file COPYING for licensing info.
Copyright Tom Gilbert 2000
Email bugs to <gozer_sucks@linuxbrit.co.uk>
![[LinuxBrit]](/images/linuxbritnew.jpg)