如何在 Eclipse for Java 文本编辑器中更改字体大小?
我刚刚尝试通过以下方式更改 Eclipse 3.6.0 中的字体大小:
常规 → 外观 → 颜色和字体 → Java 编辑器文本字体
但是,字体大小仅在我打开的文件中发生变化。如何更改在 Eclipse 中打开的所有 Java 文件和项目的字体大小?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(18)
如果您要更改字体大小,但它仅适用于当前打开的文件,那么我怀疑您更改了错误的首选项。
检查您是否没有针对每个项目的首选项。这些将覆盖顶级首选项。
Eclipse v4.2 (Juno) note
根据下面的注释,该菜单已移至 Eclipse Preferences 菜单(不再命名为 Window 菜单)。
Eclipse v4.3 (Kepler) note
Window 菜单再次启用,即菜单 Window → Preferences。
Eclipse2021-12 note
已验证所描述的路径
(窗口 → 首选项、常规 → 外观 → 颜色和字体 → Java → Java 编辑器文本字体)
仍然是正确的。
注意请务必查看ChandraBhan Singh 的答案,它显示了更改的键绑定字体大小。
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.
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.
对于 Eclipse Neon
增加
Ctrl +
减少 Ctrl -
For Eclipse Neon
To Increase
Ctrl +
To reduce Ctrl -
在 Mac 上:
Eclipse 工具栏 Eclipse → 设置 或 命令 + ,(逗号)
常规 → 外观< /em> → 颜色和字体 → 基本 → 文本字体
申请
On Mac:
Eclipse toolbar Eclipse → Settings OR Command + , (comma)
General → Appearance → Colors and Fonts → Basic → Text Font
Apply
这对我有用:
在 Eclipse 工具栏上,选择窗口 → 首选项。
设置字体大小(常规 → 外观 → 颜色和字体 → 基本 → 文本字体):
保存首选项。
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.
查看图片:
See the image:
Eclipse-Fonts 扩展将添加用于更改字体大小的工具栏按钮和键盘快捷键。然后,您可以使用 AutoHotkey 来设置 Ctrl + 鼠标滚轮缩放。
在菜单帮助 → 安装新软件...下,粘贴更新 URL (http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/) 到 适用于: 文本中框并按 Enter。展开树并选择 FontsFeature,如下图所示:
完成安装并重新启动 Eclipse。然后您应该会看到 A 工具栏按钮(下图中以红色圈出),并能够使用键盘快捷键 Ctrl + - 和Ctrl + = 进行缩放(尽管您可能必须先从 Eclipse 取消绑定这些键)。
要获取 Ctrl + 鼠标滚轮 缩放,您可以通过以下脚本使用 AutoHotkey:
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 Help → Install 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:
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).
To get Ctrl + mouse wheel zooming, you can use AutoHotkey with the following script:
如果您使用的是 Windows,则要增加字体大小,请尝试使用
CtrlShift+
,要减小字体大小,您可以使用
Ctrl移位-
If you are using Windows then to increase font size try with
CtrlShift+
and for decreasing font size you can use
CtrlShift-
按
ctrl
+-
减小,按ctrl
> ++
增加字体大小。它在 Eclipse Oxygen 中对我有用。
Press
ctrl
+-
to decrease, andctrl
++
to increase the Font Size.It's working for me in Eclipse Oxygen.
菜单窗口 → 首选项。 常规 → 外观 → 颜色和字体 → 基本 → 文本字体
Menu Window → Preferences. General → Appearance → Colors and Fonts → Basic → Text Font
在 Eclipse 工具栏上,选择窗口 → 首选项,设置字体大小(常规 → 外观 → 颜色和字体→基本→文本字体)。
保存首选项。
On the Eclipse toolbar, select Window → Preferences, set the font size (General → Appearance → Colors and Fonts → Basic → Text Font).
Save the preferences.
你可以看看 Eclipse 颜色主题,它还有很多用于自定义字体、背景的选项颜色等
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.
运行 Eclipse v4.3 (Kepler),AlvaroCachoperro 概述的步骤可以解决 Java 文本编辑器和控制台窗口文本的问题。
许多文本字体选项,包括 Java 编辑器文本字体注释,都“设置为默认值:文本字体”。可以按如下方式找到并配置“默认值”:
在 Eclipse 工具栏上,选择窗口 → 首选项。深入了解:(常规 → 外观 → 颜色和字体 → 基本 → 文本字体)(位于底部)
Eclipse 将记住当前工作区的设置。
我教编程,并为后面的学生使用较大的字体。
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)
Eclipse will remember your settings for your current workspace.
I teach programming and use the larger font for the students in the back.
我倾向于使用菜单Windows→首选项→常规→外观→颜色和字体 > → Java 文本编辑器 → 更改 → 应用。
I tend to use menu Windows → Preferences → General → Appearances → Colors and Fonts → Java Text Editors → Change → Apply.
您可以使用
ctrl 和 + 或 - 键
You can use
ctrl and + or - key
我找到了在 Eclipse 中增加字体大小的最佳方法:
遵循以下路径:Eclipse-Folder\plugins\org.eclipse.ui.themes_1.2.100.v20180514-1547\css
--这里有一堆文件,它取决于用户系统要更改哪个文件。
如果您愿意,您甚至可以更改字体系列。
对于 Windows 用户,在这些文件的底部添加以下 css 片段:
文件名:e4_default_gtk.css & e4_default_win.css
对于 Mac 用户:e4_default_mac.css
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.
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
尝试 tarlog 插件。您可以通过 Ctrl++ 和 Ctrl-- 命令更改字体。非常方便的一件事。
https://code.google.com/archive/p/tarlog-plugins/下载
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
如果您使用的是 STS,请转到 STS/Contents/Eclipse 目录并打开 STS.ini 文件。
从 STS.ini 文件中删除地板行:
并重新启动 STS。
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:
And restart the STS.