Using @font-face with Rails 3.1 app?

前端 未结 7 1769
青春惊慌失措
青春惊慌失措 2020-12-02 08:23

I\'m having trouble using the following @font-face declaration to work with my Rails 3.1 app. I put the fonts in the Asset Pipeline in its own folder called \"

相关标签:
7条回答
  • 2020-12-02 09:16

    While this is late, you could use Compass's +font-face mix-in to avoid all this trouble. The mixin helps your life easier by

    1. Not remember the awful caveats of the traditional font-face decleration

    2. It internally handles url_helper and format declarations for you

    3. It's far easier to remember

    It is declared the following way madams and gentlemen:

    +font-face("#{$font-name}",
      font-files("#{$font-name}.woff", woff, 
      "#{$fontFileName}.ttf", ttf, 
      "#{$fontFileName}.svg", svg), "#{$fontFileName}.eot", normal, normal);
    
    0 讨论(0)
提交回复
热议问题