Sha256: f0854cbea887e9785f038bed26903983836c560ce7f314351b750a5d6049d3b1

Contents?: true

Size: 726 Bytes

Versions: 29

Compression:

Stored size: 726 Bytes

Contents

module TTFunk  
  class Table
    class Cmap < Table
      attr_reader :version
      attr_reader :tables

      def self.encode(charmap, encoding)
        result = Cmap::Subtable.encode(charmap, encoding)

        # pack 'version' and 'table-count'
        result[:table] = [0, 1, result.delete(:subtable)].pack("nnA*")
        return result
      end

      def unicode
        @unicode ||= @tables.select { |table| table.unicode? }
      end

      private

        def parse!
          @version, table_count = read(4, "nn")
          @tables = []

          table_count.times do
            @tables << Cmap::Subtable.new(file, offset)
          end
        end
    end
    
  end
end

require 'ttfunk/table/cmap/subtable'

Version data entries

29 entries across 29 versions & 10 rubygems

Version Path
prawn-layout-0.3.2 vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.6.3 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.6.2 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-layout-0.3.1 vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.6.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.5.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.5.0.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-0.4.0 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-0.4.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb