Font::TTF::Glyph - Online Linux Manual PageSection : 3pm
Updated : 2020-12-27
Source : perl v5.32.0
Note : User Contributed Perl Documentation

NAMEFont::TTF::Glyph − Holds a information for a single glyph

DESCRIPTIONThis 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.

Variables for all glyphs:The standard attributes each glyph has are: numberOfContours For simple glyphs this will be the count of contours. For compound glyphs this will be −1. xMin yMin xMax yMax These identify the bounding box of the glyph. There are also other, derived, instance variables for each glyph which are read when the whole glyph is read (via read_dat): instLen Number of bytes in the hinting instructions (Warning this variable is deprecated, use length($g−{'hints'})> instead). hints The string containing the hinting code for the glyph

Variables for simple glyphs (numberOfContours >= 0):endPoints An 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. numPoints This is a generated value which contains the total number of points for this simple glyph. There are also a number of arrays indexed by point number: flags The 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. The absolute x co-ordinate of the point. The absolute y co-ordinate of the point

Variables for compound glyphs (numberOfContours == −1):metric This holds the component number (not its glyph number) of the component from which the metrics for this glyph should be taken. comps This is an array of hashes for each component. Each hash has a number of elements: glyph The glyph number of the glyph which comprises this component of the composite. ​NOTE: In some badly generated fonts, glyph may contain a numerical value but that glyph might not actually exist in the font file. This could occur in any glyph, but is particularly likely for glyphs that have no strokes, such as SPACE, U+00A0 NO-BREAK SPACE, or U+200B ZERO WIDTH SPACE. args An 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. flag The flag for this component scale A 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. numPoints This is a generated value which contains the number of components read in for this compound glyph.

Private instance variables:INFILE (P) The input file form which to read any information LOC (P) Location relative to the start of the glyf table in the read file BASE (P) The location of the glyf table in the read file LEN (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 is located, 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.

EditingIf 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. The application must 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)

METHODS

Font::TTF::Glyph−>new(%parms)Creates a new glyph setting various instance variables

$g>readReads the header component of the glyph (numberOfContours and bounding box) and also the glyph content, but into a data field rather than breaking it down into its constituent structures. Use read_dat for this.

$g>read_datReads the contents of the glyph (components and curves, etc.) from the memory store DAT into structures within the object.

$g>out($fh)Writes the glyph data to outfile

$g>out_xml($context, $depth)Outputs an XML description of the glyph

$g>dirty($val)This sets the dirty flag to the given value or 1 if no given value. It returns the value of the flag

$g>updateGenerates a $self−{'DAT'}> from the internal structures, if the data has been read into structures in the first place. If you are building a glyph from scratch you will need to set the instance variable ' isDirty'.

$g>update_bboxUpdates the bounding box for this glyph according to the points in the glyph

$g>maxInfoReturns lots of information about a glyph so that the maxp table can update itself. Returns array containing contributions of this glyph to maxPoints, maxContours, maxCompositePoints, maxCompositeContours, maxSizeOfInstructions, maxComponentElements, and maxComponentDepth.

$g>emptyEmpties the glyph of all information to the level of not having been read. Useful for saving memory in apps with many glyphs being read

$g>get_pointsThis method creates point information for a compound glyph. The information is stored in the same place as if the glyph was not a compound, but since numberOfContours is negative, the glyph is still marked as being a compound

$g>get_refsReturns an array of all the glyph ids that are used to make up this glyph. That is all the compounds and their references and so on. If this glyph is not a compound, then returns an empty array. Please note the warning about bad fonts that reference nonexistent glyphs under INSTANCE VARIABLES above. This function will not attempt to filter out nonexistent glyph numbers.

BUGS• The instance variables used here are somewhat clunky and inconsistent with the other tables. • update doesn't re-calculate the bounding box or numberOfContours.

AUTHORMartin Hosken <http://scripts.sil.org/FontUtils>.

LICENSINGCopyright (c) 1998−2016, SIL International (http://www.sil.org) This module is released under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.
0
Johanes Gumabo
Data Size   :   25,863 byte
man-Font::TTF::Glyph.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   5 / 165,726
Visitor ID   :     :  
Visitor IP   :   3.141.12.236   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Font::TTF::Glyph.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Font::TTF::Glyph.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Font::TTF::Glyph.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Font::TTF::Glyph.3pm|43|'br══─}─══ |'br══─}─══ )