Font::TTF::Loca(3)
β¨ NAME β¨
okay so bestie, welcome to the manual page for Font::TTF::Loca(3) β it's the Locations table, and it is intimately tied to the glyf table. also yes, this is a User Contributed Perl Documentation page, and we're literally about to vibe through it together π iykyk
π¦ DESCRIPTION π¦
So the location table holds the directory of locations of each glyph within the glyf table. Because of that relationship β and because the actual locations highkey stop mattering once glyphs are held in memory β reading the location table results in the creation of glyph objects for each glyph and stores them here. so if you're looking for glyphs, do not look in the glyf table, look here instead. periodt β¨
Things get complicated if you try to change the glyph list within the one table. the recommendation is to create another clean location object to replace this table in the font, ensuring that the old table is read first, and to transfer or copy glyphs across from the read table to the new table. no cap, that's the move β fr fr π«Ά
π INSTANCE VARIABLES π
quick vibe check: the instance variables do not start with a space (that's literally what the page says, okay? π).
glyphs
An array of glyph objects for each glyph. it's giving "one per glyph, stored right here" π
glyphtype
A string containing the class name to create for each new glyph. if it's empty, it defaults to Font::TTF::Glyph. ate, honestly π
π₯ METHODS π₯
$t->new
Creates a new location table and makes sure it has a glyphs array. obsessed with a clean lil' table setup β¨
$t->read
Reads the location table, creating glyph objects (Font::TTF::Glyph) for each glyph, which allows their later reading. main character behavior tbh π
$t->out($fh)
Writes the location table out to $fh. notice that not having read the location table implies that the glyf table has not been read either, so the numbers in the location table are still valid. let's hope maxp/numGlyphs and head/indexToLocFmt haven't changed β otherwise we are in big trouble ππ
The function uses the OUTLOC location in the glyph calculated when the glyf table was attempted to be output.
$t->out_xml($context, $depth)
No need to output a loca table β this is dynamically generated. so we simply don't, bestie π
$t->glyphs_do(&func)
Calls func for each glyph in this location table in numerical order:
&func($glyph, $glyph_num)
π BUGS π
None known. (a rare and beautiful thing, honestly β not me being suspicious ππ)
π AUTHOR π
Martin Hosken <http://scripts.sil.org/FontUtils>. giving credit where it's due π«Ά
π LICENSING π
Copyright (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.
mwah π this lil' page came from perl v5.42.0 on 2016-08-28, and it's Font::TTF::Loca(3) β byeee, bestie πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Font-TTF 1.06-bp160.1.12 Β· Artistic-2.0 and OFL-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms