Sha256: f9fd01d6073de7fd24ee7dd7f6e4425b9963137c6e8da32cac6e394a05ed34a9
Contents?: true
Size: 1.29 KB
Versions: 1
Compression:
Stored size: 1.29 KB
Contents
#!/usr/bin/env ruby require 'rubygems' $:.unshift File.join(File.dirname(__FILE__), "..", "lib") require 'fontprocessor' require 'optparse' require 'fileutils' options = { :characters => -1..1000, :character_set_name => "1", :license_url => "http://localhost", } opts = OptionParser.new do |opts| opts.on("-n", "--char-set-name NAME", "name of the character set (default: #{options[:character_set_name]})") { |name| options[:character_set_name] = name } opts.on("-c", "--characters N..N", "range of characters to include (default: #{options[:glyphs]})") { |characters| options[:characters] = eval(characters) } opts.on_tail("-h", "--help", "Show help") { puts opts exit } end if not ARGV.length == 1 puts "USAGE: process <filename.otf>" exit 0 end filename = ARGV.first basename = File.basename(ARGV.first).gsub('..', '').split('.')[0] FileUtils.mkdir_p(basename) FileUtils.cp(filename, File.join(basename, "#{basename}.otf")) naming_strategy = FontProcessor::FontFileNamingStrategy.new("#{basename}.otf", basename) char_set = FontProcessor::CharSet.new(options[:character_set_name], :characters => [options[:characters]]) processor = FontProcessor::Processor.new(naming_strategy, options[:license_url], "01") processor.preprocess processor.generate_char_set(char_set, 400, :normal)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fontprocessor-27.1.3 | bin/process-file |