Programmatically set the font for text editor.

Oxygen general issues.
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Programmatically set the font for text editor.

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Programmatically set the font for text editor.

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DanielH
Posts: 14
Joined: Tue Sep 27, 2011 11:29 am

Re: Programmatically set the font for text editor.

Post 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.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Programmatically set the font for text editor.

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply