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

Problem with google Font Names

3 Answers 67 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ted
Top achievements
Rank 1
Ted asked on 20 Apr 2016, 07:00 AM

 

Hi,

Will editor supports Google  fonts  "Roboto" and "Playfair Display" ? We already add this fonts to editor font name collections

I have downloaded and add this font to my machine, but still when i select this font in editor font dropdown the selected text not changed.

Is there any way to embed this fonts to Radeditor instead of installing in client machine.

 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 22 Apr 2016, 10:40 AM
Hi Ted,

If you are using the iframe content area mode, fonts should be injected in the iframe's window. You can do so by using the CssFiles approach and loading the font by using a CSS file that loads the font. 

Optionally, you can switch to Div content area mode which will not utilize an iframe and fonts loaded on the page will be available for the content area too.

Regards,
Ianko
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Ted
Top achievements
Rank 1
answered on 28 Apr 2016, 07:02 AM

Hi Lanko,

Thanks for the response and we are able to apply Google fonts now.

Now we want to display the font names in the dropdown with customised names, is it possible to do ?

eg: Arial   --->  Arial (Default)
    Roboto  --->  Roboto (for testimonials)

Thanks.

0
Ianko
Telerik team
answered on 03 May 2016, 05:44 AM
Hi Ted,  

I am afraid the values in the FontNames dropdown cannot be customized as the same are used for the inline styles when this tool is used. 

As a custom solution you can handle the OnClientCommandExecuting and change dynamically the value to be set. For example:
<telerik:RadEditor runat="server" ID="RadEditor1" OnClientCommandExecuting="OnClientCommandExecuting">
    <FontNames>
        <telerik:EditorFont Value="My Arial" />
    </FontNames>
</telerik:RadEditor>
 
<script>
    function OnClientCommandExecuting(sender, args) {
        var value = args.get_value();
 
        switch (value) {
            case "My Arial":
                args.set_value("Arial");
                break;
            default:
                break;
        }
    }
</script>


Regards,
Ianko
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Editor
Asked by
Ted
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Ted
Top achievements
Rank 1
Share this question
or