Font::TTF::Utils(3)
okay bestie, welcome to the Font::TTF::Utils(3) page from the User Contributed Perl Documentation β it's literally a little bag of utility functions that save fingers. π
β¨
πΈ NAME πΈ
Font::TTF::Utils β utility functions to save fingers π«Ά
β¨ DESCRIPTION β¨
okay so there are lots of useful functions in here to save my fingers, especially for trivial tables. no cap, that's the whole vibe. π
π₯ FUNCTIONS π₯
The following functions are exported:
π ($val, $pos) = TTF_Init_Fields ($str, $pos) π
Given a field description from the DATA section, this creates an absolute entry in the fields associative array for the class. slay. β¨
π¦ TTF_Read_Fields($obj, $dat, $fields) π¦
Given a block of data large enough to account for all the fields in a table, this processes the data block to convert to the values in the object's instance variables by name, based on the list in the DATA block which has been run through TTF_Init_Fields. π
π₯ TTF_Unpack($fmt, $dat) π₯
This is the TrueType-types equivalent of Perl's unpack function. So $fmt consists of a type followed by an optional number of elements to read, including *. The type may be one of:
c BYTE
C CHAR
f FIXED
F F2DOT14
l LONG
L ULONG
s SHORT
S USHORT
v Version number (FIXED)
Note that FUNIT, FWORD and UFWORD are not data types but units. π«Ά
Returns array of scalar (first element) depending on context. β¨
π $dat = TTF_Out_Fields($obj, $fields, $len) π
Given the fields table from TTF_Init_Fields, this writes out the instance variables from the object to the filehandle in TTF binary form. π
π $dat = TTF_Pack($fmt, @data) π
The TrueType equivalent to Perl's pack function. See details of TTF_Unpack for how to work the $fmt string. β
β ($num, $range, $select, $shift) = TTF_bininfo($num) β
Calculates binary search information from a number of elements. π₯
π§ TTF_word_utf8($str) π§
Returns the UTF8 form of the 16 bit string, assumed to be in big endian order, including surrogate handling. π¦
π TTF_utf8_word($str) π
Returns the 16-bit form in big endian order of the UTF 8 string, including surrogate handling to Unicode. π
π XML_hexdump($context, $dat) π
Dumps out the given data as a sequence of <data> blocks each 16 bytes wide. π
πΈ XML_outhints πΈ
Converts a binary string of hinting code into a textual representation. β¨
π make_circle($f, $cmap, [$dia, $sb, $opts]) π
Adds a dotted circle to a font. This function is very configurable. The parameters passed in are:
$fβ Font to work with. This is required. π$cmapβ A cmap table (not the 'val' sub-element of a cmap) to add the glyph to. Optional. π¦$diaβ Optional diameter for the main circle. Defaults to 80% em. πΈ$sbβ Side bearing. The left and right side-bearings are always the same. This value defaults to 10% em. β
There are various options to control all sorts of interesting aspects of the circle:
numDotsβ Number of dots in the circle. π₯numPointsβ Number of curve points to use to create each dot. πuidβ Unicode reference to store this glyph under in the cmap. Defaults to0x25CC. β¨pnameβ Postscript name to give the glyph. Defaults touni25CC. π-dRadiusβ Radius of each dot. π
π BUGS π
No known bugs. literally none. iconic behavior. π
π«Ά AUTHOR π«Ά
Martin Hosken <http://scripts.sil.org/FontUtils>. π
π LICENSING π
Copyright (c) 1998-2016, SIL International (http://www.sil.org)
This module is released under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE. π
and that's the whole page, bestie! it came from perl v5.42.0, dated 2016-08-28, and it's the Font::TTF::Utils(3) manual β bye! ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Font-TTF 1.06-bp160.1.12 Β· Artistic-2.0 and OFL-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms