Exemple #1
0
FontRenderer::FontRenderer(QObject *parent,const FontConfig* config) :
    QObject(parent), m_config(config)
{
    m_ft_library = 0;
    m_ft_face = 0;
    connect(config,SIGNAL(fileChanged()),this,SLOT(on_fontFileChanged()));
    connect(config,SIGNAL(faceIndexChanged()),this,SLOT(on_fontFaceIndexChanged()));
    connect(config,SIGNAL(sizeChanged()),this,SLOT(on_fontSizeChanged()));
    connect(config,SIGNAL(charactersChanged()),this,SLOT(on_fontCharactersChanged()));
    connect(config,SIGNAL(renderingOptionsChanged()),this,SLOT(on_fontOptionsChanged()));
    int error =  FT_Init_FreeType(&m_ft_library);
    if (error) {
        qDebug() << "FT_Init_FreeType error " << error;
        m_ft_library = 0;
    }
}
void FontRenderer::render(float scale) {
    m_scale = scale;
    on_fontSizeChanged();
}