如何在Summernote中设置自定义字体大小列表?

14

我正在使用summernote编辑器,有时需要比字体大小列表提供的更高的字体值。这是我的当前代码:

$('#summernote').summernote({
  toolbar: [
    ['style', ['style']],
    ['fontsize', ['fontsize']],
    ['font', ['bold', 'italic', 'underline', 'clear']],
    ['fontname', ['fontname']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
    ['height', ['height']],
    ['insert', ['picture', 'hr']],
    ['table', ['table']]
  ],
  height: 585,
  focus: false
});

我尝试在工具栏中加入字号(像10、20、25、30这样的数字),但并没有帮助。有没有办法可以设置自己的自定义字号列表?

1个回答

28

要设置自定义字体大小列表,请将以下内容添加到您的选项(options):

$('#summernote').summernote({
    fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36', '48' , '64', '82', '150']
});

1
重要事项: ['fontsize',['fontsize']] 应该首先在工具栏内提及。然后在工具栏外部提及 fontSizes 数组。 - Md. Mokammal Hossen Farnan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接