Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve 26 posts 46 karma points
    Mar 31, 2015 @ 18:34
    Steve
    0

    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.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 31, 2015 @ 21:16
    Jan Skovgaard
    0

    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.config

    <staticContent>
         <remove fileExtension=".eot" />
              <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
              <remove fileExtension=".otf" />
              <mimeMap fileExtension=".otf" mimeType="font/otf" />
              <remove fileExtension=".woff" />
              <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
    </staticContent>
    

    You 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

  • Steve 26 posts 46 karma points
    Mar 31, 2015 @ 22:19
    Steve
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 05:17
    Jan Skovgaard
    0

    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

  • Steve 26 posts 46 karma points
    Apr 01, 2015 @ 16:14
    Steve
    0

    ok, well we can't use them locally due to our agreement. Have to use absolute url. thx

  • Steve 26 posts 46 karma points
    Apr 02, 2015 @ 20:17
    Steve
    0

    turns out it was a firewall restriction disabling the path to the font hosting domain. It's been fixed. thx

Please Sign in or register to post replies

Write your reply to:

Draft