I'm trying to subclass the Pango::Renderer to draw text on an osg::Texture2D, but I cannot find a public constructor (except a copy-constructor) in its header file, neither another method to create a Pango::Renderer instance (like a static create method the Layout class for example provides).
So, how would I:
- create a
Pango::Rendererinstance - subclass
Pango::Renderer.
I've tried the following code for subclassing:
#include <pangomm/renderer.h>
class PangoRendererCanvas: public Pango::Renderer {
public:
PangoRendererCanvas() {}
};
but that gave the following compilation error:
error: no matching function for call to ‘Pango::Renderer::Renderer()’
PangoRendererCanvas::PangoRendererCanvas() {
^
According to the docs for Pango::Renderer, this should be possible:
Pango::Renderer API documentation
By subclassing Pango::Renderer and overriding operations such as draw_glyphs and draw_rectangle, renderers for particular font backends and destinations can be created.
I'm using PangoMM 2.46.2.
As I suggested, I would look at the header files. The manual is not clear enough. There are protected constructors, they are inherited from
Object. The first one is what you need to use.Inherited from