Class: HexaPDF::Font::TrueType::Table::Name

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

Overview

The ‘name’ table contains the human-readable names for features, font names, style names, copyright notices and so on.

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

Defined Under Namespace

Classes: Record, Records

Constant Summary collapse

NAME_MAP =

Table for mapping symbolic names to name_id codes.

{
  copyright: 0,
  font_family: 1,
  font_subfamily: 2,
  unique_subfamily: 3,
  font_name: 4,
  version: 5,
  postscript_name: 6,
  trademark: 7,
  manufacturer: 8,
  designer: 9,
  description: 10,
  vendor_url: 11,
  designer_url: 12,
  license: 13,
  license_url: 14,
  preferred_family: 16,
  preferred_subfamily: 17,
  compatible_full: 18,
  sample_text: 19,
  postscript_cid_name: 20,
  wws_family: 21,
  wws_subfamily: 22,
}.freeze

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

#formatObject

The format of the table.



154
155
156
# File 'lib/hexapdf/font/true_type/table/name.rb', line 154

def format
  @format
end

#language_tagsObject

The mapping of language IDs starting from 0x8000 to language tags conforming to IETF BCP 47.



161
162
163
# File 'lib/hexapdf/font/true_type/table/name.rb', line 161

def language_tags
  @language_tags
end

#recordsObject

The name records.



157
158
159
# File 'lib/hexapdf/font/true_type/table/name.rb', line 157

def records
  @records
end

Instance Method Details

#[](name_or_id) ⇒ Object

Returns an array with all available entries for the given name identifier (either a symbol or an ID).

See: NAME_MAP



167
168
169
# File 'lib/hexapdf/font/true_type/table/name.rb', line 167

def [](name_or_id)
  @records[name_or_id.kind_of?(Symbol) ? NAME_MAP[name_or_id] : name_or_id]
end