Class: HexaPDF::Font::TrueType::Table::Loca

Inherits:
HexaPDF::Font::TrueType::Table show all
Defined in:
lib/hexapdf/font/true_type/table/loca.rb

Overview

The ‘loca’ (location) table contains the offsets of the glyphs relative to the start of the ‘glyf’ table.

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

Constant Summary

Constants inherited from HexaPDF::Font::TrueType::Table

TIME_EPOCH

Instance Attribute Summary collapse

Attributes inherited from HexaPDF::Font::TrueType::Table

#font

Instance Method Summary collapse

Methods inherited from HexaPDF::Font::TrueType::Table

calculate_checksum, #checksum_valid?, #directory_entry, #initialize, #raw_data

Constructor Details

This class inherits a constructor from HexaPDF::Font::TrueType::Table

Instance Attribute Details

#offsetsObject

The array containing the byte offsets for each glyph relative to the start of the ‘glyf’ table.



52
53
54
# File 'lib/hexapdf/font/true_type/table/loca.rb', line 52

def offsets
  @offsets
end

Instance Method Details

#length(glyph_id) ⇒ Object

Returns the length of the ‘glyf’ entry for the given glyph ID.



61
62
63
# File 'lib/hexapdf/font/true_type/table/loca.rb', line 61

def length(glyph_id)
  @offsets[glyph_id + 1] - @offsets[glyph_id]
end

#offset(glyph_id) ⇒ Object

Returns the byte offset for the given glyph ID relative to the start of the ‘glyf’ table.



56
57
58
# File 'lib/hexapdf/font/true_type/table/loca.rb', line 56

def offset(glyph_id)
  @offsets[glyph_id]
end