class Fontist::Import::Otf::FontFile
Constants
- COLLECTION_ATTRIBUTES
- REQUIREMENTS
- STYLE_ATTRIBUTES
Attributes
Public Class Methods
Source
# File lib/fontist/import/otf/font_file.rb, line 24 def initialize(path) @path = path @info = read @extension = detect_extension end
Public Instance Methods
Source
# File lib/fontist/import/otf/font_file.rb, line 82 def copyright info["Copyright"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 68 def description info["Description"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 38 def family_name info["Family"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 72 def font basename = File.basename(@path, ".*").chomp(".#{@extension}") "#{basename}.#{@extension}" end
Source
# File lib/fontist/import/otf/font_file.rb, line 54 def full_name info["Full name"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 86 def homepage info["Vendor URL"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 90 def license_url info["License URL"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 58 def post_script_name info["PostScript name"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 46 def preferred_family_name info["Preferred family"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 50 def preferred_type info["Preferred subfamily"] end
Source
# File lib/fontist/import/otf/font_file.rb, line 78 def source_font File.basename(@path) unless font == File.basename(@path) end
Source
# File lib/fontist/import/otf/font_file.rb, line 34 def to_collection_style COLLECTION_ATTRIBUTES.map { |name| [name, send(name)] }.to_h.compact end
Source
# File lib/fontist/import/otf/font_file.rb, line 30 def to_style STYLE_ATTRIBUTES.map { |name| [name, send(name)] }.to_h.compact end
Source
# File lib/fontist/import/otf/font_file.rb, line 62 def version return unless info["Version"] info["Version"].gsub("Version ", "") end