1

I'm migrating a cell-based NSOutlineView to a view-based one, and I'm noticing that text is being rendered differently in the view-based outline view. See this image:

http://i.stack.imgur.com/VQs3d.png

Why the difference? Some background information that may help?

  • This is on Mac OS X 10.7.4
  • The NSOutlineView's highlight style is Source List
  • The NSOutlineView's background color is transparent, and the background is being drawn by an underlying view
  • In the view-based outline view, the cell text is being drawn by an NSTextField in an NSTableCellView
  • Nothing in the view hierarchy is, to my knowledge, layer-backed

I think this describes a similar issue: Weird font anti-aliasing in view-based NSOutlineView, but the solution did not work for me, as (I don't think) any of the cell views or text fields are layer-backed.

4

1 回答 1

1

更新:我已经想通了。在 Interface Builder 中,如果我在表格单元格视图中选择文本字段,选中“绘制背景”并将背景颜色设置为清除 (RGBA 0,0,0,0),则文本看起来像它一样平滑在基于单元格的大纲视图中。

所以我不认为这特别是一个 NSOutlineView 问题。我不知道 Cocoa 文本渲染的内部原理,但我假设这是因为字体平滑会根据绘制文本的背景类型而有所不同。

于 2012-08-15T05:55:08.380 回答