Class: Fontist::SystemIndex::PreferredFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/fontist/system_index.rb

Instance Method Summary collapse

Instance Method Details

#family_name(name) ⇒ Object



23
24
25
# File 'lib/fontist/system_index.rb', line 23

def family_name(name)
  name.preferred_family || name.family
end

#transform_override_keys(dict) ⇒ Object



31
32
33
34
# File 'lib/fontist/system_index.rb', line 31

def transform_override_keys(dict)
  mapping = { preferred_family_name: :family_name, preferred_type: :type }
  dict.transform_keys! { |k| mapping[k] }
end

#type(name) ⇒ Object



27
28
29
# File 'lib/fontist/system_index.rb', line 27

def type(name)
  name.preferred_subfamily || name.subfamily
end