Fonts included with @font-face are not rendered
-
I’d like to start with the statement that I’ve read anything google could show me on the subject.
I have a subdir “fonts” of my /wp-content/themes/theme-name dir. In this “fonts” dir I have 5 files: 4 font files, generated by FontSquirrel (robotocondensed-regular-webfont.eot, robotocondensed-regular-webfont.woff, robotocondensed-regular-webfont.ttf, robotocondensed-regular-webfont.svg) and one css file (fonts.css). The contents of fonts.css is this:
@font-face { font-family: 'Roboto Condensed'; src: url('robotocondensed-regular-webfont.eot'); src: url('robotocondensed-regular-webfont.eot?#iefix') format('embedded-opentype'), url('robotocondensed-regular-webfont.woff') format('woff'), url('robotocondensed-regular-webfont.ttf') format('truetype'), url('robotocondensed-regular-webfont.svg#robotocondensed') format('svg'); font-weight: normal; font-style: normal; }
I am referencing fonts.css with the following code in my /wp-content/themes/theme-name/header.php:
<link rel="stylesheet" type="text/css" href="<?php get_site_url(); ?>/wp-content/themes/theme-name/fonts/fonts.css" />
No fonts are rendering under any browser. Why?
However, when I unzip the contents of FontSquirrel’s zip file in a its own subdir of the /wp-content/themes/theme-name/ dir, and open FontSquirrel’s html demo of the font, the font loads normally.
I have not modified .htaccess or any other settings at server level. I’m running an Apache server.
Any help towards making the fonts render is welcome. Thank you! 🙂
- The topic ‘Fonts included with @font-face are not rendered’ is closed to new replies.