Error in textFont reporting?
Jim Ault
JimAultWins at yahoo.com
Wed Jan 17 04:29:31 EST 2007
Another solution (workaround): using field 1 and field 2 (hidden)
on action
if the selectedText is empty then exit to top
copy
select char 1 to -1 of fld 2
paste
set the textSize of char 1 to -1 of fld 2 to 12 --now same size
put the effective textFont of char 1 to -1 of fld 2 into fontAnswer
answer fontAnswer
end action
-- either the font or "mixed"
On 1/16/07 10:03 PM, "Bob Warren" <bobwarren at howsoft.com> wrote:
> Mark (Smith):
>
> You didn't solve my problem, but you gave me the inspiration to solve it!
> Roughly, what I did was to copy the selected (rich) text to a new "temp"
> field using HTMLtext, and then I examined "temp" char by char to see
> what the textFont was. If each char reported the same font name, then
> the whole selection was declared to be of the same font name (in spite
> of differing sizes).
>
> Thanks again!
>
> By the way, does anyone know whether this has been fixed in Rev 2.7?
> Or is it supposedly a "feature" and not a "bug"?
> A reminder of the original problem is below.
>
> Regards,
> Bob
>
> ------------------------------------------------------------------------------
> ---------------------------
>
> I have a single word (e.g. robert) in a field "test".
> The whole word is in the Courier font, but the middle 2 letters are of a
> size different to the others.
>
> I am doing something like this in the field's coding:
>
> on mouseMove
> if the selectedText is not empty then
> put the textFont of the selectedText into field "result"
> end if
> end mouseMove
>
>
> If I select the whole word in field "test", instead of "courier" in the
> field "result" I get "mixed". But it is the SIZE that is mixed, NOT the
> font name!
>
> I am using Rev 2.6.1.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list