Jump to content


Photo

Setting font in Xinha


  • Please log in to reply
7 replies to this topic

#1 hellenb

hellenb

    Etomite Forum Fan

  • Member
  • Pip
  • 59 posts

Posted 24 October 2006 - 09:49 PM

Hi,

I would like the editor (I am using Xinha) to have a fixed font. So that users who add content always use the same font.
How can I do that?

#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 24 October 2006 - 10:01 PM

I'm not sure that Xinha itself can be set to have a fixed font but you can certainly do it using CSS when you display the output, perhaps by using a class attached to an output div...

#3 Minddigger

Minddigger

    Etomite Forum Newbie

  • Member
  • 39 posts

Posted 05 September 2007 - 02:42 PM

Yes it can be done, like a lot of other things....

xinha_config.pageStyle = "body {font-family: Verdana; font-size: 10pt;}";

This will do to cvhange the default font to 'Verdana' and font-size to 10 points;
:D

#4 hellenb

hellenb

    Etomite Forum Fan

  • Member
  • Pip
  • 59 posts

Posted 05 November 2007 - 02:02 PM

Yes it can be done, like a lot of other things....

xinha_config.pageStyle = "body {font-family: Verdana; font-size: 10pt;}";

This will do to cvhange the default font to 'Verdana' and font-size to 10 points;
:D


Hi,
where can I find these settings? I mean in which file?

#5 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 05 November 2007 - 06:51 PM

I use xinha extensively, and have modified it to remove the font and, color selectors. xinha.css in the assets/site folder sets the style for the editor in my case... to be honest I can't remember if I had to modify it to do that or not... but it's worth a try.

#6 hellenb

hellenb

    Etomite Forum Fan

  • Member
  • Pip
  • 59 posts

Posted 06 November 2007 - 08:25 AM

I use xinha extensively, and have modified it to remove the font and, color selectors. xinha.css in the assets/site folder sets the style for the editor in my case... to be honest I can't remember if I had to modify it to do that or not... but it's worth a try.


Hi,
Could you give me a starting helping hand :D, must i make a whole new xinha.css (there doesn't exist one yet).
The thing is, i do not want the editors write their text in 3000 different fonts per each word. So I just want to reduce the number of fonts and the font-sizes.
I hoped that somewhere in the code I could just delete some of these fonts.

#7 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 06 November 2007 - 02:35 PM

Ok, this in my experience is the best editor setup for Etomite - if I could update and fix a few things in xinha, it would almost be perfect. I've removed the depreciated controls that allow changing of font-size and color, limiting the user to using proper semantics like H1, H2, address, etc.

I'm attaching an image of what my Xinha editor bar looks like.

In 0.6.1.4 \manager\actions\dynamic\mutate_content.dynamic.action.php:

Look for line 566 or thereabouts, which looks like this:
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();

Now scan downward for this line:
xinha_config = function()

Select all lines in between but not including those two lines and paste over with this:

// begin Ian's custom xinha config - www.n-vent.com
	  xinha_config.height = '600px';
	// toolbar config 
		xinha_config.toolbar = 
  [
	["formatblock","bold","italic","strikethrough","separator"],
	["justifyleft","justifycenter","justifyright","justifyfull","separator"],
	["insertorderedlist","insertunorderedlist","outdent","indent","separator"],
	["inserthorizontalrule","createlink","insertimage","inserttable","separator"],
	["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste"]),["separator"],
	["killword","clearfonts","removeformat","toggleborders","separator"],
	["selectall","print","separator","htmlmode","showhelp"]
  ];
	// end toolbar config

	  // path to custom site stylesheet for real-time development styling
	  xinha_config.pageStyleSheets = ['../../assets/site/xinha.css'];
	  xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
	  HTMLArea.startEditors(xinha_editors);
	}
// end Ian's custom xinha config

Now the xinha.css (attached) goes into the /assets/site/ folder. It's set up to display the text as red until it has been styled, immediately letting the person know where there's some text outside of a paragraph or whatever.
You'll also notice a filesize.png file. It's to style the file link control in xinha, and looks really good. if you want this to work in your site CSS, you'll need to copy over the corresponding classes:

img.fileimg{
	padding-right: 5px;
}
span.filesize{
	background:#FFF3D0 url(/assets/site/filesize.png) no-repeat top left;
	color:#000000;
	font-size:10px;
	margin:0pt 6px;
	padding:3px 3px 3px 10px;
}

Attached Files



#8 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 06 November 2007 - 02:46 PM

Let me add that what I have posted above could be considered an "unofficial mod" and will go away when you upgrade Etomite. Make backups of all core files before editing.

I have to manually re-install this mod every time I upgrade.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users