Here's a couple of macros that I use to "zoom" (increase/decrease the font size of) the text area. I have them assigned to Ctrl + = and Ctrl + -, which is the same key combination that Firefox uses to increase or decrease the font size. Just save these to your ~/.jedit/macros directory, then go to Utilities - Global Options - Shortcuts to assign the keyboard shortcuts. I don't know how these could be assigned to mouse actions.
Inc_Font.bsh:
public void incFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize() + 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}
incFont();
----------
Dec_Font.bsh:
public void decFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize();
size = size > 1 ? size - 1 : 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}
decFont();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are macros already that let you increase/decrease font size, under "Macros/Interface", which also increase/decrease the console and gutter font sizes.
But as far as I know, there is no way to bind the mouse wheel to actions in jEdit, is there?
It would be nice if we could bind wheel movements and ctrl+wheel movements to any action or macro, like we can with other keystrokes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's a couple of macros that I use to "zoom" (increase/decrease the font size of) the text area. I have them assigned to Ctrl + = and Ctrl + -, which is the same key combination that Firefox uses to increase or decrease the font size. Just save these to your ~/.jedit/macros directory, then go to Utilities - Global Options - Shortcuts to assign the keyboard shortcuts. I don't know how these could be assigned to mouse actions.
Inc_Font.bsh:
public void incFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize() + 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}
incFont();
----------
Dec_Font.bsh:
public void decFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize();
size = size > 1 ? size - 1 : 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}
decFont();
There are macros already that let you increase/decrease font size, under "Macros/Interface", which also increase/decrease the console and gutter font sizes.
But as far as I know, there is no way to bind the mouse wheel to actions in jEdit, is there?
It would be nice if we could bind wheel movements and ctrl+wheel movements to any action or macro, like we can with other keystrokes.
Related ticket: https://sourceforge.net/p/jedit/feature-requests/476/