Xcode 中的行高

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5136664/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:20:34  来源:igfitidea点击:

Line height in Xcode

xcodexcode4

提问by Mr H

How do I increase the distance between the lines in Xcode? I mean in the actual code.

如何增加 Xcode 中线之间的距离?我的意思是在实际代码中。

Even when I change the font and font sizes in the Xcode preferences, the code lines are still too close together and it is very annoying.

即使我在 Xcode 首选项中更改字体和字体大小,代码行仍然靠得太近,非常烦人。

回答by jonathan

Also check out the Meslo font; an open source customized version of Menlo that comes with much nicer line-spacing.

另请查看Meslo 字体;Menlo 的开源定制版本,具有更好的行距。

回答by Lucas Derraugh

Prior to Xcode 9, there was no way to change line height. However, now in Xcode 9 the option is available under Xcode>Preferences...>Fonts & Colors at the bottom there is a popup that has the options of "Tight Spacing", "Normal Spacing", and "Relaxed Spacing".

在 Xcode 9 之前,无法更改行高。但是,现在在 Xcode 9 中,该选项在 Xcode>Preferences...>Fonts & Colors 下可用,底部有一个弹出窗口,其中包含“Tight Spacing”、“Normal Spacing”和“Relaxed Spacing”选项。

回答by alphanumeric2

Try using the free, open source Droid Monofont. It has more line spacing build into the font itself.

尝试使用免费的开源Droid Mono字体。它有更多的行间距内置到字体本身。

The tight line spacing in XCode 4 was driving me crazy too!

XCode 4 中的紧行间距也让我发疯了!

回答by alphanumeric2

Create a custom font with whitespace on the top and bottom of the glyphs, install it and set is as the editing font in Xcode.

在字形的顶部和底部创建一个带有空格的自定义字体,安装它并设置为 Xcode 中的编辑字体。

回答by u1938014

Read this:
http://hivelogic.com/articles/top-10-programming-fonts

阅读:http:
//hivelogic.com/articles/top-10-programming-fonts

and download your favorite font and decompress it. After that, open Mac's TextEdit and Format-->Font-->Show Fonts-->click the setting in the left corner beside "+-" -->Manage Fonts-->Click "+" to add the font you just downloaded.

并下载您喜欢的字体并解压。之后,打开Mac的TextEdit and Format-->Font-->Show Fonts-->点击左上角“+-”旁边的设置-->Manage Fonts-->点击“+”添加你刚刚添加的字体下载。

Now you've successfully added a font in your Mac, and you can choose this font in your Xcode preference. The line height of the new font is changed.

现在您已经成功地在 Mac 中添加了一种字体,您可以在 Xcode 首选项中选择这种字体。新字体的行高已更改。

回答by vcarreira

Since Xcode 9 you can open your theme file and specify the desired line spacing through the property DVTLineSpacing. Example for 1.5 line spacing:

从 Xcode 9 开始,您可以打开主题文件并通过属性指定所需的行距DVTLineSpacing。1.5 行距示例:

<key>DVTLineSpacing</key>
<real>1.5</real>