ChatGPT解决这个技术问题 Extra ChatGPT

How to change font size in Eclipse for Java text editors?

I have just tried to change my font size in Eclipse 3.6.0 in the following way:

General → Appearance → Colors and Fonts → Java Editor text font

However, the font size only changed in the file I had open. How can I change the font size for all Java files and projects I open in Eclipse?

Works fine in 3.5 using those same directions.
FYI, if you want to change all editors at the same time, select General → Appearance → Colors and Fonts → Basic → Text Font.
Other solution Windows -> Preferences -> General -> appareance -> Colors a fonts -> Structured Text Editor -> Edit. this work for me :)
Eclipse Neon (4.6) added Ctrl + + and Ctrl + = for Zoom In and Ctrl + - for Zoom Out. See eclipse.org/eclipse/news/4.6/M4

D
DwB

If you are changing the font size, but it is only working for the currently open file, then I suspect that you are changing the wrong preferences.

On the Eclipse toolbar, select Window → Preferences

Set the font size, General → Appearance → Colors and Fonts → Java → Java Editor Text Font).

Save the preferences.

Check that you do not have per-project preferences. These will override the top-level preferences.

Eclipse v4.2 (Juno) note

Per comment below, this has moved to the Eclipse Preferences menu (no longer named the Window menu).

Eclipse v4.3 (Kepler) note

The Window menu is live again, that is, menu Window → Preferences.

Eclipse 2021-12 note

Verified that the path described (Window → Preferences, General → Appearance → Colors and Fonts → Java → Java Editor Text Font) is still correct.

Note Be sure to check out the ChandraBhan Singh's answer, it shows the key bindings to change the font size.


Was searching for the same question tonight and found this...just a quick note: in JUNO they have moved Preferences section under EClise menu...: EClipse->Preferences..... just If I knew Eclipse keeps moving things around so much!
tested on Version: Indigo Service Release 2 on 12-12-2012 good answer
Other solution Windows -> Preferences -> General -> appareance -> Colors a fonts -> Structured Text Editor -> Edit. this work for me :)
Checked on MARS on 12/18/2015 and still works just fine. Thanks man!
The Window -> Preferences menu is still there in NEON.
C
ChandraBhan Singh

For Eclipse Neon

To Increase Ctrl +

To reduce Ctrl -

https://i.stack.imgur.com/lqSsU.jpg


For other languaged keyboards (like Hungarian): CTRL SHIFT (+) CTRL SHIFT (-)
For Mac OsX use CMD key instead of Ctrl
For me Ctrl - to decrease, but Ctrl Shift + to increase.
P
Peter Mortensen

On Mac:

Eclipse toolbar Eclipse → Preferences OR Command + , (comma) General → Appearance → Colors and Fonts → Basic → Text Font Apply


Edit Eclipse toolbar>Window> @BenniMcBeno.
Open the java file and use Command and +/- to increase/decrease the font size
C
Community

This worked for me:

On the Eclipse toolbar, select Window → Preferences. Set the font size (General → Appearance → Colors and Fonts → Basic → Text Font): Save the preferences.


Yes this is more applicable as it is global settings
S
Sumit Singh
General → Appearance → Colors and Fonts → Java Editor text font

See the image:

https://i.stack.imgur.com/u9YuU.png


@SumitSingh How did you achieve this color shema for eclipse? Can you give some explanation or link?
This is new theme in Luna See: eclipsesource.com/blogs/2014/06/20/…
P
Peter Mortensen

The Eclipse-Fonts extension will add toolbar buttons and keyboard shortcuts for changing font size. You can then use AutoHotkey to make Ctrl + mousewheel zoom.

Under menu HelpInstall New Software... in the menu, paste the update URL (http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/) into the Works with: text box and press Enter. Expand the tree and select FontsFeature as in the following image:

https://i.stack.imgur.com/R2Ni5.png

