class Fontist::FontFile

Constants

ENCODING_MAC_ROMAN
ENCODING_MS_UNICODE_BMP
LANGUAGE_MAC_ENGLISH
LANGUAGE_MS_ENGLISH_AMERICAN
PLATFORM_MACINTOSH
PLATFORM_MICROSOFT

Public Class Methods

from_collection_index(collection, index) click to toggle source
# File lib/fontist/font_file.rb, line 25
def from_collection_index(collection, index)
  new(build_font_from_collection_index(collection, index))
end
from_content(content) click to toggle source
# File lib/fontist/font_file.rb, line 21
def from_content(content)
  new(build_font(content))
end
from_path(path) click to toggle source
# File lib/fontist/font_file.rb, line 15
def from_path(path)
  content = File.read(path, mode: "rb")

  from_content(content)
end
new(ttfunk_file) click to toggle source
# File lib/fontist/font_file.rb, line 49
def initialize(ttfunk_file)
  @file = ttfunk_file
end

Public Instance Methods

family() click to toggle source
# File lib/fontist/font_file.rb, line 57
def family
  english_name(main_name.font_family)
end
full_name() click to toggle source
# File lib/fontist/font_file.rb, line 53
def full_name
  english_name(main_name.font_name)
end
preferred_family() click to toggle source
# File lib/fontist/font_file.rb, line 65
def preferred_family
  return if main_name.preferred_family.empty?

  english_name(main_name.preferred_family)
end
preferred_subfamily() click to toggle source
# File lib/fontist/font_file.rb, line 71
def preferred_subfamily
  return if main_name.preferred_subfamily.empty?

  english_name(main_name.preferred_subfamily)
end
subfamily() click to toggle source
# File lib/fontist/font_file.rb, line 61
def subfamily
  english_name(main_name.font_subfamily)
end