简体   繁体   English

Objective-C库包装Core Text / Core Image?

[英]Objective-C libraries wrapping Core Text / Core Image?

Drawing large scrollable content with CATiledLayer works great in my application. 使用CATiledLayer绘制大型可滚动内容在我的应用程序中运行良好。 What does not work so great is drawing images and multiline text with the Core Text and Core Image APIs in C. 使用C中的核心文本和核心图像API绘制图像和多行文本的效果不是很好。

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. 我有强烈的感觉,我正在尝试重新发明轮子,围绕C函数编写我自己的Objective-C包装类,如CGContextShowTextAtPoint ,使用CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1))镜像所有内容CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1))等)等等。

I can't use UIKit's context draw methods, because they cause race-condition crashes due to the concurrent background drawing in CATiledLayer. 我无法使用UIKit的上下文绘制方法,因为它们会因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? 哪些Objective-C库已经存在,它们包含Core Text和Image函数以便在后台环境中使用?

Cheers, EP. 干杯,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. 更新:现在的方式,我还将解决除了广泛描述CoreText 的Apple Docs之外的书籍或在线资源的提示。

So a week later I have come no closer to finding a library, although the list of libraries at cocoaobjects.com is very comprehensive. 所以一周之后我就没有找到一个图书馆,尽管cocoaobjects.com上的图书馆列表非常全面。 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" . 帮助很多的是“为iPhone开发人员开始iPad开发:掌握iPad SDK”一书的第5章 It has a very nice introduction to Core Text, especially with the block pointing out the toll-free bridging and the opaque C-types. 它对Core Text有一个非常好的介绍,特别是该块指出了免费桥接和不透明的C类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM