iPad 上字体的亚像素渲染
ClearType 等子像素字体渲染可显着提高字体显示分辨率并提高屏幕可读性。我如何对字体的子像素渲染进行编程(一般而言),以及如何在 iPad 上实现这一点(iOS 设备上的 C、C++ 或 Objective-C)? iPad 上某些尺寸的字体非常模糊,我知道 iPad 的显示屏可以很好地使用这种技术...
那么,我将如何为 iPad 开发字体渲染引擎(例如,我如何访问 我是否使用 OpenGL?是否有用 C、C++ 或 Objective-C 编写的适用于 Mac OS X 的现有开源字体渲染引擎?)
Sub-pixel font rendering like ClearType dramatically improves font display resolution and improves screen readability. How would I program sub-pixel rendering of a font (in general), and how can this be achieved on the iPad (C, C++, or Objective-C on an iOS device)? Fonts are quite blurry at certain sizes on the iPad, and I know that the iPad's display would work well with this technique...
So, how would I develop a font rendering engine for the iPad (e.g. How do I even access sub-pixels? Do I use OpenGL? Is there an existing open-source font rendering engine written in C, C++, or Objective-C for Mac OS X?)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iPad 上的每个像素都是由红色、绿色和蓝色分量组成的矩形,因此人们可能会认为子像素字体渲染对于该设备来说是一个不错的选择。
但考虑到该设备可以轻松地从纵向模式更改为横向模式,并且应用程序预计会响应该更改。这意味着您的子像素字体机制也必须响应该更改,并且您需要为每种字体提供两个单独的子像素描述。
现在考虑一个事实,开发人员希望能够编写在一次购买/下载后在平板电脑和手机上运行的通用应用程序。但请看看下图中各代手机上不同的像素配置。回想一下,每一个都需要在纵向模式和横向模式下以不同的方式描述字体。现在您拥有大量的字体描述。
现在回想一下,我们谈论的是便携式设备,其中最宝贵的资源是电池,而子像素字体渲染的计算量更大。
我猜这与导致苹果公司放弃子像素字体渲染而希望显示技术将像素密度提高到不再需要的程度(iPhone 上的视网膜显示屏)的思维过程并没有太大不同4 是朝着这个方向迈出的第一步。)
我敢打赌,在 iPad 的未来版本中,我们将拥有类似密度的显示屏,而且它不会那么重要。到那时,您为 iPad 应用程序发明子像素字体渲染机制而投入的任何努力都将立即变得无用,因此我建议不要走这条路。
Each pixel on the iPad is a rectangle of red, green, and blue components, so one might think that sub-pixel font rendering would be a good choice for the device.
But consider that this device can be easily changed from portrait to landscape modes, and applications are expected to respond to that change. This would imply that your sub-pixel font mechanism would also have to respond to that change, and you would need two separate sub-pixel descriptions for each font.
Now throw in the fact that developers expect to be able to write universal applications that run on the pad and the phones in a single purchase/download. But look at the different pixel configurations on the various generations of the phones in the image below. Each of those, recall, would need to describe fonts differently in portrait mode and landscape mode. Now you have an explosion of font descriptions.
Now recall that we're speaking of portable devices where the most precious resource is the battery, and sub-pixel font rendering is more computationally intensive.
I'm guessing that this is not too different from the thought process that led Apple to eschew sub-pixel font rendering in favor of hoping that display technology increases pixel density to the point where it is no longer necessary (the retina display on the iPhone 4 being the first step in that direction.)
I would wager that in some future edition of the iPad, we'll have a display with similar density, and it won't matter as much. Any effort that you invest trying to invent a sub-pixel font rendering mechanism for your iPad application will immediately become obviated at that point, so I would recommend not going down that path.