#!/usr/bin/perl use 5.6.0; use warnings; use strict; use Gtk; # just so that compilation fails without it use Gimp qw(:auto); use Gimp::Feature qw(gimp-1.2); use Gimp::Fu; my $head = < $dfile")) { gimp_message("Cannot write to $dfile"); return(undef); } my @size = xlfd_size($font); $size[0] *= 2; my (undef, $h) = gimp_text_get_extents_fontname(join("", map(chr($_), 33 .. 255)), @size, $font); $h += 10; my $w = 0; gimp_palette_set_foreground([255, 255, 255]); gimp_palette_set_background([0, 0, 0]); my $img = gimp_image_new(1, $h, GRAY); gimp_image_undo_disable($img); gimp_image_set_filename($img, $bfile); my $draw = gimp_layer_new($img, 1, $h, GRAY_IMAGE, "subfont", 100, NORMAL_MODE); gimp_image_add_layer($img, $draw, 0); gimp_edit_fill($draw, BG_IMAGE_FILL); my $x = 0; print D (geninfo($font)); print D ($head); printf D (</Xtns/MPlayer/Render Subfont", undef, [ [PF_FONT, "font", "", "-*-arial-medium-r-normal-*-16-*-*-*-*-*-*-*", undef], [PF_FILE, "bitmap", "", "bitmap.raw", undef], [PF_FILE, "alpha", "", "alpha.raw", undef], [PF_FILE, "desc", "", "font.desc", undef], [PF_TOGGLE, "toggle", "Keep images opened", 0, undef] ], [ ], [ ], \&render_subfont ); register( "render_subfont_alpha", "Render alpha shadow for MPlayer subtitle font", "No help (yet)", "lanzz\@lanzz.org", "Copyright 2001, lanzz\@lanzz.org", "2001-07-31", "/Filters/MPlayer/Render Shadow", "GRAY", [ ], [ PF_IMAGE ], [ ], \&render_subfont_alpha ); exit(main());