在百度编辑器 Ueditor 如何增加字体 ?
要修改两个文件:
第一个文件:editor-config.js:
,
'fontfamily'
:[
{ label:
''
,name:
'songti'
,val:
'宋体,SimSun'
},
{ label:
''
,name:
'kaiti'
,val:
'楷体,楷体_GB2312, SimKai'
},
{ label:
''
,name:
'yahei'
,val:
'微软雅黑,Microsoft YaHei'
},
{ label:
''
,name:
'heiti'
,val:
'黑体, SimHei'
},
{ label:
''
,name:
'lishu'
,val:
'隶书, SimLi'
},
{ label:
''
,name:
'andaleMono'
,val:
'andale mono'
},
{ label:
''
,name:
'arial'
,val:
'arial, helvetica,sans-serif'
},
{ label:
''
,name:
'arialBlack'
,val:
'arial black,avant garde'
},
{ label:
''
,name:
'comicSansMs'
,val:
'comic sans ms'
},
{ label:
''
,name:
'impact'
,val:
'impact,chicago'
},
{ label:
''
,name:
'timesNewRoman'
,val:
'times new roman'
},
{ label:
''
,name:
'verdana'
,val:
'Verdana'
}
]
第二个文件,lang/zh-cn/zh-cn.js:
'fontfamily'
:{
'songti'
:
'宋体'
,
'kaiti'
:
'楷体'
,
'heiti'
:
'黑体'
,
'lishu'
:
'隶书'
,
'yahei'
:
'微软雅黑'
,
'andaleMono'
:
'andale mono'
,
'arial'
:
'arial'
,
'arialBlack'
:
'arial black'
,
'comicSansMs'
:
'comic sans ms'
,
'impact'
:
'impact'
,
'timesNewRoman'
:
'times new roman'
,
'verdana'
:
'Verdana'
},
两个文件的中的字体要相互对应。