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

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

13 Answers 1221 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dustin
Top achievements
Rank 1
Dustin asked on 25 Oct 2012, 02:57 PM
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?

13 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 25 Oct 2012, 03:33 PM
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!
0
Dustin
Top achievements
Rank 1
answered on 25 Oct 2012, 03:35 PM
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.
0
Dimo
Telerik team
answered on 25 Oct 2012, 03:47 PM
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!
0
Dustin
Top achievements
Rank 1
answered on 25 Oct 2012, 04:29 PM

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);


0
PennNRT
Top achievements
Rank 1
answered on 14 Nov 2012, 08:48 PM
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.
0
Dustin
Top achievements
Rank 1
answered on 20 Nov 2012, 08:43 PM
use this instead when declaring your kendoEditor. Just override the messages used for the inherited styles.

element.kendoEditor({
                messages: {
                    fontNameInherit: "Trebuchet MS",
                    fontSizeInherit: "10pt"
                }
});
0
Tayger
Top achievements
Rank 1
Iron
answered on 07 Feb 2015, 01:55 PM
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)


0
Tayger
Top achievements
Rank 1
Iron
answered on 07 Feb 2015, 05:19 PM
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.




0
Tayger
Top achievements
Rank 1
Iron
answered on 07 Feb 2015, 05:21 PM
Forgot to mention that fonts with more than one word are displayed in quotes. :(
0
Alex Gyoshev
Telerik team
answered on 11 Feb 2015, 02:34 PM

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!
 
0
Tayger
Top achievements
Rank 1
Iron
answered on 13 Feb 2015, 11:05 PM
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
0
TiborG
Top achievements
Rank 1
answered on 17 Feb 2015, 04:22 PM
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.
0
TiborG
Top achievements
Rank 1
answered on 17 Feb 2015, 04:23 PM
Hi Tayger,

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

Thanks!
Tags
Editor
Asked by
Dustin
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Dustin
Top achievements
Rank 1
PennNRT
Top achievements
Rank 1
Tayger
Top achievements
Rank 1
Iron
Alex Gyoshev
Telerik team
TiborG
Top achievements
Rank 1
Share this question
or