How to Insert NSAttributedString using custom keyboard extension?

前端 未结 2 1663
名媛妹妹
名媛妹妹 2020-12-31 13:38

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.



        
2条回答
  •  佛祖请我去吃肉
    2020-12-31 14:23

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

    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.

提交回复
热议问题