b25: allowObjects and text formatting

Need help with a script? This is the place to discuss how to get your code running!

b25: allowObjects and text formatting

Postby komouton » Sat Jan 14, 2017 10:10 am

This article isn't a bug report, but questions to confirm.

I have been evaluating the allowObjects property and relevant text formatting properties.

The relevant properties may fall into three groups.

Group 1 : fully under the control of the allowObjects.
    • borderstyle
    • firstlineIndent
    • leftIndent
    • rightIndent
    • lineSpacing
    • spaceAfter
    • spaceBefore
    • rulerInfo
For this group, when the allowObjects is false, set/get commands can't be executed because an error (number 210) occurs.


Group 2 : independent from the allowObjects.
    • allowTabs
    • underscore
    • strikethrough
    • textBackgroundColor
    • textInk
    • verticalShift
This group doesn't require the allowObjects.
Even when the allowObjects is false, set/get commands can be executed and the result are preserved. Right?
If so, the descriptions in SuperTalk Language Guide may be incorrect.


Group 3 : ambiguously related to the allowObjects
    • textAlign
The textAlign per-paragraph can be set even when the allowObjects is false and the result is rendered immediately, but it can't be preserved. To preserve it, the allowObjects must be true.
The textAlign applied per-fld is preserved even when the allowObjects is false.

The textAlign per-fld have originated since HyperCard, so the fact that it is independent from the allowObjects is reasonable.
In the other hand, though the textAlign per-paragraph is controlled by the allowObjects, the fact that the result is rendered even when the allowObjects is false may cause confusion. Is it better to refuse "set" command per-paragraph when the allowObjects is false ?
komouton
 
Posts: 105
Joined: Wed Oct 21, 2009 1:30 pm

Re: b25: allowObjects and text formatting

Postby codegreen » Sat Jan 14, 2017 11:09 am

Basically the issue you're describing is due to the fact that internally the text engine (WASTE 2.0b3 + a decade's worth of gruesome hacks by yours truly) doesn't internally implement these feature sets in parallel. Instead the allowObjects property mainly determines which set of storage formats is used to pack up and save a text record's contents (or create one from storage). Save with the richer (i.e., newer) 'allowObjects' formats and you save the richer feature set; save with the older formats and you save only what's supported in the WASTE 1.x feature set.

Until you actually do save though, the text engine doesn't know one type of field from the other. It would take (at a minimum) weeks of work and thousands of individual patches to it (and to SC itself) to implement the behavior you describe, and it's arguable whether any actual unalloyed 'benefit' would accrue from that effort.

Add to this the facts that the old field format still exists separately mainly to avoid breaking older externals which might expect 1.x storage formats (the original 'plan' was for the older form to eventually go away) and that the entire text engine and all the encodings it supports are long-since obsolete (and the biggest single anchor still tying SC to Carbon) and we're now inarguably well into 'throwing good money after bad' territory...

-Mark
codegreen
 
Posts: 1503
Joined: Mon Jul 14, 2008 11:03 pm

Re: b25: allowObjects and text formatting

Postby sctell » Sun Jan 15, 2017 12:25 am

codegreen wrote:.....and that the entire text engine and all the encodings it supports are long-since obsolete (and the biggest single anchor still tying SC to Carbon).....



I won't ask :( ;) :? :D


All the best

Terry
sctell
 
Posts: 1124
Joined: Sun Jul 06, 2008 10:41 am


Return to Scripting in SuperTalk

Who is online

Users browsing this forum: No registered users and 1 guest

cron