Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
#!/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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found