Font::TTF::Kern(3)

πŸ¦‹ Font::TTF::Kern(3) β€” Kerning tables πŸ¦‹

okay so bestie, welcome to Font::TTF::Kern(3) from the User Contributed Perl Documentation 🌈 this page has main character energy and it’s literally all about kerning tables. no cap, it’s giving β€œsomeone who actually knows Unix explaining it to their bestie” πŸ’–

🌸 NAME 🌸

Font::TTF::Kern - Kerning tables ✨

✨ DESCRIPTION ✨

okay so the way that kerning tables are held? it’s as an ordered collection of subtables, and each subtable gives incremental info about the kerning of various pairs of glyphs. fr fr, that’s the vibe.

The basic structure of the kerning data structure is:

$kern = $f->{'kern'}{'tables'}[$tnum]{'kerns'}{$leftnum}{$rightnum};

Due to the possible complexity of some kerning tables, that info above is not enough, bestie 😭 ngl you also need to reference the type of the table and the coverage field. iykyk.

πŸ’… INSTANCE VARIABLES πŸ’…

The instance variables for a kerning table are relatively straightforward. not me saying that, but slay periodt.

πŸ’– Version πŸ’–

Version number of the kerning table.

πŸ’– Num πŸ’–

Number of subtables in the kerning table.

πŸ’– tables πŸ’–

Array of subtables in the kerning table.

Each subtable has a number of instance variables.

πŸŽ€ kern πŸŽ€

A two level hash array containing kerning values. The indexing goes via left class and right class. It may seem using hashes is strange, but most tables are not type 2 and this method saves empty array values.

πŸŽ€ type πŸŽ€

Stores the table type. Only type 0 and type 2 tables are specified for TrueType so far.

πŸŽ€ coverage πŸŽ€

A bit field of coverage information regarding the kerning value. See the TrueType specification for details.

πŸŽ€ Version πŸŽ€

Contains the version number of the table.

πŸŽ€ Num πŸŽ€

Number of kerning pairs in this type 0 table.

πŸŽ€ left πŸŽ€

An array indexed by glyph - left_first which returns a class number for the glyph in type 2 tables.

An array indexed by glyph - right_first which returns a class number for the glyph in type 2 tables.

πŸŽ€ left_first πŸŽ€

The glyph number of the first element in the left array for type 2 tables.

πŸŽ€ right_first πŸŽ€

The glyph number of the first element in the right array for type 2 tables.

πŸŽ€ num_left πŸŽ€

Number of left classes.

πŸŽ€ num_right πŸŽ€

Number of right classes.

πŸ›  METHODS πŸ› 

πŸ”₯ $t->read πŸ”₯

Reads the whole kerning table into structures.

πŸ”₯ $t->out($fh) πŸ”₯

Outputs the kerning tables to the given file.

πŸ”₯ $t->XML_element($context, $depth, $key, $value) πŸ”₯

Handles outputting the kern hash into XML a little more tidily.

πŸ”₯ $t->minsize() πŸ”₯

Returns the minimum size this table can be. If it is smaller than this, then the table must be bad and should be deleted or whatever.

πŸ’€ BUGS πŸ’€

  • Only supports kerning table types 0 & 2.
  • No real support functions to do anything with the kerning tables yet.

πŸ‘‘ 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.


mwah πŸ’‹ cute sign-off time: perl v5.42.0 Β· 2016-08-28 Β· Font::TTF::Kern(3) β€” bye bestie, go kern those pairs 🫢

πŸ“¦ where this page comes from