Editor - Remove (inherited font) and (inherited size)

14 posts, 0 answers
  1. Dustin
    Dustin avatar
    79 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2012 Link to this post

    When you select and element in the editor the font name and font size in the toolbar display "inherited font" and "inherited size" in their respective toolbar control if that is the default font name and family for the content. How can you remove this so it displays the actual font name and size? This seems like a useless feature, because users don't always know what the default font name/size is and they want to see the actual value not "inherited". That doesn't make sense to me.

    Eitherway, how can I remove this inherited value/text so it displays the actual value of the selected item. I see that in the code you always add the "inhertied" option to both of those tools, so how do i remove this functionality?
  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 25 Oct 2012 Link to this post

    Hello Dustin,

    The current implementation of the Editor does not allow these options to be removed, I am sorry.

    Regards,
    Dimo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Dustin
    Dustin avatar
    79 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2012 Link to this post

    Can you please add this option or remove the "inherited" value? I don't understand how this is useful in anyway. Why would the user want to see "inherited" and not the actual value. That makes no sense and you guys add something and wasted time on a feature that adds no value to our end users, none.
  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 25 Oct 2012 Link to this post

    We will consider adding the discussed behavior in the future. In the meantime, you can add and vote for the feature request in Kendo UI UserVoice

    Regards,
    Dimo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Dustin
    Dustin avatar
    79 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2012 Link to this post

    I found a way to override this. Do the below in the select event of the editor...

    var mainToolbar = editor.wrapper.find("tr:first-child .k-editor-toolbar");
        var toolbar = editor.wrapper.find("#miniSelectionToolbar");
        var tools = editor.options.tools;
        var range = editor.getRange();
        var nodes = [range.startContainer];
        var selectionFontName = tools.fontName.finder.getFormat(nodes);
        var selectionFontSize = tools.fontSize.finder.getFormat(nodes);
     
        // set main toolbar fontname and fontsize b/c it uses the inherit
        mainToolbar.find(".k-fontName").data("kendoDropDownList").text(selectionFontName);
        mainToolbar.find(".k-fontSize").data("kendoDropDownList").value(selectionFontSize);


  7. PennNRT
    PennNRT avatar
    1 posts
    Member since:
    May 2012

    Posted 14 Nov 2012 Link to this post

    Dustin-

    Is there more to your example?  I'd like to remove those options from the dropdowns but after implementing your solution, the only difference I see if that "inherited font" changes to "inherit" when the editor gains focus.
  8. Dustin
    Dustin avatar
    79 posts
    Member since:
    Oct 2012

    Posted 20 Nov 2012 Link to this post

    use this instead when declaring your kendoEditor. Just override the messages used for the inherited styles.

    element.kendoEditor({
                    messages: {
                        fontNameInherit: "Trebuchet MS",
                        fontSizeInherit: "10pt"
                    }
    });
  9. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 07 Feb 2015 in reply to Dimo Link to this post

    I'm sad to read that but glad to know. First it confused me: 
    a) Where does it come from?
    b) What does it mean?

    I know now what it means, but it not only confuses me as a developer it will confuse editor users. This is a kind of technical information that is not easy to explain to (non IT) users. All over its not WYSIWYG. What I enter in the editor might not look like what comes out after. The style of (inherited font/size) looks different inside the editor than what will happen when the entered editor text is displayed in a html page. I would wish that this confusing inherit-thingy would be removed or disable-able in a future version. Furthermore it would be nice to set a default font family style. http://en.wikipedia.org/wiki/Don't_Make_Me_Think ;o)


  10. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 07 Feb 2015 in reply to Dustin Link to this post

    Tried it as well but doesn't seem to work. It will be displayed next to others. 
    I found a workaround for fonts but not for fontsize:
    ...
     messages: {
        fontNameInherit: "Arial"


    AND on "tools" parameter:
    ...
    {
                        name: "fontName",
                        items: [].concat(
                            kendo.ui.Editor.prototype.options.fontName[2],
                            [{ text: "Andale Mono", value: "Andale Mono" },
    { text: "Arial Black", value: "Arial Black" },
    { text: "Comic Sans MS", value: "Comic Sans MS" },
    { text: "Courier New", value: "Courier New" },
    { text: "Garamond", value: "Garamond, serif" },
    { text: "Georgia", value: "Georgia" },
    { text: "Impact", value: "Impact" },
    { text: "Times New Roman", value: "Times New Roman" },
    { text: "Trebuchet MS", value: "Trebuchet MS" },
    { text: "Verdana", value: "Verdana" },
    { text: "Webdings", value: "Webdings" }
    ]
                        )
                    }

    All open fonts w/o "Arial". All displays fine so fair, Arial in the beginning. 
    It's a nasty workaround, but it works.




  11. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 07 Feb 2015 in reply to Tayger Link to this post

    Forgot to mention that fonts with more than one word are displayed in quotes. :(
  12. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 11 Feb 2015 Link to this post

    Hello Farai,

    >  The style of (inherited font/size) looks different inside the editor than what will happen when the entered editor text is displayed in a html page. I would wish that this confusing inherit-thingy would be removed or disable-able in a future version.
    This is what inherited font means, that the font is inherited from the surrounding page and is not predefined. What do you expect that the editor will export if this is disabled? If you want to make the experience as much WYSIWYG as it could be, use the inline editing functionality.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  13. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 13 Feb 2015 in reply to Alex Gyoshev Link to this post

    Hello Alex
    I exactly know what you mean and I don't know any better technical short description than "inherited fonts". From the view of non IT persons its confusing because they don't know what it means. Something like "Default" would probably more readable for them or that the default font is font that developers can choose. All over I'm pointing to a very tiny problem. It's all ok for me, I've found a workaround how I can handle it.

    Regards
  14. Radu
    Radu avatar
    34 posts
    Member since:
    Oct 2012

    Posted 17 Feb 2015 in reply to Alex Gyoshev Link to this post

    Hi Alex,

    >This is what inherited font means, that the font is inherited from the surrounding page and is not predefined. What do you expect that the editor will export if this is disabled?

    How about to export a preconfigured font and size? Any end user would expect a behavior similar to MS-Word. This inherited font/size is very confusing and provides poor user experience.
  15. Radu
    Radu avatar
    34 posts
    Member since:
    Oct 2012

    Posted 17 Feb 2015 in reply to Tayger Link to this post

    Hi Tayger,

    Did you managed to also find a workaround for font size as well?

    Thanks!
Back to Top
Kendo UI is VS 2017 Ready