frameit/lib/frameit/editor.rb
# The font we want to use
The font we want to use
The font we want to use
def font(key)
      single_font = fetch_config[key.to_s]['font']
      return single_font if single_font
      fonts = fetch_config[key.to_s]['fonts']
      if fonts
        fonts.each do |font|
          if font['supported']
            font['supported'].each do |language|
              if screenshot.path.include?(language)
                return font["font"]
              end
            end
          else
            UI.verbose("Found a font with no list of supported languages, using this now")
            return font["font"]
          end
        end
      end
      UI.verbose("No custom font specified for #{screenshot}, using the default one")
      return nil
    end
def font ( key ) single_font = fetch_config [ key . to_s ] [ 'font' ] return single_font if single_font fonts = fetch_config [ key . to_s ] [ 'fonts' ] if fonts fonts . each do | font | if font [ 'supported' ] font [ 'supported' ] . each do | language | if screenshot . path . include? ( language ) return font [ "font" ] end end else UI . verbose ( "Found a font with no list of supported languages, using this now" ) return font [ "font" ] end end end UI . verbose ( "No custom font specified for #{screenshot}, using the default one" ) return nil end
The font we want to use
The font we want to use
# No `supported` array, this will always be true
key
<not_specific>