void FontRenderer::on_fontFileChanged() { QFile file(QDir(m_config->path()).filePath(m_config->filename())); if (file.open(QFile::ReadOnly)) { m_data = file.readAll(); on_fontFaceIndexChanged(); } }
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; } }