Class: Fontisan::Binary::TableDirectoryEntry

Inherits:
BaseRecord
  • Object
show all
Defined in:
lib/fontisan/binary/structures.rb

Overview

OpenType Table Directory Entry

Each entry describes one table in the font file.

Structure:

  • char: tag (table identifier)

  • uint32: checksum (checksum for this table)

  • uint32: offset (byte offset from beginning of font file)

  • uint32: table_length (length of table in bytes)

Instance Method Summary collapse

Methods inherited from BaseRecord

#raw_data, read, #valid?

Instance Method Details

#tag?(other_tag) ⇒ Boolean

Check if this entry has a specific tag

Parameters:

Returns:

  • (Boolean)

    True if tags match



79
80
81
# File 'lib/fontisan/binary/structures.rb', line 79

def tag?(other_tag)
  tag_object == (other_tag.is_a?(Parsers::Tag) ? other_tag : Parsers::Tag.new(other_tag))
end

#tag_objectParsers::Tag

Convert tag to Tag object for comparison

Returns:



71
72
73
# File 'lib/fontisan/binary/structures.rb', line 71

def tag_object
  Parsers::Tag.new(tag)
end