Re: Gtk::Text widget



    Derek> How does your new-and-improved version handle Unicode?  I've been
    Derek> planning on letting the user select between an 8-bit (ASCII),
    Derek> 16-bit (UCS-2), and 32-bit (UCS-4) gapped text buffer for internal
    Derek> storage.  At 3 bytes per character, you must only be using one byte
    Derek> for encoding?

    Derek> (Or are you using UTF-8 internally?)

I created a Motif text widget about 5 years ago that uses UTF-16 (aka UCS-2)
internally exclusively.  It also allows tags of a kind (I called them
attributes), and after many moons of experimentation, I ended up using 4 bytes
per character, with 2 of them acting as an index into a table of attributes
(color, font, etc..).  Tagging each character with attributes turned out to
make things a lot easier to manage than coding to deal with parallel attribute
structures as you find in Emacs or breaking things into a tree as in the
TkText widget.

And adding regex wasn't difficult with a gap buffer.
-----------------------------------------------------------------------------
Mark Leisher
Computing Research Lab            Once you fully apprehend the vacuity of a
New Mexico State University       life without struggle, you are equipped
Box 30001, Dept. 3CRL             with the basic means of salvation.
Las Cruces, NM  88003                            -- Tennessee Williams




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]