Class: HexaPDF::Font::TrueType::Table::Directory

Inherits:
Table
  • Object
show all
Defined in:
lib/hexapdf/font/true_type/table/directory.rb

Overview

The main table of an sfnt-housed font file, providing the table directory which contains information for loading all other tables.

See: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html

Defined Under Namespace

Classes: Entry

Constant Summary collapse

SELF_ENTRY =

The fixed entry that represents the table directory itself.

Entry.new('DUMMY', 0, 0, 12)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagObject (readonly)

The type of file housed by the snft wrapper as a binary string. Two possible values are 'true' or 0x00010000 for a TrueType font and 'OTTO' for an OpenType font.



65
66
67
# File 'lib/hexapdf/font/true_type/table/directory.rb', line 65

def tag
  @tag
end

Instance Method Details

#entry(tag) ⇒ Object

Returns the directory entry for the given tag or nil if no such table exists.



68
69
70
# File 'lib/hexapdf/font/true_type/table/directory.rb', line 68

def entry(tag)
  @tables[tag]
end

#table_namesObject

Returns an array with all the table names (in string form) in the directory.



73
74
75
# File 'lib/hexapdf/font/true_type/table/directory.rb', line 73

def table_names
  @tables.keys
end