How can I configure the font size for the tree item in the package explorer in Eclipse?
Asked Answered
O

24

129

How can I configure the font size for the tree item in the package explorer/outline in Eclipse?

Which item in Font under Preferences I should change?

Oldenburg answered 26/6, 2010 at 16:36 Comment(1)
S
102

In 2010, there was no way in Eclipse to change the font used for Package Explorer and other such views. You can only change the font for editor views. This is a policy decision on the part of the Eclipse developers (see, e.g., bugs 49548, 202091). (Grumble.) The font used is the one set by the general look-and-feel for whatever desktop you are using.

On Linux it is possible to override the system font when you invoke Eclipse. An excellent writeup of various possibilities is here, to which I owe this answer. I'll repeat one suggestion from there for posterity. Create a file named, say, gtkrc-eclipse:

style "eclipse" {
  font_name = "Sans Condensed 8"
}
class "GtkWidget" style "eclipse"

Then set a certain environment variable when invoking eclipse:

$ GTK2_RC_FILES=gtkrc-eclipse eclipse
Secretory answered 19/10, 2010 at 15:39 Comment(4)
It did not work in Eclipse Luna; in Eclipse Juno and Aptana Studio 3 it works for me...Chinook
Works in Luna SR1 for me.Kirbykirch
The "there is now way" clause is no longer applicable/correct for modern versions of eclipse. It must have been a great answer at some point in time, but this site is not a good fit for evolving Q&A for new versions of software. See other answers below, they vary a bit by OS flavor!Proline
everyone reading this please vote up bugs.eclipse.org/bugs/show_bug.cgi?id=49548Saritasarkaria
M
60

Does your Eclipse .ini file contain a reference to 'smallFonts?' On Mac you might see something like...

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

If you remove this line, you'll see the font size in various views fatten up.

Maffa answered 6/4, 2012 at 16:31 Comment(5)
FYI in STS on OS X, this configuration is in STS.app/Contents/MacOS/STS.iniCranny
Or: if you add this line, one nicely gets smaller fonts on Ubuntu.Subjective
There are more than one occurrences of the mentioned line. After I removed all of them, it worked. That is on Eclipse for Android version 23.0.Disentail
Worked for me on El Capitan / Mars.2. Location was Applications/Eclipse.app/Contents/Eclipse/eclipse.iniAnceline
The location moved to the Eclipse folder: https://mcmap.net/q/175495/-eclipse-ini-file-not-present-on-macBiochemistry
K
25

On Windows 7, you can affect many of the Eclipse GUI fonts, including the Project Explorer by going to:

Control Panel → PersonalizationWindow Color and AppearanceAdvanced Appearance Settings

Change the font size for "Message Box".

Of course this messes with the appearance of other stuff in your OS, but I've found that tolerable compared to squinting at the project explorer...

Kalikow answered 4/12, 2012 at 16:26 Comment(2)
Be warned that some plugins may override window's settings and have their own font system in Preferences > Colors and Fonts, like EGit.Candelabrum
To find these settings in the latest Windows 7: Control Panel -> search for "Window color", click "Change window colors and metrics".Monterrey
G
18

I just found all those answers for changing the tree view font size in Eclipse, tried several and finally got on the CSS class which reads quite more fashionable to me:

The theme I'm using includes the "e4_basestyle.css" in eclipse/opt/plugins/platform/css. There I added

.MPart Tree {
    font-size: 10;
}

which works very fine with me (Eclipse v4.3-SR2 (Kepler) on Ubuntu).

Gasket answered 15/7, 2014 at 15:25 Comment(4)
Worked for me with MARS on Linux Mint as well. Attn: the CSS files are now located in the theme-plugin's folder.Dorsman
worked fine here too. Mars 4.5.2 on windows 7. Exact location of file <eclipsefolder>/plugins/org.eclipse.ui.themes_1.1.1.v20151026-1355/css/e4_basestyle.cssYevetteyew
On my Ubuntu 14.04, when using the default classic theme, the file in eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css to change was e4_classic_winxp.css for some reason. This was confusing, as it is far from obvious that I should use winxp version, and not the win7, or even the default. Finally it worked.Klipspringer
Where is this css file located on Mac? I can't find it in the plugins directory within the install location (/Applications/Eclipse\ Mars.app/...)Klipspringer
U
17

This answer applies to Mac OS X user. Tested with Mavericks (10.9.2) but should work in all versions.

