Class: TTFunk::Table::Kern
- Inherits:
-
TTFunk::Table
- Object
- TTFunk::Table
- TTFunk::Table::Kern
- Defined in:
- lib/ttfunk/table/kern.rb,
lib/ttfunk/table/kern/format0.rb
Overview
Kerning (‘kern`) table
Defined Under Namespace
Classes: Format0
Instance Attribute Summary collapse
-
#tables ⇒ Array<TTFunk::Table::Kern::Format0>
readonly
Subtables.
-
#version ⇒ Integer
readonly
Table version.
Attributes inherited from TTFunk::Table
Class Method Summary collapse
-
.encode(kerning, mapping) ⇒ String?
Encode table.
Methods inherited from TTFunk::Table
#exists?, #initialize, #raw, #tag
Constructor Details
This class inherits a constructor from TTFunk::Table
Instance Attribute Details
#tables ⇒ Array<TTFunk::Table::Kern::Format0> (readonly)
Subtables.
15 16 17 |
# File 'lib/ttfunk/table/kern.rb', line 15 def tables @tables end |
#version ⇒ Integer (readonly)
Table version
11 12 13 |
# File 'lib/ttfunk/table/kern.rb', line 11 def version @version end |
Class Method Details
.encode(kerning, mapping) ⇒ String?
Encode table.
23 24 25 26 27 28 29 30 |
# File 'lib/ttfunk/table/kern.rb', line 23 def self.encode(kerning, mapping) return unless kerning.exists? && kerning.tables.any? tables = kerning.tables.filter_map { |table| table.recode(mapping) } return if tables.empty? [0, tables.length, tables.join].pack('nnA*') end |