Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Sans Condensed Light not working in Firefox

I have downloaded the Open Sans Condensed Light font from Google Web Fonts, and also attached their CSS code:

<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300&subset=greek-ext&v2'
      rel='stylesheet' type='text/css'>

But every browser other than Firefox, shows exact font family i.e. it looks fine in IE, Chrome, Safari, but not in Firefox.

Here is my CSS and the HTML code:

h2.title-border {
    border-bottom: 1px solid #000;
    margin-top: 10px;
    line-height: 45px;
    margin-bottom: 15px;
}

.heading-sub {
    background: #000;
    font-family: "Open Sans Condensed Light";
    font-weight: normal;
    text-transform: none;
    font-size: 32px;
    padding: 0 15px;
    margin-bottom: 0px;
    color: #fff;
    border-bottom: 1px solid #000;
}

HTML:

<h2 class="title-border"><span class="heading-sub">About Us</span></h2>

Can you please suggest, how should I fix Firefox regarding this?

like image 832
Balkar Kalsi Avatar asked Jun 30 '11 09:06

Balkar Kalsi


4 Answers

I must have tried a gazillion variations to get this work. I am trying to get Open Sans Condensed embedded into a pdf via WKHtmlToPdf.

I think it is important that you download and install the Open Sans Condensed ttf directly from google and install it. It is also important to reboot to allow other services access after install. I downloaded the ttf from font-squirrel originally and condensed was listed as "Open Sans" in windows/fonts, which is wrong, if you look after the google install it is listed as "Open Sans Condensed Light" so even google's local('Open Sans Cond Light') script is wrong.

As mentioned before you need to be explicit with the stretch and weights, so this is what has worked for me:

    @font-face { 
     font-family: 'Open Sans'; 
     font-style: normal; 
     font-weight: 400; 
     src: local('Open Sans');
    }

    @font-face { 
     font-family: 'Open Sans Condensed'; 
     font-stretch:condensed; 
     font-style: normal; 
     font-weight: 300; 
     src: local('Open Sans Condensed Light');
    }

@@font-face { font-family: 'Open Sans Condensed Bold'; font-stretch:condensed; font-style: normal; font-weight: 700; src: local('Open Sans Condensed'), local('Open Sans Condensed Bold');}
like image 101
jenson-button-event Avatar answered Nov 10 '22 08:11

jenson-button-event


According to the API, you should be calling the font like this

<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:light&v1' rel='stylesheet' type='text/css'>

The light variant needs to be called specifically, i.e. :light.

The other browsers are probably ignoring the Light in your stylesheet and giving you the Open Sans Condensed you asked for in the API call.

See here

like image 41
Jason Gennaro Avatar answered Nov 10 '22 08:11

Jason Gennaro


Condensed is the "style" of the "Open Sans" font, not part of the name. This worked for me.

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:Condensed" />


.selector
{
    font-family:'Open Sans';
    font-style:condensed;
}
like image 22
wcloister Avatar answered Nov 10 '22 07:11

wcloister


To make the font work for IE8-IE9 you have to use a EOT font file, On this page you can download the font as a webkit: http://www.fontsquirrel.com/fonts/open-sans-condensed

like image 2
drougen Avatar answered Nov 10 '22 07:11

drougen