As stated before in previous answers, to change the font size in package explorer you need to change system font size. The problem here is to do exactly this. My solution:

  1. Download the free Tinker Tool utility and adjust font sizes.
  2. Restart Eclipse

enter image description here

The results:

enter image description here

Happy coding!

Upbeat answered 26/3, 2014 at 15:53 Comment(4)
Works for me. I'm on YosemiteTrematode
Works for me on Sierra! Thank youCirque
Works for me on High Sierra (10.13.2)! Thanks a looooot!Anastasius
As mentioned in this answer, it's the "Help tags" font which needs changing to affect the Eclipse UI.Tessietessier
E
16

Here is an option that works on my Windows7 machine suggested by Diego V: https://mcmap.net/q/175494/-i-cannot-change-the-font-size-of-package-explorer-in-eclipse

On Juno you can adjust that font by CSS.

Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css for your current style sheet (probably e4_default_win7.css), and then just add the following rule:

#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
    font-size: 10px; /* <-- Desired font size */
}
Ehrman answered 17/7, 2013 at 8:9 Comment(3)
Unfortunately, this doesn't behave correctly when the project is added to a repo (which means the little icons of version control appears beside each file). I am saying behave, not working, because some of the files appears with correct font and some don't! and they keep on changing every a couple of seconds! Looks weird.Garnetgarnett
@AbdalrahmanShatou: I have experienced this "flashing" also, font gets big, font gets small, and vice-versa all the time, when clicking on the elements. I am using Eclipse Mars 4.5.1. and - like You I am also using a (.git) repository. I guess this is the trigger.Aorist
You need to also change the font for the git plugin to match this setting. Windows-> preferences->General->Appearance->Colors and Fonts Change the font in 2 git entries to 12 also • Ignored Resource (Font) • Uncommitted Change Font Then restart eclipseDutchman
F
9

Go into eclipse/plugins/org.eclipse.ui.themes_1.1.0.v{HERE_SOME_DIGITS}\css.

Here you see your installed theme CSS files. Choose you theme, and add at the end of file (for example, e4_default_win7.css):

#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
    font-size: 10px; /* <-- Desired font size */
    font: Consolas;  /* <-- Font you want to have */
}

It was tested with Eclipse v4.4 (Luna) and Eclipse v4.5 (Mars) on Windows 7.

Fictionist answered 27/8, 2015 at 9:44 Comment(2)
Thanks! Works great on Mars 4.5.1 on Windows 8.1 - I have a Lenovo X1 Carbon with a WQHD+ (2560 x 1440) screen and the default font size was impossible. This fixed it nicely. Someone needs to nudge the core Eclipse team and make them aware that these sorts of very high-res screens are becoming more common and some simple user control is needed...Thanks!Dipole
works in Eclipse kepler linux with the file e4_default_gtk.cssPhratry
R
7

FYI:

From Eclipse v4.4 (Luna):

It looks like the CSS files are no longer in the old folder:

eclipse/plugins/org.eclipse.platform_4.x.x.vy/css

They are moved to the new folder:

 eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css

And you must select a theme to apply it, in the menu

WindowsPreferencesGeneralAppearance

Rooker answered 27/8, 2014 at 8:28 Comment(0)
C
7

Eclipse v4.5 (Mars) using the built-in dark theme on Linux.

eclipse/plugins/org.eclipse.ui.themes_1.1.0.v20150511-0913/css/dark/e4-dark_globalstyle.css

Around line 204, you can add your chosen font size:

background-color: #2F2F2F;
color: #CCC;
font-size: 8;
Cithara answered 2/8, 2015 at 22:35 Comment(3)
Works great with Mars on OS/X. If you wonder, the CSS path where these values are is Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > TreeCentromere
Confirmed. quick tip, search for "tree" as of today, its the only grouping with text = "tree". DONT search for font-size, this is what you have to add. Recommending 14 pt for 1080pValine
Worked fine for Eclipse Oxygen Release (4.7.0), under Cent-OS with Gnome 3.14.2. Thanks!Walli
J
6

As someone has already mentioned previously, modifying the "e4_basestyle.css" file worked for me on Eclipse v4.3 (Kepler) and Windows 8.

Also, I find that you must also change the text size/style under

PreferencesTeamGitLabelDecorations

or

PreferencesAppearanceColorsAndFonts, under the Git section.

