I really need to see an example of how that would be done. Do you know of any example projects that show how to do this?
You don't need any example projects, you just write QML code that creates an item and shades it with your font texture. You just need to know coordinates of a particular letter. However having said all that --- this is all exactly the same as if you just had an Image QML element, there is really no point in going down to a low-level scenegraph code. You'll be practically duplicating already existing code... What is the ULTIMATE goal you are trying to achieve?
For content that is very rapidly changing, I would not think an Image element would be wise. A true bitmap font render uses a single texture for the mapping of all the letters displayed, and it is very fast when on a low-level GL call, which QQuickItem emulates nicely.
You can still use a single texture. Have a look at the Sprite qml element.
Since QML elements are instances of actual C++ objects under the hood, I would think there is a lot of overhead in creating and working with many many of these, versus just adding some texture calls to OpenGL via the QQuickItem. For example, I've found that just having many QML Text elements that are updated very often (several times a second) is too much for QML to handle well, so I'd expect no better performance from a Sprite or other QML element as there is just too much other stuff going on behind the scenes with QML elements.
With Text the text needs to be laid out so it takes time. This is not the case with Sprite. And QtQuick uses a texture atlas so textures are shared between items. So in the end it doesn't really mater much if you use Sprite or Image, the texture will still be shared.
Bookmarks