在Xcode中增加字体大小是一件痛苦的事情。


当前回答

对于 XCODE 13+

在最新版本的编辑器(目前Xcode 13)中,只需按“cmd”+“+”来增加文本大小。减少文本大小按“cmd”+“-”。事情就是这么简单。除此之外,你可以在Xcode Preferences -> Themes中为每个类别指定文本大小/字体/颜色。

其他回答

更新!看Xcode 9来拯救你! 现在你可以使用cmd +来增加Xcode 9的字体。 你花了5个主要版本才得到它,苹果!但迟到总比不到好。

我算出来了,不过不是很直观。

首先是一些痛点

When You try to change the font size directly using edit -> format -> font, nothing happens! - Not a good UX ... moreover why play dumb when you can tell user that they are using default or "System-owned" theme and they cannot change it? - Bad Design and more bad UX ... Why keep this option (Cmd t) alive, which by the way is most standard way to increase font size across most well behaved mac apps, if you do not want user to change the font this way? In Xcode preferences, when you try to change the font size by clicking on "fonts and colors", thats when XCode gives a pop-up saying what needs to be done. Also making a duplicate and then changing the fonts and colors is a lot of work rather than giving a button that says "Restore to Defaults" if Apple is so worried about the user messing up the default settings!

解决方案是-你需要复制主题,然后修改你刚刚制作的副本,并应用该副本-唷!

对于Xcode 4.1

仍然是一个巨大的痛苦。糟糕的UI设计(但我的心态似乎与那些制作100多个字符变量和方法名的软件工程师的心态不一样。我的抱怨够多了)

我将为当前版本修改以前的一篇文章。

Close any projects you have open in Xcode (Otherwise the Font window will be inaccessible while a project is open.) Go to XCode > Preferences > Fonts & Color From the 'Theme' box select the theme you want to modify (or select the theme you want to modify and click the "+" button at the bottom of the theme list to clone it first for backup, for there is no undo option) In the source editor box there is a list of types of text that you may set the font for: Plain text Comments Documentation Comments . . . Select any or all items from the source editor list and the name and size of the font for that particular text will show up in the 'Font' window below the 'Source Editor' window. (If you happen to skip highlighting one of these, you will be able to get to the Font Inspector and select new sizes, but will wonder why the changes you make are not being applied!) In the 'Font' window, click the small, almost hidden, and surely poorly design 'T' icon to the right of the font name and size. Voila! In only 14 keystrokes you are able to get the Font inspector window! Your existing font will be preselected in the font inspector. Whatever changes you make now will be applied to the text types you selected in the 'Source Editor' window. e.g. All Fonts > Menlo > Regular > 14 Close the windows you opened on this hunt for the holy grail.

祝贺你。你现在可以阅读你的代码了。 这难道不痛苦吗?

对于Xcode版本12.3及以上(不确定它是否适用于一些旧版本,但你可以尝试一下)

Xcode

-> Preferences -> Themes 
-> Select your favourite theme on left panel 
-> SourceEditor 
-> Select All (`cmd + A`) 
-> Click on T option 
-> Select size

当在XCode中从[Preferences]更改字体时(在复制一个与你想要的颜色匹配的模板后),你可以选择多个条目并一次更改字体。使用[shift]选择一个范围或[cmd]选择多个单独的条目(例如,您可以同时选择'comments'和'strings',只更改它们的字体)。

史蒂夫

我还发现,您可以更改由“打印”主题控制的打印字体。我希望打印输出与默认值相同,但是使用更大的字体。

将“打印”重命名为“printing1”(选择打印主题并单击它,它应该允许您更改名称)。 点击“+”,从“New Theme from Template”选择“Default” 重命名为“印刷” 点击字体区域的“Source Editor”和cmd-A选择所有字体 通过点击“T”图标并选择所需的字体大小,将字体大小更改为所需的值(我喜欢12点)

在此之后,打印输出应该匹配新的“打印”模板(即颜色和更大,或无论你如何制作模板),关键是打印从“打印”主题中获取其格式。