1

Topic: Default font size

Could someone please point me in the direction of a help file or forum post which details how to change the default font size in the editor?  I have been unable to find this in the documentation and other forum posts on the topic seem to be overly complicated or they don't work.

Thanks for your help.

Chris

2

Re: Default font size

I changed my displayed editor font size by doing this:

#
# OPEN
#

\tinymce\jscripts\tiny_mce\themes\advanced\css\editor_content.css

#
# FIND
#

body, td, pre {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
}

#
# REPLACE WITH
#

body, td, pre {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}

#
# SAVE AND CLOSE
#

3

Re: Default font size

This did not work for me.  I'm using this as a plugin inside Roundcube webmail
www.roundcube.net

Any other suggestions?

[ Awesome Facts of Jesus Christ: click here to see!

4

Re: Default font size

Strangely enough I found that the only way this worked was to change the editor content CSS file location to a custom location.  In other words, editing the default CSS file did not work but making an exact copy and changing the location did work.

For example, in the chunk of Javascript code that you have in your page header, put this line:

content_css : "/css/editor_content.css"

And place the 'editor_content.css' file in to a '/css' sub-directory of your document root.

Hope this helps.

Chris

5

Re: Default font size

What "page header" are you referring to?

These are the files:

root@ [/usr/local/cpanel/base/roundcube/program/js/tiny_mce]# ls -lh
total 388K
drwxr-xr-x   6 501 501 4.0K Jul 12 21:48 ./
drwxr-xr-x   3 501 501 4.0K Aug 14 21:43 ../
-rw-r--r--   1 501 501  213 Aug 15  2005 blank.htm
drwxr-xr-x   2 501 501 4.0K Jul 12 21:48 langs/
-rw-r--r--   1 501 501  24K Aug 10  2005 license.txt
drwxr-xr-x  27 501 501 4.0K Jul 12 21:48 plugins/
drwxr-xr-x   4 501 501 4.0K Jul 12 21:48 themes/
-rw-r--r--   1 501 501 134K May  4 02:29 tiny_mce.js
-rw-r--r--   1 501 501 7.2K May  4 02:29 tiny_mce_popup.js
-rw-r--r--   1 501 501 183K Oct 17 17:29 tiny_mce_src.js
drwxr-xr-x   2 501 501 4.0K Jul 12 21:48 utils/

root@ [/usr/local/cpanel/base/roundcube/program/js/tiny_mce/themes/advanced]# ls -lh
total 160K
drwxr-xr-x  7 501 501 4.0K Jul 12 21:48 ./
drwxr-xr-x  4 501 501 4.0K Jul 12 21:48 ../
-rw-r--r--  1 501 501 2.4K Feb 13  2006 about.htm
-rw-r--r--  1 501 501 1.2K Nov 25  2005 anchor.htm
-rw-r--r--  1 501 501 2.6K Nov 25  2005 charmap.htm
-rw-r--r--  1 501 501  554 Jan 11  2006 color_picker.htm
drwxr-xr-x  2 501 501 4.0K Jul 12 21:48 css/
drwxr-xr-x  3 501 501 4.0K Jul 12 21:48 docs/
-rw-r--r--  1 501 501  40K Apr 18 08:32 editor_template.js
-rw-r--r--  1 501 501  53K Apr 18 08:32 editor_template_src.js
-rw-r--r--  1 501 501 4.8K Jan 11  2006 image.htm
drwxr-xr-x  3 501 501 4.0K Jul 12 21:48 images/
drwxr-xr-x  2 501 501 4.0K Jul 12 21:48 jscripts/
drwxr-xr-x  2 501 501 4.0K Jul 12 21:48 langs/
-rw-r--r--  1 501 501 3.9K Jan 11  2006 link.htm
-rw-r--r--  1 501 501 1.4K Jan 22  2006 source_editor.htm
[ Awesome Facts of Jesus Christ: click here to see!

6

Re: Default font size

The header I am referring to is this:

<script language="javascript" type="text/javascript">
            // Notice: The simple theme does not use all options some of them are limited to the advanced theme
            tinyMCE.init({
                mode : "exact",
                elements : "content_body,event_article,elm2",
                theme : "advanced",
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_disable : "strikethrough,styleselect,formatselect",
                theme_advanced_buttons1_add : "bullist,numlist,separator,undo,redo,separator,link",
                theme_advanced_buttons2 : "",
                theme_advanced_buttons3 : "",
                content_css : "/css/editor_content.css"
            });
        </script>

7

Re: Default font size

What FILE?

[ Awesome Facts of Jesus Christ: click here to see!

8

Re: Default font size

Per the documentation you insert that Javascript into whatever files you want TinyMCE to work in.

I can't tell you the name of your file.  The name of my file is 'index.php'.  If you want TinyMCE to work in 'default.html', insert the JS code in the header of 'default.html', for example.

9

Re: Default font size

Here is what I did to change the DEFAULT font size in the textarea shown in the editor:

In the content.css file, for the advanced theme, I added p and div and increased the font size.

body, td, pre, p, div {color:#000; font-family:Lucida Grande, Verdana, Helvetica, sans-serif; font-size:16px; margin:8px;}

I added the line below as well;
.mceContentBody p {   font-size: 1.2em !important; }/* FF requires a important here */

This seemed to catch the "default font size", but there are still catches. 1. do not use the same filename for content.css  and your sites css as listed in the content_css init section. 2. Watch out for existing content with spans, and other types of formatted content.

I still see some initial formatting for the text size that then changes immediately to what I want upon load of tiny's tool bar.
Also - this did not happen in versions prior to 3.22 - I did not have to change the default font to make things usable.

Good luck!

Last edited by Dosolutions (2010-04-17 02:26:07)