Class: Fontist::Indexes::PreferredFamilyFontIndex

Inherits:
Lutaml::Model::Collection
  • Object
show all
Includes:
IndexMixin
Defined in:
lib/fontist/indexes/preferred_family_font_index.rb

Overview

YAML file structure:


adobe arabic:

  • adobe_reader_19.yml

myriad pro:

  • adobe_reader_20.yml

akabara-cinderella:

  • akabara-cinderella.yml

andale mono:

  • andale.yml

  • macos/andale_mono.yml

  • opensuse_webcore_fonts.yml

  • pclinuxos_webcore_fonts.yml

Class Method Summary collapse

Instance Method Summary collapse

Methods included from IndexMixin

#add_formula, #add_index_formula, #build, included, #load_formulas, #load_index_formulas, #to_file

Class Method Details

.pathObject



30
31
32
# File 'lib/fontist/indexes/preferred_family_font_index.rb', line 30

def self.path
  Fontist.formula_preferred_family_index_path
end

Instance Method Details

#index_key_for_style(style) ⇒ Object



34
35
36
# File 'lib/fontist/indexes/preferred_family_font_index.rb', line 34

def index_key_for_style(style)
  style.preferred_family_name || style.family_name
end

#normalize_key(key) ⇒ Object



38
39
40
# File 'lib/fontist/indexes/preferred_family_font_index.rb', line 38

def normalize_key(key)
  key.downcase
end