#!/usr/bin/perl use Gimp; use Gimp::Fu; podregister { my $img = Gimp::Image->new(100, 100, RGB); # any old size my $background = $img->layer_new( 100, 100, RGB, "Background", 100, NORMAL_MODE ); $img->insert_layer($background, 0, 0); Gimp::Context->set_foreground($fgcolor); # Choose color of text # Create the text layer. Using -1 as the drawable creates a new layer. my $text_layer = $img->text_fontname( -1, 0, 0, $text, $border, 1, $size, POINTS, $font ); # Get size of the text drawable and resize the image and the # background layer to this size. my ($width, $height) = ($text_layer->width, $text_layer->height); $img->resize($width, $height, 0, 0); $background->resize($width, $height, 0, 0); # Fill the background layer now when it has the right size. Gimp::Context->set_background($bgcolor); $background->edit_fill(BACKGROUND_FILL); Gimp::Display->new($img); return $img; }; exit main; __END__ =head1 NAME basic_logo - Basic logo =head1 SYNOPSIS /File/Create/Tutorial/Basic Logo =head1 DESCRIPTION Make a basic logo. =head1 PARAMETERS [PF_FONT, "font", "Font", "Utopia Bold"], [PF_INT32, "size", "Font size", 10], [PF_INT32, "border", "Border", 10], [PF_STRING, "text", "Text", "Hello world!"], [PF_COLOR, "bgcolor", "Background color", [40,180,160]], [PF_COLOR, "fgcolor", "Foreground color", [255,255,0]], =head1 AUTHOR Dov Grobgeld =head1 DATE 2004-03-27 =head1 LICENSE Dov Grobgeld