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

Default font and fontsize

1 Answer 2603 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ufficio Acquisti
Top achievements
Rank 1
Ufficio Acquisti asked on 06 Apr 2016, 10:29 AM

Hi,

I've got a problem with your textarea under angularjs.

I need to initialize control as you can check here:

http://dojo.telerik.com/IxEKI

but, when there's no text, i DON'T want "inherited font" and "inherited size" as default selection for comboboxes, i have to select fontsize and fonttye from settings i read on my setting db.

When something is written inside, it's accettable selection mentioned above... really it would be better if selection correstond to the font and size used to write text present inside.

Thanks a lot

Matteo

1 Answer, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 07 Apr 2016, 10:36 AM

Hello,

The value of the font-size and font-name drop-downs depend on the selected text in the editor content area. The inherited value actually signifies the lack of any explicitly defined font-size or font-name for the selected element. Therefore the value of those drop-downs are not defined by an outside value, but from within the content area.

You can change the text for the inherited value through the messages option in the editor - http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#configuration-messages.fontSizeInherit and http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#configuration-messages.fontNameInherit.

If you wish to define different default values for font-family and font-size, then you should check the option for adding additional stylesheets to the editor - http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#configuration-stylesheets. Also if you use the inline mode of the editor, where the styling on the page influenced the styling in the content area as well, then you would not need the stylesheets option.

Hope this helps.

Regards,
Niko
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Scott
Top achievements
Rank 1
commented on 30 Apr 2021, 10:46 PM

Where does the style sheet need to be put in order for the control to find it and how do you do this with Tag Helpers?
Ivan Danchev
Telerik team
commented on 04 May 2021, 12:48 PM

Scott,

The style sheet should be within the wwwroot folder of the application, for example in the "css" sub folder.

You can then pass it to the Editor as shown below:

@{
string[] stylesheets = { Url.Content("~/css/myEditorStyleSheet.css") };
}

<kendo-editor name="editor" aria-label="editor" style="width: 100%; height:840px" stylesheets="stylesheets">

Tags
Editor
Asked by
Ufficio Acquisti
Top achievements
Rank 1
Answers by
Niko
Telerik team
Share this question
or