PDF::API2::Basic::TTF::Glyph - Holds a single glyph's information |
PDF::API2::Basic::TTF::Glyph - 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.
In 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 yMax
There are also other, derived, instance variables for each glyph which are read
when the whole glyph is read (via read_dat
):
length($g-
{'hints'})> instead).
In addition there are other attribute like instance variables for simple glyphs:
For each contour there is:
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 number
update
d. 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.
For composite glyphs there are other variables
The private instance variables are:
update
method whenever any of the glyph content changes.
LEN
variable which
only reflects the read file length. The OUTLEN
variable is only set after
calling out
or out_dat
.
If you want to edit a glyph in some way, then you should read_dat the glyph, then make your changes and then update the glyph or set the $g->{' isdirty'} variable. It is the application's duty to ensure that the following instance variables are correct, from which update will calculate the rest, including the bounding box information.
numPoints numberOfContours endPoints x, y, flags (only flags bit 0) instLen hints
For components, the numPoints, x, y, endPoints & flags are not required but the following information is required for each component.
flag (bits 2, 10, 11, 12) glyph args scale metric (glyph instance variable)
=head1 METHODS
Empties the glyph of all information to the level of not having been read. Useful for saving memory in apps with many glyphs being read
update
doesn't re-calculate the bounding box or numberOfContours
.
Martin Hosken Martin_Hosken@sil.org. See the PDF::API2::Basic::TTF::Font manpage for copyright and licensing.
PDF::API2::Basic::TTF::Glyph - Holds a single glyph's information |