[英]How do I set the default font on Telerik's RadEditor?
There must be an easy way to set the default selected font of the Font Name dropdown list. 必须有一种简单的方法来设置字体名称下拉列表的默认选定字体。 I've been looking around on the Telerik site and forums but I can't find a simple way.
我一直在环视Telerik网站和论坛,但我找不到一个简单的方法。 Maybe there is no simple way, but maybe I just can't find it.
也许没有简单的方法,但也许我找不到它。
Here is my RadEditor: 这是我的RadEditor:
<telerik:RadEditor ID="RadEditor1" runat="server" ContentFilters="MakeUrlsAbsolute,ConvertToXhtml,RemoveScripts"
EditModes="All" EnableResize="false" Font-Bold="false" Font-Names="Arial" Font-Size="8pt"
Height="230px" MaxHtmlLength="3000" MaxTextLength="3000" NewLineMode="Br" Skin="Web20">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="ImageManager" />
<telerik:EditorSeparator />
<telerik:EditorTool Enabled="true" Name="FontName" />
<telerik:EditorTool Enabled="true" Name="FontSize" />
<telerik:EditorSeparator />
<telerik:EditorTool Enabled="true" Name="BackColor" />
<telerik:EditorTool Enabled="true" Name="ForeColor" />
<telerik:EditorTool Enabled="true" Name="Bold" />
<telerik:EditorTool Enabled="true" Name="Italic" />
<telerik:EditorTool Enabled="true" Name="Underline" />
<telerik:EditorSeparator />
<telerik:EditorTool Enabled="true" Name="Copy" />
<telerik:EditorTool Enabled="true" Name="Cut" />
<telerik:EditorTool Enabled="true" Name="Paste" />
<telerik:EditorTool Enabled="true" Name="AjaxSpellCheck" Text="Spell Check" />
</telerik:EditorToolGroup>
</Tools>
<ImageManager MaxUploadFileSize="1048576" SearchPatterns="*.jpg,*.jpeg,*.png,*.gif,*.bmp, *.ico"
UploadPaths="~/images/" ViewPaths="~/images/" />
</telerik:RadEditor>
I hope one of you out there can tell me! 我希望你们中的一个人能告诉我! Thanks!
谢谢!
This article might be helpful http://www.telerik.com/help/aspnet-ajax/editor-default-font-for-editable-content.html 本文可能会有所帮助http://www.telerik.com/help/aspnet-ajax/editor-default-font-for-editable-content.html
You can also set the default FontName header dropdown value in the OnClientLoad event using this code: 您还可以使用以下代码在OnClientLoad事件中设置默认的FontName标头下拉值:
var tool = editor.getToolByName("FontName");
tool.set_value("Tahoma");
This worked: 这有效:
The editor: 编辑:
<telerik:RadEditor ID="myEditor" OnClientLoad="RadEditorLoad" runat="server" ... >
Handler: 处理器:
function RadEditorLoad(editor, eventArgs) {
// Set the Editor Default Font to Arial
editor.get_contentArea().style.fontFamily = 'Arial'
}
Found this at: http://www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-setting-font.aspx 发现于: http : //www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-setting-font.aspx
Create a css file 'RadEditorContentArea.css' with the following content: 使用以下内容创建一个css文件'RadEditorContentArea.css':
body
{
font-family: Arial!important;
}
Add this css file as the editor css file as follows 将此css文件添加为编辑器css文件,如下所示
<telerik:RadEditor runat="server" ID="RadEditor1">
<CssFiles>
<telerik:EditorCssFile Value="~/RadEditorContentArea.css" />
</CssFiles>
</telerik:RadEditor>
Check out this link for more: http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/content-area-appearance/default-font-for-editable-content 查看此链接了解更多信息: http : //docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/content-area-appearance/default-font-for-editable-content
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.