Skip navigation
Firemans Run
Currently Being Moderated

@font-face

Feb 3, 2013 4:10 PM

I'm having trouble getting this @font-face to work...frustrating. Does anyone have any ideas? I'm working locally. My code:

 

HTML

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

 

<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />

 

<title>Untitled Document</title>

 

</head>

 

<body>

 

<div class="sanchezregular">Why won't this font work??</div>

 

</body>

</html>

 

 

CSS

  

/*

* Web Fonts from fontspring.com

*

* All OpenType features and all extended glyphs have been removed.

* Fully installable fonts can be purchased at http://www.fontspring.com

*

* The fonts included in this stylesheet are subject to the End User License you purchased

* from Fontspring. The fonts are protected under domestic and international trademark and

* copyright law. You are prohibited from modifying, reverse engineering, duplicating, or

* distributing this font software.

*

* (c) 2010-2012 Fontspring

*

*

*

*

* The fonts included are copyrighted by the vendor listed below.

*

* Vendor:      Latinotype

* License URL: http://www.fontspring.com/fflicense/latinotype

*

*

*/

 

@font-face {

    font-family: 'sanchezregular';

    src: url('Sanchez-Regular-webfont.eot');

    src: url('Sanchez-Regular-webfont.eot?#iefix') format('embedded-opentype'),

         url('Sanchez-Regular-webfont.woff') format('woff'),

         url('Sanchez-Regular-webfont.ttf') format('truetype'),

         url('Sanchez-Regular-webfont.svg#sanchezregular') format('svg');

    font-weight: normal;

    font-style: normal;

    font-sizs: 18pt;

}

 
Replies
  • Currently Being Moderated
    Feb 3, 2013 4:52 PM   in reply to Firemans Run
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 4, 2013 4:25 AM   in reply to Firemans Run

    > to put the font folder where the CSS file is located

     

    If your fonts are in "font" folder, the url should be src: url('font/Sanchez-Regular-webfont.eot'); (Relative to the css file.)

     

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.uk/

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 4, 2013 6:10 AM   in reply to kennethkawamoto2

    Also, @font-face does not preview correctly in IE9 from a local file by default. 

     

    You can switch to IE8 mode to see if the font rule is written correctly.

     

    It will preview in Firefox without issue too.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points