Module: Compass::Core::SassExtensions::Functions::FontFiles

Included in:
Sass::Script::Functions
Defined in:
lib/compass/core/sass_extensions/functions/font_files.rb

Constant Summary collapse

FONT_TYPES =
{
  :woff => 'woff',
  :otf => 'opentype',
  :opentype => 'opentype',
  :ttf => 'truetype',
  :truetype => 'truetype',
  :svg => 'svg',
  :eot => 'embedded-opentype'
}

Instance Method Summary collapse

Instance Method Details

#font_files(*args) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/compass/core/sass_extensions/functions/font_files.rb', line 20

def font_files(*args)
  return null unless args.any?
  files = []
  with_each_font_file(*args) do |path, type|
    files << list(font_url(path), identifier("format('#{type}')"), :space)
  end
  list(files, :comma)
end

#font_formats(*args) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/compass/core/sass_extensions/functions/font_files.rb', line 12

def font_formats(*args)
  formats = []
  with_each_font_file(*args) do |path, type|
    formats << identifier(type)
  end
  return list(formats, :comma)
end