22

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

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

4

7 回答 7

19

还可以查看Meslo 字体;Menlo 的开源定制版本,具有更好的行间距。

于 2011-10-24T07:23:28.043 回答
6

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

于 2011-02-27T23:38:13.117 回答
5

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

<key>DVTLineSpacing</key>
<real>1.5</real>
于 2017-09-22T11:41:30.380 回答
3

尝试使用免费的开源Droid Mono字体。它在字体本身中内置了更多的行距。

XCode 4 中紧凑的行距也让我抓狂!

于 2011-05-20T04:21:15.433 回答
2

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.

于 2011-02-27T23:52:07.973 回答
1

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

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

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

于 2013-09-20T07:38:17.447 回答
0

编辑文件中的DVTLineSpacing属性.xccolortheme以更改行高。

  1. 打开任何.xcolortheme文件~/Library/Developer/Xcode/UserData/FontAndColorThemes

  2. 编辑DVTLineSpacing密钥。如果没有,请将其添加到文件中,替换1.8为您想要的行距:

<key>DVTLineSpacing</key>
<real>1.4</real>
  1. 关闭并重新打开 Xcode

默认情况下,Xcode 使用1紧密间距,常规间距没有键,以及1.2宽松间距。

使用 Xcode 12.2 和 Mac OS 10.15 测试。

于 2021-02-08T02:10:55.273 回答