symfony
symfony forum
Home » support » General discussion » how to control default font size in rich text editing
how to control default font size in rich text editing [message #32790] Fri, 03 August 2007 00:38 Go to next message
indigodandelion  is currently offline indigodandelion
Messages: 8
Registered: April 2007
Junior Member
Hi everyone,

I have now my rich text editor setup. But the problem is the font (size 1 by default) is too small for my application. I would like to change it to size 2 as default. I browsed the TinyMCE API, but could not find anything about how to change the font size. If someone knows how to do it, could you please help me on that?

Thank you!

Jingyi

[Updated on: Fri, 03 August 2007 01:12]

Re: how to control default font size in rich text editing [message #32797 is a reply to message #32790 ] Fri, 03 August 2007 07:28 Go to previous messageGo to next message
snowkrash  is currently offline snowkrash
Messages: 518
Registered: July 2006
Location: The Netherlands
Faithful Member
I think you'll have to add a custom theme, or change the default.

http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Theme
Re: how to control default font size in rich text editing [message #32843 is a reply to message #32797 ] Fri, 03 August 2007 21:08 Go to previous messageGo to next message
indigodandelion  is currently offline indigodandelion
Messages: 8
Registered: April 2007
Junior Member
Thanks for your reply and the link. I think changing the default theme should be easier in my case, but I still could not find the parameter that changes the default font size of the editor...

Anyhow, thank you!

Jingyi
Re: how to control default font size in rich text editing [message #34476 is a reply to message #32843 ] Wed, 29 August 2007 19:09 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
indigodandelion, did you get it solved?

I took a look at changing the custom theme, but that's seems awfully complicated. Anybody get a simple solution?

thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: how to control default font size in rich text editing [message #34478 is a reply to message #32790 ] Wed, 29 August 2007 19:28 Go to previous messageGo to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
Are you talking about the font size within the editor's window?

If yes, then you can set custom css via content_css parameter. Just pass it along other tinymce_options, ie:
content_css: "/css/my_custom_css.css"

In your css file specify the desired font size for body element, ie:
body{font-size:1em}



[Edit: Fixed spelling]

[Updated on: Wed, 29 August 2007 19:29]

Re: how to control default font size in rich text editing [message #34479 is a reply to message #34478 ] Wed, 29 August 2007 20:03 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Yes, I'm talking about the font size within the rich editor's window.

How to pass 2 options to tinymce_options?

I tried the following but I then don't get rich edit at all:

notes: { params: rich=true tinymce_options=height:200 content_css: "/css/my_tinymce_css.css" }


thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: how to control default font size in rich text editing [message #34481 is a reply to message #34479 ] Wed, 29 August 2007 20:16 Go to previous messageGo to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
You need comma after each tinymce_option, so:
notes: { params: rich=true tinymce_options=height:200, content_css: "/css/my_tinymce_css.css" }
Re: how to control default font size in rich text editing [message #34482 is a reply to message #34481 ] Wed, 29 August 2007 20:53 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
thanks that works. I quoted the whole tinymce_options in double quotes as my 2nd attempt. Smile

Now the problem is that it doesn't have any effect. here is my .css file:

body{font-size:3em}


No matter what # I put there, the rich text editing font size is the same.

I looked at the .html file, but didn't find my .css mentioned anywhere.

any comments?

thx


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: how to control default font size in rich text editing [message #34483 is a reply to message #34482 ] Wed, 29 August 2007 21:01 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member

Hmm, I think the way we pass 2 options to tinymce_options is wrong. I tried the following, ie only 1 option:

notes: { params: rich=true tinymce_options=content_css:"/myproj/css/my_tinymce.css" }


and finally see the font size get changed.

But again, no matter what # I put there in my .css file, the rich text editing font size is the same, which is way too large.

comments?


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: how to control default font size in rich text editing [message #34484 is a reply to message #34483 ] Wed, 29 August 2007 21:10 Go to previous messageGo to next message
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
Strange, it works for me:
<?php echo object_textarea_tag($person, 'getBio', 'rich=true tinymce_options=width:500, height:500, content_css: "/css/tinymce_person.css"') ?>


Fragment of tinymce_person.css:
body {font-size:1em; line-height: 1.5em; font-family: Verdana, Arial, sans-serif; text-align: left}
Re: how to control default font size in rich text editing [message #34485 is a reply to message #34484 ] Wed, 29 August 2007 21:47 Go to previous messageGo to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
guess the syntax use in generator.yml is a bit different.

I finally get it working:

  notes: { params: rich=true tinymce_options=height:300,width:500,content_css:"/myproj/css/my_tinymce.css" }


In my_tinymce.css:

body{font-size:15px}


thanks for your help!!!


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: how to control default font size in rich text editing [message #34933 is a reply to message #34478 ] Wed, 05 September 2007 03:53 Go to previous message
indigodandelion  is currently offline indigodandelion
Messages: 8
Registered: April 2007
Junior Member
pezetgee,

thanks a lot for your help. Yes, I was unable to solve this problem quickly before, so jumped to other problems. Now this problem is solved so easily. Thank you!

Jingyi
Previous Topic:Really strange error when using imagegif() (GD-Library)
Next Topic:include_custom or include_blank workaround for select_country_tag() ?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software