开发者

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

开发者 https://www.devze.com 2022-12-14 00:11 出处:网络
Here is the scenerio: The user copies random text with mixed fonts. How do I determine the font(s) used?

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

精彩评论

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

关注公众号