配置字体

编辑器的字体,可以通过 editor.config.fontNames 配置。

const E = window.wangEditor
const editor = new E('#div1')

// 配置字体
editor.config.fontNames = [
    // 对象形式 v4.6.16
    {name:"黑体",value:"黑体"},
    {name:"绝绝字体",value:"Times New Roman"}
    // 字符串形式
    '黑体',
    '仿宋',
    '楷体',
    '标楷体',
    '华文仿宋',
    '华文楷体',
    '宋体',
    '微软雅黑',
    'Arial',
    'Tahoma',
    'Verdana',
    'Times New Roman',
    'Courier New',
]

editor.create()
Copyright © wangEditor (2020 - present) all right reserved,powered by GitbookFile Modify: 2021-05-08 00:15:48

results matching ""

    No results matching ""