QFontEngineS60::~QFontEngineS60() { if (QThread::currentThread() == thread()) { releaseFont(m_originalFont); releaseFont(m_scaledFont); } }
FontManager::~FontManager() { releaseFont(systemMonospaceFont_); systemMonospaceFont_ = nullptr; releaseFont(systemVariableWidthFont_); systemVariableWidthFont_ = nullptr; for (auto font : fonts_) { LOG_WARNING << "Unreleased font: " << font->getName(); delete font; } fonts_.clear(); }
void QFontEngineS60::setFontScale(qreal scale) { if (qFuzzyCompare(scale, qreal(1))) { if (!m_originalFont) m_originalFont = fontWithSize(m_originalFontSizeInPixels); m_activeFont = m_originalFont; } else { const qreal scaledFontSizeInPixels = m_originalFontSizeInPixels * scale; if (!m_scaledFont || (TInt(scaledFontSizeInPixels) != TInt(m_scaledFontSizeInPixels))) { releaseFont(m_scaledFont); m_scaledFontSizeInPixels = scaledFontSizeInPixels; m_scaledFont = fontWithSize(m_scaledFontSizeInPixels); } m_activeFont = m_scaledFont; } }
void MirandaFont::reloadFont() { releaseFont(); LOGFONT log_font; COLORREF color = (COLORREF) CallService(MS_FONT_GETT, (WPARAM) &fid, (LPARAM) &log_font); hFont = CreateFontIndirect(&log_font); switch(field->getType()) { case SIMPLE_TEXT: ((TextField *) field)->setFontColor(color); ((TextField *) field)->setFont(hFont); break; case CONTROL_LABEL: case CONTROL_BUTTON: case CONTROL_EDIT: ((ControlField *) field)->setFont(hFont); break; } }
MirandaFont::~MirandaFont() { releaseFont(); }
QFontEngineS60::~QFontEngineS60() { releaseFont(m_originalFont); releaseFont(m_scaledFont); }