[Gambas-user] [Gambas Bug Tracker] Bug #753: Rich text editor

Benoît Minisini gambas at ...1...
Tue Sep 22 18:08:35 CEST 2015


Le 22/09/2015 18:03, Benoît Minisini a écrit :
> Le 22/09/2015 17:49, Moviga Technologies a écrit :
>>> yes :-)... and maybe with a better synthax. But for that i think you
>>> will wait or do it yourself.
>>
>> (Since you reply by mail, and not in the bugtracker, I reply you also by
>> mail)
>>
>> I am afraid my competence is not enough to undertake such a task. I have
>> been trying to look at the gb.form.editor code, and it is a bit hard to
>> get a hold on, and there are very few comments explaining what is going
>> on.
>>
>
> It won't help you a lot. TextEditor is really made and optimized for
> displaying and editing text using a monospace font. Automatic
> line-breaking was added recently, and is a sort of hack.
>
> Making a rich-text editor is a bit like programming something like
> LibreOffice Writer, with less features.
>
> You must have paragraphs, using any font, size, colours, style...
> applied to any group of characters in the paragraph.
>
> Then you need a layouting routine that handle where and how to display
> paragraph.
>
> Then you need to display a cursor, the selected text.
>
> You need to be able to transform any mouse position in the editor window
> into a position in the text.
>
> You have to implement an undo/redo system.
>
> Only the rest is similar to what exists in TextEditor: keyboard
> handling, shortcuts, saving and loading. It's the simpler.
>
> Maybe if I have time I will make a library that implement the paragraph
> stuff on top of a vectorial canvas (i.e. a sort of DrawingArea that
> contains vectorial objects).
>
> It's interesting to have a "canvas" layer between the paragraphs and the
> final ScrollArea. Because after you can "easily" add other objects, like
> images, tables, vectorial drawings... until you have a real text processor.
>
> Interesting project if you have at least six months.
>

And there is (of course) many technical problems like : displaying fonts 
correctly in all situations when format changes. LibreOffice is now able 
to do that yet.

For example, Gambas paint methods need more feature to be able to 
displaying text using no hinting whatever how the font system is configured.

And you need handle right-to-left languages too!

And you need to handle paragraphs having left-to-right and right-to-left 
languages mixed!

...etc.

-- 
Benoît Minisini




More information about the User mailing list