Problem with google Font Names

4 posts, 0 answers
  1. Ted
    Ted avatar
    3 posts
    Member since:
    Mar 2016

    Posted 20 Apr Link to this post

     

    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.

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 22 Apr Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ted
    Ted avatar
    3 posts
    Member since:
    Mar 2016

    Posted 28 Apr Link to this post

    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.

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 03 May Link to this post

    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.
Back to Top