How to set custom fontsize list in summernote?

mesnicka picture mesnicka · Apr 22, 2016 · Viewed 16.2k times · Source

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?

Answer

mesnicka picture mesnicka · Apr 22, 2016

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']
});