0

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 shows the mixed fonts, so I believe the information is available.

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

Any Help would be much appreciated!

2 Answers2

0

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

domenico
  • 81
  • 1
  • 3
  • That doesn't seem to do what I want. I don't know where the user is pasting from. Have you used dataForPasteboardType before? Do you have a sample code? thanks for any help. –  Dec 18 '09 at 08:07
0

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.

Craig
  • 3,253
  • 5
  • 29
  • 43