Class: DragonflyFonts::Analysers::GsubTables

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_fonts/analysers/gsub_tables.rb

Instance Method Summary collapse

Instance Method Details

#call(content) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dragonfly_fonts/analysers/gsub_tables.rb', line 6

def call(content)
  return [] unless content.ext
  return [] unless FONT_FORGE_SUPPORTED_FORMATS.include?(content.ext.downcase)

  # details = content.shell_eval do |path|
  #   "#{DragonflyFonts::SCRIPT_DIR.join('gsub_tables.py')} #{path}"
  # end

  command = "#{DragonflyFonts::SCRIPT_DIR.join('gsub_tables.py')} #{content.path}"
  details, stderr_str, status = Open3.capture3(command)

  return [] unless details.present?

  JSON.parse(details)
end