Help with my project that uses custom font files

Posted by Community Admin on 04-Aug-2018 22:46

Help with my project that uses custom font files

All Replies

Posted by Community Admin on 14-Dec-2011 00:00


So I have a project that uses custom fonts that get served down to the client via IIS6.  IIS is configured properly with the mime types being declared so that they can be sent to the browsers.  I've previously got the project to work in pure ASP.NET pages so I know the font files / server configuration is correctly setup. 

I've referenced the fonts as follows in the CSS file (Just showing one for example):
@font-face
    font-family: 'TizaRegular';
    src: url('Types/tiza-webfont.eot');
    src: url('Types/tiza-webfont.eot?#iefix') format('embedded-opentype'),
         url('Types/tiza-webfont.woff') format('woff'),
         url('Types/tiza-webfont.ttf') format('truetype'),
         url('Types/tiza-webfont.svg#TizaRegular') format('svg');
         font-weight: normal;
         font-style: normal;


These fonts are stored in a folder called 'Types' located in the 'Global' folder where the calling .css file resides.  These fonts aren't however being applied to the asp:contentholders that they are designed for once a CMS user has entered text into the contentholder.  I've seen the instructions on adding fonts to the rad editor, content / blogs controls etc etc. and was wondering exactly what steps I need to take so that my site will recognize the custom font files that I have created so they can be used throughout the site  eg.  where do i put the font files physically in the project?  Is there any configuration files that need to be setup with references to the custom fonts?   What steps am I missing in general to be able to use my custom font files?  Thanks in advance.

For more info, this is how I have a class delcared in the CSS File:
.BottomTitle

    font-family:"TizaRegular";
    width:240px;
    font-size:12pt;
    color:#754200;   
    padding-left:33px;
    padding-top:10px;


And how I reference it in the master page:
               
<div class=BottomTitle><asp:ContentPlaceHolder ID="BottomLeftTitle" runat="server"/></div>

Posted by Community Admin on 19-Dec-2011 00:00

Hi Drew,

It seems that your configurations are correct. We've tested the scenario by adding custom css fonts to a Sitefinity project and the same settings did the job. Can you check in the NET tab of Firebug whether your fonts are loaded? Also, some information about your theme and its location will be useful. Is it in ~/App_Data/Sitefinity/WebsiteTemplates/ ? it is possible that the problem might be browser related. Do you get the same behavior in all browsers?

Greetings,
Jen Peleva
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 19-Dec-2011 00:00

I currently have the following directories:
~/App_Data/Sitefinity/WebsiteTemplates/Craft3/App_Master  : master pages
~/App_Data/Sitefinity/WebsiteTemplates/Craft3/App_Themes/c3Theme/Images
~/App_Data/Sitefinity/WebsiteTemplates/Craft3/App_Themes/c3Theme/Global  -> CSS files here
~/App_Data/Sitefinity/WebsiteTemplates/Craft3/App_Themes/c3Theme/Global/Types ->  font files are here.

I have tested it in Safari, Chrome, Firefox, IE.  Will check FireBug next and report the results.  Also for what it's worth, I haven't done anything special with the font files within Sitefinity, I simply dropped the files into the folder on the machine and then referenced them in the CSS file.

Posted by Community Admin on 19-Dec-2011 00:00

Here's the results in Firebug, it's kind of weird because it shows the first load as failing, then shows that they are loaded successfully after that.  Any ideas?

Posted by Community Admin on 19-Dec-2011 00:00

I'm guessing the first load of fonts is failing because that is for the IE specific fonts and the second set is loading fine because that is the firefox compliant set of fonts, which brings me back to my original problem then.

Posted by Community Admin on 20-Dec-2011 00:00

Hello Drew,

I consulted with my front-end colleagues, but we weren't able to determine why your fonts aren't loaded on first request. I will advise you to open a support ticket and send us your theme together with the fonts, so that we would try to set them on our project and see if the issue reproduces.

Best wishes,
Jen Peleva
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed