Rechercher une page de manuel
XFig.3pm
Langue: en
Version: 2009-04-19 (debian - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
XFig - A parser for XFig filesSYNOPSIS
use XFig; # Generate a parser $fig = new XFig; # Parse a Fig file $fig->parsefile($figname); die "Can't read file $figname" if ($fig->{'object'} < 0); # Get header information $fig->Version () $fig->Orientation () $fig->Justification () $fig->Units () $fig->Papersize () $fig->Magnification () $fig->MultiplePage () $fig->Transparent () $fig->Resolution () $fig->CoordSystem () # Create a new Fig element and add values to it $line = new XFig ('polyline'); $line->{'subtype'} = 1; # line $line->{'points'} = [ [0, 0], [1, 3] ]; $line->{'comment'} = [ 'This is just a comment', 'that is continued on this line ]; # Add an element to a Fig parsed file or compound element $fig->add ($line); # Loop through all elements in the parsed file and check their types for $element ($fig->eachPrimitive()) { print "Primitive\n" if $element->isPrimitive (); print "Color\n" if $element->isColor (); print "Arc\n" if $element->isArc (); print "Ellipse\n" if $element->isEllipse (); print "Polyline\n" if $element->isPolyline (); print "Spline\n" if $element->isSpline (); print "Text\n" if $element->isText (); print "Compound\n" if $element->isCompound (); print "Closed\n" if $element->isClosed (); } # Write to an XFig file $fig->writefile ($figname);
DESCRIPTION
The XFig module parses XFig files and allows access to its elements. It also allows the creation of new Fig elements, the addtion of elements to the parsed file object and the dumping to a Fig file.Fig elements composing a XFig file are represent by hashes, whose keys mimic very closely the definitions given in the FORMAT file distributed with XFig. For instance, a polyline element is a hash with the following keys:
'subtype', 'linestyle', 'thickness', 'pencolor', 'fillcolor', 'depth', 'penstyle', 'areafill', 'styleval', 'joinstyle', 'capstyle', 'radius', 'forwardarrow', 'backwardarrow', 'points'
$element->{points} is always a reference to a array of coordinates. Each coordinate is a reference to an array of length 2, containing the horizontal and vertical coordinates of the point.
SEE ALSO
xfig(1), the FORMAT3.2 file.
COPYRIGHT
Copyright (C) 1998 Marcel Rohner. This module is released under the terms of the GNU GPL.This manual page was written by Rafael Laboissiere <rafael@debian.org>.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre