Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set custom fontsize list in summernote?

I'm using summernote and sometimes I need fonts with higher value than is available in font-size list. This is my current code:

$('#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
});

I tried to put into toolbar fontsizes (numbers like 10,20,25,30) but it doesn't help. Is there a way how can I set my own custom fontsize list?

like image 520
mesnicka Avatar asked Apr 22 '16 05:04

mesnicka


1 Answers

To set custom fontsize list, add this to your options: ) options:

$('#summernote').summernote({
    fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36', '48' , '64', '82', '150']
});
like image 91
mesnicka Avatar answered Sep 27 '22 17:09

mesnicka