#!/usr/bin/perl -w ################################################################# # gdynfont.pl # # Gimp plug_in to display font details for a GDynText layer # Author: Simon Flack # Date: May 13 2002 ################################################################# use strict; use Gimp qw(:auto); use Gimp::Fu; use Gtk '-init'; register ("gdyntext_font_info", "Find out the font used in a GDynText layer", "Display font details for a GDynText Layer", 'Simon Flack <mail@no-spam.simonflack.com>', "Simon Flack", "13 May 2002", "<Image>/Script-Fu/Utils/GDynFontInfo", "*", [], \&info_from_gdyntext_layer); exit main; sub info_from_gdyntext_layer { my ($image, $drawable) = @_; my $output; my $parasite = gimp_drawable_parasite_list($drawable); unless ( $parasite =~ /plug_in_gdyntext\/data/ ) { # It's not a GDynText layer $output = "The selected layer is not a Dynamic Text Layer"; } else { # Get the parasite details for the GDynText layer and parse it my $text_parasite = gimp_drawable_parasite_find($drawable, "plug_in_gdyntext/data")- +>[2]; my ($text, $antialias, $alignment, $rotation, $line_spacing, $color, $l_alignment, $font) = $text_parasite =~ /{([^\}]+)}/g; my $antialias_bool = $antialias ? "yes" : "no"; my @layer_alignment = qw(none bottom-left bottom-center bottom-right middle-left center middle-right top-left top-center top-right); my @text_alignment = qw(left center right ); $output = <<FONTINFOOUTPUT; text: $text antialias: $antialias_bool anlignment: $text_alignment[$alignment] rotation: $rotation line_spacing: $line_spacing color: #$color layer alignment: $layer_alignment[$l_alignment] font: $font FONTINFOOUTPUT } # Display a Gtk::Window with the results my $window = new Gtk::Window("toplevel"); $window->set_title("GDynFont: Font Information"); $window->border_width(5); my $label = new Gtk::Label($output); $label->set_justify("left"); $window->add($label); $label->show; $window->show; main Gtk; }

In reply to gdynfont.pl - A Gimp plug_in by simonflk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.