Ramblings of a wanderer

FoieGras- First look at how the text rendering

After about a months of time into the GSoC project, I was able to finish the first significant improvement in the project that happened from my side. For a long time I was wandering here and there testing one thing or the other to see what’s working best and finally got a breakthrough.

For now FoieGras (The code name of the editor we are developing) text engine is capable of these capabilities. It can render some given tags but only inline tags. It can hide and show tags, so if the user wants to see tags and work with them it’s possible. Also you can add more tags and configure the style tags, which are rendered using a configure file. I think it’ll be the main configuration file with regards to text rendering functions. After phenatic (http://phanatic.hu) releases the first UI part, we’ll be able to map the menu events to this text rendering functions and present the first release of FoieGras. 🙂

To tell you how the implementation of FoieGras is done: it’s done using python and PyGTK as the wrapper for GTK to do UI work. First I planned on implementing the text renderer using some thread system, giving a thread to take care of each tag. But soon I understood that it’s a waste of time and resources so thought of a better way. Now the text rendering is done through the XMLparser that comes with python, and so far it’s working nicely.

Also my mentor ( Dr. Don Scorgie – yeah, he is now a doctor 🙂 . Congrats Don ! ) is helping me with technical details and brilliant ideas. FoieGras now has a repository in GNOME svn and I’ve created a branch for tag rendering implementation and copied my works there, So you can check it. Another news is that I’m planning to goto GUADEC next 14th July and I hope it’ll be fun and be able to discuss more about FoieGras there with the team and also hack FoieGras there.

That looks interesting; I’ve been playing around with something vaguely similar (a WYSIWYG-ish XML editor) myself. One minor point about the code: when you’re applying the tags to the buffer in xmlparser.py, you build the call to ‘insert_with_tags_by_name’ as a string, then exec it, which seems a little ugly. Couldn’t you use the asterisk operator, and do: