包装核心文本/核心图像的 Objective-C 库?
使用 CATiledLayer 绘制大型可滚动内容在我的应用程序中效果很好。不太有效的是使用 C 中的 Core Text 和 Core Image API 绘制图像和多行文本。
我有一种强烈的感觉,我正在尝试重新发明轮子,围绕 C 函数编写我自己的 Objective-C 包装器类像CGContextShowTextAtPoint
,用CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1))
等镜像所有内容。
我不能使用UIKit的上下文绘制方法,因为它们由于 CATiledLayer 中的并发背景绘制而导致竞争条件崩溃。
已有哪些 Objective-C 库包装了核心文本和图像函数以便于在后台上下文中使用?
干杯,EP。
更新:按照现在的情况,除了广泛描述 CoreText 的 Apple 文档之外,我还将满足于书籍或在线资源的提示。
Drawing large scrollable content with CATiledLayer works great in my application. What does not work so great is drawing images and multiline text with the Core Text and Core Image APIs in C.
I have the strong feeling that I'm trying to reinvent the wheel, writing my own Objective-C wrapper classes around the C functions like CGContextShowTextAtPoint
, mirroring everything with CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1))
etc, etc, etc.
I can't use UIKit's context draw methods, because they cause race-condition crashes due to the concurrent background drawing in CATiledLayer.
What Objective-C libraries are already out there, that wrap the Core Text and Image functions for ease of use in a background context?
Cheers, EP.
UPDATE: The way things are going now, I will also settle for hints at a book or online resource other than the Apple Docs that extensively describe CoreText.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,一周后,尽管 cocoaobjects.com 上的库列表非常全面,但我仍然没有找到一个库。 。我现在已经编写了自己的包装器,尽管感觉很多余。
很有帮助的是 《iPhone 开发者开始 iPad 开发:掌握 iPad SDK》一书的第 5 章。它对核心文本有一个非常好的介绍,特别是指出免费桥接和不透明 C 类型的块。
So a week later I have come no closer to finding a library, although the list of libraries at cocoaobjects.com is very comprehensive. I have written my own wrappers now, even though it feels redundant.
What helped a lot was chapter 5 of the book "Beginning iPad development for iPhone developers: Mastering the iPad SDK". It has a very nice introduction to Core Text, especially with the block pointing out the toll-free bridging and the opaque C-types.