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

NAME

6       Font::TTF::Utils - Utility functions to save fingers
7

DESCRIPTION

9       Lots of useful functions to save my fingers, especially for trivial
10       tables
11

FUNCTIONS

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           v       Version number (FIXED)
39
40       Note that "FUNIT", "FWORD" and "UFWORD" are not data types but units.
41
42       Returns array of scalar (first element) depending on context
43
44   $dat = TTF_Out_Fields($obj, $fields, $len)
45       Given the fields table from "TTF_Init_Fields" writes out the instance
46       variables from the object to the filehandle in TTF binary form.
47
48   $dat = TTF_Pack($fmt, @data)
49       The TrueType equivalent to Perl's "pack" function. See details of
50       "TTF_Unpack" for how to work the $fmt string.
51
52   ($num, $range, $select, $shift) = TTF_bininfo($num)
53       Calculates binary search information from a number of elements
54
55   TTF_word_utf8($str)
56       Returns the UTF8 form of the 16 bit string, assumed to be in big endian
57       order, including surrogate handling
58
59   TTF_utf8_word($str)
60       Returns the 16-bit form in big endian order of the UTF 8 string,
61       including surrogate handling to Unicode.
62
63   XML_hexdump($context, $dat)
64       Dumps out the given data as a sequence of <data> blocks each 16 bytes
65       wide
66
67   XML_outhints
68       Converts a binary string of hinting code into a textual representation
69
70   make_circle($f, $cmap, [$dia, $sb, $opts])
71       Adds a dotted circle to a font. This function is very configurable. The
72       parameters passed in are:
73
74       $f  Font to work with. This is required.
75
76       $cmap
77           A cmap table (not the 'val' sub-element of a cmap) to add the glyph
78           too. Optional.
79
80       $dia
81           Optional diameter for the main circle. Defaults to 80% em
82
83       $sb Side bearing. The left and right side-bearings are always the same.
84           This value defaults to 10% em.
85
86       There are various options to control all sorts of interesting aspects
87       of the circle
88
89       numDots
90           Number of dots in the circle
91
92       numPoints
93           Number of curve points to use to create each dot
94
95       uid Unicode reference to store this glyph under in the cmap. Defaults
96           to 0x25CC
97
98       pname
99           Postscript name to give the glyph. Defaults to uni25CC.
100
101       -dRadius
102           Radius of each dot.
103

BUGS

105       No known bugs
106

AUTHOR

108       Martin Hosken <http://scripts.sil.org/FontUtils>.
109

LICENSING

111       Copyright (c) 1998-2016, SIL International (http://www.sil.org)
112
113       This module is released under the terms of the Artistic License 2.0.
114       For details, see the full text of the license in the file LICENSE.
115
116
117
118perl v5.36.0                      2022-07-22               Font::TTF::Utils(3)
Impressum