Font::TTF::Glyph

Font::TTF::Glyph is a Perl module that holds a single glyph's information.
Download

Font::TTF::Glyph Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Martin Hosken
  • Publisher web site:
  • http://search.cpan.org/~areibens/PDF-API2-0.69/lib/PDF/API2/Basic/TTF/Glyph.pm

Font::TTF::Glyph Tags


Font::TTF::Glyph Description

Font::TTF::Glyph is a Perl module that holds a single glyph's information. Font::TTF::Glyph is a Perl module that holds a single glyph's information.This is a single glyph description as held in a TT font. On creation only its header is read. Thus you can get the bounding box of each glyph without having to read all the other information.INSTANCE VARIABLESIn addition to the named variables in a glyph header (xMin etc.), there are also all capital instance variables for holding working information, mostly from the location table.The standard attributes each glyph has are: numberOfContours xMin yMin xMax yMaxThere are also other, derived, instance variables for each glyph which are read when the whole glyph is read (via read_dat):instLenNumber of bytes in the hinting instructions (Warning this variable is deprecated, use length($g-{'hints'})> instead).hintsThe string containing the hinting code for the glyphIn addition there are other attribute like instance variables for simple glyphs:For each contour there is:endPointsAn array of endpoints for each contour in the glyph. There are numberOfContours contours in a glyph. The number of points in a glyph is equal to the highest endpoint of a contour.There are also a number of arrays indexed by point numberflagsThe flags associated with reading this point. The flags for a point are recalculated for a point when it is updated. Thus the flags are not very useful. The only important bit is bit 0 which indicates whether the point is an 'on' curve point, or an 'off' curve point.xThe absolute x co-ordinate of the point.yThe absolute y co-ordinate of the pointFor composite glyphs there are other variablesmetricThis holds the component number (not its glyph number) of the component from which the metrics for this glyph should be taken.compsThis is an array of hashes for each component. Each hash has a number of elements:glyphThe glyph number of the glyph which comprises this component of the composite.argsAn array of two arguments which may be an x, y co-ordinate or two attachment points (one on the base glyph the other on the component). See flags for details.flagThe flag for this componentscaleA 4 number array for component scaling. This allows stretching, rotating, etc. Note that scaling applies to placement co-ordinates (rather than attachment points) before locating rather than after.numPointsThis is a generated value which contains the number of components read in for this compound glyph.The private instance variables are:INFILE (P)The input file form which to read any informationLOC (P)Location relative to the start of the glyf table in the read fileBASE (P)The location of the glyf table in the read fileLEN (P)This is the number of bytes required by the glyph. It should be kept up to date by calling the update method whenever any of the glyph content changes.OUTLOC (P)Location relative to the start of the glyf table. This variable is only active whilst the output process is going on. It is used to inform the location table where the glyph's location is, since the glyf table is output before the loca table due to alphabetical ordering.OUTLEN (P)This indicates the length of the glyph data when it is output. This more accurately reflects the internal memory form than the LEN variable which only reflects the read file length. The OUTLEN variable is only set after calling out or out_dat. Requirements: · Perl


Font::TTF::Glyph Related Software