在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Ueditor本身自带11种字体 使用过程中这11种字体往往不能满足我们的需求,现在我要添加“仿宋”和“仿宋GB2312”两种字体 过程如下: 'fontfamily':{ '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、找到文件ueditor\ueditor.config.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] 添加好的效果图: 最后,附上部分中文字体的英文名,方便添加字体 华文细黑:STHeiti Light [STXihei] |
请发表评论