如何在 Eclipse 中为所有文本编辑器更改字体大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23272839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I change font size in Eclipse for ALL text editors?
提问by Jake Toronto
I had to do a presentation yesterday, and as part of the presentation, I used Eclipse to show some code. Many of my coworkers in the room could not read the text and asked me to increase the size of the text for ALL files, not just Java files or XML files.
昨天我不得不做一个演示,作为演示的一部分,我使用了 Eclipse 来展示一些代码。我在房间里的许多同事都无法阅读文本,并要求我增加所有文件的文本大小,而不仅仅是 Java 文件或 XML 文件。
But it wasn't immediately obvious from the available options how to do this. I went to menu Window→ Preferences and typed fontin the search input. This filtered the options to General→ Appearance→ Colors and Fonts. From here, I could see an option to change the font in Java files, but I didn't know how to change the font globally.
但是从可用选项中如何做到这一点并不是很明显。我转到菜单窗口→首选项并在搜索输入中输入字体。这将选项过滤到General→ Appearance→ Colors and Fonts。从这里,我可以看到更改 Java 文件中字体的选项,但我不知道如何全局更改字体。
I'm using Eclipse v4.3 Service Release 1 (Kepler) on Windows.
我在 Windows 上使用 Eclipse v4.3 Service Release 1 (Kepler)。
This is similar to Stack Overflow question How can I change font size in Eclipse for Java text editors?.
这类似于堆栈溢出问题如何在 Eclipse 中为 Java 文本编辑器更改字体大小?.
回答by Jake Toronto
This is what we figured out, and this is also found in this answerand also this answer(I'll quote):
这就是我们发现的,这也可以在这个答案和这个答案中找到(我会引用):
Go to Preferences→ General→ Appearance→ Colors and Fonts, expand the "Basic" folder and select "Text Font" and change that to whatever size you like.
转到Preferences→ General→ Appearance→ Colors and Fonts,展开“Basic”文件夹并选择“Text Font”并将其更改为您喜欢的任何大小。
Pretty simple!
很简单!
回答by gs_za
The answer by @Jakeworks fine on the editor. To also change the font size of the global Eclipse GUI, I have added the follows:
@Jake的答案在编辑器上运行良好。为了更改全局 Eclipse GUI 的字体大小,我添加了以下内容:
*{font-size:8;}
in the file:
在文件中:
ECLIPSE_HOME/plugins/org.eclipse.ui.themes_*/css/e4_default_gtk.css
worked for me. This is explained here: How to change eclipse font sizes
对我来说有效。这在这里解释:如何更改日食字体大小
回答by Guillaume Langlois
Eclipse provides a handy shortcut to shortcut for what is well explained in Jake Toronto answer (only by 2 points increments/decrements though).
Eclipse 为 Jake Toronto 的回答中很好地解释的内容提供了一个方便的快捷方式(尽管只有 2 点增量/减量)。
On MacOS:
在 MacOS 上:
- Increase by 2 points: command + "+"
- Decrease by 2 points: command + "-"
- 增加2点:命令+“+”
- 减少2点:命令+“-”
On Windows/Fedora:
在 Windows/Fedora 上:
- Increase by 2 points: CTRL + "+"
- Decrease by 2 points: CTRL + "-"
- 增加2点:CTRL+“+”
- 减少2点:CTRL+“-”
回答by sirmagid
Go to Preferences → General → Appearance → Colors and Fonts, expand the "Basic" folder and select "Text Font" and change that to whatever size you like.
转到首选项 → 常规 → 外观 → 颜色和字体,展开“基本”文件夹并选择“文本字体”并将其更改为您喜欢的任何大小。
回答by eugen9
The answer by @George worked fine, but if it doesn't work on the file he referred to, then you might try applying the same modification on another file from the same folder: e4_basestyle.css.
@George 的答案工作正常,但如果它对他提到的文件不起作用,那么您可以尝试对同一文件夹中的另一个文件应用相同的修改:e4_basestyle.css。
For me it worked this way (my version of the Eclipse SDK is 4.2.2).
对我来说它是这样工作的(我的 Eclipse SDK 版本是 4.2.2)。
回答by RRTW
Just for reference, if anyone change font settings from Preferences→ General→ Appearance→ *Colors and Fonts**, but it wouldn't work...
仅供参考,如果有人从首选项→常规→外观→*颜色和字体**更改字体设置,但它不起作用......
In my case, it caused by the Eclipse color theme. Just uninstall it.
就我而言,它是由 Eclipse 颜色主题引起的。只需卸载它。
回答by Navin Israni
For XML or HTML Files, you can select the "Structured Text Editors" option instead of "Basic" in the path given by Jake Toronto's answer.
对于 XML 或 HTML 文件,您可以在 Jake Toronto 的回答给出的路径中选择“结构化文本编辑器”选项而不是“基本”。
回答by Topani
- Open Eclipse Preferences
- In left menu select "General>Appearance>Colors and Fonts"
- In the resulting window under the Javanode select "Java Editor Text Font"
- Notice button "Edit Defalt..." is now enabled, click it
- Choose your preferred font settings and click OK
- 打开 Eclipse 首选项
- 在左侧菜单中选择“常规>外观>颜色和字体”
- 在Java节点下的结果窗口中选择“ Java Editor Text Font”
- 注意按钮“ Edit Defalt...”现在已启用,单击它
- 选择您喜欢的字体设置,然后单击“确定”
Now you will notice that all editor fonts have changed to your selected default (if they were set to the default to begin with). Also you can now change any editor back to this setting by selecting the editor font setting and clicking "Go to Default"
现在您会注意到所有编辑器字体都已更改为您选择的默认值(如果它们一开始就设置为默认值)。此外,您现在可以通过选择编辑器字体设置并单击“转到默认值”将任何编辑器更改回此设置