Page 1 of 1

Programmatically set the font for text editor.

Posted: Tue Jul 03, 2012 4:00 pm
by DanielH
Hi,

Looking at the FontsPreferencePage (Window -> Preferences -> Author -> Fonts) you can either tell Oxygen to use Eclipse's font settings, 'Map to text font', or specify your own, 'Customize..'.

Is there a way in the oXygen API or framework files to set oXygen to not use the Eclipe font and use a different font by default?

Thanks

Re: Programmatically set the font for text editor.

Posted: Tue Jul 03, 2012 5:04 pm
by Radu
Hi Daniel,

The simplest override would be to specify in the CSS file used to render the XML document in the Author page a different font family (or font size) using code like:

Code: Select all


*{
font-family:Arial;
font-size:16px;
}
Whatever exists in the CSS specification for defining font families, sizes, should work.

Regards,
Radu

Re: Programmatically set the font for text editor.

Posted: Tue Jul 03, 2012 5:41 pm
by DanielH
Hi Radu,

Thanks for the quick response. I understand that would work for the Author tab, however will this also work for when the XML editor is set to Text edit mode? ie, after having clicked the tab 'Text'.

Thanks again.

Re: Programmatically set the font for text editor.

Posted: Wed Jul 04, 2012 11:10 am
by Radu
Hi Daniel,

In this case, the only viable alternative I can think of would be to distribute along with the Oxygen plugin a custom set of default Oxygen preferences like described here:

http://www.oxygenxml.com/doc/ug-editorE ... tions.html

Regards,
Radu