Complete the installation and restart Eclipse. Then you should see the A toolbar buttons (circled in red in the following image) and be able to use the keyboard shortcuts Ctrl + - and Ctrl + = to zoom (although you may have to unbind those keys from Eclipse first).

https://i.stack.imgur.com/XHaX5.jpg

To get Ctrl + mouse wheel zooming, you can use AutoHotkey with the following script:

; Ctrl + mouse wheel zooming in Eclipse.
; Requires Eclipse-Fonts (https://code.google.com/p/eclipse-fonts/).
; Thank you for the unique window class, SWT/Eclipse.
;
#IfWinActive ahk_class SWT_Window0
    ^WheelUp:: Send ^{=}
    ^WheelDown:: Send ^-
#IfWinActive

Project is not active anymore.
K
Katu

If you are using Windows then to increase font size try with

CtrlShift+

and for decreasing font size you can use

CtrlShift-


f
frianH

Press ctrl + - to decrease, and ctrl + + to increase the Font Size.

It's working for me in Eclipse Oxygen.


P
Peter Mortensen

https://i.stack.imgur.com/dr3xs.png

Menu Window → Preferences. General → Appearance → Colors and Fonts → Basic → Text Font


Appears to be the same answer as 4539511.
P
Peter Mortensen

On the Eclipse toolbar, select Window → Preferences, set the font size (General → Appearance → Colors and Fonts → Basic → Text Font).

Save the preferences.


How are preferences saved? Pressing button OK?
If we're talking about the menu bar, this is the same answer as 4539511.
P
Peter Mortensen

You can have a look at Eclipse color theme, also which has a hell of a lot of options for customizing font, background color, etc.


M
Mathieu K.

On the menu bar, select Window → Preferences Set the font size (General → Appearance → Colors and Fonts → Structured Text Editors → Structured Text Editor Text Font (set to default: Text Font) → Edit...). Save the preferences.


After Colors and Fonts, isn't it something like JavaEditorJava Editor Text Font (set to default: Text Font) (two more levels interjected)? (Seen in Eclipse v4.6 (Neon), but for C/C++).
Does not work for me in Neon.2, at least on the Java file I'm looking at.
P
Peter Mortensen

Running Eclipse v4.3 (Kepler), the steps outlined by AlvaroCachoperro do the trick for the Java text editor and console window text.

Many of the text font options, including the Java Editor Text Font note, are "set to default: Text Font". The 'default' can be found and configured as follows:

On the Eclipse toolbar, select Window → Preferences. Drill down to: (General → Appearance → Colors and Fonts → Basic → Text Font) (at the bottom)

Click Edit and select the font, style and size

Click OK in the Font dialog

Click Apply in the Preferences dialog to check it

Click OK in the Preferences dialog to save it

Eclipse will remember your settings for your current workspace.

I teach programming and use the larger font for the students in the back.


P
Peter Mortensen

I tend to use menu Windows → Preferences → General → Appearances → Colors and Fonts → Java Text Editors → Change → Apply.


p
praveenj

Try the tarlog plugin. You can change the font through Ctrl++ and Ctrl-- commands with it. A very convenient thing.

https://code.google.com/archive/p/tarlog-plugins/downloads


U
Usman Yaqoob

You can use

ctrl and + or - key


Works for me. Tested with Oxygen on Linux
K
KayV

If you are using STS, then goto STS/Contents/Eclipse directory and open the STS.ini file.

From the STS.ini file, remove the flooring line:

-Dorg.eclipse.swt.internal.carbon.smallFonts

And restart the STS.


V
Vrajendra Singh Mandloi

I Found the best way to increase Font Size in Eclipse:

Follow this path : Eclipse-Folder\plugins\org.eclipse.ui.themes_1.2.100.v20180514-1547\css

--There are a bunch of Files here and it depends on user system which file to change.

* {
  font-size:13;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: normal;
} 

you can even change Font Family if you like.

For Windows Users add the following piece of css at BOTTOM of these files: File Names: e4_default_gtk.css & e4_default_win.css For Mac Users: e4_default_mac.css