Sha256: a7964d47f5e86601e2c5668dee07ef0b7296cf3666cf52d34361ce1985ae805d

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

# coding: utf-8
require 'font_forge/model/abstract'

module FontForge
  class << self
    def convert(input, output)
      script_path = File.join(File.dirname(File.expand_path(__FILE__)), "font_forge/script/convert.sh")
      system "fontforge -script '#{script_path}' '#{input}' '#{output}'"
    end

    def parse(file_path)
      script_path = File.join(File.dirname(File.expand_path(__FILE__)), "font_forge/script/parse.sh")
      stdout_str = `fontforge -script '#{script_path}' '#{file_path}'`.split("\n")
      {
        font_name: stdout_str[0],
        full_name: stdout_str[1],
        family_name: stdout_str[2]
      }
    end
    alias_method :🔍, :parse
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
font-converter-0.1.3 lib/font-converter.rb
font-converter-0.1.2 lib/font_forge.rb