Class Text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Class Text

Hannes Hirzel
Hello Juan, Ken and others,

On 2/23/13, Juan Vuletich <[hidden email]> wrote:
> On 2/22/2013 3:57 PM, Juan Vuletich wrote:
>> ...
>> In addition, most users won't need Strings but Texts, i.e. including
>> attributes. The Pharo folks did a new implementation of Text that uses
>> something very similar to Ropes. They call them 'extents'.

I have not seen 'extents' but 'spans', see screen shot.

>> This would
>> be nice to have.


> Apologies. My memory failed. It is TxTextModel, and is discussed
> (together with other stuff like paragraph layout and morph drawing)
> here:
> http://forum.world.st/TxTextMorph-based-on-new-text-model-td4663219.html
> . In any case, a new implementation of Strings suggest doing a new
> implementation of Text...
>
> Cheers,
> Juan Vuletich
>


the reference
 http://forum.world.st/TxTextMorph-based-on-new-text-model-td4663219.html
Juan gave is about a discussion of a new TextMorph called TxTextMorph in Pharo.

The source code is here
    http://www.smalltalkhub.com/#!/~sig/TxText
but no links to documentation.

I wonder if they have a more easily readable description of what they
are aiming at.

Anyhow the screen shot of browsing the code is attached. Half of the
20 classes have a comment.

I would like to know what they perceive as the disadvantages of the
current Text class in Cuis/Squeak/Pharo. And a comparison to the
current Java Text editing API would be fine as well.

The class comment of class Text from Cuis

<citation>
I represent a character string that has been marked with abstract
changes in character appearance. Text associates a set of
TextAttributes with each character in its character string.  These
attributes may be fonts, emphases such as bold or italic, or hyperling
actions. Since most characters have the same attributes as their
neighbors, the attributes are stored in a RunArray for efficiency.
Each of my instances has
        string a String
        runs a RunArray
                       
From the comment at #deepCopy, written by Dan on 11/9/97:
"Both string and runs are assumed to be read-only"
</citation>

This is very basic and AFAIK what text processing systems do. The Java
text editing API works similar.

Kind regards

Hannes


P.S. As far as I am concerned we do not need to discuss the issue
about modeling Text now though it is interesting, of course.  I mainly
write this mail that it's subject line sticks out in the archive
http://jvuletich.org/pipermail/cuis_jvuletich.org/ as a hook so that
we can easily continue this discussion any time.

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

TxModelFromPharo-Denis Kudriashov.png (109K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Class Text

KenDickey
On Sat, 23 Feb 2013 19:47:35 +0000
"H. Hirzel" <[hidden email]> wrote:

>
> the reference
>  http://forum.world.st/TxTextMorph-based-on-new-text-model-td4663219.html
> Juan gave is about a discussion of a new TextMorph called TxTextMorph in Pharo.
>
> The source code is here
>     http://www.smalltalkhub.com/#!/~sig/TxText
> but no links to documentation.
>
> I wonder if they have a more easily readable description of what they
> are aiming at.

I think we should wait until this firms up in use.

After a brief look at the code, I note that spans are a doubly-linked list -- good for add/remove and traversal.  Cursor and selection positions are by line position in the "string" of text.  We could easily replace this reference at any time with Ropes.

No bit surprises. [This is good ;^].

Cheers,
-KenD
--
Ken [dot] Dickey [at] whidbey [dot] com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: Class Text

Juan Vuletich-4
On 2/23/2013 8:16 PM, Ken Dickey wrote:

> On Sat, 23 Feb 2013 19:47:35 +0000
> "H. Hirzel"<[hidden email]>  wrote:
>
>> the reference
>>   http://forum.world.st/TxTextMorph-based-on-new-text-model-td4663219.html
>> Juan gave is about a discussion of a new TextMorph called TxTextMorph in Pharo.
>>
>> The source code is here
>>      http://www.smalltalkhub.com/#!/~sig/TxText
>> but no links to documentation.
>>
>> I wonder if they have a more easily readable description of what they
>> are aiming at.
> I think we should wait until this firms up in use.
>
> After a brief look at the code, I note that spans are a doubly-linked list -- good for add/remove and traversal.  Cursor and selection positions are by line position in the "string" of text.  We could easily replace this reference at any time with Ropes.
>
> No bit surprises. [This is good ;^].
>
> Cheers,
> -KenD

:)

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org