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 to 0x25CC. ✨
  • pname β€” Postscript name to give the glyph. Defaults to uni25CC. πŸŽ€
  • -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