/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/commands/setFont.bsh
Unknown | 25 lines | 18 code | 7 blank | 0 comment | 0 complexity | 4921b7f9007bbc2bad08aefac17c328b MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /**
- Change the point size of the font on the specified component, to ptsize.
- This is just a convenience for playing with GUI components.
- */
- bsh.help.setFont = "usage: setFont( Component comp, int size )";
- Font setFont(Component comp, String family, int style, int size) {
-
- this.font = comp.getFont();
-
- this.family = (family==null) ? font.family : family;
- this.style = (style==-1) ? font.style : style;
- this.size = (size==-1) ? font.size : size;
-
- font = new Font(family, style, size);
- comp.setFont(font);
- comp.validate();
- return font;
- }
- Font setFont(Component comp, int size) {
- return setFont(comp, null, -1, size);
- }