Text rendering

I’ve added new option to label settings dialog. Now user can choose another rendering for text. I’ve taken code from trunk of Qt and overridden renderText for GLWidget. There are some problems:

  1. it’s ~2 times slowlier than TextRenderer
    But in Qt 4.7 there was introduced new class QStaticString for rendering of strings, and performance hints QStaticText::AggressiveCaching
    http://doc.trolltech.com/4.7-snapshot/qstatictext.html#details
    http://doc.trolltech.com/4.7-snapshot/qstatictext.html#PerformanceHint-enum
    Probably there is a possibility to improve performance in future
  2. outline isn’t so nice as in TextRenderer
  3. all code is inside GLWidget: I’ve preserved original Qt code structure
    Advantages:
  4. Supports any font of any size
  5. Supports unicode characters (see attachment)
  6. Doesn’t miss charaters (I really hate this issue!)
  7. Font size is slightly scaled with changing of zoom

Default is old faithful Textenderer

Regards,
Konstantin

I’ve found 3rd party library - GLttf. It can render text in different ways, allows outlines, does caching: http://glttf.sourceforge.net/doc/
But it isn’t thread safe and may have troubles with transparency, so it’s probably not useful for Avogadro

Regards,
Konstantin

  1. Supports unicode characters (see attachment)
  2. Doesn’t miss charaters (I really hate this issue!)
  3. Font size is slightly scaled with changing of zoom

I think all of these are more important than rendering speed right now. I’m sure with a bit of work, we can improve performance, but correctness is #1.

-Geoff

Forgotten about attachment :slight_smile:

19.03.10, 08:23, “Geoffrey Hutchison” geoff.hutchison@gmail.com:

  1. Supports unicode characters (see attachment)
  2. Doesn’t miss charaters (I really hate this issue!)
  3. Font size is slightly scaled with changing of zoom
    I think all of these are more important than rendering speed right now. I’m sure with a bit of work, we can improve performance, but correctness is #1.
    -Geoff


Regards,
Konstantin

19.03.10, 08:23, “Geoffrey Hutchison” geoff.hutchison@gmail.com:

  1. Supports unicode characters (see attachment)
  2. Doesn’t miss charaters (I really hate this issue!)
  3. Font size is slightly scaled with changing of zoom
    I think all of these are more important than rendering speed right now. I’m sure with a bit of work, we can improve performance, but correctness is #1.
    -Geoff

Yes, performance regression I’ve described occurs on fast rotations with disabled quick rendewring and maximum quality, so it doesn’t really matter. As for me, main drawback is outline style (but, of course, it’s much better to see ‘Co’ instead of ‘o’ with cute shadow :slight_smile:


Regards,
Konstantin

Just wanted to let you know that I 100% support your idea of relying
on Qt for text rendering: I’m not going to complain if you drop my
code in favor of it :slight_smile:

Benoit

2010/3/19 Konstantin Tokarev annulen@yandex.ru:

19.03.10, 08:23, “Geoffrey Hutchison” geoff.hutchison@gmail.com:

  1. Supports unicode characters (see attachment)
  2. Doesn’t miss charaters (I really hate this issue!)
  3. Font size is slightly scaled with changing of zoom
    I think all of these are more important than rendering speed right now. I’m sure with a bit of work, we can improve performance, but correctness is #1.
    -Geoff

Yes, performance regression I’ve described occurs on fast rotations with disabled quick rendewring and maximum quality, so it doesn’t really matter. As for me, main drawback is outline style (but, of course, it’s much better to see ‘Co’ instead of ‘o’ with cute shadow :slight_smile:


Regards,
Konstantin


Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel