Getting the editor font


Is there any way to get the current user-selected font? I need to set it on some text fields in inspection options panels, but don't see any reasonable API.

Thanks.

2 comments
Comment actions Permalink

Dave Griffith wrote:

Is there any way to get the current user-selected font? I need to set it on some text fields in inspection options panels, but don't see any reasonable API.


I'm not sure if it'll work or not, but you could try

editor.getContentComponent().getFont()

It'd be the first place I'd look, anyway. I don't think the general IDE
settings are open.

Otherwise, you could try parsing Idea's XML configuration file
directly. I can't immediately see the editor font in there - only the
main (non-monospaced) IDE font.

- Paul

0
Comment actions Permalink

editor.getContentComponent().getFont()

This will not work.

And necessary API is not open, sorry.
--

Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"



0

Please sign in to leave a comment.