On 09-Aug-06 cl@isbd.net wrote:
Are there any simple utilities out there for converting a few characters of text (colloquially known as a 'word') to an image for use on the web?
I.e. convert text to .png or .gif.
It would be nice if one could set style, colour, etc. as well as size.
-- Chris Green (chris@halon.org.uk)
Have a look at pbmtext which I seem to have installed on all my Linux systems going back to about 1996. Two files:
/usr/bin/pbmtext /usr/share/man/man1/pbmtext.1.gz
"man pbmtext" says
SYNOPSIS pbmtext [-font fontfile] [-builtin fontname] [-space pixels] [text]
DESCRIPTION Takes the specified text, either a single line from the command line or multiple lines from standard input, and renders it into a bitmap.
In the bitmap, each line of input is a line of output. Formatting characters such as newline have no effect on the formatting; like any unprintable character, they turn into spaces.
The bitmap is just wide enough for the longest line of text, plus margins, and just high enough to contain the lines of text, plus margins.
The left and right margins are twice the width of the widest character in the font; the top and bottom margins are the height of the tallest character in the font. But if the text is only one line, all the margins are half of this.
[...] You can also specify your own font with the -font flag. The fontfile is either a BDF file from the X window system or a PBM file.
Hpoing this helps, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 10-Aug-06 Time: 13:55:18 ------------------------------ XFMail ------------------------------