1Font::TTF::Segarr(3)  User Contributed Perl Documentation Font::TTF::Segarr(3)
2
3
4

NAME

6       Font::TTF::Segarr - Segmented array
7

DESCRIPTION

9       Holds data either directly or indirectly as a series of arrays. This
10       class looks after the set of arrays and masks the individual
11       sub-arrays, thus saving a class, we hope.
12

INSTANCE VARIABLES

14       All instance variables do not start with a space.
15
16       The segmented array is simply an array of segments
17
18       Each segment is a more complex affair:
19
20       START
21           In terms of the array, the address for the 0th element in this seg‐
22           ment.
23
24       LEN Number of elements in this segment
25
26       VAL The array which contains the elements
27

METHODS

29       Font::TTF::Segarr->new($size)
30
31       Creates a new segmented array with a given data size
32
33       $s->fastadd_segment($start, $is_sparse, @dat)
34
35       Creates a new segment and adds it to the array assuming no overlap
36       between the new segment and any others in the array. $is_sparse indi‐
37       cates whether the passed in array contains "undef"s or not. If false no
38       checking is done (which is faster, but riskier). If equal to 2 then 0
39       is considered undef as well.
40
41       Returns the number of segments inserted.
42
43       $s->add_segment($start, $overwrite, @dat)
44
45       Creates a new segment and adds it to the array allowing for possible
46       overlaps between the new segment and the existing ones. In the case of
47       overlaps, elements from the new segment are deleted unless $overwrite
48       is set in which case the elements already there are over-written.
49
50       This method also checks the data coming in to see if it is sparse (i.e.
51       contains undef values). Gaps cause new segments to be created or not to
52       over-write existing values.
53
54       $s->tidy
55
56       Merges any immediately adjacent segments
57
58       $s->at($addr, [$len])
59
60       Looks up the data held at the given address by locating the appropriate
61       segment etc. If $len > 1 then returns an array of values, spaces being
62       filled with undef.
63
64       $s->remove($addr, [$len])
65
66       Removes the item or items from addr returning them as an array or the
67       first value in a scalar context. This is very like "at", including pad‐
68       ding with undef, but it deletes stuff as it goes.
69
70       $s->copy
71
72       Deep copies this array
73
74       $s->copy_seg($seg)
75
76       Creates a deep copy of a segment
77

BUGS

79       No known bugs.
80

AUTHOR

82       Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
83       and licensing.
84
85
86
87perl v5.8.8                       2005-06-14              Font::TTF::Segarr(3)
Impressum