russischer Abakus Informatik-Vollmer
    

create-button

I've written a small perl script to create images from short texts. It may be used to create buttons for e.g. web-pages like to following button: Test (moving the mouse over the butten, it's color changes). The two images are created uwing the following commands:

  create-button -raise -bg 9933CC -fg FFFFFF -W 163 -H 30 -o test.gif Test
  create-button -raise -bg 9933CC -fg FFCC00 -W 163 -H 30 -o test-over.gif Test

Download

Download the actual version (1.2 of 2004/03/04) of the script.

License

All my tools are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The programs are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

You should have received a copy of the GNU General Public License along with those programs; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

If you find this software useful, please send me a postcard from the place where you are living:
Dr. Jürgen Vollmer
Viktoriastraße 15
D-76133 Karlsruhe, Germany

Usage

Usage:
    create-button [<options>]* text ...

Options:
    --output file
        Write output to the given file (default: display it). "-" indicates
        the PNG data are written to stdout. The generated graphics format is
        determined by the given file suffix. See convert(1) for the list of
        acceptable picture formats. If no output file is specified the image
        is shown using the display(1) routine.

    --font file
        Use true-type font specified by file (default Arial bold italics).

    --size points
        Render text in the give size (default 14).

    --foreground color
    --fg color
        The foreground color of the text, default black.

    --background color
    --bg color
        The background color of the image, default white.

    --center
        Center the rendered text (default).

    --left
        Left adjust the rendered text.

    --right
        Right adjust the rendered text.

    --top
        Place the text at the top of the image.

    --middle
        Place the text in the middle of the image (default).

    --bottom
        Place the text at the bottom of the image.

        Right adjust the rendered text.

    --rotate angle
        Rotate the text -360 <= angle <= 360 (default 0).

        Right adjust the rendered text.

    -W pixel
    --width pixel
        Width of the image.

    -H pixel
    --height pixel
        Height of the image.

    --Raise widthxheight
        Raises the image into 3D. (Not available, if written to stdout).

    --raise
        Just an abbreviation for --Raise 5x5

    --Show
        Show the size of the created picture and text.

    -h
    --help
        Print a brief help message and exits.

    -M
    --manual
        Prints the manual page and exits.

    --debug
        Enable debugging.

    Options names may be abbreviated to uniqueness. Single letter options
    may be used with only one dash.

    Colors may be given as RGB triples: redgreenblue where red, green and
    blue are hexadecimal values: E.g. FFFFFF means black and 0 means white.
    Those color values may be separated by a , (comma) or : (colon). E.g.
    FF,FF,FF or 0,0,0.

    If no height or width is given, the width and height of the button text
    will be used.

Changelog

Revision 1.3  2004/03/04 09:08:56  vollmer
Added automatic computation of the size of the picture (by not setting the
default hight and width).
Take care of under-length of charcters like "g" (quite a simple heuristics).

Revision 1.2  2004/02/15 11:37:23  vollmer
Insert a small offset for -left/-right/-bottom/-top and -raise in those
cases.

Revision 1.1  2004/02/14 17:13:24  vollmer
Initial revision

############################################################################
© Copyright 2005 Dr. Jürgen Vollmer (www.informatik-vollmer.de)
This page was updated on March 09, 2012