.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Font::TTF::Segarr 3pm" .TH Font::TTF::Segarr 3pm "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Font::TTF::Segarr \- Segmented array .SH "DESCRIPTION" .IX Header "DESCRIPTION" Holds data either directly or indirectly as a series of arrays. This class looks after the set of arrays and masks the individual sub-arrays, thus saving a class, we hope. .SH "INSTANCE VARIABLES" .IX Header "INSTANCE VARIABLES" All instance variables do not start with a space. .PP The segmented array is simply an array of segments .PP Each segment is a more complex affair: .IP "\s-1START\s0" 4 .IX Item "START" In terms of the array, the address for the 0th element in this segment. .IP "\s-1LEN\s0" 4 .IX Item "LEN" Number of elements in this segment .IP "\s-1VAL\s0" 4 .IX Item "VAL" The array which contains the elements .SH "METHODS" .IX Header "METHODS" .SS "Font::TTF::Segarr\->new($size)" .IX Subsection "Font::TTF::Segarr->new($size)" Creates a new segmented array with a given data size .ie n .SS "$s\->fastadd_segment($start, $is_sparse, @dat)" .el .SS "\f(CW$s\fP\->fastadd_segment($start, \f(CW$is_sparse\fP, \f(CW@dat\fP)" .IX Subsection "$s->fastadd_segment($start, $is_sparse, @dat)" Creates a new segment and adds it to the array assuming no overlap between the new segment and any others in the array. \f(CW$is_sparse\fR indicates whether the passed in array contains \f(CW\*(C`undef\*(C'\fRs or not. If false no checking is done (which is faster, but riskier). If equal to 2 then 0 is considered undef as well. .PP Returns the number of segments inserted. .ie n .SS "$s\->add_segment($start, $overwrite, @dat)" .el .SS "\f(CW$s\fP\->add_segment($start, \f(CW$overwrite\fP, \f(CW@dat\fP)" .IX Subsection "$s->add_segment($start, $overwrite, @dat)" Creates a new segment and adds it to the array allowing for possible overlaps between the new segment and the existing ones. In the case of overlaps, elements from the new segment are deleted unless \f(CW$overwrite\fR is set in which case the elements already there are over-written. .PP This method also checks the data coming in to see if it is sparse (i.e. contains undef values). Gaps cause new segments to be created or not to over-write existing values. .ie n .SS "$s\->tidy" .el .SS "\f(CW$s\fP\->tidy" .IX Subsection "$s->tidy" Merges any immediately adjacent segments .ie n .SS "$s\->at($addr, [$len])" .el .SS "\f(CW$s\fP\->at($addr, [$len])" .IX Subsection "$s->at($addr, [$len])" Looks up the data held at the given address by locating the appropriate segment etc. If \f(CW$len\fR > 1 then returns an array of values, spaces being filled with undef. .ie n .SS "$s\->remove($addr, [$len])" .el .SS "\f(CW$s\fP\->remove($addr, [$len])" .IX Subsection "$s->remove($addr, [$len])" Removes the item or items from addr returning them as an array or the first value in a scalar context. This is very like \f(CW\*(C`at\*(C'\fR, including padding with undef, but it deletes stuff as it goes. .ie n .SS "$s\->copy" .el .SS "\f(CW$s\fP\->copy" .IX Subsection "$s->copy" Deep copies this array .ie n .SS "$s\->copy_seg($seg)" .el .SS "\f(CW$s\fP\->copy_seg($seg)" .IX Subsection "$s->copy_seg($seg)" Creates a deep copy of a segment .SH "BUGS" .IX Header "BUGS" No known bugs. .SH "AUTHOR" .IX Header "AUTHOR" Martin Hosken . .SH "LICENSING" .IX Header "LICENSING" Copyright (c) 1998\-2016, \s-1SIL\s0 International (http://www.sil.org) .PP 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 \s-1LICENSE.\s0