1Font::TTF::Utils(3) User Contributed Perl Documentation Font::TTF::Utils(3)
2
3
4
6 Font::TTF::Utils - Utility functions to save fingers
7
9 Lots of useful functions to save my fingers, especially for trivial
10 tables
11
13 The following functions are exported
14
15 ($val, $pos) = TTF_Init_Fields ($str, $pos)
16
17 Given a field description from the "DATA" section, creates an absolute
18 entry in the fields associative array for the class
19
20 TTF_Read_Fields($obj, $dat, $fields)
21
22 Given a block of data large enough to account for all the fields in a
23 table, processes the data block to convert to the values in the objects
24 instance variables by name based on the list in the "DATA" block which
25 has been run through "TTF_Init_Fields"
26
27 TTF_Unpack($fmt, $dat)
28
29 A TrueType types equivalent of Perls "unpack" function. Thus $fmt con‐
30 sists of type followed by an optional number of elements to read
31 including *. The type may be one of:
32
33 c BYTE
34 C CHAR
35 f FIXED
36 F F2DOT14
37 l LONG
38 L ULONG
39 s SHORT
40 S USHORT
41
42 Note that "FUNIT", "FWORD" and "UFWORD" are not data types but units.
43
44 Returns array of scalar (first element) depending on context
45
46 $dat = TTF_Out_Fields($obj, $fields, $len)
47
48 Given the fields table from "TTF_Init_Fields" writes out the instance
49 variables from the object to the filehandle in TTF binary form.
50
51 $dat = TTF_Pack($fmt, @data)
52
53 The TrueType equivalent to Perl's "pack" function. See details of
54 "TTF_Unpack" for how to work the $fmt string.
55
56 ($num, $range, $select, $shift) = TTF_bininfo($num)
57
58 Calculates binary search information from a number of elements
59
60 TTF_word_utf8($str)
61
62 Returns the UTF8 form of the 16 bit string, assumed to be in big endian
63 order, including surrogate handling
64
65 TTF_utf8_word($str)
66
67 Returns the 16-bit form in big endian order of the UTF 8 string,
68 including surrogate handling to Unicode.
69
70 XML_hexdump($context, $dat)
71
72 Dumps out the given data as a sequence of <data> blocks each 16 bytes
73 wide
74
75 XML_outhints
76
77 Converts a binary string of hinting code into a textual representation
78
79 make_circle($f, $cmap, [$dia, $sb, $opts])
80
81 Adds a dotted circle to a font. This function is very configurable. The
82 parameters passed in are:
83
84 $f Font to work with. This is required.
85
86 $cmap
87 A cmap table (not the 'val' sub-element of a cmap) to add the glyph
88 too. Optional.
89
90 $dia
91 Optional diameter for the main circle. Defaults to 80% em
92
93 $sb Side bearing. The left and right side-bearings are always the same.
94 This value defaults to 10% em.
95
96 There are various options to control all sorts of interesting aspects
97 of the circle
98
99 numDots
100 Number of dots in the circle
101
102 numPoints
103 Number of curve points to use to create each dot
104
105 uid Unicode reference to store this glyph under in the cmap. Defaults
106 to 0x25CC
107
108 pname
109 Postscript name to give the glyph. Defaults to uni25CC.
110
111 -dRadius
112 Radius of each dot.
113
115 No known bugs
116
118 Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright
119 and licensing.
120
121
122
123perl v5.8.8 2005-06-14 Font::TTF::Utils(3)