如何在 Xcode 编辑器中增加字体大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1339706/
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 to increase font size in the Xcode editor?
提问by Dev
To increase font-size in Xcode is a pain.
在 Xcode 中增加字体大小是一件痛苦的事情。
采纳答案by Dev
Update! - Behold Xcode 9 to the rescue! Now you can use cmd + to increase the fonts with Xcode 9. It took 5 Major releases for you to get it, Apple! But better late than never.
更新!- Xcode 9 来拯救你!现在你可以使用 cmd + 来增加 Xcode 9 的字体了。你需要 5 个主要版本才能得到它,Apple!但迟到总比不到好。
figured it out - however it was not very intuitive.
想通了 - 但是它不是很直观。
First some Pain Points
先说几个痛点
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!
当您尝试使用编辑 -> 格式 -> 字体直接更改字体大小时,没有任何反应!- 不是一个好的用户体验......此外,当您可以告诉用户他们正在使用默认或“系统拥有的”主题并且他们无法更改它时,为什么要装傻呢?- 糟糕的设计和更糟糕的用户体验......为什么要保持这个选项(Cmd t)活着,顺便说一下,这是在大多数表现良好的 mac 应用程序中增加字体大小的最标准方法,如果你不希望用户改变这个字体道路?
在 Xcode 首选项中,当您尝试通过单击“字体和颜色”来更改字体大小时,XCode 会弹出一个说明需要做什么的弹出窗口。如果 Apple 非常担心用户弄乱了默认设置,那么制作一个副本然后更改字体和颜色需要大量的工作,而不是提供一个显示“恢复为默认值”的按钮!
The solution is that - you need to duplicate the theme and then modify the copy you just made and apply that copy - phew!
解决方案是 - 您需要复制主题,然后修改您刚刚制作的副本并应用该副本 - 呸!
回答by Ted Spradley
For Xcode 4.1
对于 Xcode 4.1
Still a huge pain. Poor UI design (But my mindset does not seem to match the mindset of software engineers that make 100+ character variable and method names. Enough of my complaining)
仍然是巨大的痛苦。糟糕的 UI 设计(但我的心态似乎与制作 100 多个字符变量和方法名称的软件工程师的心态不符。我的抱怨够多了)
I'll modify a previous post for the current version.
我将修改当前版本的先前帖子。
- 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 中打开的所有项目(否则在项目打开时将无法访问字体窗口。)
- 转到 XCode > 首选项 > 字体和颜色
- 从“主题”框中选择您要修改的主题(或选择您要修改的主题并单击主题列表底部的“+”按钮先克隆它以进行备份,因为没有撤消选项)
在源代码编辑器框中,有一个您可以为其设置字体的文本类型列表:纯文本注释文档注释。. .
从源代码编辑器列表中选择任何或所有项目,该特定文本的字体名称和大小将显示在“源代码编辑器”窗口下方的“字体”窗口中。(如果您碰巧跳过突出显示其中之一,您将能够进入字体检查器并选择新大小,但会想知道为什么您所做的更改没有被应用!)
- 在“字体”窗口中,单击字体名称和大小右侧的小、几乎隐藏且设计很差的“T”图标。
- 瞧!只需按 14 次按键,您就可以获得字体检查器窗口!
- 您现有的字体将在字体检查器中预先选择。您现在所做的任何更改都将应用于您在“源代码编辑器”窗口中选择的文本类型。例如所有字体 > Menlo > 常规 > 14
- 关闭你在寻找圣杯时打开的窗户。
Congratulations. Your may now read your code. Wasn't that painless?
恭喜。您现在可以阅读您的代码。那不是无痛吗?
回答by drdiv
Easisest solution:
最简单的解决方案:
Close any open projects.
Xcode > Preferences > Font & Colors
Make sure to press CMD+Ato select all possible text types. Then change the font size from the picker.
关闭所有打开的项目。
Xcode > 首选项 > 字体和颜色
确保按CMD+A选择所有可能的文本类型。然后从选择器更改字体大小。
回答by alecco
- Go to XCode > Preferences > Fonts & Color
- Double click on a font entry to get the Font inspector window
- Select all font entries with sizes you'd like to increase/decrease
- In the Font inspector window select the same font (e.g. All Fonts > Menlo > Regular > 14)
- 转到 XCode > 首选项 > 字体和颜色
- 双击字体条目以获取字体检查器窗口
- 选择您想要增加/减少大小的所有字体条目
- 在字体检查器窗口中选择相同的字体(例如 All Fonts > Menlo > Regular > 14)
Watch out because there's no undo!
当心,因为没有撤消!
回答by PiXy
You can use this plugin to change the font size using ? +
or ? -
(Control -
and Control +
in the latest versions of Xcode. The plugin developers changed the shortcut to avoid conflict with Interface Builder hotkeys):
您可以使用此插件来更改字体大小,使用? +
或? -
(Control -
以及Control +
在最新版本的 Xcode 中。插件开发人员更改了快捷方式以避免与 Interface Builder 热键冲突):
回答by Sergey Nikiforov
You can use the following:
您可以使用以下内容:
- Press xcode->preferences
- select fonts and colors
- select ANY font in the list and press cmd+a (select all fonts)
- select font size for all editor fonts at the bottom of the window
- 按 xcode-> 首选项
- 选择字体和颜色
- 选择列表中的任何字体,然后按 cmd+a(选择所有字体)
- 在窗口底部为所有编辑器字体选择字体大小
回答by Layla Lu
Go to Xcode -> preference -> fonts and color, then pick the presentation one. The font will be enlarged automatically.
转到 Xcode -> 首选项 -> 字体和颜色,然后选择演示文稿之一。字体会自动放大。
回答by Arash Saidi
Actually, this is very easy:
其实,这很容易:
- Go to preferences
- Then to font and colors
- Then select all the text options by clicking on "plain text" then pressing cmd+a
- then click the little t in the font section
- then change the font and size as you wish and it will apply to all the code
- 转到首选项
- 然后是字体和颜色
- 然后通过单击“纯文本”然后按 cmd+a 来选择所有文本选项
- 然后单击字体部分中的小 t
- 然后根据需要更改字体和大小,它将适用于所有代码
Good luck!
祝你好运!
回答by help
Go to
去
Xcode menu > Preferences > Font & Color > Category
Double-click on Plain Text, a popup menu will come up. Change it from there.
双击纯文本,会出现一个弹出菜单。从那里改变它。
回答by SteJav
When changing fonts in XCode from [Preferences] (after duplicating a template that matches colours close to what you want), you can select multiple entries and change the fonts all at once. Use [shift] to select a range or [cmd] to select multiple individual entries (e.g. you might select both 'comments' and 'strings' and change only their fonts).
从 [首选项] 更改 XCode 中的字体时(复制与您想要的颜色相匹配的模板后),您可以选择多个条目并一次更改所有字体。使用 [shift] 选择一个范围或使用 [cmd] 选择多个单独的条目(例如,您可以同时选择“评论”和“字符串”并仅更改它们的字体)。
Steve
史蒂夫