Class: TTFunk::Table::Cff
- Inherits:
-
TTFunk::Table
- Object
- TTFunk::Table
- TTFunk::Table::Cff
- Defined in:
- lib/ttfunk/table/cff.rb,
lib/ttfunk/table/cff/dict.rb,
lib/ttfunk/table/cff/path.rb,
lib/ttfunk/table/cff/index.rb,
lib/ttfunk/table/cff/header.rb,
lib/ttfunk/table/cff/charset.rb,
lib/ttfunk/table/cff/charsets.rb,
lib/ttfunk/table/cff/encoding.rb,
lib/ttfunk/table/cff/top_dict.rb,
lib/ttfunk/table/cff/encodings.rb,
lib/ttfunk/table/cff/font_dict.rb,
lib/ttfunk/table/cff/top_index.rb,
lib/ttfunk/table/cff/charstring.rb,
lib/ttfunk/table/cff/font_index.rb,
lib/ttfunk/table/cff/subr_index.rb,
lib/ttfunk/table/cff/fd_selector.rb,
lib/ttfunk/table/cff/private_dict.rb,
lib/ttfunk/table/cff/charsets/expert.rb,
lib/ttfunk/table/cff/one_based_index.rb,
lib/ttfunk/table/cff/encodings/expert.rb,
lib/ttfunk/table/cff/charstrings_index.rb,
lib/ttfunk/table/cff/charsets/iso_adobe.rb,
lib/ttfunk/table/cff/encodings/standard.rb,
lib/ttfunk/table/cff/charsets/expert_subset.rb,
lib/ttfunk/table/cff/charsets/standard_strings.rb
Overview
Compact Font Format (‘CFF `) table
Defined Under Namespace
Modules: Charsets, Encodings Classes: Charset, Charstring, CharstringsIndex, Dict, Encoding, FdSelector, FontDict, FontIndex, Header, Index, OneBasedIndex, Path, PrivateDict, SubrIndex, TopDict, TopIndex
Constant Summary collapse
- TAG =
Table tag. The extra space is important.
'CFF '
Instance Attribute Summary collapse
-
#global_subr_index ⇒ TTFunk::Table::Cff::SubrIndex
readonly
Global subroutine index.
-
#header ⇒ TTFunk::Table::Cff::Header
readonly
Table header.
-
#name_index ⇒ TTFunk::Table::Cff::Index
readonly
Name index.
-
#string_index ⇒ TTFunk::Table::Cff::OneBasedIndex
readonly
Strings index.
-
#top_index ⇒ TTFunk::Table::Cff::TopIndex
readonly
Top dict index.
Attributes inherited from TTFunk::Table
Instance Method Summary collapse
-
#encode(subset) ⇒ TTFunk::EncodedString
Encode table.
-
#tag ⇒ String
Table tag.
Methods inherited from TTFunk::Table
Constructor Details
This class inherits a constructor from TTFunk::Table
Instance Attribute Details
#global_subr_index ⇒ TTFunk::Table::Cff::SubrIndex (readonly)
Global subroutine index.
47 48 49 |
# File 'lib/ttfunk/table/cff.rb', line 47 def global_subr_index @global_subr_index end |
#header ⇒ TTFunk::Table::Cff::Header (readonly)
Table header.
31 32 33 |
# File 'lib/ttfunk/table/cff.rb', line 31 def header @header end |
#name_index ⇒ TTFunk::Table::Cff::Index (readonly)
Name index.
35 36 37 |
# File 'lib/ttfunk/table/cff.rb', line 35 def name_index @name_index end |
#string_index ⇒ TTFunk::Table::Cff::OneBasedIndex (readonly)
Strings index.
43 44 45 |
# File 'lib/ttfunk/table/cff.rb', line 43 def string_index @string_index end |
#top_index ⇒ TTFunk::Table::Cff::TopIndex (readonly)
Top dict index.
39 40 41 |
# File 'lib/ttfunk/table/cff.rb', line 39 def top_index @top_index end |
Instance Method Details
#encode(subset) ⇒ TTFunk::EncodedString
Encode table.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ttfunk/table/cff.rb', line 60 def encode(subset) # Make sure TopDict has an entry for encoding so it could be properly replaced top_index[0][TopDict::OPERATORS[:encoding]] = 0 EncodedString.new do |result| result.concat( header.encode, name_index.encode, top_index.encode, string_index.encode, global_subr_index.encode, ) charmap = subset.new_cmap_table[:charmap] top_index[0].finalize(result, charmap) end end |