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