Sha256: e93a86ca905b3b5a24f3ba69f2a41d8306ccc2bbd9a9ad2f4b59e1b22e32f888

Contents?: true

Size: 546 Bytes

Versions: 30

Compression:

Stored size: 546 Bytes

Contents

require_relative "base_index"

module Fontist
  module Indexes
    class PreferredFamilyFontIndex < BaseIndex
      def self.path
        Fontist.formula_preferred_family_index_path
      end

      def add_formula(formula)
        formula.fonts.each do |font|
          font.styles.each do |style|
            font_name = style.preferred_family_name || font.name
            add_index_formula(font_name, formula.to_index_formula)
          end
        end
      end

      def normalize_key(key)
        key.downcase
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fontist-1.13.0 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.12.0 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.7 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.6 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.5 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.3 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.2 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.11.1 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.10.1 lib/fontist/indexes/preferred_family_font_index.rb
fontist-1.10.0 lib/fontist/indexes/preferred_family_font_index.rb