Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
180
rated 0 times [  183] [ 3]  / answers: 1 / hits: 36088  / 11 Years ago, mon, july 29, 2013, 12:00:00

I've successfully changed the default font inside the editor using the documentation here but that leaves me with a problem. The original default font no longer works in the font drop down list.



Original default: Verdana

New default: MyCustomFont



When I type into the editor I see my MyCustomFont font by default. If I try to change that to Verdana (original default) nothing happens. I can change it to any font family except Verdana. I noticed also that when I select MyCustomFont in the drop down list the content gets surrounded with a span with inline styles. This does not happen with the original default font (hence why nothing happens).



It seems to me like there's a key piece of documentation missing - how to tell the editor (the font feature in particular) that the font I've defined by default in the css is the default font.



I've Googled quite a bit but had no results. Everybody else seems to be settling for the documentation mentioned above. Am I the only one having this problem? If not, please help! :)



Please note, the answers to this question do not answer my question.


More From » css

 Answers
17

maybe too late but...



$('.tinymce').tinymce({
setup : function(ed) {
ed.onInit.add(function(ed) {
ed.execCommand(fontName, false, Arial);
ed.execCommand(fontSize, false, 2);
});
}
});


EDIT



For TinyMCE 4, as @jason-tolliver and @georg states, the syntax is:



ed.on('init', function (ed) {
ed.target.editorCommands.execCommand(fontName, false, Arial);
});

[#76676] Saturday, July 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wilson

Total Points: 27
Total Questions: 93
Total Answers: 93

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
wilson questions
Tue, Aug 9, 22, 00:00, 2 Years ago
Wed, May 11, 22, 00:00, 2 Years ago
Wed, May 20, 20, 00:00, 4 Years ago
Wed, May 13, 20, 00:00, 4 Years ago
;