to make sure that text size/colors for uncommitted files are in sync with your changes. This is of course if you initialise your project as a repository.

Jarodjarosite answered 1/10, 2014 at 0:38 Comment(0)
Y
4

Eclipse uses a system user interface font for Project Explorer, so you can change it with an OS-specific method. Note: Eclipse will have to be restarted even if other apps respond immediately to the font change.

  • On Linux (Gnome), I was able to alter Eclipse's font with Gnome Tweak Tool (Applications → Utilities → Tweak Tool). If it's not already installed, try sudo yum install gnome-tweak-tool or sudo apt-get install gnome-tweak-tool. In the Fonts page, change the Interface font.
  • On Windows 7, go to Control Panel → Personalization → Window Color and Appearance → Advanced Appearance Settings → Change the font size for "Message Box". (credit: Nathan Monteleone)
  • On Mac, unpack the Tinker Tool, run it, go to the Fonts tab and adjust the size of Help tags (tested with Eclipse 2018-12).

Some other parts of Eclipse will also be affected, such as the startup dialog.

Yonah answered 19/1, 2019 at 0:38 Comment(0)
E
3

Eclipse inherits the font size of the GUI items, from the operating system. For a demo for example you might want to increase the font size of your OS.

Elfin answered 28/7, 2012 at 10:30 Comment(0)
O
2

The following solution works on Mac OS with Eclipse v4.4 (Luna).

Choose Mac appearance: menu WindowPreferencesGeneralAppearancesTheme: Mac.

Add a copy of the following code snippet contained in

plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css

to the end of the file

plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/e4_default_mac.css.


