(no subject)

pmbrig at comcast.net pmbrig at comcast.net
Wed Mar 22 21:56:45 EST 2006


OK I did what you suggest, but it's not working:

put theHdr into fld "formatPrintText"
set the textFont of char 1 to -1 of fld "formatPrintText" to "Bookman Old Style"
set the textSize of char 1 to -1 of fld "formatPrintText" to "10"
set the clipboarddata["html"] to the htmltext of fld "formatPrintText"
-- set the clipboarddata["text"] to theHdr
launch letterPath with wordpath

This still gives a paste (into Word for OSX, or into a hypercard stack, or into Word 4 for OS9) in the textFont and textSize of the default stack properties, not what I set the properties of the field text to. I even tried using

set the clipboarddata["html"] to the htmltext of char 1 to -1 of fld "formatPrintText"

and that doesn't do it either.

(Just for fun, I tried setting the stack textFont/textSize properties to empty, and my paste then was in Lucia Grande size 11 -- hunh?)

Next experiment:

put theHdr into fld "formatPrintText"
set the textFont of char 1 to -1 of fld "formatPrintText" to "Bookman Old Style"
set the textSize of char 1 to -1 of fld "formatPrintText" to "10"
put the htmlText of char 1 to -1 of fld "formatPrintText" into fld "testFld"
exit to top

This shows the htmltext of the chunk in the test field, namely:

<p>Iphegenia Aardvaark</p>
<p>123 So. Huntington Ave,</p>
<p>Boston, MA  02114</p>

So apparently the htmlText property isn't giving font or size info...

I tried the rtfText of the field and of char 1 to -1 of the field and I get

{\rtf\mac 
Iphegenia Aardvaark
\par 123 So. Huntington Ave,
\par Boston, MA  02114}

So the rtfText property doesn't give font or size info either.

The rev documentation says (under HTMLtext):
Revolution uses a subset of HTML tags that includes font, size, style, and text color information.

So is this a bug? Is it something about my version of Dreamcard?

-- Peter M. Brigham

______________

Original message:

pmbrig at comcast.net wrote:
> I am using a button to put a text field on the clipboard. I set the
> clipboarddata["html"] to the htmltext of the field, then when I try
> to paste into MS Word, my field formatting does not come through.
> Instead, the default textFont and textSize for the stack is what
> determines the format of the pasted text -- I have experimented with
> this, and changing the field properties has zero effect on the paste,
> whereas changing the stack properties changes the paste. As an added
> complication, though, setting the textFont of the stack works
> perfectly, but when I set the textSize of the stack to 10, it comes
> through as 12. All other sizes work the way they are supposed to:
> stack textSize of 9 results in size 9 text in the paste, stack
> textSize of 14 comes through as 14, etc. Only stack textSize of 10
> comes through as 12.
> 
> here's the relevant portion of the script:
> 
> put fld "wordPath" into wordpath
> put fld "letterPath" into letterPath
> put theHdr into fld "formatPrintText"
> set the textFont of fld "formatPrintText" to "Bookman Old Style"
> set the textSize of fld "formatPrintText" to "10"
> set the clipboarddata["html"] to the htmltext of fld "formatPrintText"
> set the clipboarddata["text"] to theHdr -- * see below
> launch letterPath with wordpath
> 
> * (I've tried not setting the clipboarddata["text"] and it makes no
> difference.)
> 
> I'm puzzled. The clipboarddata["html"] clearly is not getting set
> properly. I am using Dreamcard v2.6.1 build 152 on a Mac iBook
> running OSX v10.4.5, and Word for Mac v11.2.3. The problem with the
> size 10 getting seen as size 12 appears to be a Word problem, since
> the paste into another text app comes through as expected.
> 
> Why doesn't the htmlText of the field get onto the clipboard? Why in
> the world should the default text properties of the stack have any
> effect here?

When you set the text properties of a field, the text it contains has no 
styling of its own, it uses inheritance of the field's properties to 
give an appearance of styling. Therefore, when you copy that text, there 
is no particular htmltext assigned to it.

To fix that, set the styling of the actual characters in the text 
itself, which does assign html properties to the text:

set the textfont of char 1 to -1 of fld "formatPrintText" \
      to "Bookman Old Style"
set the textsize of char 1 to -1 of fld "formatPrintText" to 10

This should give the results you are looking for.

-- 
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com



More information about the use-livecode mailing list