From 56528538bfe8882fc8b0dd9cb9163a121cfa3067 Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 9 Aug 2001 17:26:22 +0000 Subject: mplayer font-generator GIMP plugin by lanzz@lanzz.org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1470 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/subfont-gimp/Makefile | 6 ++ TOOLS/subfont-gimp/mplayer_subfont | 205 +++++++++++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+) create mode 100644 TOOLS/subfont-gimp/Makefile create mode 100644 TOOLS/subfont-gimp/mplayer_subfont (limited to 'TOOLS') diff --git a/TOOLS/subfont-gimp/Makefile b/TOOLS/subfont-gimp/Makefile new file mode 100644 index 0000000000..64a1eb519d --- /dev/null +++ b/TOOLS/subfont-gimp/Makefile @@ -0,0 +1,6 @@ +install: + gimptool --install-admin-bin mplayer_subfont || gimptool --install-bin mplayer_subfont + +uninstall: + gimptool --uninstall-admin-bin mplayer_subfont || true + gimptool --uninstall-bin mplayer_subfont || true diff --git a/TOOLS/subfont-gimp/mplayer_subfont b/TOOLS/subfont-gimp/mplayer_subfont new file mode 100644 index 0000000000..e5d9f02569 --- /dev/null +++ b/TOOLS/subfont-gimp/mplayer_subfont @@ -0,0 +1,205 @@ +#!/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()); -- cgit v1.2.3