I want to write to an image a formatted text. OpenCV offers only a limited set of default fonts. Is it possible to use others? For example to read them from the *.ttf file (in Ubuntu)?
It's possible to use other fonts but you need to link the Qt library to OpenCV and use the cvAddText function with a cvFontQt
http://docs.opencv.org/modules/highgui/doc/qt_new_functions.html#addtext
http://docs.opencv.org/modules/highgui/doc/qt_new_functions.html#fontqt
There are other solutions you might try, with more or less the same performance as OpenCV. For instance, you can use CAIRO to write fonts into the image.