开发者

Determine font(s) used in uipasteboard text on the iPhone

Here is the scenerio:

The user copies random text with mixed fonts.

How do I determine the font(s) used?

When the text is pasted from the UIPasteboard into a textview it correctly show开发者_开发知识库s the mixed fonts, so I believe the information is available.

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
textView.text = pasteboard.string;

Any Help would be much appreciated!


instead of calling [pb string], you may want to use [pb dataForPasteboardType:@"public.rtf"].


It might be "public.html" instead of "public.rtf". You should be able to iterate over the types available to see what the other app is putting into the pasteboard, then react accordingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