• I’m using TinyMCE Advanced, I am trying to add more font sizes to the editor.

    Actually I’ve made it already, by editing “wp-includes/js/tinymce/themes/advanced/editor-template.js”

    Before:
    sizes : [8, 10, 12, 14, 18, 24, 36],
    theme_advanced_font_sizes : “1,2,3,4,5,6,7”,
    s.font_size_style_values = “8pt,10pt,12pt,14pt,18pt,24pt,36pt”;
    if (k == v && v >= 1 && v <= 7) {

    After:
    sizes : [8, 9, 10, 11, 12, 13, 14, 15, 18, 24, 30, 36],
    theme_advanced_font_sizes : “1,2,3,4,5,6,7,8,9,10,11,12”,
    s.font_size_style_values = “8pt,9pt,10pt,11pt,12pt,13pt,14pt,15pt,18pt,24pt,30pt,36pt”;
    if (k == v && v >= 1 && v <= 12) {

    It works good. But it doesn’t looks good:
    http://i48.tinypic.com/fawgo3.png

    This is the code that I think needs a tweak:

    if (k == v && v >= 1 && v <= 12) {
    						k = v + ' (' + t.sizes[v - 1] + 'pt)';
    						cl = s.font_size_classes[v - 1];
    						v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
    					}
    
    					if (/^\s*\./.test(v))
    						cl = v.replace(/\./g, '');
    
    					o[k] = cl ? {'class' : cl} : {fontSize : v};

    In the picture on the right I’ve changed “{fontSize : v};” to “{fontSize : ’10px’};”, it looked good, but didn’t work (didn’t change the font size anymore)

    Any suggestions? :]

The topic ‘Adding more font sizes to TinyMCE’ is closed to new replies.