Module: HexaPDF::Font::TrueType::Table::Post::Format4

Defined in:
lib/hexapdf/font/true_type/table/post.rb

Overview

‘post’ table format 4

Class Method Summary collapse

Class Method Details

.mapper(char_codes) ⇒ Object

:nodoc:



219
220
221
# File 'lib/hexapdf/font/true_type/table/post.rb', line 219

def self.mapper(char_codes) #:nodoc:
  lambda {|glyph_id| char_codes[glyph_id] || 0xFFFF }
end

.parse(io, length) ⇒ Object

:call-seq:

Format4.parse(io, length)    -> glyph_names

Parses the format 4 post subtable from the given IO at the current position and returns a lambda mapping the glyph id to a character code.



215
216
217
# File 'lib/hexapdf/font/true_type/table/post.rb', line 215

def self.parse(io, length)
  mapper(io.read(length).unpack('n*'))
end