如何使用自定义键盘扩展插入NSAttributedString? [英] How to Insert NSAttributedString using custom keyboard extension?

查看:100
本文介绍了如何使用自定义键盘扩展插入NSAttributedString?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用键盘扩展程序在一些自定义字体中编写文本作为这些应用程序( 1 2 3 4 ) 是做。我知道如何在文档代理中插入普通字符串。

I want to write text in some custom fonts using keyboard Extension as these apps (1,2,3,4) are doing. I know how we can insert normal string in document proxy.

    [self.textDocumentProxy insertText:mystring];

我试图使用上面的方法插入 NSAttributedString 方法,但我看不到任何方法将 NSAttributedString 插入文档代理。

I have tried to insert NSAttributedString using above approach but I can't see any way to insert NSAttributedString to document proxy.

有人可以指导摆脱这个问题的最好方法是什么?任何建议将不胜感激。

Some one can guide what will the best way to get rid of this issue? any suggestion will be appreciated.

推荐答案

无法使用文本文档代理插入属性字符串(或其他丰富内容) 。

It is not possible to insert attributed strings (or otherwise rich content) using the text document proxy.

您链接的键盘不使用自定义字体。他们使用(或滥用)Unicode符号,例如 Enclosed Alphanumerics 附上字母数字补充

The keyboards you have linked are not using custom fonts. They use (or abuse) Unicode symbols such as Enclosed Alphanumerics and Enclosed Alphanumeric Supplement.

在其他情况下,不同的字母表与拉丁符号具有视觉相似性的符号用于创建时髦文本,如此处

In other instances, different alphabet symbols with visual similarity to latin symbols are used to create "funky" text, like here.

最后,某些键盘扩展程序(如图像键盘)使用粘贴板复制富图内容,用户有责任将其粘贴到他认为合适的位置。

Last, some keyboard extensions, like the image keyboards, use the pasteboard to copy the rich content, and the user is responsible to paste it where he seems fit.

这篇关于如何使用自定义键盘扩展插入NSAttributedString?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