Zooming In and Out of Text with Eclipse

I like to have as many lines of source code visible on my notebook or desktop monitor. And I think I have found a good balance between font size and readability.

On the other side: I’m getting older and my eyes are not getting any better. At the same time I noticed that students start using these ‘high-resolution-retina-displays’. They are great, but result in tiny default system fonts, so I have a hard time to read the source code on their machines.

Another challenge I noticed are the high-resolution projectors in class rooms or conferences. They are not well suited to show source code or text files because of the tiny fonts. Starting with Eclipse Neon there is an awesome feature which I can use to dynamically increase and decrease the font size which solves that problem:

Eclipse with Large Font Size

Eclipse with Large Font Size

Outline

This article describes how to change the Eclipse editor font size ‘on the fly’. I’m using an Eclipse Neon based IDE (NXP MCUXpresso IDE) in the screenshots, but things are applicable for any Eclipse Neon based IDE or later.

The ‘text zoom feature’ is available out of the box with Eclipse Neon. Previously some extra plugins had to be installed which did not always work (at least in my experience).

General Eclipse Font Preferences

To change the font size as a workspace settings, there are several configuration items under Window > Preferences > General > Appearance > Colors and Fonts:

Font Preferences

Font Preferences

The above setting exists for a long time in Eclipse. But it is rather painful to get into this dialog to increase and decrease the font size.

Keyboard Shortcut

To increase the font size or to zoom into the source text, starting with Eclipse Neon I use the <CTRL>+<+> shortcut (press the CTRL key in combination with the ‘+’ key). To zoom out and to decrease the font size use the ‘-‘ with <CTRL>+<->. The shortcut changes both the text size in the source editor view and in the console view.

💡 On Mac OS X, it is <CTRL>+<=> and <CTRL>+’-‘

Eclipse with Large Font Size

Eclipse with Large Font Size

Of course it can go even higher than that:

Big Font

Big Font

Zooming Shortcuts

The zooming shortcuts can be configured in Window > Preferences > General > Keys:

Zooming Shortcuts

Zooming Shortcuts

 

Summary

Changing the font size is a very useful feature: I can zoom in and out with increasing and decreasing the font size which is very useful presenting source code with a projector. It only changes the font size of text editors, and not the font size of other items like menus or dialogs. Zooming is in Eclipse only available as a shortcut, and I wish there would be support for it using the mouse scroll wheel (e.g. CTRL + Mouse Wheel). Still, the keyboard shortcut is very useful.

What about pre-Neon Eclipse? There is the tarlog-plugins you could use.

Happy Zooming 🙂

Links

5 thoughts on “Zooming In and Out of Text with Eclipse

  1. Para los que tienen teclado en Español.. 🙂 el + predeterminado que toma el atajo es el que esta a la izuiqerda de la Tecla Enter abajo del Delete, y el – es el guion que esta a la izquierda del Shift y a la derecha del .

    😀 Muchas gracias por todo! me ayudo tu info!

    Like

  2. This is very helpful, but in all the other applications I use zooming is done with the “+” and “-” keys on the numeric keypad. In Eclipse they don’t zoom, only the “+” and “-” keys on the regular keyboard do.

    Like

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.