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