Styled Text Copy-Paste

I have a text area with multi-colored text in the system font. Looks nice.

I want users to be able to copy-paste the text into an email, so I provide a convenient button for copying the text onto the clipboard, with code

Dim c As new Clipboard
c.RawData("public.rtf") = ReportText.StyledText.RTFData

When pasted into Outlook the colors are retained, but it shows up in some antique-looking serif font.

If I manually select the text and copy with Cmd-C, it pastes in color and in the correct font.

How can I mimic the behavior of the OS’s manual copy in Xojo?

I would take a look inside the clipboard content with an utility such as “clipboard viewer” on macos
(I recall you work on mac ?)
I presume there are other clipboards records that you must add to the rtfdata to get things done.

Or in AppleScript Editor type Return Clipboard Info…

Clipboard Viewer says that it’s “NeXT Rich Text Format v1.0 pasteboard type”. The clipboard data header is

{\rtf1\ansi\ansicpg1252{\fonttbl{\f0\fnil .AppleSystemUIFont;}}
{\colortbl\red0\green0\blue0;\red7\green205\blue43;}\uc0\f0\fs26

but I have no idea what to do with this info to get the desired result.

the “.AppleSystemUIFont” should be replaced with Arial to get a better looking in Outlook.
I suppose if you copy-paste into apple Mail the font is fine ?

That works, you just have to be sure to make a new clipboard to assign the modified RawData string to. Merci! Now I have to find out which font is best for Windows…

Arial should be the good one too for Windows.