百度编辑器Ueditor增加字体的修改⽅法
Ueditor本⾝⾃带11种字体
使⽤过程中这11种字体往往不能满⾜我们的需求,现在我要添加“仿宋”和“仿宋GB2312”两种字体
过程如下:
1、到⽂件 ueditor/lang/zh-cn/zh-cn.js ,到其中的fontfamily节点,添加“仿宋”和“仿宋GB2312”
'fontfamily':{
editor记忆方法'songti': '宋体',
'SimSun': '仿宋',
'FangSong_GB2312': '仿宋_GB2312',
'kaiti':'楷体',
'heiti':'⿊体',
'lishu':'⾪书',
'yahei':'微软雅⿊',
'andaleMono':'andale mono',
'arial': 'arial',
'arialBlack':'arial black',
'comicSansMs':'comic sans ms',
'impact':'impact',
'timesNewRoman':'times new roman'
},
2、到⽂件fig.js⽂件(⽹上也看到⼀说是ueditor\editor_config.js⽂件,可能版本问题),到其中被注释掉的fontfamily节点,去掉该节点的注释,添加“仿宋”和“仿宋GB2312”
//fontfamily
//字体设置 label留空⽀持多语⾔⾃动切换,若配置,则以配置值为准
,'fontfamily':[
{ label: '', name: 'songti', val: '宋体,SimSun' },
{ label: '', name: 'SimSun', val: '仿宋,SimSun' },
{ label:'',name:'FangSong_GB2312',val:'仿宋_GB2312 ,FangSong_GB2312'},
{ 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'}
]
//fontsize
/
/字号
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
添加好的效果图:
可以看到,仿宋和仿宋GB2312被成功添加上去了
最后,附上部分中⽂字体的英⽂名,⽅便添加字体
华⽂细⿊: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
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论