Sha256: 4654fbc71e006bff6abd294242798376f5d9763057e6926de5191c1e89d73a99

Contents?: true

Size: 1.19 KB

Versions: 34

Compression:

Stored size: 1.19 KB

Contents

require 'ttfunk/table'

module TTFunk
  class Table
    class Maxp < Table
      attr_reader :version
      attr_reader :num_glyphs
      attr_reader :max_points
      attr_reader :max_contours
      attr_reader :max_component_points
      attr_reader :max_component_contours
      attr_reader :max_zones
      attr_reader :max_twilight_points
      attr_reader :max_storage
      attr_reader :max_function_defs
      attr_reader :max_instruction_defs
      attr_reader :max_stack_elements
      attr_reader :max_size_of_instructions
      attr_reader :max_component_elements
      attr_reader :max_component_depth

      def self.encode(maxp, mapping)
        num_glyphs = mapping.length
        raw = maxp.raw
        raw[4,2] = [num_glyphs].pack("n")
        return raw
      end

      private

        def parse!
          @version, @num_glyphs, @max_points, @max_contours, @max_component_points,
            @max_component_contours, @max_zones, @max_twilight_points, @max_storage,
            @max_function_defs, @max_instruction_defs, @max_stack_elements,
            @max_size_of_instructions, @max_component_elements, @max_component_depth =
              read(length, "Nn*")
        end
    end
  end
end

Version data entries

34 entries across 34 versions & 10 rubygems

Version Path
ttfunk-1.2.2 lib/ttfunk/table/maxp.rb
ttfunk-1.2.1 lib/ttfunk/table/maxp.rb
ttfunk-1.2.0 lib/ttfunk/table/maxp.rb
ttfunk-1.1.1 lib/ttfunk/table/maxp.rb
ttfunk-1.1.0 lib/ttfunk/table/maxp.rb
ttfunk-1.0.3 lib/ttfunk/table/maxp.rb
ttfunk-1.0.2 lib/ttfunk/table/maxp.rb
ttfunk-1.0.1 lib/ttfunk/table/maxp.rb
davebenvenuti-prawn-0.11.1.pre vendor/ttfunk/lib/ttfunk/table/maxp.rb
piglop-prawn-0.10.2.3 vendor/ttfunk/lib/ttfunk/table/maxp.rb
piglop-prawn-0.10.2.2 vendor/ttfunk/lib/ttfunk/table/maxp.rb
piglop-prawn-0.10.2.1 vendor/ttfunk/lib/ttfunk/table/maxp.rb
glyph_imager-0.1.1 vendor/ttfunk/lib/ttfunk/table/maxp.rb
prawn-0.11.1.pre vendor/ttfunk/lib/ttfunk/table/maxp.rb
goodwill-prawn-edge-0.10.0 vendor/ttfunk/lib/ttfunk/table/maxp.rb
alphasights-prawn-0.10.4 vendor/ttfunk/lib/ttfunk/table/maxp.rb
alphasights-prawn-0.10.3 vendor/ttfunk/lib/ttfunk/table/maxp.rb
alphasights-prawn-0.10.2 vendor/ttfunk/lib/ttfunk/table/maxp.rb
alphasights-prawn-0.10.1 vendor/ttfunk/lib/ttfunk/table/maxp.rb
glyph_imager-0.1.0 vendor/ttfunk/lib/ttfunk/table/maxp.rb