Currently, the font size values are 1 (8 pts), 2 (10 pts), 3 (12pts), 4 (14pts), 5 (16pts), 6(18pts), 7(20pts).
I would like to change that to:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/font_size_styl...
However, I would like to ask where do I input this code? I tried to put it here under tinytinymce.module but it did not work. Thanks
tinyMCE.init({
mode : "exact",
elements: "edit-body",
theme : "advanced",
font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect, | |,forecolor,backcolor, ",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,preview,fullscreen,",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,",
theme_advanced_buttons4 : ",styleprops,|,cite,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
template_external_list_url : "example_template_list.js"
});
';
Comments
Comment #1
Steve Lockwood commentedI like the idea of using relative font sizes - the small fonts in the editor are an annoyance (and probably useless for partially-sighted users) - so I will try to build this into a future release.
Your syntax looks right to me - I wonder if it's back to the caching issue I mentioned in my other post. If you do a "view source" on your web page, you should be able to see the init script and will be able to tell whether your browser has picked up the change.
Steve
Comment #2
Jkello commentedNot sure. I will test it over the weekend...
Comment #3
Steve Lockwood commentedI managed to get control over the font sizes using the following three lines in the init statement
convert_fonts_to_spans : true,
theme_advanced_font_sizes : "xx-small=1,x-small=2,small=3,medium=4,large=5,x-large=6,xx-large=7",
font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
The first line tells tinymce to use span tags instead of font tags, so is not absolutely necessary but will give you better HTML.
The second line is a list of the names I want to give to the font sizes "small", "medium" etc are just names here and don't have any special meaning. The numbers 1-7 match to the font specification in the third line - I could have called them something else:
theme_advanced_font_sizes : "TeensyWeensy=1,ItsyBitsy=2,Small=3,JustRight=4,Big=5,VeryBig=6,TooBig=7",
The third line details the actual font sizes to be given to fonts 1-7.
Note 1: for the span tag to be handled properly, the input format for the content needs to be specified as "Full HTML".
Note 2: if you don't do the above the TinyMCE default names are 1) 8pt, 2) 10pt etc. But the resulting html uses xx-small, x-small etc. So despite appearances, TinyMCE uses relative font sizes by default.
Comment #4
Jkello commentedI read from moxie, that we will be able to use CSS to definte "xx-small" "x-small" .... "x-large" "xx-large" as different style classes.
Is that true? If it is true then perhaps it will be more efficient to define it in the style.css instead.
Comment #5
Steve Lockwood commentedYes - instead of:
font_size_style_values : ...
You can have:
font_size_classes : "fonstsize1,fontSize2,fontSize3,fontSize4,fontSize5,fontSize6,fontSize7",
When you select a font from the drop-down it will put the text in a span and give it the associated class.
Comment #6
Steve Lockwood commented