Font::TTF::OldCmap(3)

🌸 NAME 🌸

okay so this is the man page for Font::TTF::OldCmap β€” yes, Font::TTF::OldCmap(3), from the User Contributed Perl Documentation crew. It's the Character map table module, and bestie, listen: this module is deprecated. Not me delivering the news with a little sparkle. πŸ’…

🚨 Deprecated alert: the original page literally says "This module is deprecated." So yeah, that's the vibe β€” iykyk.

✨ DESCRIPTION ✨

Okay so this module looks after the character map. The main character for handling a cmap is Font::TTF::Segarr, which handles the segmented arrays of format 4 tables β€” and in a simpler form, format 0 tables. Slay. ✨

Because segmented arrays are highkey a lot, ngl, most of the handling for those arrays happens through methods rather than through instance variables. It's giving "methods are the moment." πŸ’…

The way that a format 4 table always contains a segment with a final address of 0xFFFF? Iconic. If you're creating a table from scratch, this is important β€” although Font::TTF::Segarr can work quite happily without it. No cap, fr fr. 🫢

πŸŽ€ INSTANCE VARIABLES πŸŽ€

Quick note before the list: the instance variables here are not preceded by a space, because they're emulating structural information in the font. That's on purpose, bestie, fr fr. Don't try to "fix" it. 😌

  • Num β€” Number of subtables in this table.
  • Tables β€” An array of subtables ([0..Num-1]).

Each subtable also has its own instance variables, and again, these are not preceded by a space:

  • Platform β€” The platform number for this subtable.
  • Encoding β€” The encoding number for this subtable.
  • Format β€” Gives the stored format of this subtable.
  • Ver β€” Gives the version (or language) information for this subtable.
  • val β€” This points to a Font::TTF::Segarr which contains the content of the particular subtable.

πŸ’… METHODS πŸ’…

  • $t->read β€” Reads the cmap into memory. Format 4 subtables read the whole subtable and fill in the segmented array accordingly. Format 2 subtables are not read at all β€” nope, not even a little. πŸ™ˆ
  • $t->ms_lookup($uni) β€” Given a Unicode value in the MS table (Platform 3, Encoding 1), this locates that table and looks up the appropriate glyph number from it. Very "say less, I got you." ✨
  • $t->find_ms β€” Finds the Microsoft Unicode table and sets the "mstable" instance variable to it if found. Returns the table it finds. Obsessed with a method that returns the thing it found, honestly. 🫢
  • $t->out($fh) β€” Writes out a cmap table to a filehandle. If it has not been read, then it just copies from input file to output. Easy.
  • @map = $t->reverse([$num]) β€” Returns a reverse map of the table of given number or the Microsoft cmap. I.e. given a glyph, it gives the Unicode value for it. Reverse-map realness. πŸ”

πŸ› BUGS πŸ›

  • No support for format 2 tables (MBCS). That's the whole bug note, bestie β€” short and iconic. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Martin Hosken <http://scripts.sil.org/FontUtils>. Periodt. πŸ’–

πŸ“œ 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.


okay bye bestie πŸ’– this page is running on perl v5.42.0, dated 2016-08-28 β€” mwah! πŸ’…βœ¨

πŸ“¦ where this page comes from