I’m using last version summernote library. How i can set default font size and font? I’m trying like this, but its not working:
JavaScript
x
16
16
1
$('.text-editor').summernote({
2
toolbar: [
3
['style', ['style']],
4
['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
5
['fontname', ['fontname']],
6
['fontsize', ['fontsize']],
7
['color', ['color']],
8
['para', ['ul', 'ol', 'paragraph']],
9
['height', ['height']],
10
['table', ['table']],
11
['insert', ['link', 'picture', 'video', 'hr']],
12
['view', ['codeview']]
13
],
14
fontsize: '16'
15
});
16
https://jsfiddle.net/dtgr5q29/142/
Advertisement
Answer
A possible solution to this is to apply directly the font-size style to the editor div using jQuery
JavaScript
1
12
12
1
$('.active-textcontainer').summernote({
2
toolbar: [
3
['style', ['bold', 'italic', 'underline']],
4
['fontsize', ['fontsize']],
5
['color', ['color']],
6
['para', ['ul', 'ol', 'paragraph']]
7
],
8
height:150
9
});
10
11
$('.note-editable').css('font-size','18px');
12
More .. How to set font-size in summernote?
Thanks