class Prawn::SVG::Interface
Constants
- INHERITABLE_OPTIONS
- VALID_OPTIONS
Attributes
Public Class Methods
Source
# File lib/prawn/svg/interface.rb, line 64 def self.font_path Prawn::SVG::FontRegistry.font_path end
backwards support for when the font_path
used to be stored on this class
Source
# File lib/prawn/svg/interface.rb, line 27 def initialize(data, prawn, options, &block) Prawn.verify_options VALID_OPTIONS, options @data = data @prawn = prawn @options = options font_registry = Prawn::SVG::FontRegistry.new(prawn.font_families) @document = Document.new( data, [prawn.bounds.width, prawn.bounds.height], options, font_registry: font_registry, &block ) @renderer = Renderer.new(prawn, document, options) end
Creates a Prawn::SVG
object.
data
is the SVG
data to convert. prawn
is your Prawn::Document object.
See README.md for the options that can be passed to this method.
Public Instance Methods
Source
# File lib/prawn/svg/interface.rb, line 47 def draw @renderer.draw end
Draws the SVG
to the Prawn::Document object.
Source
# File lib/prawn/svg/interface.rb, line 55 def resize(width: nil, height: nil) document.calculate_sizing(requested_width: width, requested_height: height) end