Getting Expected Results When Setting clipboardData["html"]
Copy Styled Text to the Clipboard
Executing this code in the message box places the word "Hi" on the clipboard. "Hi" should be italicized.
Paste Into 3rd Party Application
Now paste the string into a 3rd party application. Since this code was run on OS X the textFont of the home stack is set to Lucida Grande. Lucida Grande does not have an italic style so "Hi" (1) appears in the regular typeface (2).
Set the textFont of the templateField
Now set the textFont of the templateField to a font that has an italic style. In this example I'm using Helvetica. Note that as of Revolution 2.9 dp-3 the font used is determined when the clipboard contents are pasted into a 3rd party application. So if you change the textFont of the templateField before the string is pasted into another application "Helvetica" will not be used. The current textFont will be used.
Paste Into 3rd Party Application
Notice that after pasting the clipboard contents into TextEdit (1) the text uses the Helvetica font (2).
Comments (0)
Add your comment