From e601172580e0803297fe6b4c86e5d71269c4cced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=85=8B?= Date: Tue, 19 Mar 2013 15:10:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5core=20text=E4=BE=8B=E5=AD=90?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/2013/2013-03-11-core-text.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_posts/2013/2013-03-11-core-text.md b/_posts/2013/2013-03-11-core-text.md index 7599b91..cdc89c7 100644 --- a/_posts/2013/2013-03-11-core-text.md +++ b/_posts/2013/2013-03-11-core-text.md @@ -150,6 +150,9 @@ CFMutableAttributedStringRef和NSMutableAttributedString就是其中的一对, callbacks的结构体为CTRunDelegateCallbacks,主要是包含一些回调函数,比如有返回当前run的ascent,descent,width这些值的回调函数,至于函数中如何鉴别当前是哪个run,可以在CTRunDelegateCreate的第二个参数来达到目的,因为CTRunDelegateCreate的第二个参数会作为每一个回调调用时的入参。 ###三.Core Text实战 +这里使用Core Text实现一个和之前NSTextView显示类似的图文混排的例子。 + +![](http://ww4.sinaimg.cn/large/65cc0af7gw1e2v3mj0xsrj.jpg) 直接贴上代码大家体会下: