This is a migrated thread and some comments may be shown as answers.

Disable Google Font API calls at AJAX controls completely

3 Answers 936 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Netrange
Top achievements
Rank 1
Netrange asked on 08 Sep 2017, 09:09 AM

Hello,

Because of design requirements we don't want to load fonts from google fonts api.
We are using Telerik AJAX controls V2017.2.711.45.

I already read the following article about providing the Roboto font, if no internet connection exists. 
But this solution only overrides the font but still calls the api and I want to completely remove the api calls.
Mentioned reference:
http://www.telerik.com/support/kb/aspnet-ajax/details/use-material-skin-without-active-internet-connection

Even if I select a theme with no Roboto font in it (like Bootstrap for example) the api gets called.
Is there a setting to disable this call?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Ivan Zhekov
Telerik team
answered on 13 Sep 2017, 10:18 AM
We've decided to completely drop Roboto Font references from our code and instead provide an article how it can be included.

The change is scheduler for 2017 R3 SP1. 

Regards,
Ivan Zhekov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rumen
Telerik team
answered on 22 Sep 2017, 03:13 PM
After additional research we decided to not remove the roboto font references to https://fonts.gstatic.com from the Material skin because:

- this is going to be a huge breaking change
- the Use Material Skin Without Active Internet Connection solution works properly, i.e. you can host a local CDN server and replace the references to the roboto font with references to a local file in the \skins\ajax\2017.3.913\common\fonticons.css file:

 

@font-face {
  font-family'Roboto';
  font-stylenormal;
  font-weight400;
  srclocal("Roboto"), local("Roboto-Regular"),url(https://somelocalfont/s/roboto/v15/2UX7WLTfW3W8TclTUvlFyQ.woffformat("woff"),url(https://somelocalfont/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; }
 
@font-face {
  font-family'Roboto';
  font-stylenormal;
  font-weight500;
  srclocal("Roboto Medium"), local("Roboto-Medium"),url(https://somelocalfont.woffformat("woff"),url(https://somelocalfont/s/roboto/v15/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; }

 

For your convenience I have recorded a video which shows the whole procedure: https://www.screencast.com/t/rPsVj953e0Z. As you can see the modification of the fonticons.css stopped the calls to https://fonts.gstatic.com so you can use this as a solution for your scenario.



Kind regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rumen
Telerik team
answered on 06 Dec 2019, 01:55 PM

Hi all,

 I'd like to share yet another solution which will allow you to remove completely the google font without the need of local CDN.

The solution is to register a @font-face for the Roboto font with src: local("Arial"); 

The Arial font is popular and existing on all client machines, so it will override the Roboto src and the Telerik AJAX controls won't make requests to fonts.gstatic.com:

<style>
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: local("Arial");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    src: local("Arial");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
</style>
<telerik:RadEditor ID="RadEditor1" Skin="Material" runat="server"></telerik:RadEditor>

For your convenience I have attached a video recording showing the complete solution.

 

Regards,
Rumen
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Netrange
Top achievements
Rank 1
Answers by
Ivan Zhekov
Telerik team
Rumen
Telerik team
Share this question
or