Tree,
RegistryFilteredTree,
/* The following are required due to Bug 419482 (see <1>): */
Composite > Tree,
TabFolder > Composite > Tree,
TabFolder > Composite > * > Tree,
DocCommentOwnerComposite > Group > Tree,
TabFolder > Composite > ScrolledComposite > Tree,
Shell > Composite > Composite > Tree,
Composite > Composite > Composite > Group > Tree,
Shell > Composite > Composite > Composite > Tree,
ScrolledComposite > Composite > Composite > Composite > Tree,
Shell > Composite > Composite > Composite > Composite > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU']
[style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Tree, Shell[style~='SWT.RADIO']
[style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT']
[style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Tree {
    font-size: 13;
}
Orb answered 19/11, 2014 at 15:29 Comment(0)
A
2

In Windows 10,

at the left bottom corner click on the Windows symbol, enter "Display settings", then go to "Advanced display settings", then go to "Advanced sizing of text and other items", there You'll find "Change only the text size":

You'll see a list of

  • Title Bars
  • Menus
  • Message Boxes
  • Palette titles
  • Icons
  • Tooltips

Switch at least "Message Boxes" to font size e.g. 13 instead of 9 (for Eclipse Package Explorer Tree).

I would switch "Menus" also to font size 13 (for Eclipse main menu).

Or all of them :-)

Aorist answered 23/12, 2015 at 18:17 Comment(0)
C
1

For Mac users:

In file:

plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css

Find this code snippet:

Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {

    background-color: #2F2F2F;
    color: #CCC;
}

Modify it adding information about the font size:

Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {

    background-color: #2F2F2F;
    color: #CCC;
    font-size: 13;
}

This example is for the Dark theme in Eclipse v4.4 (Luna).

Coexecutor answered 17/11, 2014 at 22:23 Comment(1)
It worked on mac Mojave + Spring Tool Suite 4, ThanksWhiskey
P
1

Ubuntu, Eclipse v4.4 (Luna)*

  1. Locate your: eclipse/plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css
  2. Pick the CSS file that you are using per PreferencesGeneralAppearance inside the Eclipse UI.
  3. Backup the original and add something like the following, after first closing Eclipse just for safety:

    .MPart Tree { font-size: 14; }

*It was performed on ScalaIDE version of Eclipse v4.4 (Luna) and should be the same for regular Eclipse v4.4 (Luna), I think.

Proline answered 3/2, 2015 at 16:10 Comment(0)
A
1

On Windows 10, if you got hit by the Creators Update:

The Windows 10 Creators Update apparently removed the ability to "Change only the text size" in "Display settings". In addition the update reset my previous text size setting so that I ended up with small font size in the tree items of the package explorer.

A solution that worked for me is to use a small tool 'A+ System Font Size Changer'. There, increasing the "Message box" setting to 4 (a custom unit defined by the tool) and applying the setting changed the font size in the items of the package explorer.

The tool also allows you to increase the size of "Menu", "Title bar", "Palette title", "Icon" (which worked wonders on the display of folders in windows explorer), and "Tooltip".

P.S.: I would have preferred to comment on the answer from Hartmut, but my reputation score is too low.

Update 2022-06-10: The tool also works with Windows 11. The UI changed a bit (e.g. the size setting unit of measure is different now, a value of 12 on all settings worked for me).

Agathy answered 2/6, 2017 at 8:16 Comment(0)
I
1

In windows server,

go to control panel-->Display section. Display section If default setting is Smaller like picture,you can change the size for your demand,also you can change only the specific text size by option

Note: It is applied based on system setting ,not only for Eclipse based platform.

Inbreathe answered 13/8, 2018 at 1:30 Comment(0)
B
0

To change fonts in eclipse workspace with ubuntu, I modified system fonts desktop > system > preferences > appearance > fonts also modified eclipse indigo -> windows > preferences > General > Appearances > Colors and fonts. It reflected in eclipse.

Barnwell answered 24/1, 2013 at 13:28 Comment(1)
There are no entries there for the tree view settings.Californium
D
0

In Eclipse v4.2 (Juno) you can modify the CSS by going to menu WindowPreferencesGeneralAppearances.

Enter image description here

Dillydally answered 30/10, 2013 at 6:30 Comment(1)
I don't see this CSS editor on this page on MacOS: Version: Juno Service Release 2, Build id: 20130225-0426.. Is it anywhere else?Cheongsam
D
0

In Windows 8,

  1. go to Control Panel -> Appearance and Personalization -> Display
  2. In the middle of the screen there is a drop down under the heading Change Only the Text Size, select Message bokes.
  3. Change the font size in the adjacent drop down.
Disparate answered 16/1, 2014 at 0:38 Comment(0)
C
0

In Eclipse v4.4 (Luna) Service Release 2 (4.4.2) under Windows 7:

If you select the "Windows" theme (Eclipse default configuration)

[Window => Preferences => General->Appearance -> Theme: Windows]

You could add the following code snippet into below css file.
[Eclipse root folder]\plugins\org.eclipse.ui.themes_x.x.x.vxxxxxxxx-xxxx\css\e4_default_win7.css

Tree,
RegistryFilteredTree,
/* the following are required due to Bug 419482 (see <1>): */
Composite > Tree,
TabFolder > Composite > Tree,
TabFolder > Composite > * > Tree,
DocCommentOwnerComposite > Group > Tree,
TabFolder > Composite > ScrolledComposite > Tree,
Shell > Composite > Composite > Tree,
Composite > Composite > Composite > Group > Tree,
Shell > Composite > Composite > Composite > Tree,
ScrolledComposite > Composite > Composite > Composite > Tree,
Shell > Composite > Composite > Composite > Composite > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Tree {
    font-size: 13;
}

The value of font-size could be set as wish.

If you install other customized theme packages such as the Eclipse Moonrise UI Theme from Eclipse Marketplace, there will be the JAR file under [Eclipse root folder]\plugins
(Example: com.github.eclipseuitheme.themes.moonrise-ui_0.8.9.201404052318.jar)

Modify below the CSS files in this JAR file
\themes\css\moonrise-ui-standalone.css and moonrise-ui-standalone_WIN.css
There is similar code section in these CSS files starting with:

Tree,
RegistryFilteredTree,

Add the "font-size:13;" like the above code snippet and apply via the below steps.

Menu WindowPreferencesGeneralAppearanceTheme: MoonRise (standalone)

Chintzy answered 19/6, 2015 at 4:25 Comment(0)
U
0

I have two screens, a small and a large one. Eclipse is using the size settings from the "main screen". In my case that was a small screen with a scaling of 150%.

Switching the main screen to the large screen resolved the size issues for me.

Unprincipled answered 28/3, 2018 at 12:53 Comment(0)
G
0

In Windows 10 Environements it is not possible to change the text size of the package explorer within Eclipse. he only thing you can do is to change the text size in the OS settings.

Go to Settings (Windows + I) then Ease of Access then Display.

There you can change the text size in the "Make text bigger" section. This applies directly to the package explorer in Eclipse.

Gregor answered 11/1, 2021 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.