Heroku and Google Fonts

Change link to HTTPS

<link href='https://fonts.googleapis.com/css?family=some_kinda_font' rel='stylesheet' type='text/css'>

A better approach is to leave off the protocol altogether and just start with '//'. The correct protocol (HTTP or HTTPS) will be used depending on server context

<link href='//fonts.googleapis.com/css?family=some_kinda_font' 
rel='stylesheet' type='text/css'>

I discovered that heroku sets security parameters for using the google fonts url. It wants to use the https instead of plain http. Here's what worked for me.

Instead of:

@import url('http://fonts.googleapis.com/css?family=Oswald:400,700,300');

I used

@import url('//fonts.googleapis.com/css?family=Oswald:400,700,300');

If you notice the second line leaves out the http, allowing heroku to use https. I'm assuming you could probably use https in the link if you wanted to.


Simply use HTTPS instead of HTTP:

<%= stylesheet_link_tag "application", 'https://fonts.googleapis.com/css?family=<font_name>', :media => "all" %>

Tags:

Fonts

Heroku