Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the TinyMCE 4 Font Sizes drop down to set the font size in px instead of pt

Tags:

tinymce-4

Does anyone see a way to make the TinyMCE 4 Font Sizes drop down offer font sizes in px instead of pt?

TinyMCE Font Sizes

Thanks

like image 579
Steve Avatar asked Jan 25 '15 01:01

Steve


People also ask

How do I change font size in TinyMCE?

Font size selection The TinyMCE rich text editor comes with 7 font size options by default, ranging from 8pt to 36pt. Depending on how TinyMCE is configured, users can select a font from the menubar or toolbar (via the fontsizeselect dropdown). A user selects a font size from the fontsizeselect toolbar menu.

How do you change text color on TinyMCE?

This plugin adds the forecolor/backcolor button controls that enable you to pick colors from a color picker and apply these to text. It adds a toolbar button to enable this functionality.


1 Answers

You need to use the fontsize_formats option where you can also change the unit of the values of the font sizes dropdown:

tinymce.init({
    selector: 'textarea',
    toolbar: 'fontsizeselect',
    fontsize_formats: "8px 10px 12px 14px 18px 24px 36px"
});

Demo JSFiddle.

like image 96
nemesv Avatar answered Oct 18 '22 21:10

nemesv