Class: DragonflyFonts::Processors::WebFriendly

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_fonts/processors/web_friendly.rb

Instance Method Summary collapse

Instance Method Details

#call(content, opts = {}) ⇒ Object

Raises:



4
5
6
7
8
9
10
11
# File 'lib/dragonfly_fonts/processors/web_friendly.rb', line 4

def call(content, opts = {})
  raise UnsupportedFormat unless content.ext
  raise UnsupportedFormat unless FONT_FORGE_SUPPORTED_FORMATS.include?(content.ext.downcase)

  content.shell_update(ext: content.ext || 'ttf') do |old_path, new_path|
    "#{fontforge_command} -script #{DragonflyFonts::SCRIPT_DIR.join('webfonts.pe')} #{old_path} #{new_path}"
  end
end