Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-03-30 13:40:14

Martin_Edney
New member
Registered: 2005-03-30
Posts: 4

Change default display font

I'm using xinha nightly release downloaded today (30 March).

I want to make an x-area where I've locked down the formatting (i.e. the user cannot change the text font, size or style - I just want them to be able to bold, hyperlink and similar things).

I've used

       xinha_config.toolbar = 

  [
    ["bold","italic","separator"],
    ["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
    ["inserthorizontalrule","createlink"],
    ["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"],
    ["killword","removeformat","separator","htmlmode","about"]
  ];

in the <HEAD> tag of my web page, and that works correctly to give me what I want.

So now I would like to change the default display font and size of my x-area.  I've tried

        xinha_config.pageStyle = 'font-family: verdana,sans-serif; font-size: 11px;';

based on experience with htmlArea2, but it isn't working. 

Any suggestions please?

Last edited by Martin_Edney (2005-03-30 13:44:24)

Offline

#2 2005-03-30 14:02:07

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Change default display font

you must use complte css-statements (including selector and rules)

for example like this:

xinha_config.pageStyle = 'body { font-family: verdana,sans-serif; font-size: 11px; }';

or

xinha_config.pageStyle = 'h1 { font-family: verdana,sans-serif; font-size: 12px; }';

Niko

Offline

#3 2005-03-31 04:57:32

Martin_Edney
New member
Registered: 2005-03-30
Posts: 4

Re: Change default display font

Thanks Niko, that's got it working nicely.

Offline

#4 2005-04-13 10:01:35

con4mity
Xinha Community Member
Registered: 2005-04-06
Posts: 23

Re: Change default display font

Where do you put xinha_config.pageStyle = 'h1 { font-family: verdana,sans-serif; font-size: 12px; }'; for it to effect the textarea in use.

Does this go in the config.js of the editor your using, in the htmlarea.js, where?

Offline

#5 2005-04-13 13:00:11

adamp
Xinha Pro
Registered: 2005-03-14
Posts: 77

Re: Change default display font

In your config.js

Offline

#6 2006-01-04 18:50:01

audg
New member
Registered: 2005-11-29
Posts: 6

Re: Change default display font

Hi,

I know this is an old thread, but I'm trying to do the same thing (change the default font size) and was wondering if someone could go into a little more detail on how to do this (I'm not familiar with the DOM or previous CMS). For instance, in config.js I assume you mean my_config.js? Does it matter where in the page you insert this line? Do you need any other code besides this line xinha_config.pageStyle = 'body { font-family: verdana,sans-serif; font-size: 11px; }';? I've tried pasting it into my_config.js right after step 5 but it does not work. Thank you.

Offline

#7 2006-04-02 12:59:39

tteddo
Xinha Community Member
From: Maine
Registered: 2005-06-28
Posts: 13
Website

Re: Change default display font

Just put it in the section that determines the default configuration in my_config.js like so :

       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
       xinha_config.pageStyle = 'body { font-family: arial,sans-serif; font-size: .9em; }';
       xinha_config.width  = '100%';
       xinha_config.height = '420px';
       xinha_config.statusBar = false;


I used em so the font will resize if the user uses a different text size.

Offline

#8 2006-07-23 07:08:09

jbx
New member
Registered: 2006-07-23
Posts: 2

Re: Change default display font

Is it possible to use this method but use a CSS class (from a .css file) instead of explicitely setting the style in the config line?

Offline


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/xinha/public_html/r.f/include/parser.php on line 774

#9 2006-07-24 21:36:50

bobesch
New member
From: Bremen/Germany
Registered: 2006-06-21
Posts: 2

Re: Change default display font

You might consider to use a CSS file and include it with

       xinha_config.pageStyleSheet = [ 'myFirstCSSFille', 'mySecondCSSFile' ];

Offline

#10 2006-07-29 06:47:17

jbx
New member
Registered: 2006-07-23
Posts: 2

Re: Change default display font

But how do you tell xinha which CSS class it should use as the default for its font etc?

Offline

#11 2006-07-29 12:55:39

bobesch
New member
From: Bremen/Germany
Registered: 2006-06-21
Posts: 2

Re: Change default display font

For instance by putting this in 'myFirstCSSFile':

body {
  font-family: sans-serif;
  font-size: 12px;
}

Offline

Board footer

Powered by FluxBB