Font::TTF::Segarr(3)
π Font::TTF::Segarr(3) π
okay so this is the User Contributed Perl Documentation page for Font::TTF::Segarr, and bestie, it's literally a segmented array. We are gonna get into it. π«Άβ¨
πΈ NAME πΈ
Font::TTF::Segarr β Segmented array. That's the name. Periodt. π
β¨ DESCRIPTION β¨
So this class holds data either directly or indirectly as a series of arrays. Its whole thing is looking after the set of arrays and masking the individual sub-arrays β thus saving a class, we hope. π The "we hope" is sending me, ngl.
π INSTANCE VARIABLES π
Vibe check first: all instance variables do not start with a space. π«‘
The segmented array is simply an array of segments. Each segment is a more complex affair, and here's the breakdown:
STARTβ in terms of the array, the address for the 0th element in this segment.LENβ number of elements in this segment.VALβ the array which contains the elements.
π οΈ METHODS π οΈ
Font::TTF::Segarr->new($size)
Creates a brand-new segmented array with a given data size. Slay. β¨
$s->fastadd_segment($start, $is_sparse, @dat)
Creates a new segment and adds it to the array, assuming there is no overlap between the new segment and any of the others. $is_sparse tells you whether the array you passed in contains undefs or not. If it's false, no checking is done β which is faster, but riskier, bestie. π If $is_sparse equals 2, then 0 is considered undef as well. Returns the number of segments inserted. π
$s->add_segment($start, $overwrite, @dat)
Creates a new segment and adds it to the array, but this time it allows for possible overlaps between the new segment and the existing ones. When there's an overlap, elements from the new segment get deleted unless $overwrite is set β in which case the elements already there are over-written. π³
This method also checks the incoming data to see if it's sparse (i.e. contains undef values). Gaps cause new segments to be created or not to over-write existing values.
$s->tidy
Merges any immediately adjacent segments. Cleanup era. π§Ήβ¨
$s->at($addr, [$len])
Looks up the data held at the given address by locating the appropriate segment etc. If $len > 1, it returns an array of values, with spaces being filled with undef. π
$s->remove($addr, [$len])
Removes the item or items from addr and returns them as an array β or the first value in a scalar context. This is very like at, including padding with undef, but it deletes stuff as it goes. π
$s->copy
Deep copies this array. No shallow nonsense here. π
$s->copy_seg($seg)
Creates a deep copy of a segment. π
π BUGS π
No known bugs. Iconic behavior, honestly. β¨
π AUTHOR π
Martin Hosken <http://scripts.sil.org/FontUtils>. π«Ά
π 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.
okay bestie, that's the whole manual page! It's from perl v5.42.0, dated 2016-08-28, and it's the Font::TTF::Segarr(3) page. Mwah πβ¨
π¦ 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