1Font::TTF::Name(3) User Contributed Perl Documentation Font::TTF::Name(3)
2
3
4
6 Font::TTF::Name - String table for a TTF font
7
9 Strings are held by number, platform, encoding and language. Strings
10 are accessed as:
11
12 $f->{'name'}{'strings'}[$number][$platform_id][$encoding_id]{$language_id}
13
14 Notice that the language is held in an associative array due to its
15 sparse nature on some platforms such as Microsoft ($pid = 3). Notice
16 also that the array order is different from the stored array order
17 (platform, encoding, language, number) to allow for easy manipulation
18 of strings by number (which is what I guess most people will want to
19 do).
20
21 By default, $Font::TTF::Name::utf8 is set to 1, and strings will be
22 stored as UTF8 wherever possible. The method "is_utf8" can be used to
23 find out if a string in a particular platform and encoding will be
24 returned as UTF8. Unicode strings are always converted if utf8 is
25 requested. Otherwise, strings are stored according to platform:
26
27 ***WARNING NON-UTF8 is deprecated and utf8 strings has become the default***
28
29 You now have to set <$Font::TTF::Name::utf8> to 0 to get the old behav‐
30 iour.
31
32 Apple Unicode (platform id = 0)
33 Data is stored as network ordered UCS2. There is no encoding id for
34 this platform but there are language ids as per Mac language ids.
35
36 Mac (platform id = 1)
37 Data is stored as 8-bit binary data, leaving the interpretation to
38 the user according to encoding id.
39
40 Unicode (platform id = 2)
41 Currently stored as 16-bit network ordered UCS2. Upon release of
42 Perl 5.005 this will change to utf8 assuming current UCS2 semantics
43 for all encoding ids.
44
45 Windows (platform id = 3)
46 As per Unicode, the data is currently stored as 16-bit network
47 ordered UCS2. Upon release of Perl 5.005 this will change to utf8
48 assuming current UCS2 semantics for all encoding ids.
49
51 strings
52 An array of arrays, etc.
53
55 $t->read
56
57 Reads all the names into memory
58
59 $t->out($fh)
60
61 Writes out all the strings
62
63 $t->XML_element($context, $depth, $key, $value)
64
65 Outputs the string element in nice XML (which is all the table really!)
66
67 $t->XML_end($context, $tag, %attrs)
68
69 Store strings in the right place
70
71 is_utf8($pid, $eid)
72
73 Returns whether a string of a given platform and encoding is going to
74 be in UTF8
75
76 find_name($nid)
77
78 Hunts down a name in all the standard places and returns the string and
79 for an array context the pid, eid & lid as well
80
82 · Unicode type strings will be stored in utf8 for all known plat‐
83 forms, once Perl 5.6 has been released and I can find all the map‐
84 ping tables, etc.
85
87 Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
88 and licensing.
89
90
91
92perl v5.8.8 2005-06-14 Font::TTF::Name(3)