Class: HexaPDF::Font::TrueType::Table::Cmap

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

Overview

The ‘cmap’ table contains subtables for mapping character codes to glyph indices.

See:

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

#tablesObject

The available cmap subtables.



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

def tables
  @tables
end

#versionObject

The version of the cmap table.



53
54
55
# File 'lib/hexapdf/font/true_type/table/cmap.rb', line 53

def version
  @version
end

Instance Method Details

#preferred_tableObject

Returns the preferred of the available cmap subtables.

A preferred table is always a table mapping Unicode characters.



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

def preferred_table
  tables.select(&:unicode?).max_by(&:format)
end