Hi my site is loading a font from a cloud based source. We have created a folder "font" on the server where the fonts are un-zipped into. I am not using the "media" section in umbraco to store the fonts. Dos umbraco allow this?
The fonts are being loaded in the tag. Should I use @fontface?
What font service are you using? Usually the services offer an option to include the fonts using the <link> element. But if you have downloaded them you'll need to include them using @font-face - A good write up on this is made by Chris Coyer here https://css-tricks.com/snippets/css/using-font-face/
The fonts should never be uploaded into Umbraco since it's something that you just want to have placed on a folder on the disk like your javascript and css assets.
However you might need to add these lines in your web.config to avoid mime-type issues. You can add the mime types on a server level but I prefer adding them at the application level since I'm not always in control of the server once the project is about to go live.
So you can place the below in the <staticContent> part of the web.config
Hi Jan we're using cloud.typography.com for font hosting. I have to coordinate with my associate who has server access for the mime changes in the web.config. Hopefully that works.
Ok, but adding the mime types only makes sense if you download the fonts locally and set them up in your css manually. If they provide an option to embed the fonts using <link> then I'll recommend you use that instead though.
accessing fonts from folder on server
Hi my site is loading a font from a cloud based source. We have created a folder "font" on the server where the fonts are un-zipped into. I am not using the "media" section in umbraco to store the fonts. Dos umbraco allow this?
The fonts are being loaded in the tag. Should I use @fontface?
thx.
Hi Steve
What font service are you using? Usually the services offer an option to include the fonts using the
<link>
element. But if you have downloaded them you'll need to include them using @font-face - A good write up on this is made by Chris Coyer here https://css-tricks.com/snippets/css/using-font-face/The fonts should never be uploaded into Umbraco since it's something that you just want to have placed on a folder on the disk like your javascript and css assets.
However you might need to add these lines in your web.config to avoid mime-type issues. You can add the mime types on a server level but I prefer adding them at the application level since I'm not always in control of the server once the project is about to go live.
So you can place the below in the
<staticContent>
part of the web.configYou can see other mime-types that might be nice to add in the web.config here https://github.com/darktable/html5-boilerplate-server-configs/blob/master/web.config
I hope this makes sense and answers your question.
/Jan
Hi Jan we're using cloud.typography.com for font hosting. I have to coordinate with my associate who has server access for the mime changes in the web.config. Hopefully that works.
thx
Hi Steve
Ok, but adding the mime types only makes sense if you download the fonts locally and set them up in your css manually. If they provide an option to embed the fonts using
<link>
then I'll recommend you use that instead though./Jan
ok, well we can't use them locally due to our agreement. Have to use absolute url. thx
turns out it was a firewall restriction disabling the path to the font hosting domain. It's been fixed. thx
is working on a reply...