Sha256: 1e59e44df4457f84879c1135087f3280e394362c9c0cecf4af5c8c834e6c605b

Contents?: true

Size: 732 Bytes

Versions: 4

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

module TTFunk
  class Table
    class Cff < TTFunk::Table
      class FontIndex < TTFunk::Table::Cff::Index
        attr_reader :top_dict

        def initialize(top_dict, file, offset, length = nil)
          super(file, offset, length)
          @top_dict = top_dict
        end

        def [](index)
          entry_cache[index] ||= begin
            start, finish = absolute_offsets_for(index)
            TTFunk::Table::Cff::FontDict.new(
              top_dict, file, start, (finish - start) + 1
            )
          end
        end

        def finalize(new_cff_data, mapping)
          each { |font_dict| font_dict.finalize(new_cff_data, mapping) }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ttfunk-1.6.2.1 lib/ttfunk/table/cff/font_index.rb
ttfunk-1.6.2 lib/ttfunk/table/cff/font_index.rb
ttfunk-1.6.1 lib/ttfunk/table/cff/font_index.rb
ttfunk-1.6.0 lib/ttfunk/table/cff/font_index.rb