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

NAME

6       Font::TTF::Cmap - Character map table
7

DESCRIPTION

9       Looks after the character map. For ease of use, the actual cmap is held
10       in a hash against codepoint. Thus for a given table:
11
12           $gid = $font->{'cmap'}{'Tables'}[0]{'val'}{$code};
13
14       Note that $code should be a true value (0x1234) rather than a string
15       representation.
16

INSTANCE VARIABLES

18       The instance variables listed here are not preceeded by a space due to
19       their emulating structural information in the font.
20
21       Num Number of subtables in this table
22
23       Tables
24           An array of subtables ([0..Num-1])
25
26       Each subtables also has its own instance variables which are, again,
27       not preceeded by a space.
28
29       Platform
30           The platform number for this subtable
31
32       Encoding
33           The encoding number for this subtable
34
35       Format
36           Gives the stored format of this subtable
37
38       Ver Gives the version (or language) information for this subtable
39
40       val A hash keyed by the codepoint value (not a string) storing the
41           glyph id
42

METHODS

44   $t->read
45       Reads the cmap into memory. Format 4 subtables read the whole subtable
46       and fill in the segmented array accordingly.
47
48   $t->ms_lookup($uni)
49       Finds a Unicode table, giving preference to the MS one, and looks up
50       the given Unicode codepoint in it to find the glyph id.
51
52   $t->find_ms
53       Finds the a Unicode table, giving preference to the Microsoft one, and
54       sets the "mstable" instance variable to it if found. Returns the table
55       it finds.
56
57   $t->ms_enc
58       Returns the encoding of the microsoft table (0 => symbol, etc.).
59       Returns undef if there is no Microsoft cmap.
60
61   $t->out($fh)
62       Writes out a cmap table to a filehandle. If it has not been read, then
63       just copies from input file to output
64
65   $t->XML_element($context, $depth, $name, $val)
66       Outputs the elements of the cmap in XML. We only need to process val
67       here
68
69   $t->update
70       Tidies the cmap table.
71
72       Removes MS Fmt12 cmap if it is no longer needed.
73
74       Removes from all cmaps any codepoint that map to GID=0. Note that such
75       entries will be re-introduced as necessary depending on the cmap
76       format.
77
78   @map = $t->reverse(%opt)
79       Returns a reverse map of the Unicode cmap. I.e. given a glyph gives the
80       Unicode value for it. Options are:
81
82       tnum
83           Table number to use rather than the default Unicode table
84
85       array
86           Returns each element of reverse as an array since a glyph may be
87           mapped by more than one Unicode value. The arrays are unsorted.
88           Otherwise store any one unicode value for a glyph.
89
90   is_unicode($index)
91       Returns whether the table of a given index is known to be a unicode
92       table (as specified in the specifications)
93

BUGS

95       ยท   No support for format 2 tables (MBCS)
96

AUTHOR

98       Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
99       and licensing.
100
101
102
103perl v5.16.3                      2012-02-23                Font::TTF::Cmap(3)
Impressum