Skip to content

Long Term Plan for Text Editing Improvements

adlr edited this page Mar 15, 2014 · 1 revision

The current text editing capabilities are very limited: i18n, right-to-left, and rich text are all considered nice-to-have. This works for basic editing in English, but we need something better for the long term, and I don't want to have to re-implement an i18n right text editor from scratch.

I see a few possible ways to do this:

  • Write everything from scratch (explicitly thrown out above)
  • Prompt for text in the browser (HTML/JS) and pass that to something that just has to render. I really don't want users to input text in one box and see it rendered in another, tho.
  • Integrate with an existing GUI toolkit. This is the winner.

My current thinking is this: Use GTK+. GTK+ is a mature toolkit that's taken text editing i18n seriously. ALso, GTK+ Widgets are rendered into Cairo surfaces are part of their normal draw routines, so that should make it possible to integrate here. We could pass events (keystroke/mouse) to a GTK+ widget and then ask it to redraw. I haven't yet thought about IMEs, but hopefully they can be made to fit into this.

Why we can't do this today: I want something that will work on both ARM and x86 in NaCl. Today, GTK+ requires Glib. Glib requires glibc, and glibc requires NaCl on x86 (not ARM). Thus, GTK+ is out until it can be made to work on ARM.

So, for now I'll stick with the current poor-quality home-grown text editing code, knowing that the long-term plan is GTK+.

Clone this wiki locally