AlbertoMeyer Posted September 4, 2023 Share Posted September 4, 2023 I'm using TinyMCE as an editor in an application but I'm not able to set the initial font size. Any tip? Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 5 hours ago, AlbertoMeyer said: I'm using TinyMCE as an editor in an application but I'm not able to set the initial font size. Any tip? Thank you Hello, At least tell us which version of TinyMCE are you using? Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 majorVersion : '3', minorVersion : '5.8', releaseDate : '2012-11-20', HTMLMemo would be enough for me, if it had way to change fonts and font sizes. I am using TinyMCE because of that Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 16 minutes ago, AlbertoMeyer said: HTMLMemo would be enough for me, if it had way to change fonts and font sizes. This post may help you: Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 What I need is a way to change font size and family (Arial, Verdana) at runtime, like a basic editor. (<<< - Like this) Tiny MCE does that, HTMLMemo doesn't. But the difficulty is choosing a font size at startup Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 Nowm htmlMemo is showing but if you have a solution for Tiny, will be better, thhanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 1 hour ago, AlbertoMeyer said: What I need is a way to change font size and family (Arial, Verdana) at runtime Please explain in more detail. Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 I need to find a solution to set the TinyCE editor's font family and size when it starts up. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 1 hour ago, AlbertoMeyer said: I need to find a solution to set the TinyCE editor's font family and size when it starts up. This blog may help you: https://www.tiny.cloud/blog/how-to-change-the-default-font-family-size-and-color-in-tinymce/ Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 I am trying this with no luck Quote <textarea id="ed1" style="width: 100%; height: 400px;"></textarea> <script> tinyMCE.init({ theme : "advanced", plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", selector: "textarea", content_style: "body { background: #6A7A95; color: white; font-size: 14pt; font-family: Arial; }", // Theme options theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, extended_valid_elements : "img[class=myclass|!src|border:0|alt|title|width|height]", mode: "exact", elements : "ed1" }); </script> Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 I'm still not clear... Is your editor empty at the beginning? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2023 Share Posted September 5, 2023 29 minutes ago, AlbertoMeyer said: I am trying this with no luck Works for me: Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 Do you tested with the code above? Strange. No luck here Quote Link to comment Share on other sites More sharing options...
AlbertoMeyer Posted September 5, 2023 Author Share Posted September 5, 2023 Is it possible send a very simple example for me? Thanks anyway Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 6, 2023 Share Posted September 6, 2023 10 hours ago, AlbertoMeyer said: Do you tested with the code above? Yes. 10 hours ago, AlbertoMeyer said: Is it possible send a very simple example for me? .. JSCallGlobal('tinymce.init', [ JSStatement( '{'+ 'selector:"#'+ JSName +'_id-inputEl",'+ 'theme: "silver",'+ 'resize: false,'+ 'content_style:'+ '"body { background: #6A7A95; color: white; font-size: 14pt; font-family: Arial; }",'+ IfThen(FTinyMenuBar.PluginsCfg.Text<>'', 'plugins: '+ FTinyMenuBar.PluginsCfg.Text + ',', '')+ IfThen(MenuBarCfg<>'', 'menu: '+ MenuBarCfg + ',', '')+ IfThen(FTinyMenuBar.Visible, '', 'menubar: false,')+ .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.