0

I'm now building a listview to display fonts from the UIFonts framework. However, for using UIPasteboard.general.string, the fonts are not copied to the clipboard and only the plain text is transferred.

I've tried including the MobileCoreServices framework and use kUTTypeRTF to implement it. But there is no detailed documentation on it.

May I know how can I build a custom font list and allowing the text be selected and pasted with its font styling onto the other applications (like Notes or Facebook post), just like the font generator hosted online?

I'm now working on the two following UIFonts, but I'm not able to keep its formatting while pasting from the clipboard.

let fonts: [String] = ["BodoniSvtyTwoOSITCTT-Book", "ChalkboardSE-Regular"]
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
21.kaw
  • 583
  • 2
  • 7
  • 18
  • like I'm able to copy and paste font with its styling on the online font generator, like this https://lingojam.com/FancyLetters. Those font remains the same on pasting onto ios textfield – 21.kaw Aug 28 '21 at 14:21

2 Answers2

4

You cannot copy-paste text with a font on your iPhone.

FancyLetters also cannot do this. It just shows you characters that look like they are printed.

For example, the letter "A" has variations: "", "", "". But this is not font-altered text, StackOverflow does not allow it either. These are characters from Unicode table. They are the same characters as "A" or "B", except that without special modifiers the keyboard will not print them for you, e.g. SHIFTOPTIONK = .

Any font is superimposed over Unicode characters.

I recommend you to read an excellent article Emoji under the hood. It's about how emoji are drawn on devices, but it also explains a lot about the construction of characters and how they are rendered on different devices.

aheze
  • 24,434
  • 8
  • 68
  • 125
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
0

Or font generator also cannot do this. It just shows you characters that look like they are printed

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 16 '22 at 11:15