Note that there are some explanatory texts on larger screens.

plurals
  1. POHeroku and @font-face - embedded fonts wont display on Heroku
    primarykey
    data
    text
    <p>I have a few <strong>licensed</strong> fonts that I have embedded into my Rails app using the CSS <code>@font-face</code> tag. These fonts are located in the <code>"../Public/Fonts/"</code> path in my Rails 3 app and render perfectly on any local machine that I pull down the repo and run on.</p> <p>However when I push my app to Heroku it can't seem to find the fonts. You can tell that it's looking in the font directory but can never access them. It doesn't seem to matter where I place the fonts or how I type the font path in the @font-face declaration.</p> <p>My fonts are located at <code>#{RAILS.root}/public/fonts/ChunkFive</code></p> <p>Here is my @font-face declaration:</p> <pre><code>@font-face { font-family: "ChunkFive"; src: url("../fonts/ChunkFive/ChunkFive-webfont.eot"); src: local("?"), url("../fonts/ChunkFive/ChunkFive-webfont.woff") format("woff"), url("../fonts/ChunkFive/ChunkFive-webfont.ttf") format("truetype"), url("../fonts/ChunkFive/ChunkFive-webfont.svg") format("svg"); } </code></pre> <p>Here is the 404 resource not found message I get for each font:</p> <pre><code>Request URL:http://thedanbarrett.heroku.com/fonts/ChunkFive/ChunkFive-webfont.woff Request Method:GET Status Code:404 Not Found Request Headers Referer:http://thedanbarrett.heroku.com/home User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML,like Gecko) Chrome/8.0.552.224 Safari/534.10 Response Headers Age:0 Connection:keep-alive Content-Length:727 Content-Type:text/html Date:Wed, 05 Jan 2011 15:25:21 GMT Server:nginx/0.7.67 Via:1.1 varnish X-Runtime:0.001344 X-Varnish:764492621 </code></pre> <p>The strange thing is that it finds and loads stylesheets, icons, and images in the same root folder. Just to reiterate the fonts embed and work perfectly run from a local server, even on hosts that don't have the font installed.</p> <p>I did find one reference online to someone that was having a similar issue who changed their <strong>config.ru</strong> and <strong>environment.rb</strong> files to make it friendly with Heroku, but I can't seem to find it.</p> <p>Thanks in advance SO minions for all your help!</p> <p>~Dan</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload