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.
Source Code
lib/ttfunk/table/kern.rb, line 15
15 | def tables |
16 | @tables
|
17 | end
|
#version ⇒ Integer (readonly)
Table version
Source Code
lib/ttfunk/table/kern.rb, line 11
11 | def version |
12 | @version
|
13 | end
|
Class Method Details
.encode(kerning, mapping) ⇒ String?
Encode table.
Source Code
lib/ttfunk/table/kern.rb, line 23
23 | def self.encode(kerning, mapping) |
24 | return unless kerning.exists? && kerning.tables.any? |
25 | |
26 | tables = kerning.tables.filter_map { |table| table.recode(mapping) } |
27 | return if tables.empty? |
28 | |
29 | [0, tables.length, tables.join].pack('nnA*') |
30 | end
|