Use of Webfonts

Topics: Customizing Orchard, Writing themes
Sep 19, 2012 at 6:56 PM



I am new to orchard and would like to use webfonts.
The gallery of google and the offered quality of the fonts is poor.

So, I would like to use fonts I have generated with fontsquirrel.
I do the reference inside CSS, such as I do it on any regular page.

It seems that orchard is parsing the reference out - so my fonts are not used.

I wonder if someone here has a solution - otherwise this would be the killer argument to nor use orchard - but I am sure I am struggeling because of the knot in my head ;-)

Thank you in advance for the solution.

Sep 19, 2012 at 10:15 PM

Orchard parsing your references out? I can't understand this, Orchrad doesn't touch the content of your stylesheets.

Although I've never tried, this should work just with any stylesheet, as the default TheThemeMachine also includes an external font.

Sep 19, 2012 at 10:47 PM

There is nothing Orchard does, *nothing*, to your css files: they are being served directly by IIS. Orchard does not even glance. I use Google fonts on most of my themes without a problem. Something else is going on. Open your browser's dev tools and look at the network trace.

Sep 20, 2012 at 12:07 AM

I don't think Orchard is the problem here. If your file is a .woff or .svg, your problem more likely lies with IIS. Basically, it doesn't like unknown shizzle. So if your font file is say a .woff , you will need to explicitly tell IIS that it is a-okay. 

Open the web.config file in the Orchard.Web, and insert the code into the relevant section:




     <mimeMap fileExtension=".woff" mimeType="application/x-woff" />



I think this would be the solution. I don't really know much about what I am talking about here. Hope it helps anyway.