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
ttfunk-1.0.3 lib/ttfunk/table/cmap.rb
ttfunk-1.0.2 lib/ttfunk/table/cmap.rb
ttfunk-1.0.1 lib/ttfunk/table/cmap.rb
davebenvenuti-prawn-0.11.1.pre vendor/ttfunk/lib/ttfunk/table/cmap.rb
piglop-prawn-0.10.2.3 vendor/ttfunk/lib/ttfunk/table/cmap.rb
piglop-prawn-0.10.2.2 vendor/ttfunk/lib/ttfunk/table/cmap.rb
piglop-prawn-0.10.2.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
glyph_imager-0.1.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-0.11.1.pre vendor/ttfunk/lib/ttfunk/table/cmap.rb
goodwill-prawn-edge-0.10.0 vendor/ttfunk/lib/ttfunk/table/cmap.rb
alphasights-prawn-0.10.4 vendor/ttfunk/lib/ttfunk/table/cmap.rb
alphasights-prawn-0.10.3 vendor/ttfunk/lib/ttfunk/table/cmap.rb
alphasights-prawn-0.10.2 vendor/ttfunk/lib/ttfunk/table/cmap.rb
alphasights-prawn-0.10.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb
glyph_imager-0.1.0 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.8.4 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-graph-0.0.2 vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-graph-0.0.1 vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.7.2 vendor/ttfunk/lib/ttfunk/table/cmap.rb
prawn-core-0.7.1 vendor/ttfunk/lib/ttfunk/table/cmap.rb