Mic*_*sai 13 xcode fonts xcode5 xcode6
使用Xcode时,似乎没有办法将代码编辑器字体设置为锐利(即没有'字体平滑).尽管您可能会在"首选项">"字体和颜色"的预览区域中看到,但在实际代码视图中,它始终是平滑/消除锯齿的.
有些旧 问题可以解决以前版本的Xcode问题.他们建议使用改变各种设置defaults write com.apple.dt.Xcode <etc>,但这些似乎不会影响我在Mac OS X 10.8.5上的Xcode 5中的代码视图.我正在使用带有一个Retina和一个非Retina屏幕的双显示器设置.
我已经尝试关闭系统首选项>常规>"使用LCD字体平滑可用"中的字体平滑复选框,但这仅影响子像素渲染...
更新(2014-11-25):Mac OS X 10.10.1和Xcode 6.1.1仍然存在问题.以下是使用这些终端命令后显示编辑器视图(平滑)和首选项窗口(未平滑)的屏幕截图:
defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold 16
Run Code Online (Sandbox Code Playgroud)

从Xcode9.3开始,可以通过运行以下命令在源代码编辑器中禁用文本消除锯齿并重新启动Xcode:
defaults write com.apple.dt.Xcode SourceEditorDisableAntialiasing -bool YES
Run Code Online (Sandbox Code Playgroud)
要再次打开抗锯齿 -
defaults write com.apple.dt.Xcode SourceEditorDisableAntialiasing -bool NO
Run Code Online (Sandbox Code Playgroud)
如果您使用非视网膜显示器,请尝试
defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES并重新启动XCode.
更新:
同时调用:
defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold 24
Mike Ash说他能够构建一个Xcode插件来告诉文本视图使用屏幕字体.看起来这很简单,虽然我还没有尝试过.
一般策略(从他的推文中)将是"修补-[NSTextView drawRect:]和做" [[self layoutManager] setUsesScreenFonts: YES];.
更新(2015-08-14):这是Ash和Xcode项目中针对其插件的解释性博客文章.如果我添加到Xcode 6.4,它对我有用.我认为这个问题解决了!7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90DVTPlugInCompatibilityUUIDs
更新(2016-06-20):从Xcode 8开始,你不能使用Xcode插件,但是这个用户默认工作:
defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4488 次 |
| 最近记录: |