jeecg富文本编辑器增加字体(仿宋)(老版本)
jeecg富文本编辑器增加字体(仿宋)
温馨提示:jeecg 提供了 uedit 富文本的实现,如下针对的是 uedit 增加仿宋字体示例。
主要修改三个文件:plug-in\ueditor\ueditor.config.js、plug-in\ueditor\lang\en\en.js、plug-in\ueditor\lang\zh-cn\zh-cn.js
1、ueditor.config.js
在该文件中找到:fontfamily 节点,取消该节点的全部注释。
,'fontfamily':[
{ label:'',name:'songti',val:'宋体,SimSun'},
{ label:'',name:'fangsong',val:'仿宋,FangSong'},
{ 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'}
]
2、zh-cn.js
同样找到 fontfamily 节点,增加 'fangsong': '仿宋'
'fontfamily':{
'songti':'宋体',
'fangsong':'仿宋',
'kaiti':'楷体',
'heiti':'黑体',
'lishu':'隶书',
'yahei':'微软雅黑',
'andaleMono':'andale mono',
'arial': 'arial',
'arialBlack':'arial black',
'comicSansMs':'comic sans ms',
'impact':'impact',
'timesNewRoman':'times new roman'
},
3、en.js
还是 fontfamily 节点,增加 'fangsong':'FangSong'
'fontfamily':{
'songti':'Sim sun',
'fangsong':'FangSong',
'kaiti':'Sim kai',
'heiti':'Sim hei',
'lishu':'Sim li',
'yahei': 'Microsoft yahei',
'andaleMono':'Andale mono',
'arial': 'Arial',
'arialBlack':'Arial black',
'comicSansMs':'Comic sans ms',
'impact':'Impact',
'timesNewRoman':'Times new roman'
},
实现效果
最后
附上部分中文字体的英文名,方便添加字体
华文细黑:STHeiti Light [STXihei]
华文黑体:STHeiti
华文楷体:STKaiti
华文宋体:STSong
华文仿宋:STFangsong
俪黑 Pro:LiHei Pro Medium
俪宋 Pro:LiSong Pro Light
标楷体:BiauKai
苹果俪中黑:Apple LiGothic Medium
苹果俪细宋:Apple LiSung Light
新细明体:PMingLiU
细明体:MingLiU
标楷体:DFKai-SB
黑体:SimHei
宋体:SimSun
新宋体:NSimSun
仿宋:FangSong
楷体:KaiTi
仿宋_GB2312:FangSong_GB2312
楷体_GB2312:KaiTi_GB2312
微软正黑体:Microsoft JhengHei
微软雅黑体:Microsoft YaHei
隶书:LiSu
幼圆:YouYuan
华文细黑:STXihei
华文楷体:STKaiti
华文宋体:STSong
华文中宋:STZhongsong
华文仿宋:STFangsong
方正舒体:FZShuTi
方正姚体:FZYaoti
华文彩云:STCaiyun
华文琥珀:STHupo
华文隶书:STLiti
华文行楷:STXingkai
华文新魏:STXinwei
文章作者:niceyoo
文章地址:https://www.cnblogs.com/niceyoo/p/10529204.html
如果觉得文章对你有所帮助,右下方点个推荐~