钱柜官网专注于商业源码、商业教程、商业素材、商业模板、精品软件分享,为广泛站长朋友提供最优质的劳动。
地名:
电码:
登记

商业源码分享

VIP

织梦教程:主席台编辑器添加中文字体方法

www.yzwym.com / 2015-05-22
开辟dedecms的跳台添加文档的时光,察觉竟然中国字体没有?这就是说遇到这种状况我们应当怎么办呢?
其实办法很简单
DedeCMS 5.7购并了ckeditor网页编辑器,其它的原名是FCKeditor,是一番奇异出色的正本求源网页编辑器,但两者的部署却不完整相同。
下为ckeditor网页编辑器添加中文字体的艺术:
开辟 include/ckeditor/ckeditor.js ,追寻 i.font_names ,找到字体列表。补所需的汉语字体,补后为:
i.font_names= 'Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, 
cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, 
serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, 
Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, 
Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif;
宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;迪斯尼雅黑/迪斯尼雅黑' ; 
要求特别注意的是:补的字体,要写成诸如“宋体/宋体”的样式,而不是“宋体”。即“表现的字体名称/现实字体名称”的渐进式。
 
局部同学在添加完后发现后台还是土生土长的规范,没有增加字体啊?奇怪怎么回事呢?
此地要小心了,你更新了js下后台调用的js她还有缓冲没有更新(题外话:前不久很多同学在dedecms模板下载安装到网站后,也忘了更新缓存造成出错),这会儿你要把
<!-- 补下面的编码 -->
  <textarea name="body" rows="8" cols="60"></textarea> 
<script type="text/javascript">//<![CDATA[ 
window.CKEDITOR_BASEPATH='/include/ckeditor/'; 
//]]></script>
<script type="text/javascript" src="/include/ckeditor/ckeditor.js?t=B8DJ5M3"></script> 
<script type="text/javascript">//<![CDATA[ 
CKEDITOR.replace('body', {"extraPlugins":"dedepage,multipic,addon","toolbar":[["Source","-","Templates"],["Cut","Copy","Paste","PasteText","PasteFromWord","-","Print"],["Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"],["ShowBlocks"],["Image","Flash","Addon"],["Maximize"],"/",["Bold","Italic","Underline","Strike","-"],["NumberedList","BulletedList","-","Outdent","Indent","Blockquote"],["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],["Table","HorizontalRule","Smiley","SpecialChar"],["Link","Unlink","Anchor"],"/",["Styles","Format","Font","FontSize"],["TextColor","BGColor","MyPage","MultiPic"]],"height":450,"skin":"kama"}); 
//]]></script>
这段代码放到首页更新下首页,下一场再把这段代码去掉,这会儿你到后台就足以见到你添加的字体了。
收缩

    
       
       
       
       


    
       
       
       
       

  1. &lt;bdo id="5a3cd206"&gt;&lt;/bdo&gt;