[Cuis] Class Text

H. Hirzel hannes.hirzel at gmail.com
Sat Feb 23 13:47:35 CST 2013


Hello Juan, Ken and others,

On 2/23/13, Juan Vuletich <juan at jvuletich.org> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TxModelFromPharo-Denis Kudriashov.png
Type: image/png
Size: 81970 bytes
Desc: not available
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20130223/72b12ee9/attachment-0003.png>


More information about the Cuis mailing list